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
Extensions must override these methods
get meleRange () { throw "Game system not supported"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "protected internal function m252() {}", "transient private protected internal function m182() {}", "function ExtraMethods() {}", "transient protected internal function m189() {}", "transient final protected internal function m174() {}", "get extension() { return this; }", "private internal function m248() {}", "extend() {}", "extend() {}", "function customHandling() { }", "transient private internal function m185() {}", "initCustomFunctions() {/*To be overridden in sub class as needed*/}", "static private protected internal function m118() {}", "transient final private protected internal function m167() {}", "transient private protected public internal function m181() {}", "function Adapter() {}", "static transient final protected internal function m47() {}", "static transient final protected public internal function m46() {}", "__previnit(){}", "transient final private internal function m170() {}", "method() {\n throw new Error('Not implemented');\n }", "initExtension() {\n\t\treturn;\n\t}", "transient private public function m183() {}", "_add () {\n throw new Error('not implemented')\n }", "constructor () { super() }", "static final private internal function m106() {}", "function Utils() {}", "function Utils() {}", "static transient final private internal function m43() {}", "edit(args) {\r\n throw \"Error this method should be overridden by its extended class\";\r\n }", "init() {\n throw new Error('NOT_IMPLEMENTED_EXCEPTION: you must override this method in order to use it')\n }", "onOpenedFile() {\n throw \"[CacheObjectBaseInject::onOpnenedFile] Function Abstract, extended class have implement this method\";\n }", "function ExtraOptions(){}", "render () {\n throw new Error('render function must be override!')\n }", "function ea(){}", "constructor() { super() }", "native() {\n throw new Error('NOT_IMPLEMENTED_EXCEPTION: you must override this method in order to use it')\n }", "function SuperclassBare() {}", "function SuperclassBare() {}", "function _____SHARED_functions_____(){}", "function Utils(){}", "_getChangedEntityHpTempPath() {\n throw new Error('Child class must implement `_getChangedEntityHpTempPath`');\n }", "_validate() {\n throw new Error('_validate not implemented in child class');\n }", "static private internal function m121() {}", "slice() {\n // redefine method in derived classes\n }", "render() { return super.render(); }", "function ExtraOptions() {}", "function ExtraOptions() {}", "_getOrigEntityHpTempPath() {\n throw new Error('Child class must implement `_getOrigEntityHpTempPath`');\n }", "static transient private protected public internal function m54() {}", "function inherit(){}", "get Custom() {}", "update() {\n // Subclasses should override\n }", "initialize() {\n // Needs to be implemented by derived classes.\n }", "function Adaptor() {}", "Use(){\n throw new Error(\"Use() method must be implemented in child!\");\n }", "static transient private protected internal function m55() {}", "preorder() {\n throw new Error(\"This method hasn't been implemented yet!\");\n }", "static private protected public internal function m117() {}", "function ExtraOptions() { }", "function ExtraOptions() { }", "transient final private protected public internal function m166() {}", "get extension() {\n throw new Error(\"Handler.extension must be overriden!\");\n }", "_getOrigEntityHpPath() {\n throw new Error('Child class must implement `_getOrigEntityHpPath`');\n }", "static transient final protected function m44() {}", "_getChangedEntityHpPath() {\n throw new Error('Child class must implement `_getChangedEntityHpPath`');\n }", "static protected internal function m125() {}", "_toJSONObject() {\n throw new Error('_toJSONObject not implemented in child class');\n }", "postorder() {\n throw new Error(\"This method hasn't been implemented yet!\");\n }", "registerDomEvents() {/*To be overridden in sub class as needed*/}", "static transient final private protected internal function m40() {}", "function Helper() {}", "function DWRUtil() { }", "function AeUtil() {}", "obtain(){}", "toString(){\n\t\treturn 'not implemented';\n\t}", "patch() {\n }", "function Utils() {\n}", "redo() {\n throw new Error(\"Redo function must be overwritten in child class\");\n }", "transient final private public function m168() {}", "Pick(){\n throw new Error(\"Pick() method must be implemented in child!\");\n }", "constructor() {\n super();\n }", "_get () {\n throw new Error('_get not implemented')\n }", "constructor() {\n super();\n \n }", "static final protected internal function m110() {}", "constructor() {\n\n\t\tsuper();\n\n\t}", "function ResponseBase() {}", "function __extends(e,t){function __(){this.constructor=e}ke(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}", "getStrToEol() {\n throw new Error('this method should be impelemented in subclass');\n }", "Render(){\n throw new Error(\"Render() method must be implemented in child!\");\n }", "_init() {\n throw new Error('_init not implemented in child class');\n }", "render() {\n // Subclasses should override\n }", "function yst_overrideElemFunction() {\n\treturn;\n}", "update() {\r\n throw new Error('must be set in subclass');\r\n }", "constructor () {\r\n\t\t\r\n\t}", "static transient private public function m56() {}", "function CustomError() {}", "function whatisthis() {\n return this;\n }", "getNormalResponse() {\n return \"Not implemented\";\n }", "getBounds() {\n throw \"Abstract method\" \n }" ]
[ "0.65565217", "0.6387178", "0.6234775", "0.62329197", "0.61241794", "0.6023681", "0.60214055", "0.59723765", "0.5939525", "0.5939525", "0.5887724", "0.5880492", "0.5807941", "0.5675986", "0.5628541", "0.5611776", "0.55372316", "0.5467687", "0.5466474", "0.54606897", "0.5455964", "0.54316866", "0.5427599", "0.540966", "0.5399655", "0.53915954", "0.5347932", "0.5341812", "0.5341812", "0.53020257", "0.52921766", "0.5290747", "0.5290291", "0.5277856", "0.52654314", "0.52627105", "0.52621365", "0.5249428", "0.52443564", "0.52443564", "0.5224931", "0.52205044", "0.5204494", "0.52002436", "0.5189209", "0.51626027", "0.5161707", "0.5151452", "0.5151452", "0.5148388", "0.5146536", "0.5145044", "0.5142278", "0.51343924", "0.5132479", "0.5112925", "0.50990987", "0.5084881", "0.5083995", "0.50824964", "0.5078237", "0.5078237", "0.50727403", "0.5060786", "0.5056871", "0.5054938", "0.50549096", "0.5051081", "0.50482", "0.5042721", "0.5032318", "0.50186443", "0.50086546", "0.50017405", "0.49998868", "0.4993025", "0.4992372", "0.49888837", "0.49859223", "0.49852955", "0.49849162", "0.4981632", "0.49782583", "0.49761587", "0.49602008", "0.49600857", "0.49597734", "0.49574718", "0.49540088", "0.49472728", "0.4933441", "0.4932957", "0.49302346", "0.4923612", "0.49160156", "0.49158943", "0.49063247", "0.48982024", "0.48871627", "0.48831385", "0.48827076" ]
0.0
-1
Resource measuring how much a token can do on their turn. It takes one time unit for a token to move one tile
get time () { throw "Game system not supported"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get time ()\n\t{\n\t\tlet speed = parseInt (this.token.actor.data.data.attributes.movement.walk, 10);\n\t\t\n\t\tif (! speed)\n\t\t\tspeed = 30;\n\n\t\treturn speed / this.gridDistance;\n\t}", "function countMoves() {\n moves++;\n moveCounter.innerHTML = moves;\n if (moves === 1) {\n //time does not accelerate when startTime function is activated here, why?\n startTime();\n }\n if (moves > 10 && moves < 14) {\n for (i = 0; i < 3; i++) {\n if(i > 1) {\n stars[i].style.visibility = \"collapse\";\n }\n }\n } else if (moves > 14) {\n for (i = 0; i < 3; i++) {\n if (i > 0) {\n stars[i].style.visibility = \"collapse\";\n }\n }\n }\n }", "function countMoves() {\n\tmovesCounter++;\n\tlet move = Math.floor(movesCounter/2);\n\n\t// Starting the timer\n\tif (movesCounter == 1) {\n\t\ttime();\n\t}\n\n\tif (move == 1) {\n\t\tmoves.textContent = move + ' Move';\n\t} else if (movesCounter > 1) {\n\t\tmoves.textContent = move + ' Moves';\n\t}\n}", "function ourTurn(){\n if (Pokemon.theirAttack.hp <= Pokemon.ourAttack.power) {\n Pokemon.results.theirFaint = true;\n console.log(`${Pokemon.theirAttack.name} fainted ${Pokemon.results.theirFaint}`);\n Pokemon.results.theirAttackPower = 0;\n return 0;\n } else {\n Pokemon.results.theirAttackPower = Pokemon.theirAttack.power;\n $('#instructions-text').text(`You did ${Pokemon.ourAttack.power} damage. Click fight or switch button.`);\n // Add: they have X hit points left here...\n return Pokemon.theirAttack.hp - Pokemon.ourAttack.power;\n }\n }", "function gameProgression() {\n return 1 + (Date.now() - start) / (60 * 1000);\n}", "update(gameState: GameState): ?{ start: Tile, end:Tile } {\n this.gameState = gameState;\n this.cityCounter.update(gameState);\n return null;\n }\n \n /**\n * Return the current round.\n */\n getRound() {\n return Math.ceil(this.gameState.turn / 25);\n }\n \n /**\n * Returns the tile for this player's largest army.\n * Returns null if no armies greater than size 1 are found.\n */\n getLargestArmy(): ?Tile {\n const myTiles = this.getMyUsableTiles();\n if (myTiles.length > 0) {\n return myTiles.reduce((best, current) => (best.getArmies() > current.getArmies()) ? best : current);\n } else {\n return null;\n }\n }\n \n /**\n * Return the median army size of all my tiles, rounded down.\n * @param percentile Which percentile you want to get the value for.\n * Defaults to 0.5 which is the median.\n */\n getMedianArmySize(percentile: number = 0.5) {\n const myTiles = this.getMyTiles();\n if (myTiles.length > 0) {\n return myTiles[Math.floor(myTiles.length * percentile)].getArmies();\n }\n return 0;\n }\n \n /**\n * Returns the tile for this player's general.\n */\n getMyGeneral(): ?Tile {\n return this.gameState.tiles.find((tile) => tile.isGeneral() && tile.owner == this.playerIndex);\n }\n \n /**\n * Return a list of tiles\n * @return {Array.<Tile>}\n */\n getOpponentGenerals(): Tile[] {\n return this.gameState.tiles.filter((tile) => tile.isGeneral() && (tile.isOpponent(this.playerIndex) || tile.isNeutral()));\n }", "function getDistance(token, paladin) {\n const txPos = token.xPos;\n const tyPos = token.yPos;\n const txSize = token.xSize;\n const tySize = token.ySize;\n const pxPos = paladin.xPos;\n const pyPos = paladin.yPos;\n const pxSize = paladin.xSize;\n const pySize = paladin.ySize;\n const pageID = Campaign().get('playerpageid');\n const page = getObj('page', pageID);\n if (page !== undefined) {\n const pixPerSquare = page.get('snapping_increment') * 70;\n const grid_type = page.get('grid_type');\n const scale_units = page.get('scale_units');\n if (grid_type === 'square' && scale_units === 'ft') {\n const txAdjust = txSize <= pixPerSquare ? 0 : (txSize - pixPerSquare) / 2;\n const tyAdjust = tySize <= pixPerSquare ? 0 : (tySize - pixPerSquare) / 2;\n const pxAdjust = pxSize <= pixPerSquare ? 0 : (pxSize - pixPerSquare) / 2;\n const pyAdjust = pySize <= pixPerSquare ? 0 : (pySize - pixPerSquare) / 2;\n const xDif = Math.abs(txPos - pxPos);\n const yDif = Math.abs(tyPos - pyPos);\n const dist1 = xDif >= yDif ?\n Math.max(xDif - txAdjust - pxAdjust, 0) :\n Math.max(yDif - tyAdjust - pyAdjust, 0);\n const dist2 = xDif >= yDif ?\n Math.max(yDif - tyAdjust - pyAdjust, 0) :\n Math.max(xDif - txAdjust - pxAdjust, 0);\n // If the measurement method is set to 'auto' use the page setting,\n // unless the page is undefined - then use pythagorean.\n let measurementMethod;\n if (DiagonalMeasurementMethod === 'auto') {\n if (page === undefined) {\n measurementMethod = 'pythagorean';\n }\n else {\n measurementMethod = page.get('diagonaltype');\n }\n }\n else {\n measurementMethod = DiagonalMeasurementMethod;\n }\n switch (measurementMethod) {\n case 'foure':\n // Return the largest distance\n return dist1 - (pixPerSquare / 2);\n case 'threefive':\n // Return larger distance + 1/2 smaller distance rounded down to grid\n return dist1 + (Math.floor(dist2 / pixPerSquare / 2) * pixPerSquare) - (pixPerSquare / 2);\n case 'manhattan':\n // Return the sum of distances\n return dist1 + dist2 - (pixPerSquare / 2);\n case 'pythagorean':\n // Return exact distance, rounded to grid\n return Math.sqrt(Math.pow(dist1, 2) + Math.pow(dist2, 2));\n default:\n Chat.send('GetDistance error - measurementMethod is invalid.<br>Distances could not be calculated.', 'error');\n }\n }\n }\n else {\n return undefined;\n }\n }", "function moveToken() {\n // get all the tiles\n var tiles = document.querySelectorAll(\".tile\");\n\n // total number of tiles\n var totalTiles = tiles.length;\n\n // check if token has gone past total\n // if it has, go back, if not, the token will just continue forever\n if (character1Score > totalTiles - 1) {\n var scorePastTotal = character1Score - (totalTiles - 1);\n var recalculateScore = totalTiles - scorePastTotal;\n character1Score = recalculateScore;\n updateScoreDisplay(character1Score);\n }\n\n // loop through the tiles\n for(var i = 0; i < totalTiles; i++) {\n\n //elements inside the tile\n var elementsInsideTile = tiles[i].childNodes;\n\n // loop through the elements to check if #token is inside it\n elementsInsideTile.forEach(function(element) {\n // if token1 is inside, remove it\n if (element.id === \"token\") {\n element.remove();\n }\n });\n\n // check if the token is on the traps, if it is, run the hitATrap function, if not, snap out. \n if (character1Score === 4 || character1Score === 7 || character1Score === 17 || character1Score === 21 || character1Score === 24) {\n hitATrap();\n break;\n }\n\n\n //chcek if the score (-1) matches the tile\n // if it is, append the token element\n if (i === character1Score) {\n // make the token element\n var tokenOne = document.createElement(\"div\");\n\n tokenOne.classList.add(\"token\", characterClass);\n tokenOne.id = \"token\";\n\n tiles[i].appendChild(tokenOne);\n\n \n // check if token is on the last tile, if it is\n if (character1Score === totalTiles - 1) {\n // go to winners page\n\n window.location.href = \"winner.html\";\n }\n }\n };\n\n}", "function activ_dist(){\n if(distance_token == 0){\n distance_token = 1;\n score_actu();\n }\n}", "function doCounter()\n{\n\tcounters[playerLocation]++;\n\tcounterMoves++;\n}", "function claimTile(tile, player, value){\n\t\n\tswitchTile(tile, player, value);\t\t\n\n\t//Grab a list of all tiles around the selected one\n\tvar adjacentTiles = hexmap.getAdjacentTiles(tile.i,tile.j);\n\t\tadjacentTiles.forEach(function(tile) {\t\t\n\t\t\tif(tile.owner == 0){\n\t\t\t\t//This tile has no owner.. Do nothing\n\n\t\t\t} else if (tile.owner == player){\n\t\t\t\t//This tile is owned by the player -- Increase it's score (if below 20)\n\t\t\t\t//console.log(\"Player owned\");\n\t\t\t\tif( tile.value < 20){ \n\t\t\t\t\tswitchTile(tile, player, tile.value+1) \n\t\t\t\t};\n\n\t\t\t} else {\n\t\t\t\t//This tile is owned by the enemy.. Take it over if this tiles value is higher\n\t\t\t\tif(value > tile.value){\n\t\t\t\t\tswitchTile(tile, player, tile.value)\n\t\t\t\t};\n\t\t\t};\n\n\t\t});\n\n\t\t//If in multiplayer, and it's THIS players turn, send the location AND value of the placed tile\n\t\tif(playersTurn==thisPlayer && gameType==\"netMulti\"){\n\t\t\t//Send X,y,value\n\t\t\tvar tmpTilePlacementData = new Array(tile.i,tile.j,value)\n\t\t\tsendMessage( { \"placedTile\" : tmpTilePlacementData } );\n\t\t}\n\n\t//Now we've placed a tile, we should re-calculate every players score\n\tcalculateScores();\n\n\t//We also need to check here if the board if full, and determine a winner\n\n\tplayersTurn++; \n\tif(playersTurn==3){ playersTurn = 1 };\n\ttileValue = generateTileValue();\n\t//console.log(\"Next player: \" + playersTurn + \", Tile: \" + tileValue);\n\n\t//Update the PlayersTile notifier\n\tupdatePlayersTile();\n\n\n}", "static getRefreshCost() {\n let notComplete = player.completedQuestList.filter((elem) => { return !elem(); }).length;\n return Math.floor(250000 * Math.LOG10E * Math.log(Math.pow(notComplete, 4) + 1));\n }", "function totalRace() {\n return player1Time + player2Time;\n }", "countBlockTurns(move) {\n let layerCount = move.getLayerCount();\n let layerMask = move.getLayerMask();\n let turns = Math.abs(move.getAngle()) % 4;\n if (turns == 0) {\n return 0;\n } else {\n let previousTurnedLayer = 0;\n let countTurned = 0;\n let previousImmobileLayer = 1;\n let countImmobile = 0;\n for (let i = 0; i < layerCount; i++) {\n let currentLayer = (layerMask >>> i) & 1;\n if (currentLayer == 1 && currentLayer != previousTurnedLayer) {\n countTurned++;\n }\n if (currentLayer == 0 && currentLayer != previousImmobileLayer) {\n countImmobile++;\n }\n previousTurnedLayer = previousImmobileLayer = currentLayer;\n }\n return Math.min(countTurned, countImmobile);\n }\n }", "function moveCounter() {\n app.moves++;\n app.counter.innerHTML = app.moves;\n if (app.moves == 1) {\n app.second = 0;\n app.minute = 0;\n app.hour = 0;\n startTimer();\n }\n}", "invalidateMove(player, tile) {\n // <<-- Creer-Merge: invalidate-move -->>\n if (!player || player !== this.game.currentPlayer) {\n return `It isn't your turn, ${player}.`;\n }\n if ((this.job.title === \"worker\") && (this.owner !== player || this.owner === undefined)) {\n return `${this} isn't owned by you.`;\n }\n if (this.acted) {\n return `${this} has already acted this turn.`;\n }\n if (!this.tile) {\n return `${this} is not on a tile! Could they be behind you..?`;\n }\n // Make sure the tile is on the map\n if (!tile) {\n return `${this}, unit cannot plane shift, tile does not exist in this plane.`;\n }\n // Make sure there are moves left\n if (this.moves <= 0) {\n return `${this} has no more moves and might fall apart!`;\n }\n // Make both players don't own the tile\n if (this.owner === this.owner.opponent) {\n return `${this} cannot walk on the enemies side!`;\n }\n // Make sure tile is part of the path\n if (!tile.isPath && this.job.title !== \"worker\") {\n return `${this}, going off the path is dangerous!`;\n }\n // Or, make sure it isn't for workers\n if (tile.isPath && this.job.title === \"worker\") {\n return `${this}, workers are not allowed on the path!`;\n }\n // Make sure tile is not a river tile\n if (tile.isRiver) {\n return `${this} cannot swim.`;\n }\n // Make sure tile isnt occupied by a different unit type\n if (tile.unit) {\n if (tile.unit.job !== this.job) {\n return `${this} is not allowed to walk on ${tile.unit}!`;\n }\n else {\n if (this.job.title === \"zombie\" && tile.numZombies >= this.game.unitJobs[1].perTile\n || this.job.title === \"hound\" && tile.numHounds >= this.game.unitJobs[4].perTile\n || this.job.title === \"ghoul\" && tile.numGhouls >= this.game.unitJobs[2].perTile) {\n return `${this} cannot walk on a fully occupied tile!`;\n }\n if (this.job.title === \"worker\" || this.job.title === \"abomination\"\n || this.job.title === \"horseman\" || this.job.title === \"wraith\") {\n return `${this} cannot walk on an occupied tile!`;\n }\n }\n }\n // Make sure tile isnt a tower\n if (tile.isTower) {\n return `${this} cannot hide in the tower.`;\n }\n // Make sure tile isnt a wall\n if (tile.isWall) {\n return `${this} cannot move through, under, over or around walls..we are sorry.`;\n }\n // <<-- /Creer-Merge: invalidate-move -->>\n }", "timeDilation(){\r\n if(game.global.timeDilation > 0){\r\n console.log(\"Beginning time dilation!\");\r\n game.global.timeDilation += 0.1;\r\n console.log(game.global.timeDilation);\r\n } else {\r\n console.log(\"Max time dilation reached!\");\r\n }\r\n }", "move (tile) {\r\n let world = this.tile.world\r\n this.calories -= this.movementCost\r\n if (tile) {\r\n return world.moveObj(this.key, tile.xloc, tile.yloc)\r\n }\r\n let neighborTiles = this.tile.world.getNeighbors(this.tile.xloc, this.tile.yloc)\r\n let index = Tools.getRand(0, neighborTiles.length - 1)\r\n let destinationTile = neighborTiles[index]\r\n return world.moveObj(this.key, destinationTile.xloc, destinationTile.yloc)\r\n }", "function movie(card, ticket, perc) {\r\n let systemA = ticket;\r\n let systemB = card + ticket;\r\n let newPerc = perc;\r\n let numTicks = 0;\r\n do {\r\n numTicks++;\r\n systemA += ticket;\r\n systemB += ticket * newPerc;\r\n newPerc = newPerc * perc;\r\n }\r\n while(systemA <= Math.ceil(systemB));\r\n return numTicks;\r\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}", "passTime () {\n let time = this.player.castTimeRemaining\n if (time == 0 || (this.player.gcdRemaining > 0 && this.player.gcdRemaining < time)) time = this.player.gcdRemaining\n\n // Look for the shortest time until an action needs to be done\n if (this.player.pet) {\n\n // Pet's attacks/abilities and such\n if (this.player.pet.mode == PetMode.AGGRESSIVE) {\n if (this.player.pet.spells.melee && this.player.pet.spells.melee.cooldownRemaining < time) time = this.player.pet.spells.melee.cooldownRemaining\n else if (this.player.pet.type == PetType.RANGED && this.player.pet.castTimeRemaining > 0 && this.player.pet.castTimeRemaining < time) time = this.player.pet.castTimeRemaining\n\n if (this.player.pet.pet == PetName.SUCCUBUS) {\n if (this.player.pet.spells.lashOfPain.cooldownRemaining > 0 && this.player.pet.spells.lashOfPain.cooldownRemaining < time) time = this.player.pet.spells.lashOfPain.cooldownRemaining\n } else if (this.player.pet.pet == PetName.FELGUARD) {\n if (this.player.pet.spells.cleave.cooldownRemaining > 0 && this.player.pet.spells.cleave.cooldownRemaining < time) time = this.player.pet.spells.cleave.cooldownRemaining\n }\n }\n }\n\n if (this.player.auras.corruption && this.player.auras.corruption.active && this.player.auras.corruption.tickTimerRemaining < time) time = this.player.auras.corruption.tickTimerRemaining\n if (this.player.auras.siphonLife && this.player.auras.siphonLife.active && this.player.auras.siphonLife.tickTimerRemaining < time) time = this.player.auras.siphonLife.tickTimerRemaining\n if (this.player.auras.flameshock && this.player.auras.flameshock.active && this.player.auras.flameshock.tickTimerRemaining < time) time = this.player.auras.flameshock.tickTimerRemaining\n if (this.player.auras.curseOfAgony && this.player.auras.curseOfAgony.active && this.player.auras.curseOfAgony.tickTimerRemaining < time) time = this.player.auras.curseOfAgony.tickTimerRemaining\n if (this.player.auras.curseOfTheElements && this.player.auras.curseOfTheElements.active && this.player.auras.curseOfTheElements.durationRemaining < time) time = this.player.auras.curseOfTheElements.durationRemaining\n if (this.player.auras.curseOfRecklessness && this.player.auras.curseOfRecklessness.active && this.player.auras.curseOfRecklessness.durationRemaining < time) time = this.player.auras.curseOfRecklessness.durationRemaining\n if (this.player.auras.destructionPotion) {\n if (this.player.spells.destructionPotion.cooldownRemaining > 0 && this.player.spells.destructionPotion.cooldownRemaining < time) time = this.player.spells.destructionPotion.cooldownRemaining\n if (this.player.auras.destructionPotion.active && this.player.auras.destructionPotion.durationRemaining < time) time = this.player.auras.destructionPotion.durationRemaining\n }\n if (this.player.spells.flameCap) {\n if (this.player.spells.flameCap.cooldownRemaining > 0 && this.player.spells.flameCap.cooldownRemaining < time) time = this.player.spells.flameCap.cooldownRemaining\n if (this.player.auras.flameCap.active && this.player.auras.flameCap.durationRemaining < time) time = this.player.auras.flameCap.durationRemaining\n }\n if (this.player.spells.bloodFury) {\n if (this.player.spells.bloodFury.cooldownRemaining > 0 && this.player.spells.bloodFury.cooldownRemaining < time) time = this.player.spells.bloodFury.cooldownRemaining\n if (this.player.auras.bloodFury.active && this.player.auras.bloodFury.durationRemaining < time) time = this.player.auras.bloodFury.durationRemaining\n }\n if (this.player.spells.demonicRune && this.player.spells.demonicRune.cooldownRemaining > 0 && this.player.spells.demonicRune.cooldownRemaining < time) time = this.player.spells.demonicRune.cooldownRemaining\n if (this.player.spells.superManaPotion && this.player.spells.superManaPotion.cooldownRemaining > 0 && this.player.spells.superManaPotion.cooldownRemaining < time) time = this.player.spells.superManaPotion.cooldownRemaining\n if (this.player.spells.powerInfusion) {\n for (let i = 0; i < this.player.spells.powerInfusion.length; i++) {\n if (this.player.spells.powerInfusion[i].cooldownRemaining > 0 && this.player.spells.powerInfusion[i].cooldownRemaining < time) time = this.player.spells.powerInfusion[i].cooldownRemaining\n }\n }\n if (this.player.spells.bloodlust) {\n for (let i = 0; i < this.player.spells.bloodlust.length; i++) {\n if (this.player.spells.bloodlust[i].cooldownRemaining > 0 && this.player.spells.bloodlust[i].cooldownRemaining < time) time = this.player.spells.bloodlust[i].cooldownRemaining\n }\n if (this.player.auras.bloodlust.active && this.player.auras.bloodlust.durationRemaining < time) time = this.player.auras.bloodlust.durationRemaining\n }\n if (this.player.spells.innervate) {\n for (let i = 0; i < this.player.spells.innervate.length; i++) {\n if (this.player.spells.innervate[i].cooldownRemaining > 0 && this.player.spells.innervate[i].cooldownRemaining < time) time = this.player.spells.innervate[i].cooldownRemaining\n }\n if (this.player.auras.innervate.active && this.player.auras.innervate.durationRemaining < time) time = this.player.auras.innervate.durationRemaining\n }\n if (this.player.spells.mysticalSkyfireDiamond) {\n if (this.player.spells.mysticalSkyfireDiamond.cooldownRemaining > 0 && this.player.spells.mysticalSkyfireDiamond.cooldownRemaining < time) time = this.player.spells.mysticalSkyfireDiamond.cooldownRemaining\n if (this.player.auras.mysticalSkyfireDiamond.active && this.player.spells.mysticalSkyfireDiamond.durationRemaining < time) time = this.player.auras.mysticalSkyfireDiamond.durationRemaining\n }\n if (this.player.spells.insightfulEarthstormDiamond && this.player.spells.insightfulEarthstormDiamond.cooldownRemaining > 0 && this.player.spells.insightfulEarthstormDiamond.cooldownRemaining < time) time = this.player.spells.insightfulEarthstormDiamond.cooldownRemaining\n if (this.player.spells.timbalsFocusingCrystal && this.player.spells.timbalsFocusingCrystal.cooldownRemaining > 0 && this.player.spells.timbalsFocusingCrystal.cooldownRemaining < time) time = this.player.spells.timbalsFocusingCrystal.cooldownRemaining\n if (this.player.spells.markOfDefiance && this.player.spells.markOfDefiance.cooldownRemaining > 0 && this.player.spells.markOfDefiance.cooldownRemaining < time) time = this.player.spells.markOfDefiance.cooldownRemaining\n if (this.player.spells.lightningOverload && this.player.spells.lightningOverload.cooldownRemaining > 0 && this.player.spells.lightningOverload.cooldownRemaining < time) time = this.player.spells.lightningOverload.cooldownRemaining\n if (this.player.spells.drumsOfBattle && this.player.spells.drumsOfBattle.cooldownRemaining > 0 && this.player.spells.drumsOfBattle.cooldownRemaining < time) time = this.player.spells.drumsOfBattle.cooldownRemaining\n if (this.player.spells.drumsOfWar && this.player.spells.drumsOfWar.cooldownRemaining > 0 && this.player.spells.drumsOfWar.cooldownRemaining < time) time = this.player.spells.drumsOfWar.cooldownRemaining\n if (this.player.spells.drumsOfRestoration && this.player.spells.drumsOfRestoration.cooldownRemaining > 0 && this.player.spells.drumsOfRestoration.cooldownRemaining < time) time = this.player.spells.drumsOfRestoration.cooldownRemaining\n if (this.player.auras.drumsOfBattle && this.player.auras.drumsOfBattle.active && this.player.auras.drumsOfBattle.durationRemaining < time) time = this.player.auras.drumsOfBattle.durationRemaining\n if (this.player.auras.drumsOfWar && this.player.auras.drumsOfWar.active && this.player.auras.drumsOfWar.durationRemaining < time) time = this.player.auras.drumsOfWar.durationRemaining\n if (this.player.auras.drumsOfRestoration && this.player.auras.drumsOfRestoration.active && this.player.auras.drumsOfRestoration.tickTimerRemaining < time) time = this.player.auras.drumsOfRestoration.tickTimerRemaining\n if (this.player.auras.wrathOfCenarius && this.player.auras.wrathOfCenarius.active && this.player.auras.wrathOfCenarius.durationRemaining < time) time = this.player.auras.wrathOfCenarius.durationRemaining\n if (this.player.auras.spellstrikeProc && this.player.auras.spellstrikeProc.active && this.player.auras.spellstrikeProc.durationRemaining < time) time = this.player.auras.spellstrikeProc.durationRemaining\n if (this.player.auras.powerInfusion && this.player.auras.powerInfusion.active && this.player.auras.powerInfusion.durationRemaining < time) time = this.player.auras.powerInfusion.durationRemaining\n if (this.player.auras.eyeOfMagtheridon && this.player.auras.eyeOfMagtheridon.active && this.player.auras.eyeOfMagtheridon.durationRemaining < time) time = this.player.auras.eyeOfMagtheridon.durationRemaining\n if (this.player.auras.sextantOfUnstableCurrents) {\n if (this.player.auras.sextantOfUnstableCurrents.active && this.player.auras.sextantOfUnstableCurrents.durationRemaining < time) time = this.player.auras.sextantOfUnstableCurrents.durationRemaining\n if (this.player.spells.sextantOfUnstableCurrents.cooldownRemaining > 0 && this.player.spells.sextantOfUnstableCurrents.cooldownRemaining < time) time = this.player.spells.sextantOfUnstableCurrents.cooldownRemaining\n }\n if (this.player.auras.quagmirransEye) {\n if (this.player.auras.quagmirransEye.active && this.player.auras.quagmirransEye.durationRemaining < time) time = this.player.auras.quagmirransEye.durationRemaining\n if (this.player.spells.quagmirransEye.cooldownRemaining > 0 && this.player.spells.quagmirransEye.cooldownRemaining < time) time = this.player.spells.quagmirransEye.cooldownRemaining\n }\n if (this.player.auras.shiffarsNexusHorn) {\n if (this.player.auras.shiffarsNexusHorn.active && this.player.auras.shiffarsNexusHorn.durationRemaining < time) time = this.player.auras.shiffarsNexusHorn.durationRemaining\n if (this.player.spells.shiffarsNexusHorn.cooldownRemaining > 0 && this.player.spells.shiffarsNexusHorn.cooldownRemaining < time) time = this.player.spells.shiffarsNexusHorn.cooldownRemaining\n }\n if (this.player.spells.bladeOfWizardry) {\n if (this.player.spells.bladeOfWizardry.cooldownRemaining > 0 && this.player.spells.bladeOfWizardry.cooldownRemaining < time) time = this.player.spells.bladeOfWizardry.cooldownRemaining\n if (this.player.auras.bladeOfWizardry.active && this.player.auras.bladeOfWizardry.durationRemaining < time) time = this.player.auras.bladeOfWizardry.durationRemaining\n }\n if (this.player.spells.robeOfTheElderScribes) {\n if (this.player.spells.robeOfTheElderScribes.cooldownRemaining > 0 && this.player.spells.robeOfTheElderScribes.cooldownRemaining < time) time = this.player.spells.robeOfTheElderScribes.cooldownRemaining\n if (this.player.auras.robeOfTheElderScribes.active && this.player.auras.robeOfTheElderScribes.durationRemaining < time) time = this.player.auras.robeOfTheElderScribes.durationRemaining\n }\n if (this.player.auras.ashtongueTalismanOfShadows && this.player.auras.ashtongueTalismanOfShadows.active && this.player.auras.ashtongueTalismanOfShadows.durationRemaining < time) time = this.player.auras.ashtongueTalismanOfShadows.durationRemaining\n if (this.player.auras.darkmoonCardCrusade && this.player.auras.darkmoonCardCrusade.active && this.player.auras.darkmoonCardCrusade.durationRemaining < time) time = this.player.auras.darkmoonCardCrusade.durationRemaining\n if (this.player.auras.manaEtched4Set && this.player.auras.manaEtched4Set.active && this.player.auras.manaEtched4Set.durationRemaining < time) time = this.player.auras.manaEtched4Set.durationRemaining\n if (this.player.spells.theLightningCapacitor && this.player.spells.theLightningCapacitor.cooldownRemaining > 0 && this.player.spells.theLightningCapacitor.cooldownRemaining < time) time = this.player.spells.theLightningCapacitor.cooldownRemaining\n if (this.player.spells.elementalMastery && this.player.spells.elementalMastery.cooldownRemaining > 0 && this.player.spells.elementalMastery.cooldownRemaining < time) time = this.player.spells.elementalMastery.cooldownRemaining\n if (this.player.auras.bandOfTheEternalSage) {\n if (this.player.auras.bandOfTheEternalSage.active && this.player.auras.bandOfTheEternalSage.durationRemaining < time) time = this.player.auras.bandOfTheEternalSage.durationRemaining\n if (this.player.spells.bandOfTheEternalSage.cooldownRemaining > 0 && this.player.spells.bandOfTheEternalSage.cooldownRemaining < time) time = this.player.spells.bandOfTheEternalSage.cooldownRemaining\n }\n if (this.player.spells.shatteredSunPendantOfAcumen) {\n if (this.player.spells.shatteredSunPendantOfAcumen.cooldownRemaining > 0 && this.player.spells.shatteredSunPendantOfAcumen.cooldownRemaining < time) time = this.player.spells.shatteredSunPendantOfAcumen.cooldownRemaining\n if (this.player.auras.shatteredSunPendantOfAcumen && this.player.auras.shatteredSunPendantOfAcumen.active && this.player.auras.shatteredSunPendantOfAcumen.durationRemaining < time) time = this.player.auras.shatteredSunPendantOfAcumen.durationRemaining\n }\n if (this.player.mp5Timer < time) time = this.player.mp5Timer\n for (let i = 0; i < 2; i++) {\n if (this.player.trinkets[i]) {\n if (this.player.trinkets[i].active && this.player.trinkets[i].durationRemaining < time) time = this.player.trinkets[i].durationRemaining\n if (this.player.trinkets[i].cooldownRemaining > 0 && this.player.trinkets[i].cooldownRemaining < time) time = this.player.trinkets[i].cooldownRemaining\n }\n }\n if (this.player.pet) {\n if (this.player.pet.auras.blackBook && this.player.pet.auras.blackBook.active && this.player.pet.auras.blackBook.durationRemaining < time) time = this.player.pet.auras.blackBook.durationRemaining\n }\n\n // Pass time\n // This needs to be the first modified value since the time in combat needs to be updated before spells start dealing damage/auras expiring etc. for the combat logging.\n this.player.fightTime += time\n this.player.castTimeRemaining = Math.max(0, this.player.castTimeRemaining - time)\n\n // Pet\n if (this.player.pet) this.player.pet.tick(time)\n\n // Auras need to tick before Spells because otherwise you'll, for example, finish casting Corruption and then immediately afterwards, in the same millisecond, immediately tick down the aura\n // This was also causing buffs like the t4 4pc buffs to expire sooner than they should.\n\n // Auras\n if (this.player.auras.powerInfusion && this.player.auras.powerInfusion.active) this.player.auras.powerInfusion.tick(time)\n if (this.player.auras.corruption && this.player.auras.corruption.active) this.player.auras.corruption.tick(time)\n if (this.player.auras.siphonLife && this.player.auras.siphonLife.active) this.player.auras.siphonLife.tick(time)\n if (this.player.auras.flameshock && this.player.auras.flameshock.active) this.player.auras.flameshock.tick(time)\n if (this.player.auras.curseOfAgony && this.player.auras.curseOfAgony.active) this.player.auras.curseOfAgony.tick(time)\n if (this.player.auras.curseOfTheElements && this.player.auras.curseOfTheElements.active) this.player.auras.curseOfTheElements.tick(time)\n if (this.player.auras.curseOfRecklessness && this.player.auras.curseOfRecklessness.active) this.player.auras.curseOfRecklessness.tick(time)\n if (this.player.auras.destructionPotion && this.player.auras.destructionPotion.active) this.player.auras.destructionPotion.tick(time)\n if (this.player.auras.elementalMastery && this.player.auras.elementalMastery.active) this.player.auras.elementalMastery.tick(time)\n if (this.player.auras.flameCap && this.player.auras.flameCap.active) this.player.auras.flameCap.tick(time)\n if (this.player.auras.spellstrikeProc && this.player.auras.spellstrikeProc.active) this.player.auras.spellstrikeProc.tick(time)\n if (this.player.auras.eyeOfMagtheridon && this.player.auras.eyeOfMagtheridon.active) this.player.auras.eyeOfMagtheridon.tick(time)\n if (this.player.auras.sextantOfUnstableCurrents && (this.player.auras.sextantOfUnstableCurrents.active || this.player.auras.sextantOfUnstableCurrents.hiddenCooldownRemaining > 0)) this.player.auras.sextantOfUnstableCurrents.tick(time)\n if (this.player.auras.quagmirransEye && (this.player.auras.quagmirransEye.active || this.player.auras.quagmirransEye.hiddenCooldownRemaining > 0)) this.player.auras.quagmirransEye.tick(time)\n if (this.player.auras.shiffarsNexusHorn && this.player.auras.shiffarsNexusHorn.active) this.player.auras.shiffarsNexusHorn.tick(time)\n if (this.player.auras.manaEtched4Set && this.player.auras.manaEtched4Set.active) this.player.auras.manaEtched4Set.tick(time)\n if (this.player.auras.bloodFury && this.player.auras.bloodFury.active) this.player.auras.bloodFury.tick(time)\n if (this.player.auras.bloodlust && this.player.auras.bloodlust.active) this.player.auras.bloodlust.tick(time)\n if (this.player.auras.drumsOfBattle && this.player.auras.drumsOfBattle.active) this.player.auras.drumsOfBattle.tick(time)\n if (this.player.auras.drumsOfWar && this.player.auras.drumsOfWar.active) this.player.auras.drumsOfWar.tick(time)\n if (this.player.auras.drumsOfRestoration && this.player.auras.drumsOfRestoration.active) this.player.auras.drumsOfRestoration.tick(time)\n if (this.player.auras.ashtongueTalismanOfShadows && this.player.auras.ashtongueTalismanOfShadows.active) this.player.auras.ashtongueTalismanOfShadows.tick(time)\n if (this.player.auras.darkmoonCardCrusade && this.player.auras.darkmoonCardCrusade.active) this.player.auras.darkmoonCardCrusade.tick(time)\n if (this.player.auras.bladeOfWizardry && this.player.auras.bladeOfWizardry.active) this.player.auras.bladeOfWizardry.tick(time)\n if (this.player.auras.shatteredSunPendantOfAcumen && this.player.auras.shatteredSunPendantOfAcumen.active) this.player.auras.shatteredSunPendantOfAcumen.tick(time)\n if (this.player.auras.robeOfTheElderScribes && this.player.auras.robeOfTheElderScribes.active) this.player.auras.robeOfTheElderScribes.tick(time)\n if (this.player.auras.bandOfTheEternalSage && this.player.auras.bandOfTheEternalSage.active) this.player.auras.bandOfTheEternalSage.tick(time)\n if (this.player.auras.mysticalSkyfireDiamond && this.player.auras.mysticalSkyfireDiamond.active) this.player.auras.mysticalSkyfireDiamond.tick(time)\n if (this.player.auras.wrathOfCenarius && this.player.auras.wrathOfCenarius.active) this.player.auras.wrathOfCenarius.tick(time)\n if (this.player.auras.innervate && this.player.auras.innervate.active) this.player.auras.innervate.tick(time)\n\n // Spells\n if (this.player.spells.lightningBolt && this.player.spells.lightningBolt.casting) this.player.spells.lightningBolt.tick(time)\n if (this.player.spells.flameshock && this.player.spells.flameshock.casting) this.player.spells.flameshock.tick(time)\n if (this.player.spells.corruption && this.player.spells.corruption.casting) this.player.spells.corruption.tick(time)\n if (this.player.spells.destructionPotion && this.player.spells.destructionPotion.cooldownRemaining > 0) this.player.spells.destructionPotion.tick(time)\n if (this.player.spells.elementalMastery && this.player.spells.elementalMastery.cooldownRemaining > 0) this.player.spells.elementalMastery.tick(time)\n if (this.player.spells.superManaPotion && this.player.spells.superManaPotion.cooldownRemaining > 0) this.player.spells.superManaPotion.tick(time)\n if (this.player.spells.demonicRune && this.player.spells.demonicRune.cooldownRemaining > 0) this.player.spells.demonicRune.tick(time)\n if (this.player.spells.flameCap && this.player.spells.flameCap.cooldownRemaining > 0) this.player.spells.flameCap.tick(time)\n if (this.player.spells.bloodFury && this.player.spells.bloodFury.cooldownRemaining > 0) this.player.spells.bloodFury.tick(time)\n if (this.player.spells.mysticalSkyfireDiamond && this.player.spells.mysticalSkyfireDiamond.cooldownRemaining > 0) this.player.spells.mysticalSkyfireDiamond.tick(time)\n if (this.player.spells.drumsOfBattle && this.player.spells.drumsOfBattle.cooldownRemaining > 0) this.player.spells.drumsOfBattle.tick(time)\n if (this.player.spells.drumsOfWar && this.player.spells.drumsOfWar.cooldownRemaining > 0) this.player.spells.drumsOfWar.tick(time)\n if (this.player.spells.drumsOfRestoration && this.player.spells.drumsOfRestoration.cooldownRemaining > 0) this.player.spells.drumsOfRestoration.tick(time)\n if (this.player.spells.timbalsFocusingCrystal && this.player.spells.timbalsFocusingCrystal.cooldownRemaining > 0) this.player.spells.timbalsFocusingCrystal.tick(time)\n if (this.player.spells.markOfDefiance && this.player.spells.markOfDefiance.cooldownRemaining > 0) this.player.spells.markOfDefiance.tick(time)\n if (this.player.spells.lightningOverload && this.player.spells.lightningOverload.cooldownRemaining > 0) this.player.spells.lightningOverload.tick(time)\n if (this.player.spells.theLightningCapacitor && this.player.spells.theLightningCapacitor.cooldownRemaining > 0) this.player.spells.theLightningCapacitor.tick(time)\n if (this.player.spells.bladeOfWizardry && this.player.spells.bladeOfWizardry.cooldownRemaining > 0) this.player.spells.bladeOfWizardry.tick(time)\n if (this.player.spells.shatteredSunPendantOfAcumen && this.player.spells.shatteredSunPendantOfAcumen.cooldownRemaining > 0) this.player.spells.shatteredSunPendantOfAcumen.tick(time)\n if (this.player.spells.robeOfTheElderScribes && this.player.spells.robeOfTheElderScribes.cooldownRemaining > 0) this.player.spells.robeOfTheElderScribes.tick(time)\n if (this.player.spells.quagmirransEye && this.player.spells.quagmirransEye.cooldownRemaining > 0) this.player.spells.quagmirransEye.tick(time)\n if (this.player.spells.shiffarsNexusHorn && this.player.spells.shiffarsNexusHorn.cooldownRemaining > 0) this.player.spells.shiffarsNexusHorn.tick(time)\n if (this.player.spells.sextantOfUnstableCurrents && this.player.spells.sextantOfUnstableCurrents.cooldownRemaining > 0) this.player.spells.sextantOfUnstableCurrents.tick(time)\n if (this.player.spells.bandOfTheEternalSage && this.player.spells.bandOfTheEternalSage.cooldownRemaining > 0) this.player.spells.bandOfTheEternalSage.tick(time)\n if (this.player.spells.insightfulEarthstormDiamond && this.player.spells.insightfulEarthstormDiamond.cooldownRemaining > 0) this.player.spells.insightfulEarthstormDiamond.tick(time)\n if (this.player.spells.powerInfusion) {\n for (let i = 0; i < this.player.spells.powerInfusion.length; i++) {\n if (this.player.spells.powerInfusion[i].cooldownRemaining > 0) this.player.spells.powerInfusion[i].tick(time)\n }\n }\n if (this.player.spells.bloodlust) {\n for (let i = 0; i < this.player.spells.bloodlust.length; i++) {\n if (this.player.spells.bloodlust[i].cooldownRemaining > 0) this.player.spells.bloodlust[i].tick(time)\n }\n }\n if (this.player.spells.innervate) {\n for (let i = 0; i < this.player.spells.innervate.length; i++) {\n if (this.player.spells.innervate[i].cooldownRemaining > 0) this.player.spells.innervate[i].tick(time)\n }\n }\n\n // Trinkets\n if (this.player.trinkets[0]) this.player.trinkets[0].tick(time)\n if (this.player.trinkets[1]) this.player.trinkets[1].tick(time)\n\n this.player.gcdRemaining = Math.max(0, this.player.gcdRemaining - time)\n this.player.mp5Timer = Math.max(0, this.player.mp5Timer - time)\n this.player.fiveSecondRuleTimer = Math.max(0, this.player.fiveSecondRuleTimer - time)\n if (this.player.mp5Timer == 0) {\n this.player.mp5Timer = 5\n if (this.player.stats.mp5 > 0 || this.player.fiveSecondRuleTimer <= 0 || (this.player.auras.innervate && this.player.auras.innervate.active)) {\n const currentPlayerMana = this.player.mana\n // MP5\n if (this.player.stats.mp5 > 0) {\n this.player.mana = Math.min(this.player.stats.maxMana, this.player.mana + this.player.stats.mp5)\n }\n // Spirit mana regen\n if (this.player.fiveSecondRuleTimer <= 0 || (this.player.auras.innervate && this.player.auras.innervate.active)) {\n // Formula from https://wowwiki-archive.fandom.com/wiki/Spirit?oldid=1572910\n let mp5FromSpirit = 5 * (0.001 + Math.sqrt(this.player.stats.intellect * this.player.stats.intellectModifier) * (this.player.stats.spirit * this.player.stats.spiritModifier) * 0.009327)\n if (this.player.auras.innervate && this.player.auras.innervate.active) {\n mp5FromSpirit *= 4\n }\n this.player.mana = Math.min(this.player.stats.maxMana, this.player.mana + mp5FromSpirit)\n }\n const manaGained = this.player.mana - currentPlayerMana\n this.player.totalManaRegenerated += manaGained\n this.player.manaGainBreakdown.mp5.casts = this.player.manaGainBreakdown.mp5.casts + 1 || 1\n this.player.manaGainBreakdown.mp5.manaGain = this.player.manaGainBreakdown.mp5.manaGain + manaGained || manaGained\n this.player.combatLog('Player gains ' + Math.round(manaGained) + ' mana from MP5 (' + Math.round(currentPlayerMana) + ' -> ' + Math.round(this.player.mana) + ')')\n }\n }\n\n return time\n }", "function incorrect() {\nshotClock -= 10; \nnext();\n}", "async battle_phase_round_start() {\n const enemy_members = this.enemies_info.map(info => info.instance);\n this.enemies_abilities = Object.fromEntries(enemy_members.map((enemy, index) => {\n let abilities = new Array(enemy.turns);\n for (let i = 0; i < enemy.turns; ++i) {\n abilities[i] = EnemyAI.roll_action(enemy, party_data.members, enemy_members);\n }\n return [this.enemies_info[index].battle_key, abilities];\n }));\n for (let char_key in this.player_abilities) {\n const this_char = main_char_list[char_key];\n for (let i = 0; i < this.player_abilities[char_key].length; ++i) {\n const this_ability = abilities_list[this.player_abilities[char_key][i].key_name];\n const priority_move = this_ability !== undefined ? this_ability.priority_move : false;\n this.player_abilities[char_key][i].speed = BattleFormulas.player_turn_speed(this_char.current_agi, priority_move, i > 0);\n this.player_abilities[char_key][i].caster = this_char;\n }\n }\n for (let battle_key in this.enemies_abilities) {\n const this_enemy = this.this_enemies_list[battle_key];\n for (let i = 0; i < this.enemies_abilities[battle_key].length; ++i) {\n const this_ability = abilities_list[this.enemies_abilities[battle_key][i].key_name];\n const priority_move = this_ability !== undefined ? this_ability.priority_move : false;\n this.enemies_abilities[battle_key][i].speed = BattleFormulas.enemy_turn_speed(this_enemy.current_agi, i + 1, this_enemy.turns, priority_move);\n this.enemies_abilities[battle_key][i].caster = this_enemy;\n }\n }\n this.turns_actions = _.sortBy(Object.values(this.player_abilities).flat().concat(Object.values(this.enemies_abilities).flat()), action => {\n return action.speed; //still need to add left most and player preference criterias\n });\n for (let i = 0; i < this.turns_actions.length; ++i) {\n const action = this.turns_actions[i];\n await this.animation_manager.load_animation(action.key_name);\n }\n this.battle_phase = battle_phases.COMBAT;\n this.controls_enabled = true;\n this.check_phases();\n }", "function countMoves() {\n moves++; //moves the counter up one after each 2 cards are clicked//\n movesCounter.innerHTML = moves; //displays the values of moves on the page//\n if (moves === 1) {\n seconds = 0;\n minutes = 0;\n startTimer(); //go to startTimer function//\n }\n }", "function countMoves() {\n\n num++;\n moves.textContent = num;\n\n if (num === 1) {\n //start the stopwatch on the first move\n startTimer();\n } else if (num > 1) {\n //reduce the number of stars based on number of moves\n if (num > 49) {\n endGame(); //moves limit for game\n } else if (num > 18) {\n stars[1].innerHTML = '<i class=\"fa fa-star-o\"></i>';\n } else if (num > 12) {\n stars[2].innerHTML = '<i class=\"fa fa-star-o\"></i>';\n }\n }\n}", "getMove() {\n if (this.infected) {\n let nearby = this.world.characters.filter((character) => Math.abs(character.x - this.x) <= 2 && Math.abs(character.y - this.y) <= 2 && character != this)\n for (let c of nearby) {\n let probability = 1 / (Math.sqrt((c.x - this.x) * (c.x - this.x) + (c.y - this.y) * (c.y - this.y))) * this.world.outsideInfectionRate\n if (Math.random() < probability) {\n c.particlesIn()\n }\n }\n }\n\n let distances = this.currentBuilding.distancesFrom;\n if (distances[this.x][this.y] == 1) {\n this.world.intoBuilding(this.currentBuilding, this)\n return\n }\n\n // Make sure every coordinate is in the map and valid\n let possibleValues = moves.map((diff) => [this.x + diff[0], this.y + diff[1]]).filter((coord) => this.world.isEmpty(coord[0], coord[1]))\n\n // Sort by rating\n possibleValues.sort((first, second) => distances[second[0]][second[1]] - distances[first[0]][first[1]])\n\n if (possibleValues.length == 0) {\n return\n }\n\n var distancing = this.world.sdRange\n let nearbies = this.world.characters.filter((character) => Math.abs(character.x - this.x) <= 3 && Math.abs(character.y - this.y) <= 3).filter((c) => c != this)\n\n let maxVal = distances[possibleValues[0][0]][possibleValues[0][1]]\n // score based on how it can get to the home\n let scores = possibleValues.map((coord) => Math.abs(distances[coord[0]][coord[1]] - maxVal - 1))\n\n\n scores = scores.map(function (currentScore, i) {\n let [x, y] = possibleValues[i]\n if (nearbies.length == 0) {\n return currentScore\n }\n let closestDistance = Math.sqrt(nearbies.map((char) => (char.x - x) * (char.x - x) + (char.y - y) * (char.y - y)).reduce((last, current) => Math.min(last, current)))\n\n let multiplier = Math.pow(1 - distancing / 3 / (Math.pow(2, 2 * (closestDistance - 2.5)) + 1), 2)\n return currentScore * multiplier\n })\n\n let maxScore = scores.reduce((last, cur) => Math.max(last, cur))\n for (let i = 0; i < scores.length; ++i) {\n if (scores[i] == maxScore) {\n this.world.move(this, possibleValues[i][0], possibleValues[i][1])\n }\n }\n }", "calcSpeed(){\n\treturn this.distance/(this.time/60);//miles per hour\n }", "function takeAMasterMove(turn){ ... }", "tick(elapsed, idempotencyToken) {\n if (this._idempotencyToken === idempotencyToken) {\n return;\n }\n this._idempotencyToken = idempotencyToken;\n this._timeLeftInFrame -= elapsed;\n if (this._timeLeftInFrame <= 0) {\n this.currentFrame = this.loop ? (this.currentFrame + 1) % this.sprites.length : this.currentFrame + 1;\n this._timeLeftInFrame = this.speed;\n }\n this._updateValues();\n const current = this.sprites[this.currentFrame];\n if (current) {\n this.width = current.width;\n this.height = current.height;\n this.drawWidth = current.drawWidth;\n this.drawHeight = current.drawHeight;\n }\n }", "regrow()\n {\n this.timer += 1; \n\n if(this.timer > 50 && this.state < 5) \n {\n this.state++;\n this.timer = 25;\n }\n }", "function timeTrack() {\r\n tracker++;\r\n time = tracker / 50;\r\n}", "countLayerTurns(move) {\n let layerCount = move.getLayerCount();\n let layerMask = move.getLayerMask();\n let turns = Math.abs(move.getAngle()) % 4;\n if (turns == 0) {\n return 0;\n } else {\n let count = 0;\n for (let i = 0; i < layerCount; i++) {\n if (((layerMask >>> i) & 1) == 1) {\n count++;\n }\n }\n return Math.min(count, layerCount - count);\n }\n }", "function runTest(state, robot, memory) {\n for (let turn = 0;; turn++) {\n if (state.parcels.length == 0) {\n //console.log(`Done in ${turn} turns`);\n return turn;\n //break;\n }\n let action = robot(state, memory);\n state = state.move(action.direction);\n memory = action.memory;\n //console.log(\"turn = \", turn)\n //console.log(`Moved to ${action.direction}`); \n }\n}", "function measure (token) {\n if (!token) { return -1 }\n\n return categorizeGroups(token).replace(/^C/, '').replace(/V$/, '').length / 2\n}", "static tick() {\n this.counter = 0;\n this.pokemonAttack();\n }", "static tick() {\n this.counter = 0;\n this.pokemonAttack();\n }", "static tick() {\n this.counter = 0;\n this.pokemonAttack();\n }", "function playerMove(elem) {\n \"use strict\";\n if (!endState) {\n drawToken(elem, 'X');\n turnPasses();\n setTimeout(function () {\n\t\tcomputerMove();\n \tturnPasses();\n\t}, 200);\n }\n}", "get entropy() {\n const {\n entropy,\n globalEntropy\n } = this.lastTimeMark;\n return entropy + Math.abs((this.globalEntropy - globalEntropy) * this.playbackRate);\n }", "function takeTurn () {}", "invalidateAttack(player, tile) {\n // <<-- Creer-Merge: invalidate-attack -->>\n if (!player || player !== this.game.currentPlayer) {\n return `It isn't your turn, ${player}.`;\n }\n if (!this) {\n return `This unit does not exist!`;\n }\n if (this.owner !== player || this.owner === undefined) {\n return `${this} isn't owned by you.`;\n }\n // Make sure the unit hasn't acted.\n if (this.acted) {\n return `${this} has already acted this turn.`;\n }\n // Make sure the unit is alive.\n if (this.health <= 0) {\n return `${this} is dead, for now.`;\n }\n // Make sure the unit is on a tile.\n if (!this.tile) {\n return `${this} is not on a tile.`;\n }\n // Make sure the tile exists.\n if (!tile) {\n return `${this} is trying to attack a tile that doesn't exist`;\n }\n // Make sure the tile is in range.\n if (this.tile !== tile.tileEast && this.tile !== tile.tileSouth &&\n this.tile !== tile.tileWest && this.tile !== tile.tileNorth) {\n return `${this} is trying to attack ${tile}, which is too far away.`;\n }\n // Make sure the the unit is attacking a tower.\n if (!tile.tower) {\n return `${this} is attacking ${tile}, which doesn't have a tower.`;\n }\n // Make sure you aren't attacking a friendly tower.\n if (tile.tower.owner === player) {\n return `${this} is trying to attack the allied tower: ${tile.tower} on tile ${tile}`;\n }\n // Handle possible unit invalidations here:\n if (this.owner === undefined) {\n return `${this} is attacking a unit that has no owner. Report this to the game Devs. This is 100% a bug`;\n }\n // Make sure the unit has a job.\n if (this.job === undefined) {\n return `${this} doesn't have a job. That shouldn't be possible.`;\n }\n // <<-- /Creer-Merge: invalidate-attack -->>\n }", "function trackPositionPerSecond(){\n\t\t\tif(!isGameOver){\n\t\t\t\tgetMousePosition();\n\t\t\t\t// console.log(positionTracker);\n\t\t\t\tvar posX = positionTracker.pos_x;\n\t\t\t\tvar posY = positionTracker.pos_y;\n\t\t\t\tvar idx = getSpaceIndex(posX,posY);\n\t\t\t\tvar region = identifyBoardRegion(idx);\n\t\t\t\t// console.log(posX, posY, idx, region);\n\t\t\t\tvar currentPositionMetrics = {region: region, positionX: posX, positionY: posY};\n\t\t\t\tplayerStats.timeTaken++;\n\t\t\t\t$(\".ms-timer\").text(playerStats.timeTaken);\n\t\t\t\t$(\".ms-flag-count\").text(playerStats.flags);\n\t\t\t\tif(playerStats.timeTaken >= 1800){\n\t\t\t\t\tisGameOver = true;\n\t\t\t\t\t$(\".ms-timer\").css(\"color\",\"red\")\n\n\t\t\t\t}\n\t\t\t\ttimeExpired();\n\t\t\t\t//console.log(playerStats.timeTaken);\n\t\t\t\tplayerStats.regionLocationsPerSecond.push(currentPositionMetrics);\n\t\t\t}\n\t\t}", "invalidateRes(player, num) {\n // <<-- Creer-Merge: invalidate-res -->>\n // Player invalidation\n if (!player || player !== this.game.currentPlayer) {\n return `It isn't your turn, ${player}.`;\n }\n // Ensure tile exists\n if (!this) {\n return `This tile does not exist!`;\n }\n // Ensure number isn't too large\n if (this.corpses < num) {\n return `${this} doesn't have ${num} corpses, it only has ${this.corpses}!`;\n }\n // Ensure num is positive\n if (num <= 0) {\n return `Why are you trying to resurrect ${num} corpses?!`;\n }\n // Ensure the player has enough mana\n const cost = num * this.game.unitJobs[1].manaCost;\n if (this.game.currentPlayer.mana < cost) {\n return `You do not have enough mana to resurrect ${num} corpses!`;\n }\n let spawnTile;\n for (const tile of this.game.tiles) {\n if (tile.owner === player && tile.isUnitSpawn) {\n spawnTile = tile;\n }\n }\n if (!spawnTile) {\n return `You do not have a unit spawn tile. This is probably a bug.`;\n }\n // Ensure there isn't another unit currently on this tile\n const unitCount = Math.max(this.numGhouls, this.numHounds);\n if (unitCount > 0 || (this.unit !== undefined && this.unit.job.title !== \"zombie\")) {\n return `Your unit spawn tile is already occupied by another unit!`;\n }\n // Ensure there wouldn't be too many zombies\n if (spawnTile.numZombies + num > this.game.unitJobs[1].perTile) {\n return `Your spawn tile cannot fit an additional ${num} zombies!`;\n }\n // <<-- /Creer-Merge: invalidate-res -->>\n }", "function incrementCounter(){\n\tnumberOfMoves++;\n\tconsole.log(`total moves ${numberOfMoves}`);\n\tcounterForMoves.innerHTML = numberOfMoves;\n\tif(numberOfMoves == 1){\n\t\tstartTimer();\n\t}\n}", "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}", "forceTurnEvaluation() {\n this.turnIndicator -= 1;\n this.turnIndicator += 1;\n }", "function checkCollectable(t_collectable)\n{\n \n var d = dist(gameChar_world_x, gameChar_y, t_collectable.x_Pos, t_collectable.y_Pos);\n if(d < 89)\n {\n t_collectable.isFound = true;\n game_score += 1; //Logic for incrementing game score\n }\n}", "function compareRobots(robot1, memory1, robot2, memory2) {\n const NUMBER_OF_TASKS = 100;\n const turn_counts = {robot1: 0, robot2: 0};\n let average_robot1 = 0;\n let average_robot2 = 0;\n for(let counter = 0; counter < NUMBER_OF_TASKS; counter++) {\n let villageState = (new classes.VillageState(null, null, roadGraph)).random();\n turn_counts.robot1 += utils.runRobot(villageState, robot1, memory1, roadGraph);\n turn_counts.robot2 += utils.runRobot(villageState, robot2, memory2, roadGraph);\n }\n\n average_robot1 = utils.calculateAverage(turn_counts.robot1, NUMBER_OF_TASKS);\n average_robot2 = utils.calculateAverage(turn_counts.robot2, NUMBER_OF_TASKS);\n\n console.log(\"Robot1: \" + average_robot1);\n console.log(\"Robot2: \" + average_robot2);\n}", "function msecUntilNextGame()\n {\n var now = new Date().getTime();\n var timePrevGameOver = Math.floor(now / MSECS_IN_COMPLETE_CYCLE) * MSECS_IN_COMPLETE_CYCLE;\n return (timePrevGameOver + MSECS_IN_COMPLETE_CYCLE) - now;\n }", "allTerritoriesClaimed(){\r\n let claimedCount = 0;\r\n Object.keys(this.mapGrid.hashOfTiles).forEach( pointer => {\r\n let tile = this.mapGrid.hashOfTiles[pointer];\r\n if (tile.status === true){\r\n claimedCount += 1;\r\n }\r\n })\r\n \r\n if (claimedCount === this.mapGrid.size - 6){\r\n this.claimTerritoryPhase = false; // this will NOT be REACTIVATED\r\n this.initialPlacementPhase = true; \r\n } \r\n }", "function measure(token) {\n if(!token)\n\treturn -1;\n\n return categorizeGroups(token).replace(/^C/, '').replace(/V$/, '').length / 2;\n}", "_getRemainingTime()\r\n {\r\n // Get time remaining in seconds.\r\n let timeRemaining = this._getRemainingDistance() / this._getAverageSpeed();\r\n if (timeRemaining === Infinity){\r\n timeRemaining = NaN\r\n }\r\n return timeRemaining\r\n }", "function checkForAce(turn) {\n if (hasAce(turn) && (turn.total + 10 <= 21)) {\n $(`#${turn.name}-total p`).text(`${turn.total} (${turn.total + 10})`)\n turn.total += 10;\n };\n\n}", "doCalculation() {\n const { questAPI, idAPI, timer } = this.props;\n const { difficulty } = questAPI[idAPI];\n const staticPoint = 10;\n let points = 1;\n const TRES = 3;\n switch (difficulty) {\n case \"hard\":\n points = TRES;\n break;\n case \"medium\":\n points = 2;\n break;\n default:\n points = 1;\n }\n return staticPoint + points * timer;\n }", "getPictureShootTime() {\n return (this.getPictureHeightWithOverlap() / this.mission.flightSpeed).toFixed(2);\n }", "enemyMovementFlow() {\n squares[this.enemyIndex].classList.remove('enemy')\n if (this.enemyShouldMove && !this.enemyHit) {\n // console.log('should move right')\n this.enemyIndex ++ // move right\n this.enemyMoveCount ++\n } else if (!this.enemyShouldMove && !this.enemyHit) {\n // console.log('should move left')\n this.enemyIndex -- // move left\n this.enemyMoveCount --\n }\n if (!this.enemyHit) squares[this.enemyIndex].classList.add('enemy')\n // console.log(this.enemyMoveCount)\n setTimeout(() => {\n this.dropLine()\n }, 250)\n }", "function enemyRacketMovement(){\n yEnemySpeed = yBall -yEnemyRacket - lengthRacket / 2 - 30;\n yEnemyRacket += yEnemySpeed + missChance\n calcMissChance()\n}", "function manhattan(tile){\n if (tile){\n return Math.abs(tile.row - tile.goalRow) + Math.abs(tile.col - tile.goalCol);\n }else{\n return 0;\n }\n}", "function executeGreatestClaim(roomId) {\n const room = rooms[roomId];\n //console.log('end timer');\n //console.log(room.currentClaims);\n const tile = room.rnd.getLastDiscard();\n room.timerElapsed = true;\n let maxIndices = [];\n let greatestClaim = ClaimTypes.none;\n for (let i = 0; i < 4; i++) {\n if (room.currentClaims[i] > greatestClaim) {\n maxIndices = [i];\n greatestClaim = room.currentClaims[i];\n } else if (room.currentClaims[i] === greatestClaim) {\n maxIndices.push(i);\n }\n }\n if (greatestClaim === ClaimTypes.none) {\n //do nothing, disable all options for non-turn players\n for (let i = 0; i < room.players.length; i++) {\n let actions = [false, false, false, false, false, false];\n\n if (i === room.rnd.turn && room.hasDrawn) {\n actions[0] = true;\n actions[1] = room.rnd.players[i].currentHand.checkChow(tile);\n actions[2] = room.rnd.players[i].currentHand.checkPeng(tile);\n actions[3] = room.rnd.players[i].currentHand.checkKong(tile);\n actions[4] = room.rnd.players[i].currentHand.checkWin(tile);\n // Draw tile\n executeDraw(roomId);\n }\n\n }\n } else if (greatestClaim === ClaimTypes.chow) { //chow\n const chowArray = executeChow(roomId);\n\n for (let i = 0; i < room.players.length; i++) {\n if (i === room.rnd.turn) {\n let actions = [false, false, false, false, room.rnd.players[i].currentHand.checkWin(), true];\n\n const chowPayload = { hand : room.rnd.players[room.rnd.turn].currentHand, actions : actions };\n io.to(room.players[i].id).emit('chow', chowPayload);\n } else {\n let actions = [false, false, false, false, false, false];\n const chowPayloadOthers = { agent : room.rnd.turn+1, chow : new Meld(MeldTypes.chow, chowArray), actions: actions };\n io.to(room.players[i].id).emit('chow-others', chowPayloadOthers);\n }\n }\n } else if (greatestClaim === ClaimTypes.peng) { //peng\n const pengArray = executePeng(roomId, maxIndices[0]);\n\n for (let i = 0; i < room.players.length; i++) {\n if (i === room.rnd.turn) {\n let actions = [false, false, false, false, room.rnd.players[i].currentHand.checkWin(), true];\n\n const pengPayload = { hand : room.rnd.players[i].currentHand, actions : actions, turn: room.rnd.turn+1 };\n io.to(room.players[i].id).emit('peng', pengPayload);\n } else {\n let actions = [false, false, false, false, false, false];\n\n const pengPayloadOthers = { agent : room.rnd.turn+1, peng : new Meld(MeldTypes.peng, pengArray), turn: room.rnd.turn+1, actions: actions };\n io.to(room.players[i].id).emit('peng-others', pengPayloadOthers);\n }\n }\n } else if (greatestClaim === ClaimTypes.kong) {\n const kongArray = executeDiscardedKong(roomId, maxIndices[0]);\n\n for (let i = 0; i < room.players.length; i++) {\n if (i === room.rnd.turn) {\n let actions = [false, false, false, false, room.rnd.players[i].currentHand.checkWin(), true];\n\n const kongPayload = { hand : room.rnd.players[i].currentHand, actions : actions, turn: room.rnd.turn+1 };\n io.to(room.players[i].id).emit('kong', kongPayload);\n\n } else {\n let actions = [false, false, false, false, false, false];\n\n const kongPayloadOthers = { agent : room.rnd.turn+1, kong : new Meld(MeldTypes.kong, kongArray, false), turn: room.rnd.turn+1, actions: actions };\n io.to(room.players[i].id).emit('kong-others', kongPayloadOthers);\n }\n }\n } else if (greatestClaim === ClaimTypes.hu) {\n const winTile = room.rnd.removeLastDiscard();\n\n for (const maxIndex of maxIndices) {\n const winningMelds = Evaluator.getWinningMelds(room.rnd.players[maxIndex].currentHand, winTile);\n const winScore = new ScoreState(winningMelds, false, false);\n winScore.checkAllFan().assignScore();\n room.game.players[maxIndex].totalScore += winScore.totalScore;\n room.game.players[maxIndex].currentHand.inPlayTiles = Array.from(Array(5), _ => Array(9).fill(0));\n room.game.players[maxIndex].currentHand.melds = winningMelds;\n }\n\n const huPayload = { won: maxIndices[0]+1, p1Hand : room.game.players[0].currentHand,\n p2Hand : room.game.players[1].currentHand,\n p3Hand : room.game.players[2].currentHand,\n p4Hand : room.game.players[3].currentHand,\n p1Score : room.game.players[0].totalScore,\n p2Score : room.game.players[1].totalScore,\n p3Score : room.game.players[2].totalScore,\n p4Score : room.game.players[3].totalScore}\n\n //send all hands to everybody\n io.to(roomId).emit('hu', huPayload);\n }\n}", "calcCombatMove(){\n var rnd = _.random(1,100);\n var result = this._canAct();\n if(result.OK===false) {\n window.gm.Encounter.execCombatCmd(window.gm.combat.moveNOP);\n return(result);\n }\n if(rnd>30) { \n result=window.gm.Encounter.execCombatCmd(window.gm.combat.movePhysicalAttack);\n result.msg =this.name+\" trys to attack you.</br>\"+result.msg;\n } else {\n result=window.gm.Encounter.execCombatCmd(window.gm.combat.moveGuard);\n result.msg =this.name+\" takes a defensive stance.</br>\"+result.msg;\n }\n return(result);\n }", "function calculateFirstMove(board) {\n if ($(\".modeactive\").text() === game.modenormal) {\n\n return Math.floor((Math.random() * 9) + 1);\n\n } else {\n var tile = GetUserFirstMove();\n\n //make perfect move\n \n var moves = ['1', '3', '7', '9'];\n if (tile === 1 || tile === 3 || tile === 7 || tile === 9) return 5;\n else if (tile === 2 || tile === 4) return 1;\n else if (tile === 6 || tile === 8) return 9;\n else if (tile === 5) {\n return moves[Math.floor(Math.random() * 3)];\n }\n }\n\n\n\n}", "function calculateMinimumMoves() {\n\n}", "getMov()\n {\n let bn = 0\n for (let i of this.equipment)\n {\n for (let [stat, amt] of Object.entries(i.stats))\n {\n if (stat == \"mov\")\n\t bn += amt\n }\n }\n\n let ret = this.stats.mov + bn;\n if (ret < 0)\n ret = 0\n return ret\n }", "function takeABlindMove(turn) { ... }", "accelerate(amount) {\n // It's virtually impossible for this data to be\n // accidentally accessed.\n this.#speed += amount;\n this.#milesDriven += speed;\n }", "function compareRobots(robot1, memory1, robot2, memory2) {\n \n let robot1Total = 0;\n let robot2Total = 0;\n let numberOfTasks = 100;\n let numberOfTurns = 0;\n \n for (let i = 0; i < numberOfTasks; i++){\n //console.log(\"Task number: \", i+1)\n let village = VillageState.random();\n //console.log(\"Parcels: \", village.parcels[0])\n numberOfTurns = runTest(village, robot1, []);\n robot1Total += numberOfTurns;\n //console.log(\"Robot 1 tasks: \", numberOfTurns);\n numberOfTurns = runTest(village, robot2, []);\n //console.log(\"Robot 2 tasks: \", numberOfTurns);\n robot2Total += numberOfTurns;\n //console.log(\"Robot 1: \", robot1Total)\n //console.log(\"Robot 2: \", robot2Total)\n }\n\n let r1avg = robot1Total/numberOfTasks;\n let r2avg = robot2Total/numberOfTasks;\n\n console.log(\"Grand totals\");\n console.log(\"Number of tasks: \", numberOfTasks)\n console.log(\"Robot 1 Average: \", r1avg)\n console.log(\"Robot 2 Average: \", r2avg)\n if ( r1avg > r2avg) {\n console.log(\"Robot 2 performed more efficiently\")\n }\n else if (r1avg < r2avg){\n console.log(\"Robot 1 performed more efficiently\")\n }\n else if(r1avg == r2avg){\n console.log(\"The robots were the same efficiency\")\n } \n}", "function time_watcher_turn(){\n if(game_content.watcher.turn_watcher){\n // If he is looking, take it down so he is not looking.\n if(game_content.watcher.watcher_looking){\n game_content.watcher.watcher_staring = false;\n game_content.watcher.watcher_frame++;\n if(game_content.watcher.watcher_frame == 6){\n game_content.watcher.turn_watcher = false;\n game_content.watcher.watcher_looking = false;\n }\n } else {\n game_content.watcher.watcher_frame--;\n if (game_content.watcher.watcher_frame == 1){\n game_content.watcher.turn_watcher = false;\n game_content.watcher.watcher_looking = true;\n game_content.watcher.watcher_staring = true;\n }\n }\n }\n setTimeout(time_watcher_turn, interval * 5);\n}", "incrementTroops(tickStartTime){\n //Adds troops based on time not tick\n var troopsToAdd = 0;\n if(tickStartTime - this.lastTroopIncTime >= 500){\n troopsToAdd = Math.floor((tickStartTime -this.lastTroopIncTime)/100); //return to 500\n this.lastTroopIncTime = tickStartTime - (tickStartTime%500);\n }\n\n if(troopsToAdd > 0){\n\n for(var i = 0; i < this.playerPool.activePlayers.length; i++) {\n this.playerPool.activePlayers[i].incrementArmies(troopsToAdd, this.center, this.radius);\n }\n }\n }", "function moveCount () {\n moves++;\n moveCounter.innerHTML = moves;\n if (moves == 1) {\n timer();\n }\n}", "attack(target) {\n return (target.res -= this.power);\n }", "function calcMoves() {\n moves++;\n movesSpan.innerText = moves;\n updateStars();\n }", "function C012_AfterClass_Amanda_PleasurePlayer() {\n\t\n\t// The more it progresses, the faster Amanda must go\n\tCurrentTime = CurrentTime + 50000;\n\tvar StartCount = C012_AfterClass_Amanda_PleasurePlayerCount;\n\tif ((C012_AfterClass_Amanda_PleasurePlayerCount >= 0) && (C012_AfterClass_Amanda_PleasurePlayerCount <= 1) && (C012_AfterClass_Amanda_PleasurePlayerSpeed == 0)) C012_AfterClass_Amanda_PleasurePlayerCount++;\n\tif ((C012_AfterClass_Amanda_PleasurePlayerCount >= 2) && (C012_AfterClass_Amanda_PleasurePlayerCount <= 3) && (C012_AfterClass_Amanda_PleasurePlayerSpeed == 1)) C012_AfterClass_Amanda_PleasurePlayerCount++;\n\tif ((C012_AfterClass_Amanda_PleasurePlayerCount >= 4) && (C012_AfterClass_Amanda_PleasurePlayerCount <= 9) && (C012_AfterClass_Amanda_PleasurePlayerSpeed == 2)) C012_AfterClass_Amanda_PleasurePlayerCount++;\n\t\n\t// At 6 counts, an orgasm is achieved, the next one will be slower\n\tif (C012_AfterClass_Amanda_PleasurePlayerCount >= 6) {\n\t\tOverridenIntroText = GetText(\"OrgasmFromAmandaPleasure\");\n\t\tActorAddOrgasm();\n\t\tGameLogSpecificAddTimer(CurrentChapter, \"Player\", \"NextPossibleOrgasm\", PlayerHasLockedInventory(\"VibratingEgg\") ? CurrentTime + 1800000 : CurrentTime + 3600000);\n\t\tif (PlayerHasLockedInventory(\"Collar\")) OverridenIntroImage = \"PlayerCollarCloseUpOrgasm.jpg\";\n\t\telse OverridenIntroImage = \"PlayerCloseUpOrgasm.jpg\";\n\t\tC012_AfterClass_Amanda_CurrentStage = 636;\n\t\tC012_AfterClass_Amanda_PleasurePlayerCount = 0;\n\t\tC012_AfterClass_Amanda_PleasurePlayerSpeed = 0;\n\t} else {\n\t\tif (StartCount == C012_AfterClass_Amanda_PleasurePlayerCount) OverridenIntroText = GetText(\"PleasureFromAmandaNoProgress\");\n\t}\n\t\n}", "function getComputerMove() {\n computerMoves++;\n let $boardSpaces = getBoardSpaceElements();\n let isComputerFirstMove = computerMoves < 2;\n\n if (isComputerFirstMove) {\n var centerSpaceIndex = 4;\n var $centerSpaceElement = $($boardSpaces[centerSpaceIndex]);\n var isCenterSpaceEmpty = isBoardPositionEmpty($centerSpaceElement);\n\n return isCenterSpaceEmpty ? setPlayerToken($centerSpaceElement) : randomCorner();\n }\n\n var currentBoardValues = getCurrentBoardValues();\n var bestMove = makeHigherScoreMove(currentBoardValues);\n var move = bestMove ? bestMove : randomPlay();\n setPlayerToken($(move));\n}", "function timePassed() {\r\n if (health === 0 || happiness === 0 || hunger === 0) {\r\n clearInterval(timer);\r\n dodo(); \r\n timer =null; \r\n groan();\r\n }\r\n \r\n message();\r\n screen();\r\n i++;\r\n decrease();\r\n changeStar();\r\n changeDonut();\r\n changeHeart();\r\n console.log(i)\r\n console.log(`health: ${health}, happiness: ${happiness}, hunger: ${hunger}`) \r\n }", "function calculateTime(testCase, next) {\n let timeSpent = 0;\n\n while (testCase.buttonPresserOrder.length) {\n let buttonPushed = false;\n\n timeSpent += 1;\n\n // Complete a turn for all of the robots, this will move them\n // if they need to be moved, wait if they shouldn't move or push\n // the button if it's their turn.\n Reflect.ownKeys(testCase.robots).forEach((robotName) => {\n const robot = testCase.robots[robotName];\n\n // Move the robot closer to it's desired position\n if (robot.position !== robot.nextSteps[0]) {\n let delta = (robot.position > robot.nextSteps[0]) ? -1 : 1;\n\n robot.position += delta;\n\n return;\n }\n\n // Push the button since this robot is in the right position\n if (\n !buttonPushed &&\n robotName === testCase.buttonPresserOrder[0] &&\n robot.position === robot.nextSteps[0]\n ) {\n buttonPushed = true;\n robot.nextSteps.shift();\n testCase.buttonPresserOrder.shift();\n\n return;\n }\n });\n }\n\n next(null, timeSpent);\n}", "checkGridThreshold() {\n let targNums = 0; // amount of target numbers\n let nonNums = 0; // amount of non-target numbers\n let nons = [];\n for (let x = 0; x < gameState.GRID_WIDTH; x++) {\n for (let y = 0; y < gameState.GRID_HEIGHT; y++) {\n let current = gameState.grid[x][y];\n if (current.targetNumber) { targNums++; }\n else { \n nons[nonNums] = gameState.grid[x][y];\n nonNums++; \n }\n }\n }\n console.log(\"checkGridThreshold results: \" + (targNums / (targNums + nonNums)).toString());\n let percent = (targNums / (targNums + nonNums));\n // Reroll a percentage of the spaces that were non-target.\n while (percent < gameState.MIN_GRID_THRESHOLD) {\n for (let i = 0; i < nons.length; i++) {\n if (Math.random() < gameState.REROLL_PERCENT) {\n this.resetGridSpace(nons[i], true);\n nonNums--;\n targNums++;\n }\n }\n percent = (targNums / (targNums + nonNums))\n console.log(\"Reroll! results: \" + (targNums / (targNums + nonNums)).toString());\n }\n }", "function calculateScore() {\n\tscore = winCount * 100 + loseCount * -50 + (coveredTileCount * 2) + (100 - time) + (50 - moves) * 2 + (bonus * 15);\n}", "getAttackResult(action, unit, calc) {\n const result = { unit };\n calc ??= this.calcAttack(unit, this.assignment, action.target);\n\n if (calc.miss === 'immune') {\n result.miss = 'immune';\n\n return result;\n }\n\n let random;\n\n // This metric is used to determine which actions required luck to determine results.\n if (calc.chance > 0 && calc.chance < 100) {\n random = this.team.random();\n\n result.luck = Object.assign({ chance:calc.chance }, random);\n } else\n random = { number:50 };\n\n if (random.number < calc.chance) {\n result.damage = calc.damage;\n result.changes = {};\n if (result.damage)\n result.changes.mHealth = Math.max(-unit.health, Math.min(0, unit.mHealth - calc.damage));\n if (calc.bonus)\n result.changes.mBlocking = unit.mBlocking += calc.bonus;\n\n if (Object.keys(result.changes).length === 0)\n delete result.changes;\n } else {\n result.miss = 'blocked';\n\n if (calc.penalty || unit.directional !== false) {\n result.changes = {};\n\n if (unit.directional !== false) {\n let direction = this.board.getDirection(unit.assignment, this.assignment, unit.direction);\n if (direction !== unit.direction)\n result.changes.direction = unit.direction = direction;\n }\n\n if (calc.penalty)\n result.changes.mBlocking = unit.mBlocking -= calc.penalty;\n }\n }\n\n return result;\n }", "function troll(elapsed){\n\n}", "countFaceTurns(move) {\n let layerCount = move.getLayerCount();\n let layerMask = move.getLayerMask();\n let angle = Math.abs(move.getAngle()) % 4;\n\n let allLayers = (1 << layerCount) - 1;\n if (angle == 0 || layerMask == 0 || layerMask == allLayers) {\n return 0;\n }\n\n let innerTurned = (layerMask & 1) != 0;\n let outerTurned = (layerMask & (1 << (layerCount - 1))) != 0;\n\n return innerTurned == outerTurned ? 2 : 1;\n }", "function takeTurns() {\n self.gameBoard.turn++;\n if (self.gameBoard.turn % 2 === 0) {\n return \"o\";\n }\n else {\n return \"x\";\n }\n\n }", "performAttack() {\n return this.attack + Math.floor(this.attackModifier * Math.random());\n }", "getTotalRewards() {\n let asps = []\n let stats = game.app.stats\n let rews = {\n force: stats.embodimentReward.Force.amount,\n entropy: stats.embodimentReward.Entropy.amount,\n form: stats.embodimentReward.Form.amount,\n inertia: stats.embodimentReward.Inertia.amount,\n life: stats.embodimentReward.Life.amount,\n }\n\n for (let x in this.app.state.aspects) {\n asps.push(this.getReferenceById(this.app.state.aspects[x].id))\n }\n\n for (let x in asps) {\n for (let z in asps[x].rewards) {\n let amount = asps[x].rewards[z]\n rews[z] += amount\n }\n }\n\n // core nodes\n for (let x in game.app.state.coreNodes) {\n rews[x] += game.app.state.coreNodes[x] ? 1 : 0\n if (game.app.hasCompleteCore)\n rews[x] += 1\n }\n\n return rews;\n }", "function timeout() {\n\n // Update the timing properties if we're using time control.\n var moveEnd = new Date().getTime();\n if (stats.timeControl != -1) {\n if (stats.future[0] == \"r\") {\n stats.redTime -= moveEnd - stats.moveStart;\n }\n else {\n stats.bluTime -= moveEnd - stats.moveStart;\n }\n stats.moveStart = moveEnd;\n }\n\n // Update the winning properties.\n if (stats.future[0] == \"r\") {\n stats.winner = \"Blue\";\n }\n else {\n stats.winner = \"Red\";\n }\n stats.winBy = \"timeout\";\n }", "function movesConter() {\n console.log('function movesConter active');\n numberMoves += 1;\n moves.innerHTML = numberMoves + ' Move(s)';\n if (numberMoves === 1) {\n Timer();\n }\n starRating();\n}", "function getEnemyMaxSpeedX() {\n return 1;\n}", "function stage2(){\n player.attack.plusser += 62;\n}", "function increaseMoveCounter() {\n state.totalMoves++;\n document.querySelector('.moves').textContent = state.totalMoves;\n }", "distance() {\n return this.speed * this.duration() / 3600000;\n }", "function timer() {\n function countSeconds() {\n if (moves !== 0 && matched < 16) {\n seconds++\n document.querySelector('.timer').innerHTML = seconds;\n }\n } setInterval(countSeconds, 1000);\n}", "function tileCost(s, tile, goal, from) {\n var nextTile = (tile.chr === ' ') ? tile : from;\n var lifePenalty = (tile.chr[0] === '$') ? 20 : 0;\n return tile.dist(goal) + tileDanger(s, nextTile, lifePenalty) * 50;\n}", "function compareRobots(robot1, memory1, robot2, memory2){\n\tlet turns1 = 0, turns2 = 0;\n\tfor (let i=0; i<100; i++){\n\t\tlet task = VillageState.random();\n\t\tturns1 = turns1 + runRobot(task, robot1, memory1);\n\t\tturns2 = turns2 + runRobot(task, robot2, memory2);\n\t}\n\treturn [turns1/100, turns2/100];\n}", "moveMrX_Easy(positions, turn) {\n // this is the second shot at improving the AI\n\n // generate the players' heat maps\n const heatMaps = []; // null for index 0\n for (let i = 1; i <= this.CONSTS.MAX_PLAYERS; i++) {\n heatMaps.push(this._generateDistanceArray(positions[i]));\n }\n\n // now compare the heatmaps and combine into one map by taking the lowest value for each\n const fHeatMap = [];\n for (let i = 0; i < 200; i++) {\n let thisNumber = 999;\n // in heatMaps array player 1 is at index 0\n for (let j = 0; j < this.CONSTS.MAX_PLAYERS; j++) {\n if (heatMaps[j][i] < thisNumber) {\n thisNumber = heatMaps[j][i];\n }\n }\n fHeatMap.push(thisNumber);\n }\n\n // ok so now we get into the AI\n\n // start by creating an array of all nodes around Mr X's node with a radius\n // this array should contain the NodeLocation and its current heatmap number\n\n // first get the raw locations in a radius around Mr. X:\n const NodeLocationArrayRelativeToMrX = this._getNodeLocationArrayRelativeToMrX(positions, 2);\n\n // add the heatmap sum to the array\n const NodeLocationArrayWithHeatmapSums = this._getNodeLocationArrayWithHeatmapSums(NodeLocationArrayRelativeToMrX);\n\n // add the heatmap value to the array as the third element and make the final array in which each element is an array with three integers:\n // LOCATION, HEATMAP SUM, and HEATMAP value\n // these are the three things we need to take a stab at some non-retarded AI\n const DataArray = [];\n\n for (let i = 0; i < NodeLocationArrayWithHeatmapSums.length; i++) {\n const thisArray = [];\n thisArray.push (NodeLocationArrayWithHeatmapSums[i][0]);\n thisArray.push (NodeLocationArrayWithHeatmapSums[i][1]);\n thisArray.push (fHeatMap[NodeLocationArrayWithHeatmapSums[i][0]]);\n DataArray.push(thisArray);\n }\n\n DataArray.sort(this._compareHeatmapSums);\n // DataArray now is complete for a 'radius' number of hops with ratings for heatmap and heatmapSum\n\n // AI decisions start now\n\n // SAFE AI:\n // Mr. X should first look for the location with the highest heatmapSum with a heatmap of 2 or greater (not potentially being insta-killed)\n // After that he should look for the location with the highest heatmapSum with a heatmap of 1\n // Then find the best path to that location (it may not be adjacent to Mr. X)\n\n // *** BUT THE DATAARRAY NEEDS A PASS ON IT FIRST:\n // If MrX wants to go 2 or 3 spaces away to a spot, he needs to make sure first that his NEXT MOVE isn't on a heatmap of 1 or less...\n // ...so do another pass on the DataArray and update the heatmap on any entry that isn't next to Mr. X\n\n for (let i = 0; i < DataArray.length; i++) {\n // look at each item and replace it's heatmap, which = DataArray[i][2]\n // remember that each element in DataArray has LOCATION, HEATMAP SUM, and HEATMAP value\n const firstLocationAndTransport = this._findStartingPointOnPathAndTransportation(positions[0],DataArray[i][0]);\n DataArray[i][2] = fHeatMap[firstLocationAndTransport[0]];\n }\n\n // OK, now search through the entries!\n let destinationLocation = this._findBestDestination(DataArray, 2);\n let boolDead = false;\n if (destinationLocation < 1) {\n destinationLocation = this._findBestDestination(DataArray, 1);\n if (destinationLocation < 1) {\n // MRX HAS NO MOVEZZZZZZZ IF THIS GETS HIT\n boolDead = true;\n }\n }\n\n // now you have the starting point, positions[0], and the destination, destinationLocation...\n // ...figure out where Mr X should move next!\n // loop through the heatmap for the Mr. X location and look at all the spots connected to it (heatmap value of 1)...\n // ...these are the only places he can move this turn!\n\n let firstLocationAndTransport = this._findStartingPointOnPathAndTransportation(positions[0],destinationLocation);\n // firstLocationAndTransport[0] = the location that Mr X should move to next!\n // firstLocationAndTransport[1] = the transportation that Mr X will use to get to that spot (0:taxi, 1: bus, etc.)\n\n\n return {\n position: firstLocationAndTransport[0],\n transportation: firstLocationAndTransport[1], /// ???\n isVisible: this.CONSTS.MRX_VISIBLE_TURNS.indexOf(turn) >= 0,\n dead: boolDead // nowhere to move\n };\n }", "moraleBuff () {\n\n this.statReset();\n\n if (morale === 120) {\n\n this.atk += 10;\n this.def += 10;\n // this.spd += this.tile;\n\n } else if (morale >= 100) {\n\n this.atk += 8;\n this.def += 3;\n // this.spd += this.tile;\n\n } else if (morale >= 80) {\n\n this.atk += 5;\n this.def += 3;\n // this.spd += this.tile;\n\n\n } else if (morale >= 40 || morale <= 40) {\n\n this.def += 8;\n this.atk -= 4;\n this.spd += 1;\n\n }\n this.spd += this.tile;\n }", "function readToken(token) { \n console.log(token);\n state = turn[token];\n nextAction(state);\n}", "getBlockTurnCount() {\n return this.current == null ? this.btm : this.btm + this.countBlockTurns(this.current);\n }", "function cpuMove(array, turn) {\n var movesLeft = getAvailableMoves(array);\n\n //opening move\n if (turn == 1 && movesLeft.length >= 7) {\n var arr = [0,2,4,6,8];\n var newArr = [];\n for (i in arr) {\n if (array[arr[i]] == 0) newArr.push(arr[i]);\n }\n var n = Math.floor(Math.random() * newArr.length);\n //console.log(arr[n], newArr, array)\n placeMarker(newArr[n], turn);\n return\n }\n\n if (movesLeft.length >= 8) {\n if (isEmpty(4)) {\n placeMarker(4, turn);\n return\n }\n if (!isEmpty(4)) {\n var arr = [0,2,6,8];\n var n = Math.floor(Math.random() * arr.length);\n placeMarker(arr[n], turn);\n return\n }\n }\n\n var game = new tictactoe(array);\n minimax(game, -Infinity, Infinity);\n //console.log(game.scoreList, game.moveList, bestMove(game, turn));\n placeMarker(bestMove(game, turn), turn);\n checkBoard(board);\n}", "function calculateWalk (){\n \n yield WaitForSeconds(0.4);//Waits abit as to allow movement to complete (if it did not they could enter battle or trigger triggers without actually being on the block yet\n var hit : RaycastHit;//Create rayCast varible\n Options =0;\n var distanceToGround;//Create distanceToGround variable\n\tif(Physics.Raycast(transform.position, -transform.up, hit,100)){//Raycast the unit down one block\n\tdistanceToGround = hit.distance;//Get the distance to ground \n\t//Use the distance to ground to see which tile the character came into contact with\n\tif(hit.collider.gameObject.tag == \"NoUse\"){//If the character is ontop of a tile of NoUse\n \tcurrentTileTag = \"NoUse\";\n \tDebug.Log(\"NoUse\");\n }\n if(hit.collider.gameObject.tag == \"TallGrass\"){//If the character is ontop of a tile of TallGrass\n walkCounter++;//Increase the walk counter\n Debug.Log(\"TallGrass\");\n currentTileTag = \"Tallgrass\";\n }\n if(hit.collider.gameObject.tag == \"Water\"){//If the character is ontop of a tile of Water\n walkCounter++;//Increase the walk counter\n Debug.Log(\"Water\");\n currentTileTag = \"Water\";\n }\n if(hit.collider.gameObject.tag == \"Dungeon\"){//If the character is ontop of a tile of Dungeon\n walkCounter++;//Increase the walk counter\n Debug.Log(\"Dungeon\");\n currentTileTag = \"Dungeon\";\n }\n \n\t}\n\t//if the walkcounter is larger than walkcounter2 (Which was randomly generated in the start function) character will enter battle\n if(walkCounter >= walkCounter2){\n walkCounter2 = Random.Range(5,10);//Create a new walkCoutner2 to add abit of randomness as to when you enter battle\n walkCounter = 0;//Rest walkcounter\n enterCombat();//Call the enterCombat function\n }\n }//Enters combat", "get attack() { return this._attackDurationSamples; }", "#cpuFireAttack() {\n let p2 = this.players[1];\n let status = -1;\n let shotsFired = 0;\n const stuckThreshold = 10;\n let row;\n let col;\n while (status === -1) {\n [row, col] = this.#cpuAttackDetermineCoordinates(p2);\n \n status = p2.attack(this.players[0], row, col);\n \n if(shotsFired > stuckThreshold) {\n shotsFired = 0;\n p2.resetCPUBehaviors();\n }\n\n shotsFired++;\n }\n\n let attackedCell = \n document.querySelector(`.p1.gameboard .selectable[data-row=\"${row}\"][data-col=\"${col}\"]`)\n attackedCell.classList.add(\"attacked\");\n\n switch(status) {\n case 1: {\n console.log(\"CPU scores a hit!\");\n attackedCell.classList.add(\"hit\");\n\n let shipId = attackedCell.dataset.ship.split(\"player-ship\")[1];\n\n let shipSunk = this.players[0].gameboard.isShipSunk(shipId);\n if (shipSunk) {\n document.querySelector(`.p1.gameboard .ship-name[data-ship=\"player-ship${shipId}\"]`)\n .classList.add(\"destroyed\");\n console.log(\"CPU sank that ship!\");\n }\n\n // The CPU has made its first successful hit against a ship! \n if (p2.cpuBehavior === CPU_STATE.random\n && p2.cpuFirstSuccessfulHit.row === null\n ) {\n p2.cpuFirstSuccessfulHit.row = row;\n p2.cpuFirstSuccessfulHit.col = col;\n p2.cpuBehavior = CPU_STATE.found;\n // The CPU has made a second successful hit while in found mode!\n } else if (p2.cpuBehavior === CPU_STATE.found\n && p2.cpuSecondSuccessfulHit.row === null\n ) {\n p2.cpuSecondSuccessfulHit.row = row;\n p2.cpuSecondSuccessfulHit.col = col;\n p2.cpuBehavior = CPU_STATE.focused;\n } else {\n // focused mode behaviors -- revert to random whe sunk.\n if (p2.cpuBehavior === CPU_STATE.focused) {\n // only keep updating the second hit.\n p2.cpuSecondSuccessfulHit.row = row;\n p2.cpuSecondSuccessfulHit.col = col;\n }\n // in focused mode... lay down some attacks.\n // if a ship was sunk, then reset to random.\n if (shipSunk) {\n p2.resetCPUBehaviors();\n }\n }\n break;\n }\n case 0:\n console.log(\"CPU misses!\");\n attackedCell.classList.add(\"miss\");\n\n if (p2.cpuBehavior === CPU_STATE.focused) {\n console.log(\"Since CPU was focused, it'll swap directions starting from the first hit.\");\n p2.cpuFocusInvert = true;\n }\n break;\n }\n\n this.#p1turn = true;\n this.#determineIfGameOver();\n }", "function moving_phase() {\n game_phase = MOVING;\n\n // Record reaction time as time spent with target visible before moving\n rt = new Date() - begin;\n\n // Start of timer for movement time\n begin = new Date();\n\n mousetm = new Array(200).fill(-1);\n mousetm[0] = [0];\n\n // Start circle disappears\n d3.select('#start').attr('display', 'none');\n\n }" ]
[ "0.61191505", "0.5944346", "0.57466817", "0.5740257", "0.57154614", "0.5714246", "0.5704308", "0.5698482", "0.56001776", "0.5569426", "0.550349", "0.54873794", "0.5465075", "0.54643494", "0.54584754", "0.5416745", "0.54138476", "0.54136264", "0.5404696", "0.5395248", "0.5390347", "0.5377295", "0.5371398", "0.535619", "0.5335934", "0.5330996", "0.5310387", "0.5305235", "0.53036064", "0.5293222", "0.52897036", "0.5266102", "0.5260789", "0.5255315", "0.52536476", "0.52536476", "0.52536476", "0.5244301", "0.52257645", "0.52183396", "0.5213745", "0.5211469", "0.52021533", "0.51881623", "0.5180658", "0.5172932", "0.5170458", "0.5153808", "0.51525307", "0.51518923", "0.51412326", "0.5140557", "0.5139964", "0.51363474", "0.5135677", "0.5133182", "0.5132469", "0.51233304", "0.51231027", "0.51221067", "0.5119692", "0.5115484", "0.5114857", "0.5114637", "0.5100119", "0.5095259", "0.50937086", "0.50918144", "0.50891227", "0.50853884", "0.50829864", "0.5082978", "0.50808644", "0.50764614", "0.50741994", "0.5072932", "0.50726646", "0.50658196", "0.5062256", "0.50601065", "0.50533336", "0.50427645", "0.50381094", "0.50303185", "0.5023596", "0.5018727", "0.50167984", "0.50132304", "0.5009383", "0.5006683", "0.50066686", "0.5000674", "0.50001925", "0.49985063", "0.49955806", "0.49927926", "0.49842387", "0.49840665", "0.49835926", "0.49817657", "0.49794224" ]
0.0
-1
Get various token data
getCurrentHealth (token_ = this.token) { return token_.actor.data.data.attributes.hp.value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getToken() { return this.token.getToken(); }", "function getToken() {\n return token;\n }", "getToken() {\n return [\n this.authenticate([AUTH_TYPE.BASIC, AUTH_TYPE.CLIENT]),\n this._bindAfterToken.bind(this),\n this.exchange(),\n ];\n }", "getToken({ data }) {\n // the parameter details will show in type definitions\n // because default response message type is \"data\", in general,\n // you need to return a message object which specify a \"data\" property,\n // and the data property value is which the request sender will get,\n // otherwise request sender may get undefined\n return {\n data: {\n token: \"you are allowed to get token\",\n },\n };\n }", "getToken() {\n return _token;\n }", "getNextToken() {\n //isMoreThen2Bytes\n //isPossibleCCTalkToken payload => 5 + data.length \n //hasChecksums\n //isVerofyedCCTalkToken\n //!isMoreThen2Bytes preservedDataBuffer\n //!isPossibleCCTalkToken slice data out next\n //!hasChecksums slice data out next\n //!isVerifyedCCTalkTOken slice data out next\n\n\n }", "async getTokens() {\n const apiURL = `${this.dxApiURL}/v1/tokens`\n const res = await fetcher(apiURL)\n\n return res.data\n }", "_getTokens() {\n return http\n .get(`${ENV.VUE_APP_TOKEN_INFO_API_URL}/tokens`)\n .then(resp => resp.data);\n }", "generateToken() {\n this.data = require(\"../data/tokens\");\n return this.data[Math.floor(Math.random() * this.data.length)];\n }", "getToken() {\n return this.token;\n }", "function getToken() {\n\t\treturn store.getItem(key);\n\t}", "getValue() {\n return this.token;\n }", "get token() {\n return this._token;\n }", "function getToken() {\n return token || null;\n }", "function getToken(){\n\n\t\t\tvar url = 'https://opentdb.com/api_token.php?command=request'\n\t\t\tfunction get(url) {\n \n\t\t\t return new Promise(function(resolve, reject) {\n \n\t\t\t\tvar req = new XMLHttpRequest();\n\t\t\t\treq.open('GET', url);\n\t\n\n\t\t\t\treq.onload = function() {\n \n\t\t\t\t if (req.status == 200) {\n \n\t\t\t\t\tresolve(req.response);\n\t\t\t\t }\n\t\t\t\t else {\n \n\t\t\t\t\treject(Error(req.statusText));\n\t\t\t\t }\n\t\t\t\t};\n\n \n\t\t\t\treq.onerror = function() {\n\t\t\t\t reject(Error(\"Network Error\"));\n\t\t\t\t \n\t\t\t\t}\n\n \n\t\t\t\treq.send();\n\t\t\t });\n\t\t\t}\n\n\t\t\t get(url).then(function(response) {\n\t\t\t return JSON.parse(response);\n \n\t\t\t}).then(function(response){console.log(response['response_code'])\n\t\t\t\t\t\t\t\t\t\tgame.token=response['token']\n\t\t\t\t\t\t\t\t\t\tconsole.log(response['token'])\n\t\t\t\t\t\t\t\t\t\t}).then(function(){getQuestion(opts.codes)})\n\t\t\t, function(error) {\n\t\t\t console.error(\"Failed!\", error);\n\t\t\t console.log(\"Sorry, we cannot get your data right now\")\n\t\t\t}\n}", "get() {\n return {\n authenticated: authenticated,\n createLoginUrl: () => 'loginUrl',\n createLogoutUrl: () => 'logoutUrl',\n fullName: 'fName',\n ready: true,\n subject: zeroUuid,\n token: 'token',\n tokenParsed: {\n given_name: 'John',\n family_name: 'Doe',\n name: 'John Doe',\n email: '[email protected]',\n identity_provider: 'idir',\n idp_userid: zeroGuid,\n preferred_username: 'johndoe',\n realm_access: {},\n resource_access: {\n chefs: {\n roles: roles,\n },\n },\n },\n userName: 'uName',\n };\n }", "getToken() {\n return JSON.parse(localStorage.getItem(TOKEN_KEY));\n }", "function getTokenString(state) {\n return state.data.substring(state.currentTokenStart, state.currentTokenEnd);\n }", "token() {\n return {\n id: this.id,\n role: this.role,\n };\n }", "getPayload(token) {\n const payload = token.split('.')[1]\n return payload;\n }", "async get_token() {\n\n var username = await AsyncStorage.getItem(\"username\");\n if (username != null && username != this.guestuserkey()) {\n var bytes_username = utf8.encode(username);\n var encoded_username = binaryToBase64(bytes_username);\n\n //update when upgrading authentication flow\n var securityversion = \"1\";\n\n var tokenobj = {};\n tokenobj[\"token\"] = encoded_username;\n tokenobj[\"securityversion\"] = securityversion;\n\n var token = JSON.stringify(tokenobj);\n var bytes = utf8.encode(token);\n var encoded = binaryToBase64(bytes);\n return encoded;\n }\n else {\n var token = \"4B0053744852ED7C2705E668C43982928978B74BBB7F21A0F9B4E43914E49A6F\";\n var bytes = utf8.encode(token);\n var encoded = binaryToBase64(bytes);\n return encoded;\n }\n\n }", "get_token_string(){\n return this.token_string;\n }", "get(token) {\n const value = this.store.get(token);\n\n if (value !== undefined) {\n return value;\n }\n\n const raw = this.getRaw(token);\n\n if (raw !== undefined) {\n this.hydrate(token, raw);\n return this.get(token);\n }\n }", "function getUserToken(){\n\t\treturn $cookies.get('user.token');\n\t}", "getToken() {\n return Cookies.get(\"cTok\");\n }", "function showToken(response){\n console.log(response);\n}", "function callTokenInfo() {\r\n $.ajax({\r\n url: \"https://apilist.tronscan.org/api/token\",\r\n type: \"get\",\r\n dataType: \"json\",\r\n data: {\r\n id: \"1002652\",\r\n },\r\n success: function (result) {\r\n //push ajax call result to global var\r\n tokenInfo = result.data[0];\r\n // callback function to push result after ajax success\r\n useTokenInfo();\r\n },\r\n });\r\n }", "function getToken(){\n try\n {\n return LocalStorage.get(Constants.TOKEN);\n \n }\n catch(err)\n {\n return {};\n }\n }", "getToken() {\n\t\treturn this.qdacityTokenAuthenticationProvider.getToken();\n\t}", "function fetchToken() {\n $.getJSON(buildTokenUrl(), {command: 'request'}, response => {\n token = response.token;\n console.log(`session token fetched: ${token}`);\n });\n}", "retriveToken(context, data) {\n\t\t\treturn new Promise((resolve, reject) => {\n\t\t\t\taxios.post(\"/login\", data).then((res) => {\n\t\t\t\t\tconst token = res.data.access_token;\n\t\t\t\t\tlocalStorage.setItem('access_token', token);\n\t\t\t\t\tcontext.commit('RETIVE_TOKEN', token)\n\t\t\t\t\tresolve(res);\n\t\t\t\t})\n\t\t\t\t\t.catch((error) => {\n\t\t\t\t\t\treject(error);\n\t\t\t\t\t});\n\t\t\t})\n\n\t\t}", "jwt(token, deligate) {\n var base64Url = token.split('.')[1];\n var base64 = base64Url.replace('-', '+').replace('_', '/');\n\n const jwtPayload = JSON.parse(this._$window.atob(base64));\n\n for (const key of Object.keys(jwtPayload)) {\n if (key !== undefined) {\n switch (deligate) {\n case 'api':\n // TODO: Output JWT Payload Key/Value pairs to a webservice\n break;\n \n case 'console':\n // Output JWT Payload Key/Value pairs to the console\n console.log(key + \": \" + jwtPayload[key]);\n break;\n\n case 'cookie':\n // TODO: Output JWT Payload Key/Value pairs to a cookie\n break;\n\n case 'database':\n // TODO: Output JWT Payload Key/Value pairs to a database\n break;\n\n case 'localstorage':\n // Output JWT Payload Key/Value pairs to LocalStorage\n this._$window.localStorage[key] = jwtPayload[key];\n break;\n \n default:\n // Return JWT Payload as Object Array\n return jwtPayload;\n }\n }\n }\n }", "function readToken(req,res){\n req.on('data',function(data){\n var stringtoken = data.toString();\n var splittoken = stringtoken.split(\"=\");\n splittoken.shift();\n readSignInUser(req,res,splittoken)\n });\n \n req.on('end',function(){\n console.log('****end req****');\n \n });\n \n}", "token() {\n return {\n _id: this._id,\n role: this.role\n }\n }", "function get() {\n return sessionStorage.getItem(TOKEN_KEY);\n}", "static getPayload() {\n const token = this.getToken();\n if(!token) return null;\n const parts = token.split('.');\n if(parts.length < 3) return null;\n return JSON.parse(atob(parts[1]));\n\n }", "getRequestToken() {\n return apiClient.get(\n '/authentication/token/new?api_key=6c1e80dae659cb7d1abdf16afd8bb0e3'\n )\n }", "parseBasicToken(token) {\n return Buffer.from(token, 'base64').toString().split(':');\n }", "async function getSupportedTokens() {\n let tokensBasicInfoRequest = await fetch(\n \"https://api.kyber.network/currencies\"\n );\n let tokensBasicInfo = await tokensBasicInfoRequest.json();\n return tokensBasicInfo;\n}", "function readToken(token) { \n console.log(token);\n state = turn[token];\n nextAction(state);\n}", "getToken() {\n return this.cookies.get('token', {\n signed: true,\n encrypt: true\n });\n }", "function getToken(state) {\n return tokenTable[state]\n}", "get tokens() {\n return this._tokens;\n }", "function getTokenValue(context, cb) {\n try{\n let tokenVal = '';\n /*if(context && context.remotingContext) {\n if(context.remotingContext.args) {\n if(context.remotingContext.args.auth_user_id)\n tokenVal = context.remotingContext.args.auth_user_id;\n else if(context.remotingContext.args.custom && context.remotingContext.args.custom.auth_user_id)\n tokenVal = context.remotingContext.args.custom.auth_user_id;\n } else if(context.remotingContext.req) {\n if(context.remotingContext.req.query) {\n if(context.remotingContext.req.query.accesstoken)\n tokenVal = context.remotingContext.req.query.accesstoken;\n else if(context.remotingContext.req.query.access_token)\n tokenVal = context.remotingContext.req.query.access_token;\n }\n }\n }*/\n // if(typeof context.remotingContext.args.auth_user_id !== 'undefined')\n // tokenVal = context.remotingContext.args.auth_user_id;\n // else if(typeof context.remotingContext.req.query.accesstoken !== 'undefined')\n // tokenVal = context.remotingContext.req.query.accesstoken;\n // else if(typeof context.remotingContext.req.query.access_token !== 'undefined')\n // tokenVal = context.remotingContext.req.query.access_token;\n // else if(typeof context.remotingContext.args.custom.auth_user_id !== 'undefined')\n // tokenVal = context.remotingContext.args.custom.auth_user_id;\n\n if(context.remotingContext.args) {\n if(context.remotingContext.args.accessToken)\n tokenVal = context.remotingContext.args.accessToken;\n else if(context.remotingContext.args.access_token)\n tokenVal = context.remotingContext.args.access_token;\n else if(context.remotingContext.args.apiParams) {\n if(typeof context.remotingContext.args.apiParams.accessToken !== 'undefined')\n tokenVal = context.remotingContext.args.apiParams.accessToken;\n else if(typeof context.remotingContext.args.apiParams.access_token !== 'undefined')\n tokenVal = context.remotingContext.args.apiParams.access_token;\n } \n }\n return tokenVal;\n } catch(e){\n console.log('Exception catched in Role Resolver: Getting Token value... ');\n console.log(e);\n }\n }", "async getData(token) {\n let response = await axios.get(`${API_URL}/y?access_token=${token}`);\n // console.log(response.data);\n return response.data;\n }", "function getToken() {\n\treturn wAccessToken;\n}", "get token() {\n return (this.tokenGenerated) ? this.config.token : new Error(\"Token not Generated... Please use getUserToken()\");\n }", "function populateTokenData() {\n Voting.deployed().then(function (contractInstance) {\n contractInstance.totalTokens().then(function (v) {\n $('#tokens-total').html(v.toString());\n });\n contractInstance.tokensSold.call().then(function (v) {\n $('#tokens-sold').html(v.toString());\n });\n contractInstance.tokenPrice().then(function (v) {\n tokenPrice = parseFloat(web3.utils.fromWei(v.toString()));\n $('#token-cost').html(tokenPrice);\n });\n web3.eth.getBalance(contractInstance.address, function (error, result) {\n $('#contract-balance').html(web3.utils.fromWei(result.toString()) + ' Ether');\n });\n })\n}", "constructor(token) {\n this.createdTimestamp = BigInt(token.created_timestamp);\n this.deleted = token.deleted;\n this.decimals = BigInt(token.decimals);\n this.feeScheduleKey = token.fee_schedule_key;\n this.freezeDefault = token.freeze_default;\n this.freezeKey = token.freeze_key;\n this.initialSupply = BigInt(token.initial_supply);\n this.kycKey = token.kyc_key;\n this.maxSupply = BigInt(token.max_supply);\n this.memo = token.memo;\n this.modifiedTimestamp = BigInt(token.modified_timestamp);\n this.name = token.name;\n this.pauseKey = token.pause_key;\n this.pauseStatus = token.pause_status;\n this.supplyKey = token.supply_key;\n this.supplyType = token.supply_type;\n this.symbol = token.symbol;\n this.tokenId = token.token_id;\n this.totalSupply = BigInt(token.total_supply);\n this.treasuryAccountId = token.treasury_account_id;\n this.type = token.type;\n this.wipeKey = token.wipe_key;\n }", "function getTokens(title) {\n var code = title.split('=').pop();\n var xhr = new XMLHttpRequest();\n xhr.open(\"POST\", tokenUrl, true);\n xhr.onreadystatechange = function() {\n if (xhr.readyState == 4) {\n var resp = JSON.parse(xhr.responseText);\n sendValidationRequest(resp);\n }\n };\n var tokenParams = {\n 'grant_type': 'authorization_code',\n 'client_id': clientId,\n 'client_secret': clientSecret,\n 'code': code,\n 'redirect_uri': redirectUri,\n 'scope': authScope\n };\n // Send the proper header information along with the request\n xhr.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n xhr.send(stringify(tokenParams));\n}", "async getTokens () {\n\t\tthis.tokens = this.members.reduce((tokens, user) => {\n\t\t\tconst userAttrs = user.attributes || user;\n\t\t\tif (userAttrs.broadcasterToken) {\n\t\t\t\ttokens.push(userAttrs.broadcasterToken);\n\t\t\t}\n\t\t\treturn tokens;\n\t\t}, []);\n\t}", "function currentToken() {\n return input[index].value;\n }", "getToken() {\n return this._localStorageService.get(tokenKey);\n }", "getTokens() {\n this.$http.get('/settings/api/tokens')\n .then(function(response) {\n this.tokens = response.data;\n });\n }", "function token() {\n return currentToken;\n }", "function GenTokenParser(){}", "active() { return this.data.token; }", "function getUser(token){\n const tokenParts = token.split('.');\n const encodedPayload = tokenParts[1];\n const rawPayload = atob(encodedPayload);// atob zet versleutelde data om te zetten naar leesbare tekst\n const user = JSON.parse(rawPayload); // user uit token halen zonder dat je code nodig hebt.\n return user;\n}", "tokenValue () {\n return this.currentToken.value()\n }", "function getToken() {\n return sessionStorage.getItem('token_chat');\n }", "static getToken() {\n return localStorage.getItem('token');\n }", "static getToken() {\n return localStorage.getItem('token');\n }", "function getToken(){\n return localStorage.getItem(\"token\");\n}", "static generateToken() {\n return DataGenerator.generateRandomText() + DataGenerator.generateRandomText(); // to make it longer\n }", "getValue() {\n return this.token.access_token;\n }", "function readToken()\n{\n var value = 0;\n var token = \"\";\n // print(\"call System['in'].read()\");\n /* skip whitespace */\n do\n {\n value = System['in'].read();\n // print(value);\n } while( value >=0 && value <= 32 );\n /* get the token */\n while( value > 32 )\n {\n token += String.fromCharCode( value );\n value = System['in'].read();\n // print(value);\n }\n // print( \"token='\" + token + \"'\" );\n return token;\n}", "getToken() {\n return axios.get('contract-builder/template/contracts/Token.sol')\n .then((response) => {\n return response.data\n })\n }", "async function gettoken() {\n\n const resp = await fetch(\"http://www.mumstudents.org/api/login\", {\n method: \"POST\",\n headers: { \"content-type\": \"application/json\" },\n body: JSON.stringify({\n username: 'mwp', password: '123'\n })\n })\n const respBody = await resp.json();\n console.log(respBody);\n token = respBody.token;\n\n myAnimantion();\n }", "async obtainToken(req, res, next) {\n const request = new Request(req);\n const response = new Response(res);\n\n try {\n const token = await oAuth2.token(request, response);\n debug('obtainToken: token %s obtained successfully', token);\n res.json(token);\n } catch (err) {\n next(err);\n }\n }", "function getUserDetails(token) {\n return jwt.decode(token);\n}", "constructor() {\n //para cargar los tokens \n this.loadToken(); //estudiante\n this.loadTokenTeacher(); //docente \n }", "static getUserToken(){\n let token = JSON.parse(localStorage.getItem('USER')).token;\n return token;\n }", "static getUserToken(){\n let token = JSON.parse(localStorage.getItem('USER')).token;\n return token;\n }", "function getToken() {\n var code = function () {\n document.getElementsByTagName('body')[0].setAttribute(\"token\", _docs_flag_initialData.info_params.token)\n };\n\n var script = document.createElement('script');\n script.textContent = '(' + code + ')()';\n (document.head || document.documentElement).appendChild(script);\n script.parentNode.removeChild(script);\n\n return document.body.getAttribute('token')\n }", "function getToken(){\n \n return $window.localStorage.getItem(tokenStorageName);\n\n }", "function getToken() {\n axios.post(\"https://id.twitch.tv/oauth2/token?client_id=qh6jfouob87senzmm6422jomq4ui44&client_secret=83qdp141qoaog5ybcmwpr4z7u6wj4y&grant_type=client_credentials\")\n .then(function (response) {\n // console.log(\"response in auth func\", response.data.access_token);\n var token = response.data.access_token;\n // console.log(\"token in auth function\", token);\n return token;\n }, function (err) {\n console.log(err);\n });\n\n }", "function getRequestToken() {\n StartService.getRequestToken().then(function ( data ) {\n // save oauth_token, oauth_token_secret to requestToken\n requestToken = data;\n }, function ( error ) {\n console.error('Can\\'t get request token');\n Toast.showToast(null, 'Can\\'t get request token');\n });\n }", "function describeToken(val)\n{\n\tbuildStr = \"\"\n\tif ((val & TIME) == TIME) buildStr += \"time \"\n\tif ((val & DATE) == DATE) buildStr += \"date \"\n\tif ((val & ODOMETER) == ODOMETER) buildStr += \"odometer \"\n\tif ((val & LOCATION) == LOCATION) buildStr += \"location \"\n\n\treturn buildStr.trim()\n}", "function NextTokenInfo()\n {\n if (tokenIndex >= tokens.length) {\n console.log(\"sheets.js: NextTokenInfo: Ran out of tokens!\");\n return ['.', -1, -1];\n }\n var tokenInfo = tokens[tokenIndex++];\n return tokenInfo;\n }", "getEncodedToken() {\n\t\treturn this.encodeTokenWithIdentityProvider(this.getToken());\n\t}", "function getSessionToken(){\n\tvar data = localStorage.getItem('SessionToken');\n\tconsole.log(data);\n}", "function getLogginInfo() {\n const token = jsCookie.get(TOKEN_KEY);\n if (!token)\n return undefined;\n const user = jwtDecode(token);\n return user;\n}", "static async login(data) {\n let res = await this.request(`users/token`, data, 'post');\n console.log(\"TOKEN FROM SERVER--->\", res.token);\n return res.token;\n }", "function getTokenFromBuffer(offset) {\n\t\t\tvar toRead = offset - tokenBuffer.length + 1;\n\t\t\twhile (toRead-- > 0) readTokenToBuffer();\n\t\t\treturn tokenBuffer[offset];\n\t\t}", "DecryptDataToken(token){\n let reponse = new Object()\n reponse.TokenValide = false\n reponse.TokenData = \"\"\n let DecryptReponse = this.Decrypt(token)\n if(DecryptReponse.decryptedValide){\n let jwt = require('jsonwebtoken')\n try {\n reponse.TokenData = jwt.verify(DecryptReponse.decryptedData, this._Secret)\n reponse.TokenValide = true\n } catch(err) {\n this.LogAppliError(\"jsonwebtoken non valide\", \"Server\", \"Server\")\n }\n }\n return reponse\n }", "function populateTokenData() {\n Voting.deployed().then(function(contractInstance) {\n contractInstance.totalTokens().then(function(v) {\n $(\"#tokens-total\").html(v.toString());\n });\n contractInstance.tokensSold.call().then(function(v) {\n $(\"#tokens-sold\").html(v.toString());\n });\n contractInstance.tokenPrice().then(function(v) {\n tokenPrice = parseFloat(web3.fromWei(v.toString()));\n $(\"#token-cost\").html(tokenPrice + \" Ether\");\n });\n web3.eth.getBalance(contractInstance.address, function(error, result) {\n $(\"#contract-balance\").html(web3.fromWei(result.toString()) + \" Ether\");\n });\n });\n}", "function fetch_user_token()\n{\n if(document.cookie.indexOf(\"_bn_ut\")>=0)\n return getCookie(\"_bn_ut\");\n else\n {\n var err = {\"responseText\":'INVALID_TOKEN',\"status\":403};\n error_response(err);\n }\n}", "async loadTokensList() {\n return null;\n }", "function ObtenerToken() {\n\tvar respuestaToken = null;\n\n\tvar dataJSON = {\n\t\t\"ClienteId\": \"sample string 1\",\n\t\t\"ClienteLlave\": \"AD64KCYPIWKQ0KPVO2FC\"\n\t}\n\n\t$.ajax({\n\t\ttype: 'POST',\n\t\turl: urlPQRS + \"Token\",\n\t\tdata: JSON.stringify(dataJSON),\n\t\tcrossDomain: true,\n\t\tcontentType: 'application/json',\n\t\tdataType: 'json',\n\t\tasync: false,\n\t\tsuccess: function (data) {\n\t\t\trespuestaToken = data;\n\t\t},\n\t\terror: function (data) {\n\t\t\trespuestaToken = null;\n\t\t},\n\t});\n\n\treturn respuestaToken;\n}", "function ObtenerToken() {\n\tvar respuestaToken = null;\n\n\tvar dataJSON = {\n\t\t\"ClienteId\": \"sample string 1\",\n\t\t\"ClienteLlave\": \"AD64KCYPIWKQ0KPVO2FC\"\n\t}\n\n\t$.ajax({\n\t\ttype: 'POST',\n\t\turl: urlPQRS + \"Token\",\n\t\tdata: JSON.stringify(dataJSON),\n\t\tcrossDomain: true,\n\t\tcontentType: 'application/json',\n\t\tdataType: 'json',\n\t\tasync: false,\n\t\tsuccess: function (data) {\n\t\t\trespuestaToken = data;\n\t\t},\n\t\terror: function (data) {\n\t\t\trespuestaToken = null;\n\t\t},\n\t});\n\n\treturn respuestaToken;\n}", "onToken(token) {\n return token;\n }", "onToken(token) {\n return token;\n }", "function getToken() {\n if (window.ofoGlobals && window.ofoGlobals.get) {\n try {\n var tempValues = JSON.parse(window.ofoGlobals.get());\n keys_default()(tempValues).forEach(function (key) {\n window[key] = tempValues[key];\n });\n } catch (e) {}\n }\n\n if (tokenFormat.test(window.ofoToken)) {\n if (window.localStorage) {\n window.localStorage.setItem('ofo-tokened', window.ofoToken);\n }\n js_cookie_default.a.set('ofo-tokened', window.ofoToken);\n }\n}", "static async login(data) {\n let res = await this.request(`auth/token`, data, \"post\");\n return res.token;\n }", "function fetchAuthToken() { \r\n _authToken();\r\n }", "getToken() {\n return fetch(STT_AUTHURL).then(function(response) {\n return response.text();\n });\n }", "function getTokenPayload(token) {\n let payload = jwt.decode(token);\n return payload.username;\n }", "function _getTokenFromSession() {\r\n return $sessionStorage.getObject('auth_token');\r\n }", "getToken() {\n\t\treturn this._post(\"/api/user/token\");\n\t}", "getAccessToken() {}", "static getTokenFromLS() {\n const localStorageToken = localStorage.getItem(\"tokenObject\");\n if (localStorageToken !== \"\" && localStorageToken !== null) {\n return JSON.parse(localStorageToken).access_token;\n } else {\n return -1;\n }\n }" ]
[ "0.6809693", "0.6736218", "0.667215", "0.6598766", "0.6449091", "0.6422729", "0.64042854", "0.631129", "0.62498766", "0.6212837", "0.62045026", "0.6202585", "0.6146302", "0.6122915", "0.6111426", "0.6108626", "0.6101695", "0.6097957", "0.60831034", "0.6081622", "0.60598177", "0.60440254", "0.59848624", "0.59629583", "0.59589195", "0.59526485", "0.5950208", "0.5950188", "0.5926388", "0.59234667", "0.591869", "0.5888145", "0.5885206", "0.5884658", "0.5875588", "0.5862367", "0.5856184", "0.58499676", "0.5848782", "0.5833454", "0.5828493", "0.5826371", "0.58134985", "0.5801109", "0.5799618", "0.57835525", "0.5781976", "0.5780334", "0.5776575", "0.57715595", "0.5770971", "0.5767182", "0.5762584", "0.57611024", "0.57509416", "0.57426554", "0.57300663", "0.57102114", "0.57017624", "0.5700376", "0.5692447", "0.5692447", "0.569096", "0.5688343", "0.5683949", "0.5679963", "0.56794107", "0.56737983", "0.5660654", "0.56513", "0.5648204", "0.5646543", "0.5646543", "0.56378144", "0.5634292", "0.5634125", "0.56254965", "0.5614718", "0.56145835", "0.56117386", "0.56083506", "0.56078446", "0.5605939", "0.56043446", "0.55943316", "0.5586302", "0.5580183", "0.5565589", "0.5563754", "0.5563754", "0.5560875", "0.5560875", "0.55573636", "0.5555734", "0.55379766", "0.5528684", "0.5519542", "0.5506661", "0.550565", "0.5502189", "0.5499899" ]
0.0
-1
A measure of the amount of time a mook has to do stuff todo: evaluate units
get time () { let speed = parseInt (this.token.actor.data.data.attributes.movement.walk, 10); if (! speed) speed = 30; return speed / this.gridDistance; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "totalTime() {\n let time = 0\n this.measures.forEach(m => time += m.totalTime())\n return time\n }", "getCompletedPerUnit() {\n return this.recentProgress / this.windowLength;\n }", "function PropulsionUnit() {\n }", "function PropulsionUnit() {\n }", "function PropulsionUnit() {\n\t}", "getTotalMilliseconds() {\n return this._quantity;\n }", "getUnits() {\n const seconds = this.props.timeElapsed / 1000;\n var hr = Math.floor(seconds / 3600).toString();\n var min = Math.floor(seconds / 60).toString();\n var sec = Math.floor(seconds % 60).toString();\n var msec = (seconds % 1).toFixed(2).substring(2);\n \n return this.formatTime(hr) + \":\" + this.formatTime(min) + \":\" + this.formatTime(sec) + \".\" + msec;\n }", "function coffeeConsumptionTime() {\n for (var i = 0; i < entries.length; i++) {\n if (entries[i].q1_3 === 0) {\n coffeeTimes.none += 1;\n } else if (entries[i].q1_3 === 1) {\n coffeeTimes.min += 1;\n } else if (entries[i].q1_3 === 2) {\n coffeeTimes.mid += 1;\n } else if (entries[i].q1_3 === 3) {\n coffeeTimes.max += 1;\n }\n }\n }", "calculateTime() {\n // Number of ingredients\n const numberOfIngredients = this.ingredients.length;\n // Number of periods (1 period = 3 ingredients)\n const periods = Math.ceil(numberOfIngredients / 3);\n\n // Time needed to cook (1 period takes 15 minutes)\n this.time = periods * 15;\n }", "timeTaken(){\n var resultTime = this._endTime - this._startTime; \n var diff = Math.ceil(resultTime / 1000); \n this._timeTaken = diff;\n return diff ;\n }", "amt_of(item) { }", "function measure(fn) {\n\t const start = exports.debugNow();\n\t fn();\n\t return exports.debugNow() - start;\n\t}", "static getRefreshCost() {\n let notComplete = player.completedQuestList.filter((elem) => { return !elem(); }).length;\n return Math.floor(250000 * Math.LOG10E * Math.log(Math.pow(notComplete, 4) + 1));\n }", "function howLongDidItTake() {\n\tvar end, start;\n\t\n\tstart = new Date();\n\t\n\t for(var i = 0; i < 10000; i++) {\n\t console.log(Math.sqrt(i));\n\t }\n\t\n\tend = new Date();\n \n var totalTime = end.getTime() - start.getTime();\n return 'This function took ' + totalTime + ' mseconds';\n\t\n\t// use date object's .getTime() method to get difference in milliseconds\n}", "doMath() {\n // Actual capacities\n const runningCap = this.props.workerType.runningCapacity;\n const pendingCap = this.props.workerType.pendingCapacity;\n const maxCap = this.props.workerType.maxCapacity;\n // We want to make sure that if a bar is there that it's visible\n const smallestCapUnit = maxCap * 0.05;\n // Fuzz the percentages to make sure all bars are visible. If we have a\n // state with 0%, we don't fuzz at all. If we have 1-4%, we round to 5%\n // and we don't fuzz above 5%\n const fuzzedRunning = runningCap\n ? Math.max(runningCap, smallestCapUnit)\n : 0;\n const fuzzedPending = pendingCap\n ? Math.max(pendingCap, smallestCapUnit)\n : 0;\n // Determine the number which we should use to figure out our percentages.\n // When we have less than the max configured, we use that setting. When we\n // exceed that amount, we want to sum up all the capacity units\n const count = fuzzedRunning + fuzzedPending;\n const divideBy = Math.max(maxCap, count);\n // Calculate the percentages to use for the bars. These numbers are\n // invalid for other purposes\n const runPer = fuzzedRunning / divideBy;\n const pendPer = fuzzedPending / divideBy;\n\n return {\n r: runPer * 100,\n p: pendPer * 100,\n rc: runningCap,\n pc: pendingCap\n };\n }", "function kittenEfficiency() {\r\n\tvar timePlayed = gamePage.stats.statsCurrent[3].calculate(game);\r\n\tvar numberKittens = gamePage.resPool.get('kittens').value;\r\n\tvar curEfficiency = (numberKittens - 70) / timePlayed;\r\n\tgamePage.msg(\"Your current efficiency is \" + parseFloat(curEfficiency).toFixed(2) + \" kittens per hour.\");\r\n}", "function calculateUnitValue(i) {\n\tif (getUnit(i) === \"in\") return 1;\n\telse if (getUnit(i) === \"cm\") return .3937;\n\telse return 0;\n}", "function calculateSpeed(timeTaken, words) {\nvar minutes = timeTaken / 60;\nreturn (words / minutes).toFixed(0);\n}", "doCalculation() {\n const { questAPI, idAPI, timer } = this.props;\n const { difficulty } = questAPI[idAPI];\n const staticPoint = 10;\n let points = 1;\n const TRES = 3;\n switch (difficulty) {\n case \"hard\":\n points = TRES;\n break;\n case \"medium\":\n points = 2;\n break;\n default:\n points = 1;\n }\n return staticPoint + points * timer;\n }", "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 get_units() {\n switch(cookie['units'])\t{\n case \"mi\":\treturn \"Miles\"; break;\n case \"nm\":\treturn \"Naut.M\"; break;\n default:\treturn \"KM\"; break;\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 }", "computeDamage(){\n return this._units.reduce((accum, curUnit) => accum + curUnit.computeDamage(), 0.0);\n }", "_calcRemainingTime() {\n return this._remainingTestsCount;\n }", "function measure (fun) {\n\t\tvar now, start = new Date().getTime();\n\t\tvar count = 0, n = 500;\n\t\tdo {\n\t\t\tfor (var i = 0; i < n; i++) fun();\n\t\t\tcount += n;\n\t\t\tnow = new Date().getTime();\n\t\t} while ( (now - start) < 1000);\n\t\treturn (count / (now - start)) * 1000;\n\t}", "function calculateTotalWorth() {\n if(totalWealthIsAlreadyDisplayed) {\n updateDOM();\n } else {\n displayTotalWorth();\n }\n}", "get unitFormatted() {\r\n\t\treturn this.count > 1 ? this.unit + 's' : this.unit;\r\n\t}", "function calculateTimeTaken(complexity, resultForm, n, speed, processors, timeUnits) {\n // can only have whole integers for number of items\n n = Math.round(n);\n $('#n-items').val(n);\n processors = Mathjs.bignumber(Math.round(processors));\n $('#processors').val(processors);\n speed = Mathjs.bignumber(speed);\n $('#speed').val(speed);\n var steps = calculateSteps(n, complexity);\n\n var denominator = Mathjs.multiply(speed, processors);\n var timeTaken = Mathjs.divide(steps, denominator);\n\n var timeScale = Mathjs.bignumber(TIME_SCALERS[timeUnits])\n timeTaken = Mathjs.multiply(timeTaken, timeScale);\n\n if (resultForm == 'scientific') {\n timeTaken = Mathjs.format(Mathjs.bignumber(timeTaken), {notation: 'exponential', precision: 3});\n } else {\n timeTaken = Mathjs.format(Mathjs.bignumber(timeTaken), {notation: 'fixed', precision: 2});\n // If there are no significant decimal places don't show any decimal places (non scientific mode only)\n if (timeTaken % 1 == 0) {\n timeTaken = Mathjs.format(Mathjs.bignumber(timeTaken), {notation: 'fixed', precision: 0});\n }\n }\n\n return timeTaken;\n}", "calcTime() {\n const ingNum = this.ingredients.length;\n const periods = Math.ceil(ingNum / 3);\n this.time = periods * 15;\n }", "totalTime() {\n return this.duration() / (this.tempo() / 60)\n }", "function estimateT(\n\tmass,\n\tuseStarter,\n\tuseMixer\n) {\n // minutes of mixing\n t = 2\n\n // Perhaps counter intuitively, mixers are generally _less_ efficient than hands for smaller amounts of dough, so add a minute if mixing by mixer.\n if (useMixer && mass < 2000) {\n t += 1\n }\n\n // Add a minute if using starter since its stickiness requires longer to integrate.\n if (useStarter) {\n t += 1\n }\n\n // Add a minute for every additional 10kg\n if (mass > 10000) {\n t += Math.floor(mass / 10000)\n }\n\n return t\n}", "calcTime() {\n const numIng = this.ingredients.length;\n const periods = Math.ceil(numIng / 3);\n this.time = periods * 15;\n }", "function calcularTiempoEjecucion(){\n\t\tvar tiempo = new Date().getTime() - tiempo_ejecucion;\n\t\tvar div = find(\"//div[@class='div3']\", XPFirst);\n\t\tdiv.appendChild(elem(\"P\", \"TB: \" + tiempo + \" ms\"));\n\t}", "function calculateGameTime() {\n var d = new Date();\n endTime = d.getTime();\n\n var elapsedTime = endTime - startTime;\n\n metrics.set(\"elapsedTime\", elapsedTime);\n}", "calcTime() {\n const numberOfIngredients = this.ingredients.length;\n const periods = Math.ceil(numberOfIngredients / 3);\n this.time = periods * 15;\n }", "quotaMysWPass(){\n return math.chain(+this.props.numLocalEmp || 0).multiply(0.666667).floor().done();\n }", "function howLongDidItTake() {\n var later = new Date();\n return Math.round( (later.getTime() - startMilliseconds) / 1000.0);\n}", "function calculateHealthPlan() {\n var actualCalories = getTotalCalories();\n var idealCalories = getIdealCalories();\n if (actualCalories < idealCalories) {\n return 'Time for seconds!';\n }\n if (actualCalories > idealCalories) {\n return 'You\\'re fat. Get to the gym.';\n }\n else {\n return 'You know your body. Calories right on the money';\n }\n}", "function findContainerTotalTime(ingredients) {\n var time = 0;\n var i;\n for (i = 0; i < ingredients.length; ++i) {\n var item = ingredients[i];\n var total = item.prepTime + item.cookTime + item.coolTime;\n if (total > time) {\n time = total;\n }\n }\n return time;\n }", "checkUnits(){\n let logger = this.namespace.container.logger;\n\n let leftSideUnit = this.unitsParsed;\n if (typeof leftSideUnit === 'undefined') {\n logger.warn(`No units set for \"${this.index}\"`);\n }\n for (const scope in this.assignments) {\n let rightSideExpr = this.assignments[scope];\n if (typeof rightSideExpr.num === 'undefined') { // skip numbers\n let rightSideUnit = rightSideExpr.calcUnit(this);\n if (typeof rightSideUnit === 'undefined') {\n logger.warn(`Cannot calculate right side units in \"${this.index}\" for scope \"${scope}\".`);\n } else if (leftSideUnit && !leftSideUnit.equal(rightSideUnit, true)) {\n let leftUnitString = leftSideUnit.toString();\n let rightUnitString = rightSideUnit.simplify().toString();\n logger.warn(`Units inconsistency in \"${this.index}\" for scope \"${scope}\". Left: \"${leftUnitString}\". Right: \"${rightUnitString}\"`);\n }\n }\n }\n }", "calcTime () {\n const numberOfIngredients = this.ingredients.length;\n const period = Math.ceil( numberOfIngredients / 3 )\n this.time = period * 15;\n }", "function countSum() {\n\tvar sum = 0;\n\tvar timeWasted = JSON.parse(localStorage[\"timeWasted\"]);\n\t\tif (timeWasted !== undefined) {\n\t\t\tsum = timeWasted + UPDATE_SECONDS;\n\t\t\tlocalStorage[\"timeWasted\"] = JSON.stringify(sum);\n\t\t\tconsole.log('Total time wasted is ' + sum + ' seconds');\n\n\t\t\tvar target = JSON.parse(localStorage[\"target\"]);\n\t\t\tvar key = localStorage[\"keyVal\"];\n\t\t\tif (target !== 0 && !waiting && key !== \"Vaan\" && key !== \"Squall\") {\n\t\t\t\tcheckWasteTarget(sum, target);\n\t\t\t}\t\n\t\t\telse console.log(\"no target set\");\n\t\t\tif (waiting) console.log(\"waiting patiently\");\n\t\t}\n\t\telse console.log(\"PANIC: timeWasted undefined!!\");\n}", "calculateCookingTime() {\n const numOfIngredients = this.ingredients.length;\n const timePeriod = Math.ceil(numOfIngredients / 3);\n this.cookingTime = timePeriod * 15;\n }", "function calculateMetric() {\r\n\tlet litres = 52.28; //Litres is fuel consumed for 500km\r\n\tlet metricEfficiency = litres / 5; //To get fuel consumed for 100km, divide value by 5.\r\n\tconsole.log(\"Your car has a fuel economy of \" + metricEfficiency.toFixed(2) + \" litres per hundred kilometres.\"); //Write value to console.\r\n}", "calculateTiming(grossTimeMS, humanReadableTimeElapsed, tests) {\n const netTimeMS = tests.reduce((total, test) => total + test.timeSpentMs, 0);\n const overheadTimeMS = grossTimeMS - netTimeMS;\n return {\n net: netTimeMS,\n overhead: overheadTimeMS < 0 ? 0 : overheadTimeMS,\n humanReadableTimeElapsed,\n };\n }", "units() {\n return this.growRight('#Unit').match('#Unit$')\n }", "function evCost(mile, units) {\n mile = parseFloat(mile);\nlet evcost;\nswitch (units) {\n case 'Car/ Light Van':\n evcost = (mile * 0.05) * 52;\n break;\n case 'Medium Van':\n evcost = (mile * 0.09) * 52;\n break;\n case 'Large Van':\n evcost = (mile * 0.12) * 52;\n break;\n default:\n evcost = (mile * 0.05) * 52;\n}\nreturn evcost.toFixed(2);\n}", "get efficiency() {\n\t\treturn this.passengers.length / this.travelTime;\n\t}", "lifeExpectancyMars() {\n let martianLifeExpectancy = Math.floor(this.lifeExpectancy/1.88);\n return martianLifeExpectancy;\n }", "get_mult(units) {\n var mult = 0;\n if (units === 'minutes') {\n mult = 1;\n } else if (units === 'hours') {\n mult = 60;\n } else if (units === 'days') {\n mult = 60 * 24;\n } else if (units === 'months') {\n mult = 30 * 60 * 24;\n } else if (units === 'years') {\n mult = 365 * 60 * 24;\n } else {\n throw new TypeError;\n }\n return mult;\n }", "get duration() {\n\t\tconst items = this.items;\n\t\tlet item;\n\t\tlet time = 0;\n\t\tlet id;\n\n\t\tfor (id in items) {\n\t\t\titem = items[id];\n\t\t\ttime = Math.max(time, item.totalDuration / item.playSpeed);\n\t\t}\n\t\treturn time;\n\t}", "getCalories(minutes, seconds, kg) { // Duration(in minutes) * MEL * 3.5 * weight(kg) /200 \n return ((minutes.min + seconds.sec/60) * 8 * 3.5 * kg.weight) / 200 // avg cycling MEL is 8\n }", "function testTapeLength() {\n\tvar test = getTapeLength();\n\tconsole.log(\"tape length in meters: \" + test);\n}", "function enough(cap, on, wait){\nif(on+wait>cap){\nreturn (on+wait)-cap\n}else{\nreturn 0\n}\n\n}", "_getRemainingTime()\r\n {\r\n // Get time remaining in seconds.\r\n let timeRemaining = this._getRemainingDistance() / this._getAverageSpeed();\r\n if (timeRemaining === Infinity){\r\n timeRemaining = NaN\r\n }\r\n return timeRemaining\r\n }", "function budgetCalculator(watch, mobile, laptop) {\n var preiceOfWatch = watch * 50;\n var preiceOfMobile = mobile * 100;\n var preiceOfLaptop = laptop * 500;\n var total = preiceOfWatch + preiceOfMobile + preiceOfLaptop;\n return total;\n}", "function totalcalc() {\n let total = 1299 + rmemory + ssd + deli;\n return total;;\n}", "function units(num) {\n\treturn num*CELL_SIZE + UNIT_NAME;\n}", "function measureUpdate(unitSet) {\n let unitsTo = {\n \"length\": \"\",\n \"speed\": \"\",\n \"temperature\": \"\",\n \"volume_flow_rate\": \"\"\n }\n if(unitSet == 'imperial') {\n // Imperial\n // Speed: mile/hour\n // Length: feet\n // Volume Flow Rate: cubic feet/second\n // Temperature: Fahrenheit\n unitsTo.length = 'ft';\n unitsTo.speed = 'm/h';\n unitsTo.temperature = 'F';\n unitsTo.volume_flow_rate = 'ft3/s';\n } else {\n // Metric\n // Speed: metre/second\n // Length: meter\n // Volume Flow Rate: cubic meter/second\n // Temperature: Celsius\n unitsTo.length = 'm';\n unitsTo.speed = 'm/s';\n unitsTo.temperature = 'C';\n unitsTo.volume_flow_rate = 'm3/s';\n }\n let unitBase = 'FT';\n if(unitSet == 'metric') {\n unitBase = 'M';\n }\n\n // Select values of all the items that need to have their units update\n // Height range\n let heightUnit = document.querySelector('.height-wrapper').getAttribute('data-unit');\n let highHeightMeasure = parseInt(document.querySelector('#high-height').textContent);\n let lowHeightMeasure = parseInt(document.querySelector('#low-height').textContent);\n // Convert\n highHeightMeasure = Math.round(convert(highHeightMeasure).from(heightUnit).to(unitsTo.length)*10)/10;\n lowHeightMeasure = Math.round(convert(lowHeightMeasure).from(heightUnit).to(unitsTo.length)*10)/10;\n // Set\n document.querySelector('.height-wrapper').setAttribute('data-unit', unitsTo.length);\n document.querySelector('#high-height').innerHTML = highHeightMeasure;\n document.querySelector('#low-height').innerHTML = lowHeightMeasure;\n // Measurement\n document.querySelector('#height-unit').innerHTML = '';\n document.querySelector('#height-unit').insertAdjacentText('afterbegin', unitBase);\n\n // Flow range\n let rangeFlowUnit = document.querySelector('.range-wrapper').getAttribute('data-unit');\n let highRangeFlowMeasure = parseInt(document.querySelector('#high-range').textContent);\n let lowRangeFlowMeasure = parseInt(document.querySelector('#low-range').textContent);\n // Convert\n highRangeFlowMeasure = Math.round(convert(highRangeFlowMeasure).from(rangeFlowUnit).to(unitsTo.volume_flow_rate));\n lowRangeFlowMeasure = Math.round(convert(lowRangeFlowMeasure).from(rangeFlowUnit).to(unitsTo.volume_flow_rate));\n // Set\n document.querySelector('.range-wrapper').setAttribute('data-unit', unitsTo.volume_flow_rate);\n document.querySelector('#high-range').innerHTML = highRangeFlowMeasure;\n document.querySelector('#low-range').innerHTML = lowRangeFlowMeasure;\n // Measurement\n document.querySelector('#range-unit').innerHTML = '';\n document.querySelector('#range-unit').insertAdjacentText('afterbegin', unitBase);\n document.querySelector('#range-unit').insertAdjacentHTML('beforeend', '<span class=\"superscript\">3</span>');\n document.querySelector('#range-unit').insertAdjacentText('beforeend', '/S');\n\n // Current temp\n let currentTempUnit = document.querySelector('.weather-subtitle').getAttribute('data-unit');\n let currentWaterTempMeasure = document.querySelector('#water-temp').textContent.split('o')[0].split(' ')[1];\n let currentAirTempMeasure = parseInt(document.querySelector('#air-temp').textContent.split('o')[0].split(' ')[1]);\n // Convert\n if(currentWaterTempMeasure !== '-') {\n // Water temp is not a null value\n currentWaterTempMeasure = Math.round(convert(parseInt(currentWaterTempMeasure)).from(currentTempUnit).to(unitsTo.temperature));\n }\n currentAirTempMeasure = Math.round(convert(currentAirTempMeasure).from(currentTempUnit).to(unitsTo.temperature));\n // Set\n document.querySelector('.weather-subtitle').setAttribute('data-unit', unitsTo.temperature);\n // Water\n document.querySelector('#water-temp').innerHTML = '';\n document.querySelector('#water-temp').insertAdjacentText('afterbegin', 'Water: ' + currentWaterTempMeasure);\n document.querySelector('#water-temp').insertAdjacentHTML('beforeend', '<span class=\"degree\">o</span>');\n document.querySelector('#water-temp').insertAdjacentText('beforeend', unitsTo.temperature);\n // Air\n document.querySelector('#air-temp').innerHTML = '';\n document.querySelector('#air-temp').insertAdjacentText('afterbegin', 'Air: ' + currentAirTempMeasure);\n document.querySelector('#air-temp').insertAdjacentHTML('beforeend', '<span class=\"degree\">o</span>');\n document.querySelector('#air-temp').insertAdjacentText('beforeend', unitsTo.temperature);\n\n // Current flow\n let currentFlowUnit = document.querySelector('#current-flow').getAttribute('data-unit');\n let currentFlowMeasure = parseInt(document.querySelector('#current-flow > .container').textContent);\n // Convert\n currentFlowMeasure = Math.round(convert(currentFlowMeasure).from(currentFlowUnit).to(unitsTo.volume_flow_rate));\n // Set\n document.querySelector('#current-flow').setAttribute('data-unit', unitsTo.volume_flow_rate);\n document.querySelector('#current-flow > .container').textContent = currentFlowMeasure;\n}", "get units() {\n return this._units;\n }", "function stand() {\n getComputerTotal();\n compare(PLAYERTOTAL, COMPUTERTOTAL);\n}", "function tally() {\n tallied = Math.floor((100 / quizLength) * score);\n if(tallied >= 80){\n commendation = commendationObj.good;\n } else if (tallied >= 66.66){\n commendation = commendationObj.ok;\n } else {\n commendation = commendationObj.bad;\n }\n }", "infectionByRequestedTime() {\n const factor = this.powerFactor();\n return this.currentlyInfected() * 2 ** factor;\n }", "getTotalProductionPerSecond() {\n var productionPerSecond = 0;\n Object\n .keys(this.Model.upgrades)\n .forEach( (key, index) => {\n productionPerSecond += this.getProductionPerSecond(key);\n });\n return Math.round(productionPerSecond * 10) / 10;\n }", "function calculateUnitRatios () {\n\t\t\n\t\t /************************\n\t\t Same Ratio Checks\n\t\t ************************/\n\t\t\n\t\t /* The properties below are used to determine whether the element differs sufficiently from this call's\n\t\t previously iterated element to also differ in its unit conversion ratios. If the properties match up with those\n\t\t of the prior element, the prior element's conversion ratios are used. Like most optimizations in Velocity,\n\t\t this is done to minimize DOM querying. */\n\t\t var sameRatioIndicators = {\n\t\t myParent: element.parentNode || document.body, /* GET */\n\t\t position: CSS.getPropertyValue(element, \"position\"), /* GET */\n\t\t fontSize: CSS.getPropertyValue(element, \"fontSize\") /* GET */\n\t\t },\n\t\t /* Determine if the same % ratio can be used. % is based on the element's position value and its parent's width and height dimensions. */\n\t\t samePercentRatio = ((sameRatioIndicators.position === callUnitConversionData.lastPosition) && (sameRatioIndicators.myParent === callUnitConversionData.lastParent)),\n\t\t /* Determine if the same em ratio can be used. em is relative to the element's fontSize. */\n\t\t sameEmRatio = (sameRatioIndicators.fontSize === callUnitConversionData.lastFontSize);\n\t\t\n\t\t /* Store these ratio indicators call-wide for the next element to compare against. */\n\t\t callUnitConversionData.lastParent = sameRatioIndicators.myParent;\n\t\t callUnitConversionData.lastPosition = sameRatioIndicators.position;\n\t\t callUnitConversionData.lastFontSize = sameRatioIndicators.fontSize;\n\t\t\n\t\t /***************************\n\t\t Element-Specific Units\n\t\t ***************************/\n\t\t\n\t\t /* Note: IE8 rounds to the nearest pixel when returning CSS values, thus we perform conversions using a measurement\n\t\t of 100 (instead of 1) to give our ratios a precision of at least 2 decimal values. */\n\t\t var measurement = 100,\n\t\t unitRatios = {};\n\t\t\n\t\t if (!sameEmRatio || !samePercentRatio) {\n\t\t var dummy = Data(element).isSVG ? document.createElementNS(\"http://www.w3.org/2000/svg\", \"rect\") : document.createElement(\"div\");\n\t\t\n\t\t Velocity.init(dummy);\n\t\t sameRatioIndicators.myParent.appendChild(dummy);\n\t\t\n\t\t /* To accurately and consistently calculate conversion ratios, the element's cascaded overflow and box-sizing are stripped.\n\t\t Similarly, since width/height can be artificially constrained by their min-/max- equivalents, these are controlled for as well. */\n\t\t /* Note: Overflow must be also be controlled for per-axis since the overflow property overwrites its per-axis values. */\n\t\t $.each([ \"overflow\", \"overflowX\", \"overflowY\" ], function(i, property) {\n\t\t Velocity.CSS.setPropertyValue(dummy, property, \"hidden\");\n\t\t });\n\t\t Velocity.CSS.setPropertyValue(dummy, \"position\", sameRatioIndicators.position);\n\t\t Velocity.CSS.setPropertyValue(dummy, \"fontSize\", sameRatioIndicators.fontSize);\n\t\t Velocity.CSS.setPropertyValue(dummy, \"boxSizing\", \"content-box\");\n\t\t\n\t\t /* width and height act as our proxy properties for measuring the horizontal and vertical % ratios. */\n\t\t $.each([ \"minWidth\", \"maxWidth\", \"width\", \"minHeight\", \"maxHeight\", \"height\" ], function(i, property) {\n\t\t Velocity.CSS.setPropertyValue(dummy, property, measurement + \"%\");\n\t\t });\n\t\t /* paddingLeft arbitrarily acts as our proxy property for the em ratio. */\n\t\t Velocity.CSS.setPropertyValue(dummy, \"paddingLeft\", measurement + \"em\");\n\t\t\n\t\t /* Divide the returned value by the measurement to get the ratio between 1% and 1px. Default to 1 since working with 0 can produce Infinite. */\n\t\t unitRatios.percentToPxWidth = callUnitConversionData.lastPercentToPxWidth = (parseFloat(CSS.getPropertyValue(dummy, \"width\", null, true)) || 1) / measurement; /* GET */\n\t\t unitRatios.percentToPxHeight = callUnitConversionData.lastPercentToPxHeight = (parseFloat(CSS.getPropertyValue(dummy, \"height\", null, true)) || 1) / measurement; /* GET */\n\t\t unitRatios.emToPx = callUnitConversionData.lastEmToPx = (parseFloat(CSS.getPropertyValue(dummy, \"paddingLeft\")) || 1) / measurement; /* GET */\n\t\t\n\t\t sameRatioIndicators.myParent.removeChild(dummy);\n\t\t } else {\n\t\t unitRatios.emToPx = callUnitConversionData.lastEmToPx;\n\t\t unitRatios.percentToPxWidth = callUnitConversionData.lastPercentToPxWidth;\n\t\t unitRatios.percentToPxHeight = callUnitConversionData.lastPercentToPxHeight;\n\t\t }\n\t\t\n\t\t /***************************\n\t\t Element-Agnostic Units\n\t\t ***************************/\n\t\t\n\t\t /* Whereas % and em ratios are determined on a per-element basis, the rem unit only needs to be checked\n\t\t once per call since it's exclusively dependant upon document.body's fontSize. If this is the first time\n\t\t that calculateUnitRatios() is being run during this call, remToPx will still be set to its default value of null,\n\t\t so we calculate it now. */\n\t\t if (callUnitConversionData.remToPx === null) {\n\t\t /* Default to browsers' default fontSize of 16px in the case of 0. */\n\t\t callUnitConversionData.remToPx = parseFloat(CSS.getPropertyValue(document.body, \"fontSize\")) || 16; /* GET */\n\t\t }\n\t\t\n\t\t /* Similarly, viewport units are %-relative to the window's inner dimensions. */\n\t\t if (callUnitConversionData.vwToPx === null) {\n\t\t callUnitConversionData.vwToPx = parseFloat(window.innerWidth) / 100; /* GET */\n\t\t callUnitConversionData.vhToPx = parseFloat(window.innerHeight) / 100; /* GET */\n\t\t }\n\t\t\n\t\t unitRatios.remToPx = callUnitConversionData.remToPx;\n\t\t unitRatios.vwToPx = callUnitConversionData.vwToPx;\n\t\t unitRatios.vhToPx = callUnitConversionData.vhToPx;\n\t\t\n\t\t if (Velocity.debug >= 1) console.log(\"Unit ratios: \" + JSON.stringify(unitRatios), element);\n\t\t\n\t\t return unitRatios;\n\t\t }", "function get_time_left() {\n return (escrow_amount / price_per_second) - time_spent;\n}", "function totalAutoMoneyPerSecond() {\n MoneyForThisRound += MoneyPerSecondForThisRound / 10; //add money per sec to money for this round\n totalMoney += MoneyPerSecondForThisRound / 10;\n if(totalMPS < MoneyPerSecondForThisRound){\n totalMPS = MoneyPerSecondForThisRound;\n }\n displayMoney(); \n}", "function timeProSystem(wq, niu){\n return wq + (1/niu)\n}", "function add_zero(measure_unit) {\n let unit; //variable needed to store different data from the time object depending on function argument\n\n if (measure_unit == hours){\n unit = time.hours; //stores the hours\n } else if (measure_unit == minutes) {\n unit = time.minutes; //stores the minutes\n } else if (measure_unit == seconds) {\n unit = time.seconds; //stores the seconds\n }\n\n //function returns additional zero symbol if 'unit' variable value are less than 10\n return (unit < 10) ? measure_unit.innerText = '0' + unit : measure_unit.innerText = unit;\n }", "function calcDemandMeetAbility() {\n var percent; // 0.0 - 1.0\n var totDemandMet = 0;\n var totDemand = 0;\n var scoreCount = 0;\n \n var profileCapacity, profileActualDemand;\n \n percent = 0.0;\n \n for (var i=0; i<agileModel.activeProfiles.length; i++) {\n \n profileCapacity = float(agileModel.activeProfiles[i].globalProductionLimit);\n profileActualDemand = float(agileModel.activeProfiles[i].demandProfile.getString(2, session.current.TURN-1));\n \n if (profileActualDemand > 0) {\n scoreCount++;\n totDemandMet += min(profileCapacity, profileActualDemand);\n totDemand += profileActualDemand;\n percent += min(profileCapacity, profileActualDemand) / profileActualDemand;\n }\n }\n \n if (totDemand > 0) {\n //percent = totDemandMet / totDemand;\n percent /= scoreCount;\n } else {\n percent = 1.0;\n }\n \n return percent;\n\n}", "static getTimesCompleted(diff, quest, startingAct, act) {\n const timesBeatGame = Number.parseInt(diff, 10) / 5;\n let timesCompleted = timesBeatGame * (quest ? 1 : 0);\n if (Number.parseInt(startingAct, 10) >= act && quest) {\n timesCompleted += 1;\n }\n\n return Math.min(3, timesCompleted);\n }", "elapsed_days(){\n return this.ticks / TICKS_PER_DAY; \n }", "function utregningTid() {\n spentMilliseconds = Math.floor(finishTime - startTime);\n //spentSeconds = spentMilliseconds / 1000;?\n totalTider.push(spentMilliseconds);\n total = totalTider.reduce((a, b) => a + b, 0);\n snitt = total / totalTider.length;\n}", "function getRemainingStomach() {\n return (0, _kolmafia.fullnessLimit)() - (0, _kolmafia.myFullness)();\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 accuracyCalculator(weapon, userObject, weaponName, cb) {\n var gunShots = 0;\n var gunHits = 0;\n var champions = userObject.playerProfileStats.champions;\n //console.log(champions);\n for (var i in champions) {\n gunShots += champions[i].damageStatusList[weapon].shots;\n gunHits += champions[i].damageStatusList[weapon].hits;\n }\n cb(`${weaponName} accuracy for ${userObject.name} = ${Math.round((gunHits/gunShots)*1000)/10}%`);\n}", "judgeHolds(delta, currentAudioTime, beat, tickCounts) {\n\n\n this.activeHolds.cumulatedHoldTime += delta ;\n\n\n this.activeHolds.timeCounterJudgmentHolds += delta ;\n\n const secondsPerBeat = 60 / this.composer.bpmManager.getCurrentBPM() ;\n\n const secondsPerKeyCount = secondsPerBeat/ tickCounts ;\n\n const numberOfHits = Math.floor(this.activeHolds.timeCounterJudgmentHolds / secondsPerKeyCount ) ;\n\n\n // console.log(numberOfPerfects) ;\n\n\n if ( numberOfHits > 0 ) {\n\n\n let aux = this.activeHolds.timeCounterJudgmentHolds ;\n const remainder = this.activeHolds.timeCounterJudgmentHolds % secondsPerKeyCount;\n this.activeHolds.timeCounterJudgmentHolds = 0 ;\n\n\n const difference = Math.abs((this.activeHolds.lastAddedHold.beginHoldTimeStamp) - currentAudioTime) ;\n // case 1: holds are pressed on time\n if (this.areHoldsBeingPressed()) {\n\n this.composer.judgmentScale.animateJudgement('p', numberOfHits);\n this.composer.animateTapEffect(this.activeHolds.asList());\n // case 2: holds are not pressed. we need to give some margin to do it\n } else if (this.activeHolds.beginningHoldChunk && difference < this.accuracyMargin ) {\n\n this.activeHolds.timeCounterJudgmentHolds += aux -remainder ;\n\n // case 3: holds are not pressed and we run out of the margin\n } else {\n // TODO: misses should not be in the same count.\n this.composer.judgmentScale.miss() ;\n this.activeHolds.beginningHoldChunk = false ;\n }\n\n\n this.activeHolds.timeCounterJudgmentHolds += remainder;\n\n }\n\n\n }", "function calculateTotalTime() {\n\t\tfor ( var i = 0, count = times.length; i < count; i++ ) {\n\t\t\ttotalTime += +times[i].time;\n\t\t}\n\t}", "function calculateTotalTime() {\n\t\tfor ( var i = 0, count = times.length; i < count; i++ ) {\n\t\t\ttotalTime += +times[i].time;\n\t\t}\n\t}", "function calculateUnitRatios () {\n\n /************************\n Same Ratio Checks\n ************************/\n\n /* The properties below are used to determine whether the element differs sufficiently from this call's\n previously iterated element to also differ in its unit conversion ratios. If the properties match up with those\n of the prior element, the prior element's conversion ratios are used. Like most optimizations in Velocity,\n this is done to minimize DOM querying. */\n var sameRatioIndicators = {\n myParent: element.parentNode || document.body, /* GET */\n position: CSS.getPropertyValue(element, \"position\"), /* GET */\n fontSize: CSS.getPropertyValue(element, \"fontSize\") /* GET */\n },\n /* Determine if the same % ratio can be used. % is based on the element's position value and its parent's width and height dimensions. */\n samePercentRatio = ((sameRatioIndicators.position === callUnitConversionData.lastPosition) && (sameRatioIndicators.myParent === callUnitConversionData.lastParent)),\n /* Determine if the same em ratio can be used. em is relative to the element's fontSize. */\n sameEmRatio = (sameRatioIndicators.fontSize === callUnitConversionData.lastFontSize);\n\n /* Store these ratio indicators call-wide for the next element to compare against. */\n callUnitConversionData.lastParent = sameRatioIndicators.myParent;\n callUnitConversionData.lastPosition = sameRatioIndicators.position;\n callUnitConversionData.lastFontSize = sameRatioIndicators.fontSize;\n\n /***************************\n Element-Specific Units\n ***************************/\n\n /* Note: IE8 rounds to the nearest pixel when returning CSS values, thus we perform conversions using a measurement\n of 100 (instead of 1) to give our ratios a precision of at least 2 decimal values. */\n var measurement = 100,\n unitRatios = {};\n\n if (!sameEmRatio || !samePercentRatio) {\n var dummy = Data(element).isSVG ? document.createElementNS(\"http://www.w3.org/2000/svg\", \"rect\") : document.createElement(\"div\");\n\n Velocity.init(dummy);\n sameRatioIndicators.myParent.appendChild(dummy);\n\n /* To accurately and consistently calculate conversion ratios, the element's cascaded overflow and box-sizing are stripped.\n Similarly, since width/height can be artificially constrained by their min-/max- equivalents, these are controlled for as well. */\n /* Note: Overflow must be also be controlled for per-axis since the overflow property overwrites its per-axis values. */\n $.each([ \"overflow\", \"overflowX\", \"overflowY\" ], function(i, property) {\n Velocity.CSS.setPropertyValue(dummy, property, \"hidden\");\n });\n Velocity.CSS.setPropertyValue(dummy, \"position\", sameRatioIndicators.position);\n Velocity.CSS.setPropertyValue(dummy, \"fontSize\", sameRatioIndicators.fontSize);\n Velocity.CSS.setPropertyValue(dummy, \"boxSizing\", \"content-box\");\n\n /* width and height act as our proxy properties for measuring the horizontal and vertical % ratios. */\n $.each([ \"minWidth\", \"maxWidth\", \"width\", \"minHeight\", \"maxHeight\", \"height\" ], function(i, property) {\n Velocity.CSS.setPropertyValue(dummy, property, measurement + \"%\");\n });\n /* paddingLeft arbitrarily acts as our proxy property for the em ratio. */\n Velocity.CSS.setPropertyValue(dummy, \"paddingLeft\", measurement + \"em\");\n\n /* Divide the returned value by the measurement to get the ratio between 1% and 1px. Default to 1 since working with 0 can produce Infinite. */\n unitRatios.percentToPxWidth = callUnitConversionData.lastPercentToPxWidth = (parseFloat(CSS.getPropertyValue(dummy, \"width\", null, true)) || 1) / measurement; /* GET */\n unitRatios.percentToPxHeight = callUnitConversionData.lastPercentToPxHeight = (parseFloat(CSS.getPropertyValue(dummy, \"height\", null, true)) || 1) / measurement; /* GET */\n unitRatios.emToPx = callUnitConversionData.lastEmToPx = (parseFloat(CSS.getPropertyValue(dummy, \"paddingLeft\")) || 1) / measurement; /* GET */\n\n sameRatioIndicators.myParent.removeChild(dummy);\n } else {\n unitRatios.emToPx = callUnitConversionData.lastEmToPx;\n unitRatios.percentToPxWidth = callUnitConversionData.lastPercentToPxWidth;\n unitRatios.percentToPxHeight = callUnitConversionData.lastPercentToPxHeight;\n }\n\n /***************************\n Element-Agnostic Units\n ***************************/\n\n /* Whereas % and em ratios are determined on a per-element basis, the rem unit only needs to be checked\n once per call since it's exclusively dependant upon document.body's fontSize. If this is the first time\n that calculateUnitRatios() is being run during this call, remToPx will still be set to its default value of null,\n so we calculate it now. */\n if (callUnitConversionData.remToPx === null) {\n /* Default to browsers' default fontSize of 16px in the case of 0. */\n callUnitConversionData.remToPx = parseFloat(CSS.getPropertyValue(document.body, \"fontSize\")) || 16; /* GET */\n }\n\n /* Similarly, viewport units are %-relative to the window's inner dimensions. */\n if (callUnitConversionData.vwToPx === null) {\n callUnitConversionData.vwToPx = parseFloat(window.innerWidth) / 100; /* GET */\n callUnitConversionData.vhToPx = parseFloat(window.innerHeight) / 100; /* GET */\n }\n\n unitRatios.remToPx = callUnitConversionData.remToPx;\n unitRatios.vwToPx = callUnitConversionData.vwToPx;\n unitRatios.vhToPx = callUnitConversionData.vhToPx;\n\n if (Velocity.debug >= 1) console.log(\"Unit ratios: \" + JSON.stringify(unitRatios), element);\n\n return unitRatios;\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 calculateTickSize(start, end, unit) {\n //Comprobar si existe this.units[unit]\n var current_unit = global.UNITS[unit];\n var num_units = 1;\n var excedido = false;\n do {\n //Milisegundos entre las dos fechas \n var period_size = (current_unit.milliseconds * num_units);\n var num_periods = calculateNumPeriods(start, end, period_size);\n if (num_units > current_unit.max_value) {\n if (current_unit.end) {\n excedido = true;\n } else {\n current_unit = global.UNITS[current_unit.next_unit];\n num_units = 1;\n }\n }\n //unidades: 1, 2, 4, 6 ,12\n if (num_units == 4) num_units +=2;\n else num_units *= 2; \n } while (!excedido && (num_periods > global.MAX_PERIODS))\n\n if (excedido) return null;\n return [num_units * current_unit.shift, current_unit.unit];\n}", "function update_counter() {\n let time = remaining_time(); //get the time object\n\n //adds zero in front of the time measure unit if it displays less than 2 symbols\n function add_zero(measure_unit) {\n let unit; //variable needed to store different data from the time object depending on function argument\n\n if (measure_unit == hours){\n unit = time.hours; //stores the hours\n } else if (measure_unit == minutes) {\n unit = time.minutes; //stores the minutes\n } else if (measure_unit == seconds) {\n unit = time.seconds; //stores the seconds\n }\n\n //function returns additional zero symbol if 'unit' variable value are less than 10\n return (unit < 10) ? measure_unit.innerText = '0' + unit : measure_unit.innerText = unit;\n }\n\n //if delta time is over stops update function and display zero to every time measure unit\n if (time.total < 0) {\n clearInterval(update_time);\n time.hours = time.minutes = time.seconds = 0;\n }\n\n //adding zero to every displayed measure unit\n add_zero(hours);\n add_zero(minutes);\n add_zero(seconds);\n }", "function calculateDuration() {\n return endTime - startTime;\n }", "modeOne (numBalls, numMinutes) {\n let initialized = this.initialize(numBalls) // keep error handling at user input level\n if (!initialized.success) { return initialized.error }\n let start = performance.now()\n let result = JSON.stringify(this.count(numMinutes))\n let end = performance.now()\n console.log(`${numBalls} balls were cycled over ${numMinutes} minutes.`)\n console.log(result)\n let mil = Math.floor(end - start)\n let sec = mil/1000\n console.log(`Completed in ${mil} milliseconds (${sec} seconds)`)\n return result\n }", "function calculateUnitRatios () {\n\t\n\t /************************\n\t Same Ratio Checks\n\t ************************/\n\t\n\t /* The properties below are used to determine whether the element differs sufficiently from this call's\n\t previously iterated element to also differ in its unit conversion ratios. If the properties match up with those\n\t of the prior element, the prior element's conversion ratios are used. Like most optimizations in Velocity,\n\t this is done to minimize DOM querying. */\n\t var sameRatioIndicators = {\n\t myParent: element.parentNode || document.body, /* GET */\n\t position: CSS.getPropertyValue(element, \"position\"), /* GET */\n\t fontSize: CSS.getPropertyValue(element, \"fontSize\") /* GET */\n\t },\n\t /* Determine if the same % ratio can be used. % is based on the element's position value and its parent's width and height dimensions. */\n\t samePercentRatio = ((sameRatioIndicators.position === callUnitConversionData.lastPosition) && (sameRatioIndicators.myParent === callUnitConversionData.lastParent)),\n\t /* Determine if the same em ratio can be used. em is relative to the element's fontSize. */\n\t sameEmRatio = (sameRatioIndicators.fontSize === callUnitConversionData.lastFontSize);\n\t\n\t /* Store these ratio indicators call-wide for the next element to compare against. */\n\t callUnitConversionData.lastParent = sameRatioIndicators.myParent;\n\t callUnitConversionData.lastPosition = sameRatioIndicators.position;\n\t callUnitConversionData.lastFontSize = sameRatioIndicators.fontSize;\n\t\n\t /***************************\n\t Element-Specific Units\n\t ***************************/\n\t\n\t /* Note: IE8 rounds to the nearest pixel when returning CSS values, thus we perform conversions using a measurement\n\t of 100 (instead of 1) to give our ratios a precision of at least 2 decimal values. */\n\t var measurement = 100,\n\t unitRatios = {};\n\t\n\t if (!sameEmRatio || !samePercentRatio) {\n\t var dummy = Data(element).isSVG ? document.createElementNS(\"http://www.w3.org/2000/svg\", \"rect\") : document.createElement(\"div\");\n\t\n\t Velocity.init(dummy);\n\t sameRatioIndicators.myParent.appendChild(dummy);\n\t\n\t /* To accurately and consistently calculate conversion ratios, the element's cascaded overflow and box-sizing are stripped.\n\t Similarly, since width/height can be artificially constrained by their min-/max- equivalents, these are controlled for as well. */\n\t /* Note: Overflow must be also be controlled for per-axis since the overflow property overwrites its per-axis values. */\n\t $.each([ \"overflow\", \"overflowX\", \"overflowY\" ], function(i, property) {\n\t Velocity.CSS.setPropertyValue(dummy, property, \"hidden\");\n\t });\n\t Velocity.CSS.setPropertyValue(dummy, \"position\", sameRatioIndicators.position);\n\t Velocity.CSS.setPropertyValue(dummy, \"fontSize\", sameRatioIndicators.fontSize);\n\t Velocity.CSS.setPropertyValue(dummy, \"boxSizing\", \"content-box\");\n\t\n\t /* width and height act as our proxy properties for measuring the horizontal and vertical % ratios. */\n\t $.each([ \"minWidth\", \"maxWidth\", \"width\", \"minHeight\", \"maxHeight\", \"height\" ], function(i, property) {\n\t Velocity.CSS.setPropertyValue(dummy, property, measurement + \"%\");\n\t });\n\t /* paddingLeft arbitrarily acts as our proxy property for the em ratio. */\n\t Velocity.CSS.setPropertyValue(dummy, \"paddingLeft\", measurement + \"em\");\n\t\n\t /* Divide the returned value by the measurement to get the ratio between 1% and 1px. Default to 1 since working with 0 can produce Infinite. */\n\t unitRatios.percentToPxWidth = callUnitConversionData.lastPercentToPxWidth = (parseFloat(CSS.getPropertyValue(dummy, \"width\", null, true)) || 1) / measurement; /* GET */\n\t unitRatios.percentToPxHeight = callUnitConversionData.lastPercentToPxHeight = (parseFloat(CSS.getPropertyValue(dummy, \"height\", null, true)) || 1) / measurement; /* GET */\n\t unitRatios.emToPx = callUnitConversionData.lastEmToPx = (parseFloat(CSS.getPropertyValue(dummy, \"paddingLeft\")) || 1) / measurement; /* GET */\n\t\n\t sameRatioIndicators.myParent.removeChild(dummy);\n\t } else {\n\t unitRatios.emToPx = callUnitConversionData.lastEmToPx;\n\t unitRatios.percentToPxWidth = callUnitConversionData.lastPercentToPxWidth;\n\t unitRatios.percentToPxHeight = callUnitConversionData.lastPercentToPxHeight;\n\t }\n\t\n\t /***************************\n\t Element-Agnostic Units\n\t ***************************/\n\t\n\t /* Whereas % and em ratios are determined on a per-element basis, the rem unit only needs to be checked\n\t once per call since it's exclusively dependant upon document.body's fontSize. If this is the first time\n\t that calculateUnitRatios() is being run during this call, remToPx will still be set to its default value of null,\n\t so we calculate it now. */\n\t if (callUnitConversionData.remToPx === null) {\n\t /* Default to browsers' default fontSize of 16px in the case of 0. */\n\t callUnitConversionData.remToPx = parseFloat(CSS.getPropertyValue(document.body, \"fontSize\")) || 16; /* GET */\n\t }\n\t\n\t /* Similarly, viewport units are %-relative to the window's inner dimensions. */\n\t if (callUnitConversionData.vwToPx === null) {\n\t callUnitConversionData.vwToPx = parseFloat(window.innerWidth) / 100; /* GET */\n\t callUnitConversionData.vhToPx = parseFloat(window.innerHeight) / 100; /* GET */\n\t }\n\t\n\t unitRatios.remToPx = callUnitConversionData.remToPx;\n\t unitRatios.vwToPx = callUnitConversionData.vwToPx;\n\t unitRatios.vhToPx = callUnitConversionData.vhToPx;\n\t\n\t if (Velocity.debug >= 1) console.log(\"Unit ratios: \" + JSON.stringify(unitRatios), element);\n\t\n\t return unitRatios;\n\t }", "function calculateUnitRatios () {\n\t\n\t /************************\n\t Same Ratio Checks\n\t ************************/\n\t\n\t /* The properties below are used to determine whether the element differs sufficiently from this call's\n\t previously iterated element to also differ in its unit conversion ratios. If the properties match up with those\n\t of the prior element, the prior element's conversion ratios are used. Like most optimizations in Velocity,\n\t this is done to minimize DOM querying. */\n\t var sameRatioIndicators = {\n\t myParent: element.parentNode || document.body, /* GET */\n\t position: CSS.getPropertyValue(element, \"position\"), /* GET */\n\t fontSize: CSS.getPropertyValue(element, \"fontSize\") /* GET */\n\t },\n\t /* Determine if the same % ratio can be used. % is based on the element's position value and its parent's width and height dimensions. */\n\t samePercentRatio = ((sameRatioIndicators.position === callUnitConversionData.lastPosition) && (sameRatioIndicators.myParent === callUnitConversionData.lastParent)),\n\t /* Determine if the same em ratio can be used. em is relative to the element's fontSize. */\n\t sameEmRatio = (sameRatioIndicators.fontSize === callUnitConversionData.lastFontSize);\n\t\n\t /* Store these ratio indicators call-wide for the next element to compare against. */\n\t callUnitConversionData.lastParent = sameRatioIndicators.myParent;\n\t callUnitConversionData.lastPosition = sameRatioIndicators.position;\n\t callUnitConversionData.lastFontSize = sameRatioIndicators.fontSize;\n\t\n\t /***************************\n\t Element-Specific Units\n\t ***************************/\n\t\n\t /* Note: IE8 rounds to the nearest pixel when returning CSS values, thus we perform conversions using a measurement\n\t of 100 (instead of 1) to give our ratios a precision of at least 2 decimal values. */\n\t var measurement = 100,\n\t unitRatios = {};\n\t\n\t if (!sameEmRatio || !samePercentRatio) {\n\t var dummy = Data(element).isSVG ? document.createElementNS(\"http://www.w3.org/2000/svg\", \"rect\") : document.createElement(\"div\");\n\t\n\t Velocity.init(dummy);\n\t sameRatioIndicators.myParent.appendChild(dummy);\n\t\n\t /* To accurately and consistently calculate conversion ratios, the element's cascaded overflow and box-sizing are stripped.\n\t Similarly, since width/height can be artificially constrained by their min-/max- equivalents, these are controlled for as well. */\n\t /* Note: Overflow must be also be controlled for per-axis since the overflow property overwrites its per-axis values. */\n\t $.each([ \"overflow\", \"overflowX\", \"overflowY\" ], function(i, property) {\n\t Velocity.CSS.setPropertyValue(dummy, property, \"hidden\");\n\t });\n\t Velocity.CSS.setPropertyValue(dummy, \"position\", sameRatioIndicators.position);\n\t Velocity.CSS.setPropertyValue(dummy, \"fontSize\", sameRatioIndicators.fontSize);\n\t Velocity.CSS.setPropertyValue(dummy, \"boxSizing\", \"content-box\");\n\t\n\t /* width and height act as our proxy properties for measuring the horizontal and vertical % ratios. */\n\t $.each([ \"minWidth\", \"maxWidth\", \"width\", \"minHeight\", \"maxHeight\", \"height\" ], function(i, property) {\n\t Velocity.CSS.setPropertyValue(dummy, property, measurement + \"%\");\n\t });\n\t /* paddingLeft arbitrarily acts as our proxy property for the em ratio. */\n\t Velocity.CSS.setPropertyValue(dummy, \"paddingLeft\", measurement + \"em\");\n\t\n\t /* Divide the returned value by the measurement to get the ratio between 1% and 1px. Default to 1 since working with 0 can produce Infinite. */\n\t unitRatios.percentToPxWidth = callUnitConversionData.lastPercentToPxWidth = (parseFloat(CSS.getPropertyValue(dummy, \"width\", null, true)) || 1) / measurement; /* GET */\n\t unitRatios.percentToPxHeight = callUnitConversionData.lastPercentToPxHeight = (parseFloat(CSS.getPropertyValue(dummy, \"height\", null, true)) || 1) / measurement; /* GET */\n\t unitRatios.emToPx = callUnitConversionData.lastEmToPx = (parseFloat(CSS.getPropertyValue(dummy, \"paddingLeft\")) || 1) / measurement; /* GET */\n\t\n\t sameRatioIndicators.myParent.removeChild(dummy);\n\t } else {\n\t unitRatios.emToPx = callUnitConversionData.lastEmToPx;\n\t unitRatios.percentToPxWidth = callUnitConversionData.lastPercentToPxWidth;\n\t unitRatios.percentToPxHeight = callUnitConversionData.lastPercentToPxHeight;\n\t }\n\t\n\t /***************************\n\t Element-Agnostic Units\n\t ***************************/\n\t\n\t /* Whereas % and em ratios are determined on a per-element basis, the rem unit only needs to be checked\n\t once per call since it's exclusively dependant upon document.body's fontSize. If this is the first time\n\t that calculateUnitRatios() is being run during this call, remToPx will still be set to its default value of null,\n\t so we calculate it now. */\n\t if (callUnitConversionData.remToPx === null) {\n\t /* Default to browsers' default fontSize of 16px in the case of 0. */\n\t callUnitConversionData.remToPx = parseFloat(CSS.getPropertyValue(document.body, \"fontSize\")) || 16; /* GET */\n\t }\n\t\n\t /* Similarly, viewport units are %-relative to the window's inner dimensions. */\n\t if (callUnitConversionData.vwToPx === null) {\n\t callUnitConversionData.vwToPx = parseFloat(window.innerWidth) / 100; /* GET */\n\t callUnitConversionData.vhToPx = parseFloat(window.innerHeight) / 100; /* GET */\n\t }\n\t\n\t unitRatios.remToPx = callUnitConversionData.remToPx;\n\t unitRatios.vwToPx = callUnitConversionData.vwToPx;\n\t unitRatios.vhToPx = callUnitConversionData.vhToPx;\n\t\n\t if (Velocity.debug >= 1) console.log(\"Unit ratios: \" + JSON.stringify(unitRatios), element);\n\t\n\t return unitRatios;\n\t }", "function computeTimeUnitSize(duration){\n\treturn $(\"#diagram\").width()/duration ;\n}", "function CalPassesPerMinute(playerInstance) // holds on argument of the current player item in the \"players\" array \r\n{\r\n \r\n//Object with passes per minute formula\r\nformulaObj = {\r\n\r\n // (backward_pass + fwd_pass) / mins_played\r\n\r\n formula:(playerInstance.stats[8].value + playerInstance.stats[4].value) / playerInstance.stats[7].value\r\n\r\n}\r\n\r\nresult = formulaObj.formula.toFixed(2); // fixing the integer length of the double to three digits\r\n\r\nreturn result // returning the new result \r\n \r\n}", "function MilliSecondsElapsed()\r\n{\r\n\toTimeNow = new Date();\r\n\treturn (oTimeNow - ACROSDK.oTimeStart);\r\n}", "function test_candu_verify_global_utilization_metrics() {}", "function result() {\n // var charcount = samples[random].length\n var totaltime = parseInt(min) + parseInt(sec) / 60;\n var wpm = calculateWPM(samples[random], totaltime).toFixed(2);\n var cpm = calculateCPM(totalCharsInf, totaltime).toFixed(2);\n var accuracy = calculateAccuracy(samples[random], totalCharsInf).toFixed(2);\n document.querySelector(\"#timer-wpm-inf\").innerText = wpm;\n document.querySelector(\"#timer-cpm-inf\").innerText = cpm;\n document.querySelector(\"#timer-accuracy-inf\").innerText = accuracy;\n}", "async measure(f) {\n const start = performance.now();\n await f();\n return performance.now() - start;\n }", "function treadmillHours(calories, caloriesBurned, speed){\n var timeToWalk = calories / (caloriesBurned * speed); // set timeToWalk to be calories divided by caloriesBurned times speed.\n return timeToWalk; // return the value of timeToWalk.\n}", "getRefreshCost() {\n const notComplete = this.incompleteQuests().length;\n return new Amount(Math.floor(250000 * Math.LOG10E * Math.log(Math.pow(notComplete, 4) + 1)), GameConstants.Currency.money);\n }", "function ev(mile, units) {\n mile = parseFloat(mile);\n let ev;\n switch (units) {\n case 'Car/ Light Van':\n ev = 0;\n break;\n case 'Medium Van':\n ev = 0;\n break;\n case 'Large Van':\n ev = 0;\n break;\n default:\n ev = 0;\n }\n return ev.toFixed(2);\n}", "makeDuration(recipe) {\n return Math.ceil(\n recipe.steps.reduce((accum, step) => { // Add all the steps together\n return accum + (this.performStepDuration(step) || 0)\n }, 0)\n )\n }", "function calcTestTime(){\n return document.querySelectorAll(\".questions li\").length * unitQuestionTime;\n}", "function getRemaining() {\n\tvar millLeft = timeDone - (new Date).getTime();\n\n\tif (millLeft < 0) {\n\t\tmillLeft = 0;\n\t}\n\n\treturn {\n\t\t\"hours\": Math.floor(millLeft / 1000.0 / 60 / 60),\n\t\t\"minutes\": Math.floor(millLeft / 1000.0 / 60 % 60),\n\t\t\"seconds\": Math.floor(millLeft / 1000.0 % 60),\n\t\t\"milli\": Math.floor(millLeft % 1000.0)\n\t};\n}" ]
[ "0.671757", "0.65408695", "0.64435166", "0.64435166", "0.64319277", "0.63505006", "0.63386524", "0.63067424", "0.6302476", "0.62557125", "0.6216922", "0.6166669", "0.61409885", "0.61378205", "0.61341965", "0.6129477", "0.61283743", "0.6123936", "0.61157423", "0.6099823", "0.60894775", "0.6040726", "0.6039915", "0.60370755", "0.60349697", "0.60278106", "0.60027677", "0.5995619", "0.59757453", "0.59677", "0.5958326", "0.5943935", "0.5943601", "0.5934985", "0.5910881", "0.5910092", "0.59037626", "0.58883846", "0.58843994", "0.5872927", "0.5843351", "0.58430326", "0.58384424", "0.58329284", "0.5803181", "0.5801704", "0.5781144", "0.5752533", "0.57433236", "0.57294476", "0.5711712", "0.5709292", "0.5692058", "0.5690263", "0.56881714", "0.568567", "0.5680882", "0.56716335", "0.566475", "0.5663697", "0.5657813", "0.56544125", "0.5650877", "0.5650204", "0.56494683", "0.5649127", "0.56476504", "0.56468505", "0.5645626", "0.56385505", "0.56361187", "0.5634974", "0.56309456", "0.5615175", "0.5612799", "0.56117105", "0.56071335", "0.5606608", "0.5606608", "0.5598993", "0.5598698", "0.5598698", "0.5598698", "0.5594477", "0.5594129", "0.5591174", "0.5588019", "0.5586497", "0.5586497", "0.5583208", "0.5579902", "0.5564184", "0.55623066", "0.5560936", "0.55588174", "0.555878", "0.5556193", "0.5550369", "0.5547689", "0.5545821", "0.5541382" ]
0.0
-1
Build a custom Model Instance
function JDBModel(modelDef) { this.$$schema = schemaDef; Model.call(this, db, modelDef); } // end JDBModel
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "newModel(arg) {\n const Model = this.Model;\n return new Model(arg);\n }", "newModel(arg) {\n const Model = this.Model;\n return new Model(arg);\n }", "function Model() {}", "function createModel() {\n var model = new Model();\n\n // give model the default values provided by the service\n model.color = DEFAULT_COLOR;\n model.shape = DEFAULT_SHAPE;\n model.texture = DEFAULT_TEXTURE;\n\n return model;\n }", "function Model() {\n}", "function Model() {\n\n }", "init() {\n this.createModel();\n }", "function make() {\n\n // Return Model (singleton) if not a function\n if (!isFunction(Model)) {\n // throw new Error('Factory registered must be a function.');\n return Model;\n } else {\n var args = Array.prototype.slice.call(arguments);\n var obj = createObject(Model.prototype);\n Model.apply(obj, args);\n return obj;\n }\n }", "getInstance(data) {\n if (data instanceof this.model) {\n // TODO: strict mode: validate that the instance is an instance of this.model\n return data;\n }\n return new this.model(data); // eslint-disable-line new-cap\n }", "constructor (data) {\n super(data, InstanceModel)\n }", "model() {}", "function MainModel()\n{\n this.InstanceAndInit = function (model)\n {\n var obj = new model();\n obj.Init(this);\n\n return obj;\n }\n}", "constructor(model) {\n this.model = model;\n }", "function TaskModelBuilder() {}", "constructor(model){\n this.model = model;\n }", "constructor(model){\n this.model = model;\n }", "function Model () {\n this.modelName = \"\";\n}", "function Model()\r\n{ \r\n this.m_strID = undefined;\r\n this.m_strModelType = 'unknown';\r\n\r\n UberObject.apply( this );\r\n}", "build(dataModel, currentEntity, context){\n var $that = this;\n var modelClass = this.buildObject(); // build entity with models\n modelClass.__proto__ = {};\n const modelFields = Object.entries(dataModel); /// return array of objects\n modelClass.__entity = currentEntity;\n modelClass.__name = currentEntity.__name;\n modelClass.__context = context;\n this.buildRelationshipModels(modelClass, currentEntity, dataModel);\n \n // loop through data model fields\n for (const [modelField, modelFieldValue] of modelFields) { \n \n // set the value dynamiclly\n if(!$that._isRelationship(currentEntity[modelField])){\n // current entity has a value then add\n modelClass[\"__proto__\"][\"_\" + modelField] = modelFieldValue;\n\n // Setter\n modelClass.__defineSetter__(modelField, function(value){\n modelClass.__state = \"modified\";\n modelClass.__dirtyFields.push(modelField);\n if(typeof currentEntity[modelField].set === \"function\"){\n this[\"__proto__\"][\"_\" + modelField] = currentEntity[modelField].set(value);\n }else{\n // Then it will add name to dirty fields\n this[\"__proto__\"][\"_\" + modelField] = value;\n }\n });\n\n // Getter\n modelClass.__defineGetter__(modelField, function(){\n if(typeof currentEntity[modelField].get === \"function\"){\n return currentEntity[modelField].get(this[\"__proto__\"][\"_\" + modelField]);\n }else{\n return this[\"__proto__\"][\"_\" + modelField];\n }\n \n });\n } \n }\n \n \n return modelClass;\n }", "static create(data){\n return new GameModel(data);\n }", "function basicModel() {\n \n }", "initializeNewModel() {\n\n }", "function buildModel(name, schema) {\n class Model extends BaseModel {\n constructor(data) {\n if (data !== undefined) {\n Object.entries(data).forEach(([key, value]) => {\n if (schema[key]) {\n Joi.attempt(value, schema[key]);\n }\n });\n }\n super(data);\n }\n\n _set(key, value) {\n if (schema[key]) {\n Joi.attempt(value, schema[key]);\n }\n return super._set(key, value);\n }\n }\n Object.defineProperty(Model, 'name', { value: name });\n Object.keys(schema).forEach(key =>\n Object.defineProperty(Model.prototype, key, {\n // `function` is used rather than `=>` to work around context problem with `this`\n /* eslint-disable func-names, object-shorthand */\n get: function () {\n return this._get(key);\n },\n set: function (value) {\n this._set(key, value);\n },\n /* eslint-enable func-names, object-shorthand */\n }));\n return Model;\n}", "function initialize(publicAPI, model) {}", "constructor(obj, parent = null) {\n // cloning\n if (obj instanceof Model) {\n let clone = obj;\n this.attributeDefinitions = clone.attributeDefinitions;\n this.elementAttributes = clone.elementAttributes;\n this.attributes = clone.attributes;\n this.parent = parent;\n this.xml = clone.xml;\n\n // attribute values\n for (name in clone.attributeDefinitions)\n this[name] = clone[name];\n\n // child elements\n for (let name of clone.elementAttributes)\n this[name] = clone[name];\n\n // allow the model to assign further attributes\n obj.clone(this);\n\n // new from xml\n } else {\n let xml = obj;\n this.attributeDefinitions = {};\n this.elementAttributes = [];\n this.attributes = xml.attributes;\n this.parent = parent;\n this.xml = xml;\n this.setup();\n }\n\n // setup is only called on models instantiated from xml,\n // postSetup is called on these models and clones\n this.postSetup();\n }", "create() {\n return this.new();\n }", "function Model() {\n this.modelName = \"outback\";\n}", "constructor(obj){\n\t\tsuper(obj);\n\n\t\t//model specific customizations can be done here\n\t}", "function createModel() {\n if (args !== undefined) {\n // create a new MedEntry model\n args.timestamp = timestamp;\n\n // reconcile medication name (or substituted name) that is submitted by user\n if (args.name_sub && args.name_sub.length > 0) {\n args.name = args.name_sub;\n } else {\n args.name = args.med_name;\n }\n delete args.med_name;\n delete args.name_sub;\n\n var model = new MedEntry(args);\n // add a promise to save that model to the models array\n //saveModels.push(model.saveQ);\n // FIXME: save an array of promises, that isnt working so we are adding a model to the array instead of a promise\n saveModels.push(model);\n }\n // after, reset the args to a new object\n args = {\n patient_id: req.body.patient_id,\n created_by: req.user.id\n };\n }", "function createModel(name, mappings, methods) {\n /*\n * this looks weird. what it is doing is identical to the commented-out\n * Model function below. why we're doing it this way is that if we use\n * the commented-out version, all models created with this helper function\n * will appear in the console.log as \"Model\", even though the objects\n * being instantiated are indeed using fully-qualified names like\n * \"UserModel\". the problem has to do with the creation of the function\n * itself...only then can it be given the name it will appear as in the\n * console. so we do some magic to create a dynamic function, and now\n * the console.log behaves like we want\n */\n var Model = new Function(\"LoomModel\", \"mappings\",\n \"return function \" + name + \"(api, json) {\" +\n \"LoomModel.call(this, api, json, mappings);\" +\n \"}\")(LoomModel, mappings);\n\n /*\n function Model(api, json) {\n LoomModel.call(this, mappings, api, json);\n }\n */\n\n var prototype = $.extend({model: Model}, LoomModel.prototype, methods);\n Model.prototype = prototype;\n return Model;\n}", "clone() {\n const clone = new this.constructor(this.model);\n clone.config = Object.assign(clone.config, this.config);\n clone.options = Object.assign(clone.options, this.options);\n return clone;\n }", "function Model(koop) { }", "function model() {\n var args = []\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i]\n }\n var name = typeof args[0] === \"string\" ? args.shift() : \"AnonymousModel\"\n var props = args.shift() || fail(\"types.model must specify properties\")\n var volatileState = (args.length > 1 && args.shift()) || {}\n var actions = args.shift() || {}\n return new ObjectType(name, props, volatileState, actions)\n}", "get Model() {\n return this.constructor;\n }", "function Model() {\n 'use strict';\n this.adapter = null;\n this.serviceUUID = '5BCE9431-6C75-32AB-AFE0-2EC108A30860';\n}", "static create(params) {\n return {type: `${this.prefix}${this.name}`, _instance: new this(params)}; //eslint-disable-line\n }", "function constructFromDb(model, row) {\n\t var o = new model();\n\t console.assert(o instanceof Instance);\n\t for (var col in row) {\n\t var val = row[col];\n\t var _col = '_' + col;\n\t // TODO: refactor this into column class\n\t switch (model.columns[col].type) {\n\t case Updraft.ColumnType.json:\n\t o[_col] = JSON.parse(val);\n\t break;\n\t case Updraft.ColumnType.date:\n\t case Updraft.ColumnType.datetime:\n\t o[_col] = new Date(val * 1000);\n\t break;\n\t case Updraft.ColumnType.enum:\n\t var enumClass = o._model.columns[col].enum;\n\t console.assert(enumClass != null);\n\t if (typeof enumClass === 'object' && typeof enumClass.get == 'function') {\n\t o[_col] = enumClass.get(val);\n\t }\n\t else {\n\t console.assert(val in enumClass);\n\t o[_col] = enumClass[val];\n\t }\n\t break;\n\t case Updraft.ColumnType.set:\n\t o[_col].push(val);\n\t break;\n\t default:\n\t o[_col] = val;\n\t break;\n\t }\n\t }\n\t o._isInDb = true;\n\t console.assert(o._changeMask === 0);\n\t return o;\n\t }", "function createDataModel(model, data) {\n const Model = model;\n Object.keys(data).forEach((key) => {\n Model[key] = data[key];\n });\n return Model;\n}", "function fillModelForInstance(instance, hasDataProps){\n instance.uniqueId = generateUniqueId();\n instance.name = getName(instance.id,instance.label);\n instance.class.sort();\n instance.color = classColorGetter.getSomeObjectColor(instance.class);\n instance.expanded = false;\n instance.ui = fillInstanceUI(instance, false); //collapsed version in ui\n if(hasDataProps) instance.uiExpanded = fillInstanceUI(instance, true, null); //expanded version in uiExpanded, before request, it should be indicator\n else instance.uiExpanded = fillInstanceUI(instance, true, \"Loading...\"); //expanded version in uiExpanded, before request, it should be indicator\n instance.dpLoaded = hasDataProps;\n instance.type = elementTypes.instance;\n return instance;\n }", "getModel() {\n }", "newFromData( data = {}, make_dirty = false ) {\n let model = factory.make_reactive_model( this.modelDefinition, data, this._create_context(), false );\n // model._update_data( generated_data, null, true );\n return model\n }", "async create () {\n\t\tthis.model = await this.collection.create(this.model.attributes);\n\t}", "constructor() {\n super()\n this.model = 'FINGGAL LINK IRSTP3'\n }", "initializeModel() { }", "constructor() {\n this.type = ModelType.DEFAULT;\n this.scene = null;\n this.node = null;\n this.transform = null;\n this.enabled = true;\n this.visFlags = Layers.Enum.NONE;\n this.castShadow = false;\n this.isDynamicBatching = false;\n this.instancedAttributes = {\n buffer: null,\n list: []\n };\n this._worldBounds = null;\n this._modelBounds = null;\n this._subModels = [];\n this._device = void 0;\n this._inited = false;\n this._descriptorSetCount = 1;\n this._updateStamp = -1;\n this._transformUpdated = true;\n this._localData = new Float32Array(UBOLocal.COUNT);\n this._localBuffer = null;\n this._instMatWorldIdx = -1;\n this._lightmap = null;\n this._lightmapUVParam = new Vec4();\n this._receiveShadow = true;\n this._device = legacyCC.director.root.device;\n }", "function Model(attrs) {\n this.attributes = attrs || {};\n}", "static get type() { return 'model'; }", "create() {\n const model = internal(this).model;\n internal(model).entities.add(this);\n return this;\n }", "createRecord(data, skipExpose = false) {\n return new this.modelClass(data, this, null, skipExpose);\n }", "createRecord(data, skipExpose = false) {\n return new this.modelClass(data, this, null, skipExpose);\n }", "model(args) {\n let argtype = YngwieUI.Util.getType(args).toUpperCase();\n switch (argtype) {\n case \"UNDEFINED\":\n return this._model;\n case \"OBJECT\":\n this._model = YngwieUI.Model.setAsModel(args);\n return this;\n default:\n throw new YngwieError(\"Cannot set model with unsupported type\", argtype);\n }\n }", "function Model(storage) {\n\t\tthis.storage = storage;\n\t}", "constructor() {\n super();\n\n /**\n * None of the property flags.\n * @constant {number} bo.common.PropertyFlag#none\n * @default 0\n */\n this.none = 0;\n /**\n * The model property cannot be set.\n * @constant {number} bo.common.PropertyFlag#readOnly\n * @default 1\n */\n this.readOnly = 1;\n /**\n * The model property is a key element of the model.\n * @constant {number} bo.common.PropertyFlag#key\n * @default 2\n */\n this.key = 2;\n /**\n * The model property is a key element of the parent model.\n * @constant {number} bo.common.PropertyFlag#parentKey\n * @default 4\n */\n this.parentKey = 4;\n /**\n * The value of the model property will be used on the client transfer object only.\n * @constant {number} bo.common.PropertyFlag#onCtoOnly\n * @default 8\n */\n this.onCtoOnly = 8;\n /**\n * The value of the model property will be used on the data transfer object only.\n * @constant {number} bo.common.PropertyFlag#onDtoOnly\n * @default 16\n */\n this.onDtoOnly = 16;\n\n // Immutable object.\n Object.freeze( this );\n }", "init(){\n for(var entityName in this._models){\n var Model = this._models[entityName];\n new Model();\n }\n }", "function makeModel(item) {\n return {\n id : item.id,\n providerId: item.provider.id,\n legacyJobName: item.jobPart.name,\n score: item.score,\n languageId: item.language ? item.language.id : null,\n domain1Id: item.domain1 ? item.domain1.id : null,\n domain2Id: item.domain2 ? item.domain2.id : null,\n // TODO: serviceTypeId should be real !!! \n serviceTypeId: null,\n comment: item.comment,\n error: item.error || {},\n bonus: item.bonus || {}\n };\n }", "function VeryModel(definition, options) {\n if (!(this instanceof VeryModel)) {\n throw new Error(\"You must invoke VeryModel with `new`, not as a function call.\");\n }\n if (Array.isArray(definition)) {\n this.definition = [];\n } else {\n this.definition = {};\n }\n this.primary = null;\n this.controllers = {};\n this.options = {};\n\n //initialize sub model definitions recursively\n this.fields = [];\n this.map = {};\n this.alias = {};\n this.addDefinition(definition);\n this.addOptions(options);\n}", "build(model) {\n\t\t// set bindable data\n\t\tthis.priority = 1;\n\t\tthis.resolver = RaziloBindCoreDetector.resolver(this.resolvable, this.node);\n\t\tthis.alterer = RaziloBindCoreDetector.resolver(this.alterable, this.node);\n\t\tthis.config = RaziloBindCoreDetector.resolver(this.configurable, this.node);\n\t\tthis.model = model;\n\n\t\t// resolve data to actuals and observables if of correct type or no types set\n\t\tif (this.resolver && (this.accepts.length === 0 || this.accepts.indexOf(this.resolver.name) >= 0)) this.update();\n\n\t\t// collate binders\n\t if (this.resolver.observers) for (let i = 0; i < this.resolver.observers.length; i++) if (this.observables.indexOf(this.resolver.observers[i]) < 0) this.observables.push(this.resolver.observers[i]);\n\t if (this.alterer.observers) for (let i = 0; i < this.alterer.observers.length; i++) if (this.observables.indexOf(this.alterer.observers[i]) < 0) this.observables.push(this.alterer.observers[i]);\n\t if (this.config.observers) for (let i = 0; i < this.config.observers.length; i++) if (this.observables.indexOf(this.config.observers[i]) < 0) this.observables.push(this.config.observers[i]);\n\n\t\treturn this;\n\t}", "get Model () {\n return Model\n }", "function create(composite, parameters) {\n var createOptions = _.extend({}, composite.options, options);\n this[composite.property] = new composite.model(parameters,\n createOptions);\n }", "function MaschineModel ()\n{\n this.sceneBank = new SceneBankProxy (16);\n}", "function Model(controller) {\n this.controller = controller;\n this.rooms = new Rooms(controller);\n this.sensors = new Sensors(controller);\n this.devices = new Devices(controller);\n this.rules = new Rules(controller);\n}", "model(params) {\n var store = this.get('store');\n\n var base = store.createRecord('components-examples/flexberry-dropdown/settings-example/base', {});\n\n return base;\n }", "function Model (){\n\t\tthis.isNew\t\t\t= true;\n\t\tthis.money \t\t\t= 0;\n\t\tthis.xp\t\t\t\t= 0;\n\t\tthis.name\t\t\t= \"neighbor\";\n\t\tthis.unlocked_task \t= {\n\t\t\t\"shearing\": true,\n\t\t\t\"eggsort\": false,\n\t\t\t\"stable\": false,\n\t\t\t\"pigpen\": false\n\t\t}\n\t\tthis.tractor_tier = 0;\n\t}", "function Models() {\n this.model = {};\n}", "createNew(languagePreference, modelDB, isInitialized) {\n const contentFactory = this.contentFactory;\n return new NotebookModel({\n languagePreference,\n contentFactory,\n modelDB,\n isInitialized\n });\n }", "static create (input) {\n // SCHEMA: this is the ideal place to throw on schema failure\n // const input = this.validate(input, Message.create)\n\n const instance = new this()\n Object.assign(instance, input)\n return instance\n }", "function Model(_scope, _pk) {\n this.$type = Model;\n this.$scope = _scope || Model;\n this.$pk = _pk;\n this.$initialize();\n }", "function createModel(inputs) {\n app.models.get(modelID).then(\n app.models.initModel(modelID).then(model.addConcepts({name})),\n app.models.create(modelID, [name]).then(trainModel)\n );\n }", "function DBModel(modelname) {\n this.init(modelname);\n}", "model(params) {\n let store = get(this, 'store');\n\n let base = store.createRecord('components-examples/flexberry-groupedit/shared/aggregator');\n return base;\n }", "set Model (Model) {\n Object.defineProperty(this, 'Model', {\n configurable: true,\n enumerale: true,\n value: Model,\n writable: true,\n })\n }", "function ModelHelper() {\n\t\t_classCallCheck(this, ModelHelper);\n\t}", "function newInstance(modelName, instanceData) {\n if (!modelName) throw '--- modelName is undefined ---';\n if (!ModelManager.exists(modelName)) throw ' --- throw modelName ' + modelName + ' is undefined --- ';\n var instanceId = ++lastId;\n var instanceContext = new instanceObj(instanceId, modelName, instanceData, new Set());\n instanceMap[instanceId] = instanceContext;\n return instanceContext;\n }", "_createResponseModel() {\n\n }", "function createModelStub(name) {\n const now = new Date();\n return {\n createdAt: now,\n id: (0, _v2.default)(),\n modelType: name,\n type: 'MODEL',\n updatedAt: now\n };\n}", "function Model(name) {\n this.name = name;\n this.color = \"\";\n}", "constructor() {\n\n this.format = require('string-format');\n this.lodash = require('lodash');\n\n this.verbs = this.mapVerbs();\n this.implementedAnnotations = this.mapImplementedAnnotations();\n this.types = this.mapTypes();\n this.formats = this.mapFormats();\n this.parametersIn = this.mapParametersIn();\n this.name = 'node';\n this.fileExtension = '.js';\n this._IDType = 'int';\n this.capitalizeModelName = true;\n this.capitalizePropertyName = true;\n this.destinationFolderPath = 'Models';\n this.projectName = 'App';\n this._IDPrefix = 'Id';\n this._IDType = 'int';\n this.models = [];\n this.arrayImplementer = '[]';\n }", "function Model() {\n this.status = {\n value: '',\n validValues: ['beginning', 'running', 'ended'],\n subscribers: [],\n };\n\n this.whoseTurn = {\n value: '',\n validValues: ['player-one', 'player-two'],\n subscribers: [],\n };\n\n this.result = {\n value: '',\n validValues: ['player-one-won', 'player-two-won'],\n subscribers: [],\n };\n\n // 1 = human/computer, 2 = human/human\n this.gameType = {\n value: 0,\n validValues: [1, 2],\n subscribers: [],\n };\n\n // player one avatar\n this.playerOneAvatar = {\n value: '',\n validValues: ['X', 'O'],\n subscribers: [],\n };\n\n // player two avatar\n this.playerTwoAvatar = {\n value: '',\n validValues: ['X', 'O'],\n subscribers: [],\n };\n\n // player one score\n this.playerOneScore = {\n value: 0,\n validValues: [],\n subscribers: [],\n };\n\n // player two avatar\n this.playerTwoScore = {\n value: 0,\n validValues: [],\n subscribers: [],\n };\n }", "_initModels() {}", "model() {\n return internal(this).model;\n }", "function build() {\n var Constructor, Instance;\n\n Constructor = function() {\n // Initialize a new instance, which won't do nothing but\n // inheriting the prototype.\n var instance = new Instance();\n\n // Apply the initializer on the given instance.\n instance.initialize.apply(instance, arguments);\n\n return instance;\n };\n\n // Define the function that will be used to\n // initialize the instance.\n Instance = function() {};\n Instance.prototype = Constructor.prototype;\n\n // Save some typing and make an alias to the prototype.\n Constructor.fn = Constructor.prototype;\n\n // Define a noop initializer.\n Constructor.fn.initialize = function() {};\n\n return Constructor;\n }", "static getInstance() {\n if (!this.__instance) {\n this.__instance = new ModelConverter();\n }\n return this.__instance;\n }", "constructor(urlScheme, Model = BaseModel, options={}) {\n if(Model && typeof Model !== 'function') {\n options = Model;\n Model = BaseModel;\n }\n\n this._urlScheme = URLScheme.fromString(urlScheme);\n\n const name = options.name || (Model === BaseModel ? '_' : Model.name);\n this._Model = Model;\n this.index = options.index || Symbol(`${name}.INDEX`);\n\n delete options.name;\n\n this._data = options.data || {};\n this._parameters = options.parameters || {};\n this._options = options;\n }", "model(params) {\n\n }", "create() {\n const entity = internal(this).entity;\n entity.create(); // Make sure the entity exists.\n const model = entity.model();\n internal(model).components.add(this);\n return this;\n }", "function init(model){\n\n }", "constructor () {\n this._model = null;\n this._formatter = null;\n this._config = this.constructor.defaultConfig();\n }", "function build() {\n var Constructor, Instance;\n\n Constructor = function() {\n // Initialize a new instance, which won't do nothing but\n // inheriting the prototype.\n var instance = new Instance();\n\n // Apply the initializer on the given instance.\n instance.initialize.apply( instance, arguments );\n\n return instance;\n };\n\n // Define the function that will be used to\n // initialize the instance.\n Instance = function() {};\n Instance.prototype = Constructor.prototype;\n\n // Save some typing and make an alias to the prototype.\n Constructor.fn = Constructor.prototype;\n\n // Define a noop initializer.\n Constructor.fn.initialize = function() {};\n\n return Constructor;\n }", "generateModels() {\n let models_constructor = new ModelConstructor(openapi_dictionary, guiModels);\n return models_constructor.generateModels(this.api.openapi);\n }", "function model(o, proto) { \n if(!(this instanceof model)) return new model(o, proto)\n \n o = o || {}\n this.properties = []\n for(var name in o) {\n model.addProperty(this, name, o[name])\n model.observeProperty(this, name)\n }\n \n var defaults = this.constructor.defaults\n \n for(var name in defaults) {\n if(name in o) continue\n var val = defaults[name]\n model.addProperty(this, name, val)\n model.observeProperty(this, name)\n }\n \n proto && extend(this, proto)\n this.initialize.call(this, o, proto)\n this.constructor.emit('create', this, o)\n}", "static create () {}", "function createModelModule() {\n\n /**\n * PiModel keeps track of next/current pi output and stuff.\n * @constructor\n */\n var PiModel = function() {\n var self = this;\n this.spigotCallback = function(digit) {\n self.digitCounter++;\n var toAppend = self.digitCounter == 2 ? \".\" + digit : digit;\n _.each(self.listeners, function(listener) {\n listener(\"NEW\", toAppend, self.digitCounter);\n });\n };\n this.spigot = new SpigotPi(this.spigotCallback);\n this.initial = this.spigot.save();\n this.digitCounter = 0;\n this.listeners = [];\n };\n\n _.extend(PiModel.prototype, {\n\n /**\n * Adds a listener to be notified of when the model changes.\n * @param listener_fn A function with the signature: (eventData),\n * where eventType is type of event, piAppend is string to be appended, countSet is digit count to be set.\n */\n addListener: function(listener_fn) {\n if (!_.isFunction(listener_fn)) {\n throw new Error(\"Invalid arguments to ImageModel.addListener: \" + JSON.stringify(arguments));\n }\n this.listeners.push(listener_fn);\n },\n\n /**\n * Removes the given listener from this object.\n * @param listener_fn\n */\n removeListener: function(listener_fn) {\n if (!_.isFunction(listener_fn)) {\n throw new Error(\"Invalid arguments to ImageModel.removeListener: \" + JSON.stringify(arguments));\n }\n this.listeners = _.without(this.listeners, listener_fn);\n },\n\n /*\n * Gen next pi digit.\n */\n nextDigit: function() {\n this.spigot.next_();\n },\n\n /*\n * Reset spigot\n */\n reset: function() {\n this.spigot.load(this.initial);\n this.digitCounter = 0;\n _.each(this.listeners, function(listener) {\n listener(\"RESET\", undefined, 0);\n });\n }\n });\n\n // Return an object containing all of our classes and constants\n return {\n PiModel: PiModel\n };\n}", "function Builder() {}", "function Builder() {}", "static getModel() {\n return routineModel;\n }", "function Person() {\n Model.apply(this, arguments);\n}", "constructor(init){\n Object.assign(this,init)\n this.type = 'entity'\n }", "constructor(model) {\n this.model = model;\n this.allModelsLoaded = false;\n }", "function newModel(path, dim, relSize) {\n model = new JsonRenderable(gl, program, \"../model/\" + path + \"/models/\", \"model.json\");\n if (!model)alert(\"No model could be read\");\n scene.addModel(model, dim, relSize);\n }", "constructor(model) {\n this._model = model;\n this.getOne = this.getOne.bind(this);\n this.getAll = this.getAll.bind(this);\n this.create = this.create.bind(this);\n this.destroy = this.destroy.bind(this);\n this.update = this.update.bind(this);\n }", "function getModel(is_expected) {\n if (typeof is_expected !== 'boolean') {\n is_expected = false;\n }\n return {\n name: 'test',\n type: 'object',\n seed: 123456789,\n data: { min, max, count: is_expected ? max : to.random(2, 10), inputs: {}, dependencies: [], },\n properties: {\n phones: {\n type: 'array',\n description: 'An array of phone numbers',\n items: {\n type: 'object',\n data: { min: 1, max: 3, count: 0, },\n properties: {\n type: {\n type: 'string',\n data: {\n build(documents, globals, inputs, faker, chance) { // eslint-disable-line\n return faker.random.arrayElement([ 'Home', 'Work', 'Mobile', 'Main', 'Other' ]);\n },\n },\n },\n phone_number: {\n type: 'string',\n data: {\n build(documents, globals, inputs, faker, chance) { // eslint-disable-line\n return faker.phone.phoneNumber().replace(/\\s*x[0-9]+$/, '');\n },\n },\n },\n extension: {\n type: 'string',\n data: {\n build(documents, globals, inputs, faker, chance) { // eslint-disable-line\n return chance.bool({ likelihood: 20 }) ? chance.integer({ min: 1000, max: 9999 }).toString() : null;\n },\n },\n },\n },\n },\n },\n },\n };\n }" ]
[ "0.7250482", "0.7250482", "0.70093375", "0.6923544", "0.67450756", "0.67220956", "0.6662518", "0.64658755", "0.63567436", "0.634368", "0.6336473", "0.6316182", "0.63027406", "0.62577987", "0.6220183", "0.6220183", "0.61887413", "0.6155591", "0.61268884", "0.6102393", "0.6085182", "0.6084268", "0.60747975", "0.6074715", "0.60746604", "0.60745776", "0.6040279", "0.60160476", "0.5971661", "0.59660506", "0.5956101", "0.59487206", "0.5946967", "0.5931725", "0.5904483", "0.59014064", "0.5885457", "0.581989", "0.5799145", "0.57920796", "0.5778459", "0.5777145", "0.57725775", "0.5769822", "0.576682", "0.57580847", "0.57129335", "0.5701135", "0.5683638", "0.5683638", "0.5662524", "0.5649829", "0.5646371", "0.56451", "0.56290984", "0.5606263", "0.55993384", "0.55959374", "0.55848026", "0.5579099", "0.55767787", "0.5548479", "0.55425584", "0.5541349", "0.5541194", "0.55257165", "0.5518892", "0.5515325", "0.55104303", "0.5508537", "0.55035096", "0.54980654", "0.54956317", "0.54910785", "0.54902846", "0.54848295", "0.5474441", "0.5473944", "0.54642665", "0.5454858", "0.5454249", "0.5441187", "0.54371834", "0.5433524", "0.5423094", "0.54159355", "0.5411167", "0.5402824", "0.539834", "0.5393314", "0.5392688", "0.53757143", "0.536862", "0.536862", "0.5366594", "0.5352022", "0.5347531", "0.5343243", "0.53416747", "0.5338562", "0.533373" ]
0.0
-1
! Vue.js v2.5.2 (c) 20142017 Evan You Released under the MIT License.
function r(t){return void 0===t||null===t}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "mounted() {\n }", "mounted() {\n\n }", "mounted() {\n\n }", "constructor() {\n this.vue = new Vue();\n }", "mounted() {\n /* eslint-disable no-console */\n console.log('Mounted!');\n /* eslint-enable no-console */\n }", "created () {\n\n }", "created () {\n\n }", "created() {\n this.$nuxt = true\n }", "function vueTest() {\n new Vue({\n \n el: '#vueApp',\n \n data: {\n \"hello\" : \"Spinning Parrot\",\n image: 'img/spinning-parrot.gif'\n }\n \n });\n }", "function Es(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"source.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "ready() {\n this.vm = new Vue({\n el: 'body',\n components: {\n rootvue: require('./vue'),\n },\n });\n }", "mounted() {\n console.log('Mounted!')\n }", "function BO(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"source.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function TM(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"source.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function jj(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"source.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "data() {\n return {};\n }", "install(Vue, options) {\n Vue.VERSION = 'v0.0.1';\n\n let userOptions = {...defaultOptions, ...options};\n // console.log(userOptions)\n\n // create a mixin\n Vue.mixin({\n // created() {\n // console.log(Vue.VERSION);\n // },\n\n\n });\n Vue.prototype.$italicHTML = function (text) {\n return '<i>' + text + '</i>';\n }\n Vue.prototype.$boldHTML = function (text) {\n return '<b>' + text + '</b>';\n }\n\n // define a global filter\n Vue.filter('preview', (value) => {\n if (!value) {\n return '';\n }\n return value.substring(0, userOptions.cutoff) + '...';\n })\n\n Vue.filter('localname', (value) => {\n if (!value) {\n return '';\n }\n var ln = value;\n if(value!= undefined){\n if ( value.lastIndexOf(\"#\") != -1) { ln = value.substr(value.lastIndexOf(\"#\")).substr(1)}\n else{ ln = value.substr(value.lastIndexOf(\"/\")).substr(1) }\n ln = ln.length == 0 ? value : ln\n }\n return ln\n })\n\n // add a custom directive\n Vue.directive('focus', {\n // When the bound element is inserted into the DOM...\n inserted: function (el) {\n // Focus the element\n el.focus();\n }\n })\n\n }", "function hM(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"interaction.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "created() { }", "created() { }", "created() {\n\n }", "created() {\n\n }", "created() {\n\n }", "created() {\n\n }", "function JV(e,t){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+e),t&&console.warn(t.stack))}", "function yh(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"graticule.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "created(){\n\n }", "created() {\n }", "created() {\n\n\t}", "created() {\n\n\t}", "created() {\n\n\t}", "created() {\n\n\t}", "created() {\n\n\t}", "created() {\n\n\t}", "created() {\n\n\t}", "created() {\n\n\t}", "created() {\n\n\t}", "created() {\n\n\t}", "created() {\n\n\t}", "mounted(){\n console.log('Mounted');\n }", "mounted() {\n this.initialize()\n }", "function PD(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function Qw(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "mounted() {\n console.log(this.element); // eslint-disable-line\n }", "function Uk(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function Ak(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function Ek(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function iP(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"source.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function cO(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"source.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function loadVue(){\n\n\tlisteObjBoutons = loadVueObjects();\n\n\tmvButtons = new Vue({\n\t\tel:\"#boutonsMots\",\n\t\tdata:{\n\t\t\tlisteMots:listeObjBoutons,\n\t\t\tsize: MOTS_NUMBER,\n\t\t\tetendu: (MOTS_NUMBER>4),\n\t\t\tdisplay:\"flex\"\n\t\t},\n\t\tmethods:{\n\t\t\ttestAnswer: verification,\n\t\t\treInit: function(){\n\t\t\t\tfor (let i = 0; i < this.listeMots.length; i++) {\n\t\t\t\t\tthis.listeMots[i].tvalue = false;\n\t\t\t\t\tthis.listeMots[i].fvalue = false;\n\t\t\t\t\tthis.listeMots[i].disabled = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\nmvNextButton = new Vue({\n\t\tel:\"#nextButton\",\n\t\tdata:{\n\t\t\tmessage : \"Image suivante\",\n\t\t\tdisplay: \"none\"\n\t\t},\n\t\tmethods:{\n\t\t\tnext: chargementImageMot,\n\t\t\tactive: function () {\n\t\t\t\tthis.display=\"block\";\n\t\t\t}\n\t\t}\n\t});\n}", "function jx(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function p(e,t){if(typeof console!==\"undefined\"){console.warn(\"[vue-i18n] \"+e);if(t){console.warn(t.stack)}}}", "function Wx(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function dp(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "created() {\r\n\r\n\t}", "function $S(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function hA(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function ow(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function vT(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"layer.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function __vue_normalize__(a,b,c,d,e){var f=(\"function\"==typeof c?c.options:c)||{};// For security concerns, we use only base name in production mode.\nreturn f.__file=\"/Users/hadefication/Packages/vue-chartisan/src/components/Pie.vue\",f.render||(f.render=a.render,f.staticRenderFns=a.staticRenderFns,f._compiled=!0,e&&(f.functional=!0)),f._scopeId=d,f}", "data() {\n return {\n saludocomponent: \"hola desde vue\"\n };\n }", "function annulerAffichage(){\r\n var app = new Vue({\r\n el: '#meteo',\r\n data: {\r\n message:'ATTENTION : probleme de geolocalisation veuillez l\\'activer dans votre navigateur'\r\n }\r\n })\r\n}", "ready() {\n let logCtrl = this.$logTextArea;\n let logListScrollToBottom = function () {\n setTimeout(function () {\n logCtrl.scrollTop = logCtrl.scrollHeight;\n }, 10);\n };\n\n\n window.plugin = new window.Vue({\n el: this.shadowRoot,\n created() {\n },\n init() {\n },\n data: {\n logView: \"\",\n findResName: \"\",\n },\n methods: {\n _addLog(str) {\n let time = new Date();\n // this.logView = \"[\" + time.toLocaleString() + \"]: \" + str + \"\\n\" + this.logView;\n this.logView += \"[\" + time.toLocaleString() + \"]: \" + str + \"\\n\";\n logListScrollToBottom();\n },\n onBtnClickFindReferenceRes() {\n console.log(\"1\");\n },\n onResNameChanged() {\n console.log(\"2\");\n },\n dropFile(event) {\n event.preventDefault();\n let files = event.dataTransfer.files;\n if (files.length > 0) {\n let file = files[0].path;\n console.log(file);\n } else {\n console.log(\"no file\");\n }\n },\n drag(event) {\n event.preventDefault();\n event.stopPropagation();\n // console.log(\"dragOver\");\n },\n\n }\n });\n }", "function initVue() {\n\n new Vue({\n\n el: \"#containerId\",\n data: {\n \"h1title\": 0,\n \"url\": \"img/scotland.jpeg\"\n }, // END OF DATA\n\n methods: {\n increase: function() {\n this.h1title++;\n }, // END OF INCREASE\n\n decrease: function() {\n this.h1title--;\n } // END OF DECREASE\n\n } // END OF METHODS\n }); // END OF VUE\n\n} // END OF FUNCTION initVue", "mounted() {\n this.local()\n }", "function vI(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"style.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function VI(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"layer.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function wl(e,t){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+e),t&&console.warn(t.stack))}", "registerVmProperty() {\n const { vmProperty, modules } = this.options;\n this.Vue.prototype[vmProperty] = modules;\n }", "mounted() {\n\t\tvar h = document.createElement('DIV');\n\t\th.innerHTML = `<div>this is create append child</div>`;\n\t\tdocument.body.appendChild(h);\n\t\tconsole.log('this is log vue mounted function ', this.$el, this , this.el);\n\t}", "function Vue(options) {\n var oberver = new Observer(options.data)\n var render = compile(options.el, oberver)\n render()\n}", "data() {\n return {\n saludo: '¡Hola! Soy Desiré, te saludo desde un componente'\n }\n }", "function Hr(e,t){\"undefined\"!==typeof console&&(console.warn(\"[vue-i18n] \"+e),t&&console.warn(t.stack))}", "function i(t,e){\"undefined\"!==typeof console&&(console.warn(\"[vue-i18n] \"+t),e&&console.warn(e.stack))}", "function i(t,e){\"undefined\"!==typeof console&&(console.warn(\"[vue-i18n] \"+t),e&&console.warn(e.stack))}", "function i(t,e){\"undefined\"!==typeof console&&(console.warn(\"[vue-i18n] \"+t),e&&console.warn(e.stack))}", "function i(t,e){\"undefined\"!==typeof console&&(console.warn(\"[vue-i18n] \"+t),e&&console.warn(e.stack))}", "function WD(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function a(e,t){'undefined'!=typeof console&&(console.warn('[vue-i18n] '+e),t&&console.warn(t.stack))}", "function la(e,t){if(typeof console!==\"undefined\"){console.warn(\"[vue-i18n] \"+e);if(t){console.warn(t.stack)}}}", "function i(t,e,n){if(o(t,e))return void(t[e]=n);if(t._isVue)return void i(t._data,e,n);var r=t.__ob__;if(!r)return void(t[e]=n);if(r.convert(e,n),r.dep.notify(),r.vms)for(var s=r.vms.length;s--;){var a=r.vms[s];a._proxy(e),a._digest()}return n}", "function i(t,e){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+t),e&&console.warn(e.stack))}", "function i(t,e){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+t),e&&console.warn(e.stack))}", "function Eu(t,e){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+t),e&&console.warn(e.stack))}", "function i(e,t){\"undefined\"!==typeof console&&(console.warn(\"[vue-i18n] \"+e),t&&console.warn(t.stack))}", "registerVmProperty() {\n const { vmProperty, modules } = this.options;\n this.registerError(modules);\n this.Vue.prototype[vmProperty] = modules;\n }", "function bn(t,e){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+t),e&&console.warn(e.stack))}", "mounted() {\n store.commit('updateHash');\n }", "function Ht(t,e){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+t),e&&console.warn(e.stack))}", "function i(e,t){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+e),t&&console.warn(t.stack))}", "ready() {\n this.vue = createVUE(this[\"$mainDiv\"]);\n Editor.log(\"ConvertHelper view ready\");\n }", "function q(e,t){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+e),t&&console.warn(t.stack))}", "function vt(e,t){if(!e){throw new Error(\"[vue-router] \"+t)}}", "function a(e,t){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+e),t&&console.warn(t.stack))}", "function a(e,t){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+e),t&&console.warn(t.stack))}", "install(vue) {\n \n vue.prototype.$renderer = this;\n vue.prototype.$engine = this.engine;\n \n vue.prototype.$start = this.start.bind(this);\n vue.prototype.$stop = this.stop.bind(this);\n vue.prototype.$pipe = this.pipe.bind(this);\n vue.prototype.$unpipe = this.unpipe.bind(this);\n }", "function ex(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"style.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "created () {\n this.classNames = this.getDefaultClassName(this.$options.name)\n }", "mounted() {\n let vm = this;\n\n vm.interval = null;\n vm.job = null;\n vm.editable = true;\n vm.rowId = null;\n vm.rowType = 'column';\n vm.refresh = false;\n $('#st-processsing-div').hide();\n\n show_loading('sample-template-contents');\n\n // Get the overview information from the server\n vm.updateSampleTemplateOverview();\n }", "install(vue) {\n /* globalize class */\n vue.prototype.$input = this;\n vue.prototype.$mouse = this.mouse;\n vue.prototype.$keyboard = this.keyboard;\n }", "init () {\n // config values are set in .env.[dev, test, production] files.\n // they can be overridden with a similar file with a .local extension.\n axios.defaults.baseURL = process.env.VUE_APP_API_URL\n axios.defaults.withCredentials = true\n axios.defaults.transformRequest = [\n function (data, header) {\n if (data && data._sendJSON) {\n return JSON.stringify(data)\n } else {\n let fdata = new FormData()\n for (let key in data) {\n if (typeof data[key] !== 'undefined') {\n fdata.append(key, data[key])\n }\n }\n return fdata\n }\n }\n ]\n\n axios.defaults.transformResponse = [\n function (data) {\n try {\n return JSON.parse(data)\n } catch {\n return data\n }\n }\n ]\n Vue.use(VueAxios, axios)\n }" ]
[ "0.6943217", "0.6901279", "0.6879416", "0.65494436", "0.6468856", "0.6391447", "0.6391447", "0.6340164", "0.63236547", "0.6313482", "0.6293663", "0.62686497", "0.6234844", "0.6215023", "0.6211317", "0.61953175", "0.61894226", "0.6187602", "0.61824423", "0.61824423", "0.6162535", "0.6162535", "0.6162535", "0.6162535", "0.6131043", "0.61208427", "0.6072767", "0.6046807", "0.60324705", "0.60324705", "0.60324705", "0.60324705", "0.60324705", "0.60324705", "0.60324705", "0.60324705", "0.60324705", "0.60324705", "0.60324705", "0.6027889", "0.6026976", "0.60199475", "0.60114694", "0.5997798", "0.59350747", "0.5907761", "0.5904526", "0.59018576", "0.59014857", "0.587239", "0.5869048", "0.58665264", "0.5860807", "0.58451253", "0.582079", "0.58020264", "0.5796686", "0.57940465", "0.57732826", "0.5767047", "0.5741793", "0.5739834", "0.57371956", "0.5727805", "0.57207406", "0.5709772", "0.5685859", "0.5673545", "0.567133", "0.56479037", "0.56457597", "0.56343174", "0.56250566", "0.5613668", "0.5613668", "0.5613668", "0.5613668", "0.5607961", "0.56070584", "0.55995864", "0.55878294", "0.55849624", "0.55849624", "0.55788964", "0.5575613", "0.5571194", "0.5569369", "0.5568677", "0.5562224", "0.55570614", "0.5554673", "0.55546606", "0.5542017", "0.55410236", "0.55410236", "0.5540226", "0.5518177", "0.55012906", "0.54981136", "0.54920316", "0.54908127" ]
0.0
-1
alert("screen" + screenwidth + "x" + screenheight); NAVIGATION
function hideAllMenus() { document.getElementById("menu1").style.display = "none"; document.getElementById("menu2").style.display = "none"; document.getElementById("menu3").style.display = "none"; document.getElementById("tableXContainer").style.display = "none"; document.getElementById("map-canvas2").style.display = "none"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getBom(){\n console.log(screen.width);\n console.log(screen.height);\n console.log(window.location);\n}", "function starting() {\n\tvar hpos = window.screenX;\n\tvar vpos = window.screenY;\n\talert (\"tonterias\");\n\talert( window.heigth +\",\"+ window.width );\n\twindow.resizeTo( resh, resv);\n\twindow.moveTo( hpos, vpos );\n\t\n}", "function getBom(){\r\nconsole.log(screen.Width);\r\n//console.log(window.innerWidth);//para ver la anchura de la ventana\r\n\r\nconsole.log(window.innerHeight);//para ver la altura de la ventana\r\n\r\nconsole.log(window.location.href);//para sacar la localizacion\r\n}", "function popupParams(width, height) {\r\n var a = typeof window.screenX != \"undefined\" ? window.screenX : window.screenLeft;\r\n var i = typeof window.screenY != \"undefined\" ? window.screenY : window.screenTop;\r\n var g = typeof window.outerWidth!=\"undefined\" ? window.outerWidth : document.documentElement.clientWidth;\r\n var f = typeof window.outerHeight != \"undefined\" ? window.outerHeight: (document.documentElement.clientHeight - 22);\r\n var h = (a < 0) ? window.screen.width + a : a;\r\n var left = parseInt(h + ((g - width) / 2), 10);\r\n var top = parseInt(i + ((f-height) / 2.5), 10);\r\n return \"width=\" + width + \",height=\" + height + \",left=\" + left + \",top=\" + top;\r\n}", "function ShowBrowserDimensions() {\n alert(\"Dimensions of document: \" + $(document).width() + \"x\" + $(document).height());\n alert(\"Dimensions of window: \" + $(window).width() + \"x\" + $(window).height());\n}", "function getBom(){\n\t//de browser\n\tconsole.log(window.innerHeight);//alto\n\tconsole.log(window.innerWidth);//ancho\n\t//de pc\n\tconsole.log(screen.height);\n\tconsole.log(screen.width);\n\n\tconsole.log(window.location);\n\n}", "function getBom(){\nconsole.log(window.innerHeight);// para ver el tamaño de la ventana (altura)\nconsole.log(window.innerWidth);// para ver el tamaño de la ventana (anchura)\nconsole.log(screen.width);// para ver el tamaño de la ventana (anchura) de otra forma\nconsole.log(screen.height);// para ver el tamaño de la ventana (anchura) de otra forma\nconsole.log(window.location.href);//para imprimir la url de donde estamos\n}", "function bom() {\r\n console.log(`Window ${window.innerHeight} ${window.innerWidth}`);\r\n console.log(`Screen ${screen.width} ${screen.height}`);\r\n console.log('Location', window.location);\r\n}", "function getBom(params) {\n console.log(window.innerWidth);\n console.log(window.innerHeight);\n\n console.log(screen.width);\n console.log(screen.height);\n console.log(window.location);\n}", "function getArea(w, h){\n //window.alert(\"Area=\" + (width*height))\n}", "function pantalla() {\n document.getElementById(\"divBom\").innerHTML = \"el ancho de pantalla es \" + screen.width + \" y el alto es \" + screen.height;\n}", "function popup_params(width, height) {\n\t\t\t\tvar x = typeof window.screenX != 'undefined' ? window.screenX : window.screenLeft;\n\t\t\t\tvar y = typeof window.screenY != 'undefined' ? window.screenY : window.screenTop;\n\t\t\t\tvar w = typeof window.outerWidth!='undefined' ? window.outerWidth : document.documentElement.clientWidth;\n\t\t\t\tvar h = typeof window.outerHeight != 'undefined' ? window.outerHeight: (document.documentElement.clientHeight - 22);\n\t\t\t\tvar X = (x < 0) ? window.screen.width + x : x;\n\n\t\t\t\tvar left = parseInt(X + ((w - width) / 2), 10);\n\t\t\t\tvar top = parseInt(y + ((h - height) / 2.5), 10);\n\t\t\t\tvar output = 'width=' + width + ',height=' + height + ',left=' + left + ',top=' + top + ',scrollbars=1';\n\t\t\t\treturn output;\n\t\t\t}", "function client_info() {\n let tinggi = document.body.clientHeight;\n let lebar = document.body.clientWidth;\n let screen_height = screen.height;\n let screen_width = screen.width;\n document.getElementById('tinggi').innerHTML = tinggi;\n document.getElementById('lebar').innerHTML = lebar;\n document.getElementById('screenH').innerHTML = screen_height;\n document.getElementById('screenW').innerHTML = screen_width;\n}", "function setScreen() {\n\t$('#workSpace').css(\"height\", window.innerHeight + 'px');\n}", "function resize_window() \n{\n\tw = $(window).width();\n\th = $(window).height();\n}", "getScreenSize(event) {\r\n this.scrHeight = window.innerHeight;\r\n }", "function getBom() {\n // console.log(window.innerHeight);\n // console.log(window.innerWidth);\n // console.log(screen.height);\n // console.log(screen.width);\n console.log(window.open)\n}", "function showXY(ev) {\n\tif (document.all) { ev = event; } \n\twindow.status = 'X: ' + ev.screenX + ' Y: ' + ev.screenY;\n\t}", "setup() {\r\n\t\tthis.midScreenX = width /2;\r\n\t\tthis.midScreenY = height /2;\r\n\t}", "function getbom(){\n console.log(window.innerHeight);\n console.log(window.innerWidth); \n console.log(window.location); //Objecto location ves las propiedades y imprimen las url que \n // en estas estan\n}", "function getResolution(){\n var width = $(window).width() - 100;\n var height = $(window).height() - 100;\n return [width, height];\n}", "_getWinSize(){return{width:document.documentElement.clientWidth,height:c.innerHeight}}", "function pageCalculations() {\r\n winW = $(window).width();\r\n winH = $(window).height();\r\n }", "function s(){var a=$(window).width();maxDrawerScreenSize>=a?p():q()}", "function displayWindowSize() {\n var win = $(window);\n $('.window-size').html('(' + win.width() + ', ' + win.height() + ')');\n //console.log(win.height());\n }", "getScreenSize(event) {\r\n this.scrWidth = window.innerWidth;\r\n }", "getScreenSize(event) {\r\n this.scrWidth = window.innerWidth;\r\n }", "function adjustGameStage() {\n //Vairiables to capture height and width values.\n valueHeight = window.innerHeight\n valueWidth = window.innerWidth\n\n //console.log(valueHeight, valueWidth)\n}", "function pageCalculations() {\n winW = $(window).width();\n winH = $(window).height();\n }", "function getWinSize() {\n winHeight = window.screen.height;\n winWidth = window.screen.width;\n}", "function setArea(){\r\n\tvar width = window.innerWidth;\r\n\t\r\n\t\r\n\t$(\".nav-desktop a\").css(\"font-size\", 21*width/1100);\r\n\t$(\".nav-desktop a span\").css(\"font-size\", 20*width/1100);\r\n\t\r\n\tif(320 <= width && width <= 1024)\r\n\t{\r\n\t\t$('#hamburger').css(\"display\", \"block\");\r\n\t\t$('.nav-desktop').css(\"display\", \"none\");\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$('#hamburger').css(\"display\", \"none\");\r\n\t\t$('.nav-desktop').css(\"display\", \"block\");\r\n\t}\r\n}", "function getBom(){\n //Ancho de la pantalla\n console.log(\"Ancho: \"+window.innerWidth);\n //Largo de la pantalla\n console.log(\"Largo: \"+window.innerHeight);\n //Saber que pagina esta cargando\n console.log(\"Pagina: \"+window.location);\n}", "function W() {\n return window.screen.width;\n}", "function pantallaDisponible() {\n document.getElementById(\"divBom\").innerHTML = \"el ancho de pantalla disponible es \" + screen.availWidth + \" y el alto disponible es \" + screen.availHeight;\n}", "function getBom() {\n // tamaño ventana usuario\n console.log(window.innerHeight);\n console.log(window.innerWidth);\n // tamaño pantalla usuario\n console.log(screen.height);\n console.log(screen.width);\n // objeto de location (href, port, origin...etc)\n console.log(window.location);\n}", "function windowHW() {\n return window.innerHeight>window.innerWidth?window.innerWidth:window.innerHeight-20;\n}", "function screen_resize() {\n var h = parseInt(window.innerHeight);\n var w = parseInt(window.innerWidth);\n\n if (w <= 800) {\n showShare();\n } else if (w > 800) {\n showShareDesktop();\n }\n}", "function top_calcul(){\r\n \r\n pose_menu();\r\n \r\n if(xsmall){\r\n top2=$('.g-head').innerHeight() + 524;\r\n }else{\r\n var cons=0;\r\n if(small){\r\n cons=170;\r\n }else if(md){\r\n cons=170;\r\n }else if(lg){\r\n cons=105;\r\n }\r\n //alert(cons);\r\n top2=$('.g-head').innerHeight() + $('.slide').innerHeight()-($('.sous-bloc').innerHeight()+cons);\r\n }\r\n }", "function showCoords(event) {\n var x = event.screenX; //Applies to the entire screen\n var y = event.screenY; //Applies to the entire screen\n // var x = event.clientX; //Applies to a Div or HTML element\n // var y = event.clientY; //Applies to a Div or HTML element\n console.log(x,y);\n return x,y;\n}", "function handleGameWindow(){\n height = window.innerHeight;\n width = window.innerWidth; \n console.log(height, width);\n}", "function setPage()\n{\n var winH = $(window).height();\n var winW = $(window).width();\n var winName = location.pathname.\n substring(location.pathname.lastIndexOf(\"/\") + 1);\n $('#rightofpage').css('height', winH-90);\n $('#rightofpage').css('width', winW-135);\n if(winName === \"board18Map.php\" || \n winName === \"board18Market.php\" || \n winName === \"board18SnapMap.php\" || \n winName === \"board18SnapMrk.php\") {\n $('#botleftofpage').css('height', winH-140);\n }\n else $('#leftofpage').css('height', winH-90);\n}", "function getWindowSize() {\n var sw = document.body.clientWidth;\n\tif (sw <= smWidth) {\n\t\tmedMenu(); \n\t\twindowState='small'; // we only have two menu configurations (medium & large)\n\t} else if (sw > smWidth && sw <= medWidth ) {\n\t\tmedMenu();\n\t} else {\n\t\tlrgMenu();\n\t}\n}", "function getBom()\n{\n /*Para ver el tamaño de la pantalla (altura)*/\n console.log(window.innerHeight);\n /*Para ver el ancho de la pantalla*/\n console.log(window.innerWidth);\n /*obtener la url actual */\n console.log(window.location);\n}", "function alert2 (info, size_factor, wratio) { // size_factor=0.5 gives window half size of screen, 0.33, a third size, etc.\r\n if (size_factor) sfactor=size_factor;\r\n if (wratio) widthratio=wratio;\r\n var swidth=screen.width*sfactor*widthratio, sheight=screen.height*sfactor;\r\n var popup=window.open(\"\",\"alert2\",\"scrollbars,\"\r\n\t\t\t +\", resizable=1,,location=no,menubar=no\"\r\n\t\t\t +\", personalbar=no, toolbar=no, status=no, addressbar=no\"\r\n\t\t\t +\", left=\"+(screen.width/2-swidth/2)+\",top=\"+(screen.height/2-sheight/1.5)\r\n\t\t\t +\", height=\"+sheight\r\n\t\t\t +\", width=\"+swidth\r\n\t\t\t );\r\n\t//log(\"sfactor \"+sfactor+ \"height=\"+sheight+\" top=\"+(sheight*sfactor)+ \", width=\"+swidth +\", left=\"+(swidth*sfactor));\r\n popup.document.body.innerHTML=\"<pre style='white-space: pre-wrap;'>\"+info+\"</pre>\";\r\n popup.focus();\r\n popup.document.addEventListener(\"keydown\", function(e) {\t if (e.keyCode == 27) popup.close();}, 0)\r\n return popup;\r\n }", "function showPosition() {\n var s = 'X=' + window.event.clientX + ' Y=' + window.event.clientY;\n\n alert(s);\n\n\n}", "function updateScreenSize(){\n\t\tvar w = window,\n\t\td = document,\n\t\te = d.documentElement,\n\t\tg = d.getElementsByTagName('body')[0],\n\t\tx = w.innerWidth || e.clientWidth || g.clientWidth,\n\t\ty = w.innerHeight|| e.clientHeight|| g.clientHeight;\n\t\tscreenSize.x = x;\n\t\tscreenSize.y = y;\n\t}", "function findWH() {\r\n\twinW = (is.ns)? window.innerWidth : document.body.offsetWidth-20\r\n\twinH = (is.ns)? window.innerHeight : document.body.offsetHeight-4\r\n}", "function getScreenWidth(){\n\tvar width = $('body').width();\n\t// Add class mobile to body \n\tif(width < 769){\n\t\t$('body').addClass('mobile');\n\t} else {\n\t\t//Open Up Left Tabs by Default on desktop\n\t\t$('#topology .wrap').addClass('expanded');\n\t}\n}", "function Start() {\n\tscreenRect = Rect(0,0,Screen.width, Screen.height);\n}", "function show_showinfo() {\n\t//alert( \"pageX: \" + event.pageX + \", pageY: \" + event.pageY );\n\tvar showinfo_width = $('#showinfo').width();\n\tvar showinfo_height = $('#showinfo').height();\n\n\tvar map_height = $('#main').height();\n\n\tvar showinfo_top = (map_height/2)-(showinfo_height/2);\n\tvar showinfo_left = (window_width/2)-(showinfo_width/2);\n\n\n\n\t$(\"#showinfo\").css({\n\t\t'top' : showinfo_top+'px',\n\t\t'left' : showinfo_left+'px'\n\t}).show();\n\n}", "function getScreenSize(){\n\tscreenHeight = $('#height').attr('value');\n\tscreenWidth = $('#width').attr('value');\n\taspectRatio = screenWidth / screenHeight;\n\treturn 0;\n}", "function alert2 (info, size_factor, wratio) { // size_factor=0.5 gives window half size of screen, 0.33, a third size, etc.\n if (size_factor) sfactor=size_factor;\n if (wratio) widthratio=wratio;\n var swidth=screen.width*sfactor*widthratio, sheight=screen.height*sfactor;\n var popup=window.open(\"\",\"alert2\",\"scrollbars,\"\n\t\t\t +\", resizable=1,,location=no,menubar=no\"\n\t\t\t +\", personalbar=no, toolbar=no, status=no, addressbar=no\"\n\t\t\t +\", left=\"+(screen.width/2-swidth/2)+\",top=\"+(screen.height/2-sheight/1.5)\n\t\t\t +\", height=\"+sheight\n\t\t\t +\", width=\"+swidth\n\t\t\t );\n\t//log(\"sfactor \"+sfactor+ \"height=\"+sheight+\" top=\"+(sheight*sfactor)+ \", width=\"+swidth +\", left=\"+(swidth*sfactor));\n popup.document.body.innerHTML=\"<pre style='white-space: pre-wrap;'>\"+info+\"</pre>\";\n popup.focus();\n popup.document.addEventListener(\"keydown\", function(e) {\t if (e.keyCode == 27) popup.close();}, 0)\n return popup;\n }", "function setWidthAndHeight() {\n \"use strict\";\n var height = window.innerHeight + 15;\n var width = window.innerWidth;\n $(\".sessionTracker\").css(\"height\", height).css(\"width\", width);\n}", "function c_screen(logical)\n{\n // '1 -' because computer display coords are upside down ^_^\n return ((1 - logical) * CHART_HEIGHT)>>0;\n}", "function getScreenSize() {\n var width = getScreenWidth();\n var height = getScreenHeight();\n\n //Check for Mobile\n if (width < 800) {\n return \"Mobile\";\n }\n //Check for Desktop Normal\n if (width > 799) {\n return \"Desktop\";\n }\n}", "function _0001485874502442_POS_screen_launches_maximised()\n{\n \n try { \n Log.AppendFolder(\"_0001485874502442_POS_screen_launches_maximised\");\n InitializationEnviornment.initiliaze(); \n AppLoginLogout.login(); \n var width = wnd.Width ; //1382\n var height = wnd.Height; // 742\n if(width >=1296 && height >= 742)\n {\n Log.Message(\"The POS launches with the maximum screen size by default.\");\n }else {\n merlinLogError(\"The POS IS NOT launches with the maximum screen size by default.\");\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 AppLoginLogout.logout();\n } \n}", "function getWindowScreenSize() {\n var _ActualWindowScreen = $(this).scrollTop();\n return Math.floor(actualWindowScreen / $scope.constants.SCREEN_DIVISOR) * $scope.constants.SCREEN_DIVISOR;\n}", "function setDimensions() {\n\t\n\t//get the dimensions of the window again\n\tw = window,\n d = document,\n e = d.documentElement,\n g = d.getElementsByTagName('body')[0],\n x = w.innerWidth || e.clientWidth || g.clientWidth,\n y = w.innerHeight || e.clientHeight || g.clientHeight;\n\n\t//set styles for the page elements\n\t$('#can').css('height', y);\n\t$('#can').css('width', '100%'); \n\t//$('.homeContent2').css('top', y); \n}", "function getScreenSize()\n{\n var viewportwidth;\n var viewportheight;\n\n\n if (typeof window.innerWidth !== 'undefined')\n {\n viewportwidth = window.innerWidth,\n viewportheight = window.innerHeight;\n } else if (typeof document.documentElement !== 'undefined'\n && typeof document.documentElement.clientWidth !==\n 'undefined' && document.documentElement.clientWidth !== 0)\n {\n viewportwidth = document.documentElement.clientWidth,\n viewportheight = document.documentElement.clientHeight;\n } else\n {\n viewportwidth = document.getElementsByTagName('body')[0].clientWidth,\n viewportheight = document.getElementsByTagName('body')[0].clientHeight;\n }\n return viewportwidth, viewportheight;\n}", "function detectScreenSize(){\n\tif($.browser.mobile || isTablet){\n\t\tif (window.matchMedia(\"(orientation: landscape)\").matches) {\n\t\t\tmodeW = stageW;\n\t\t\tmodeH = stageH;\n\t\t\treturn false;\n\t\t}else{\n\t\t\tmodeW = portraitW;\n\t\t\tmodeH = portraitH;\n\t\t\treturn true;\n\t\t}\n\t}else{\n\t\tmodeW = stageW;\n\t\tmodeH = stageH;\n\t\treturn false;\n\t\t/*if($(window).width() <= 768){\n\t\t\treturn true;\t\n\t\t}else{\n\t\t\treturn false;\t\n\t\t}*/\n\t}\n}", "function displayComputer(computer) {\r return computer.cpu+ \" \" + computer.screenSize;\r}", "function openDetails(Url)\n{ \n\t\n\tvar scheight=screen.height;\n\tvar scwidth=screen.width;\n\tvar w=window.open(Url, null, \"left=0,top=0,resize=0, height=\"+scheight+\", width=\"+scwidth);\n\tw.focus();\n\treturn false;\n}", "function setPage()\n{\n var winH = $(window).height();\n var winW = $(window).width();\n var winName = location.pathname.\n substring(location.pathname.lastIndexOf(\"/\") + 1);\n $('#restofpage').css('height', winH-90);\n $('#restofpage').css('width', winW);\n}", "function screen_center_pos(PopUpWidth, PopUpHeight)\n{\n\tvar Width = $(window).width()\n\n\tvar Height = $(window).height()\n\n\treturn({\n\t\tx : (Width/2 - PopUpWidth/2) , \n\t\ty : (Height/2 - PopUpHeight/2)\n\t})\n}", "function wH() {\r\n return window.innerHeight;\r\n}", "function getScreenSize() {\n\t\t\treturn window.innerWidth;\n\t\t} // end getScreenSize()", "function showCoords(event) {\n var x = event.clientX;\n\tvar y = event.clientY;\n\tvar sheight=screen.height;\n\tvar swidth=screen.width;\n\tperc=x/swidth*100;\n }", "function viewport() {\n var e = window, a = 'inner';\n if (!('innerWidth' in window )) {\n a = 'client';\n e = document.documentElement || document.body;\n }\n return { width : e[ a+'Width' ] , height : e[ a+'Height' ] };\n}", "function setScreenSize() {\n $container.css('height', $screenHeight); // updates the CSS with the current screen height\n $container.css('width', $screenWidth); // updates the CSS with the current screen width\n\n $box1.css('height', $screenHeight);\n $box1.css('width', $screenWidth);\n $box1.css('left', $screenWidth); // updates the CSS with the width from the right eg this used to be $screenWidth - 30 to show a bit of the div like a tile effect\n\n $box2.css('height', $screenHeight);\n $box2.css('width', $screenWidth);\n $box2.css('left', $screenWidth); // updates the CSS with the width from the right eg this used to be $screenWidth - 30 to show a bit of the div like a tile effect\n\n $box3.css('height', $screenHeight);\n $box3.css('width', $screenWidth);\n $box3.css('left', $screenWidth); // updates the CSS with the width from the right eg this used to be $screenWidth - 30 to show a bit of the div like a tile effect\n }", "function Browser_ScreenTop()\n{\n\t//window has screenTop?\n\tif (!isNaN(window.screenTop))\n\t{\n\t\t//use this one\n\t\treturn window.screenTop;\n\t}\n\telse\n\t{\n\t\t//try the screenY\n\t\treturn window.screenY;\n\t}\n}", "function pageLoad() {\n nSCV('hdnPageHgt', screen.height);\n}", "function ShowDetails(pageURL, windowName) {\r\r\r\n var nLeft, nTop, nWidth, nHeight;\r nWidth = 700;\r nHeight = 600;\r nLeft = screen.width - nWidth - 50;\r nTop = screen.height - nHeight - 100;\r Window1 = window.open(pageURL, windowName, \"dependent=yes,height=\" + nHeight + \",width=\" + nWidth + \",left=\" + nLeft + \",top=\" + nTop + \",location=no,menubar=no,resizable=yes,scrollbars=yes\");\r\r\r\n Window1.focus();\r\r\r\n}", "function PageDim(){\r\n//Get the page width and height\r\n\tthis.W = 600;\r\n\tthis.H = 400;\r\n\tthis.W = document.getElementsByTagName('body')[0].clientWidth;\r\n\tthis.H = document.getElementsByTagName('body')[0].clientHeight;\r\n}", "function _dispPLMScreen(navinfo)\r\n{\r\n\t_plmNav(navinfo);\r\n}", "function windowSize() {\n windowHeight = window.innerHeight ? window.innerHeight : $(window).height();\n windowWidth = window.innerWidth ? window.innerWidth : $(window).width();\n}", "function movetot(){\n console.log(123);\n // window.moveTo(0,0);\n window.resizeTo(2,2);\n}", "function getScreenWidth() {\n var width = window.innerWidth;\n return width;\n}", "function viewport() {\n var e = window,\n a = 'inner';\n if (!('innerWidth' in window)) {\n a = 'client';\n e = document.documentElement || document.body;\n }\n return {\n width: e[a + 'Width'],\n height: e[a + 'Height']\n }\n }", "function view_home_resize() {\n\t\t\n\t}", "function Screen() {\r\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 menuScreen() {\n if (currentPage === 'highscorepage') {\n $box2.animate({left: $screenWidth}, 150); // slides highscorepage back to original location hidden offscreen - 150 is the speed in mlilliseconds\n } else if (currentPage === 'creditspage') {\n $box3.animate({left: $screenWidth}, 150); // slides creditspage back to original location hidden offscreen - 150 is the speed in mlilliseconds\n } else {\n $box1.animate({left: $screenWidth}, 150); // slides playpage back to original location hidden offscreen - 150 is the speed in mlilliseconds\n }\n currentPage = 'menupage';\n }", "function Jt(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!Ge(e))return t;var a=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*a,right:t.right*a,top:t.top*n,bottom:t.bottom*n}}", "function resizeFunction() {\n alert(\"You have changed the size of the browser window\");\n}", "function getScreenSize(){\nvar body = document.body,\nhtml = document.documentElement;\nvar height = Math.max( body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight );\n\treturn height;\n}", "function viewport() {\n var e = window,\n a = 'inner';\n\n if (!('innerWidth' in window)) {\n a = 'client';\n e = document.documentElement || document.body;\n }\n return {\n width: e[a + 'Width'],\n height: e[a + 'Height']\n };\n }", "function screenWidth(){\r\n return window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth||0;\r\n }", "function fullScreenContainer() {\r\n\r\n var screenWidth = $(window).width() + \"px\";\r\n var screenHeight = '';\r\n if ($(window).height() > 500) {\r\n\tscreenHeight = $(window).height() + \"px\";\r\n }\r\n else {\r\n\tscreenHeight = \"500px\";\r\n }\r\n\r\n\r\n $(\"#intro, #intro .item\").css({\r\n\twidth: screenWidth,\r\n\theight: screenHeight\r\n });\r\n}", "function getNavBarName() {\n return $(window).height() >= (55/67) * $(window).width() - (325/67) ? \"SARA GW\" : \"SARA GOLDSTEIN-WEISS\";\n}", "function Browser_ScreenLeft()\n{\n\t//window has screenLeft?\n\tif (!isNaN(window.screenLeft))\n\t{\n\t\t//use this one\n\t\treturn window.screenLeft;\n\t}\n\telse\n\t{\n\t\t//try the screenX\n\t\treturn window.screenX;\n\t}\n}", "function fullScreenContainer() {\n\n var screenWidth = $(window).width() + \"px\";\n var screenHeight = '';\n if ($(window).height() > 500) {\n\tscreenHeight = $(window).height() + \"px\";\n }\n else {\n\tscreenHeight = \"500px\";\n }\n\n\n $(\"#intro, #intro .item\").css({\n\twidth: screenWidth,\n\theight: screenHeight\n });\n}", "function fullScreenContainer() {\n\n var screenWidth = $(window).width() + \"px\";\n var screenHeight = '';\n if ($(window).height() > 500) {\n\tscreenHeight = $(window).height() + \"px\";\n }\n else {\n\tscreenHeight = \"500px\";\n }\n\n\n $(\"#intro, #intro .item\").css({\n\twidth: screenWidth,\n\theight: screenHeight\n });\n}", "function _showPLMScreen(navinfo, actionmethod)\r\n{\r\n\t// alert(\"_showPLMScreen = \" + navinfo + \"\\nactionMethod:\" + actionmethod);\r\n\tnavInfo = navinfo;\r\n\tif(!actionmethod || actionmethod == \"\")\r\n\t{\r\n\t // Navigating directly to Fit eval overview screen\r\n\t _plmNavDefaultReload();\r\n\t}\r\n\telse\r\n\t{\r\n\t // Navigating to the Search screen\r\n\t _plmNavWithMethod(actionmethod);\r\n }\r\n}", "function getScreenSize(){\n if (lcmds.xrandr === null) {\n screen_size = { w: 1920, h: 1080 }\n }\n let databuf = \"\"\n let probespawn = spawn(\"sh\", [\"-c\",\"xrandr --current | grep '*+'\" ])\n probespawn.stdout.on('data', (data) => { databuf += data });\n probespawn.stderr.on('data', (data) => { console.log(\"stderr\",data.toString());});\n probespawn.on('exit', (code) => {\n //console.log(`probespawn exited with code ${code}`);\n //\n let s = databuf.trim().split(\"\\n\")\n s.forEach((item, i) => {\n s[i] = item.trim().split(\" \")\n s[i] = s[i][0].trim().split(\"x\")\n });\n //console.log(\"getScreenSize\",s[0]);\n screen_size = { w:parseInt(s[0][0]), h:parseInt(s[0][1]) }\n console.log(\"LSH computed screen size \", screen_size);\n })\n}", "function menusize() {\n var showmap = $(\"#showmap\").height(),\n menu = $(\"#menu\").height(),\n smallwin = win - 30,\n string = smallwin.toString() + \"px\";\n\n if (win * 0.035 < 30) {\n document.getElementById(\"showmap\").style.top = \"30px\";\n document.getElementById(\"showmap\").style.height = string;\n }\n }", "function saveResolutionToSession() {\r\n //var height = screen.height;\r\n //var width = screen.width;\r\n var height=document.documentElement.getBoundingClientRect().height;\r\n var width=document.documentElement.getBoundingClientRect().width;\r\n //#2887\r\n saveDataToSession(\"screenWidth\", width);\r\n saveDataToSession(\"screenHeight\", height);\r\n}", "findSize() {\n var height = window.innerHeight - 180;\n var width = window.innerWidth;\n this.csize = height/width > 1 ? Math.floor(0.9 * width / 4) : Math.floor(0.9 * height / 4);\n }", "function getSize() {\n setScreenHeight(window.innerHeight);\n setScreenWidth(window.innerWidth);\n }", "function getBackgroundRightPoint($window) {\n var windowWidth = $window.innerWidth;\n var windowHeight = $window.innerHeight;\n var rightHeight = windowHeight * rightPercent;\n return [\n windowWidth, // x\n rightHeight // y\n ];\n}", "function popupWindow(addr,popname,w,h,features) {\r\n var winl = (screen.width-w)/2;\r\n var wint = (screen.height-h)/2;\r\n if (winl < 0) winl = 0;\r\n if (wint < 0) wint = 0;\r\n var settings = 'height=' + h + ',';\r\n settings += 'width=' + w + ',';\r\n settings += 'top=' + wint + ',';\r\n settings += 'left=' + winl + ',';\r\n settings += features;\r\n win = window.open(addr,popname,settings);\r\n win.window.focus();\r\n}", "function getScreenHeight() {\n return screen.availHeight + 6;\n}" ]
[ "0.6858412", "0.67050314", "0.66744655", "0.6490168", "0.6460653", "0.64594173", "0.6424386", "0.63180405", "0.62979835", "0.62548226", "0.61987776", "0.6198234", "0.61946374", "0.61483264", "0.61412436", "0.61165553", "0.6107346", "0.60996777", "0.6095634", "0.60836464", "0.60820025", "0.6079217", "0.60570925", "0.605002", "0.6041403", "0.60357493", "0.60357493", "0.6016878", "0.59867513", "0.59864026", "0.59748745", "0.5959926", "0.59576786", "0.5953574", "0.5934705", "0.592628", "0.59180146", "0.59178346", "0.5902748", "0.58969504", "0.5896567", "0.58916867", "0.5885383", "0.58642656", "0.58624494", "0.5823549", "0.58059675", "0.5791867", "0.5784962", "0.5778293", "0.57730687", "0.5771677", "0.57640576", "0.57635754", "0.5738536", "0.5730473", "0.57225186", "0.5717842", "0.571734", "0.5714885", "0.5706548", "0.57030576", "0.5702296", "0.56959903", "0.5667941", "0.56484056", "0.564441", "0.5642637", "0.56421155", "0.5637368", "0.56314033", "0.56244963", "0.56224597", "0.56178236", "0.5611088", "0.5610541", "0.5608175", "0.56073964", "0.56065184", "0.5606446", "0.5594208", "0.5593327", "0.55927724", "0.5587836", "0.5583843", "0.5575605", "0.5575037", "0.55708945", "0.5570703", "0.5567427", "0.5557545", "0.5557545", "0.5548861", "0.5548165", "0.5546976", "0.5544599", "0.55324787", "0.55313593", "0.55259514", "0.5518472", "0.5518322" ]
0.0
-1
The study feature. variation: study info about particular client study variation studyUtils: the configured studyUtils singleton. reasonName: string of bootstrap.js startup/shutdown reason logLevel: the log level from Config.jsm ( uses same level as bootstrap.js)
constructor({variation, studyUtils, reasonName, logLevel}) { this.treatment = variation.name; this.studyUtils = studyUtils; this.reasonName = reasonName; // Randomize frame script URL due to bug 1051238. this.FRAME_SCRIPT_URL = `resource://${STUDY}/content/new-tab-variation.js?${Math.random()}`, this.XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; this.DOORHANGER_ID = "onboarding-trackingprotection-notification"; this.DOORHANGER_ICON = "chrome://browser/skin/tracking-protection-16.svg#enabled"; this.STYLESHEET_URL = `resource://${STUDY}/skin/tracking-protection-study.css`; this.PREF_TP_UI_ENABLED = "privacy.trackingprotection.ui.enabled"; this.TP_ENABLED_GLOBALLY = (this.treatment === "pseudo-control"); this.TP_ENABLED_IN_PRIVATE_WINDOWS = (this.treatment === "control"); this.PREF_TP_ENABLED_GLOBALLY = "privacy.trackingprotection.enabled"; this.PREF_TP_ENABLED_IN_PRIVATE_WINDOWS = "privacy.trackingprotection.pbmode.enabled"; this.init(logLevel); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getStudyState() {\n return this.study_state;\n }", "getStudyStatus() {\n return this.study_status;\n }", "function getScenario (name) {\n var scenario = { name: name }\n scenario.config = require(`../examples/${name}/webpack.config`)\n\n try {\n var manifest = require(`../examples/${name}/package`)\n scenario.deps = Object.keys(manifest.dependencies)\n } catch (e) {}\n\n return scenario\n}", "function STXStudies(){\n}", "function createVariation(variation){\n const durSecInterval = setInterval(function(){\n outputDurSec++;\n },1000);\n\n const headerMargin = windowW - d3.select('#header').node().clientWidth;\n d3.select('#header')\n .style('margin-left', '-'+(headerMargin/2)+'px')\n .style('margin-right', '-'+(headerMargin/2)+'px');\n\n const w = d3.select('#content-empathy').node().clientWidth;\n\n if(variation == 'narrative description'){\n createDescription();\n }\n\n d3.json(session).then(function(data){\n // console.log(data);\n\n /* VARIABLES */\n const mlScore = data.scores.globals.empathy;\n const percentOpenQuestions = data.scores.behaviorCounts.percentOpenQuestions.percentOpenQuestions;\n const closedQuestions = data.scores.behaviorCounts.percentOpenQuestions.closedQuestions;\n const openQuestions = data.scores.behaviorCounts.percentOpenQuestions.openQuestions;\n const percentComplexReflections = data.scores.behaviorCounts.percentComplexReflections.percentComplexReflections;\n const complexReflections = data.scores.behaviorCounts.percentComplexReflections.complexReflections;\n const simpleReflections = data.scores.behaviorCounts.percentComplexReflections.simpleReflections;\n\n const openArr = [];\n const closeArr = [];\n const complexArr = [];\n const simpleArr = [];\n\n data.session.talkTurn.forEach(function(d){\n d.influence = (Number(Math.random().toFixed(3))*2) - 1; // randomize influence scores per talk turn - placeholder for real output\n if(d.codes[0]=='QUO'){\n openArr.push({\n id: d.id,\n })\n }\n if(d.codes[0]=='QUC'){\n closeArr.push({\n id: d.id,\n })\n }\n if(d.codes[0]=='REC'){\n complexArr.push({\n id: d.id,\n })\n }\n if(d.codes[0]=='RES'){\n simpleArr.push({\n id: d.id,\n })\n }\n });\n\n /************* EMPATHY BARS *************/\n\n const svgEmpathy = d3.select('#content-empathy')\n .append('svg');\n\n svgEmpathy\n .attr('class','bars-empathy')\n .attr('id','svg-empathy')\n .attr('width',w)\n .attr('height',h);\n\n const mlScoreG = svgEmpathy\n .append('g')\n .attr('id','mlScoreG')\n .attr('transform','translate(0,160)');\n\n const userScoreG = svgEmpathy\n .append('g')\n .attr('id','userScoreG')\n .attr('transform','translate(0,40)');\n\n const userScoreT = userScoreG.append('text')\n .attr('class','textScore userScore')\n .attr('id','textScore-user')\n .attr('x','0px');\n userScoreT.append('tspan')\n .text('You rated the session ');\n userScoreT.append('tspan')\n .attr('id','userNum')\n .text(userScore)\n .style('font-weight','bold');\n\n userScoreG.append('rect')\n .attr('class','rect-background userScore');\n\n const mlScoreT = mlScoreG.append('text')\n .attr('class','textScore mlScore')\n .attr('id','textScore-ml')\n .attr('x','0px');\n mlScoreT.append('tspan')\n .text('The software rated the session ');\n mlScoreT.append('tspan')\n .attr('id','mlNum')\n .text(mlScore.toFixed(1))\n .style('font-weight','bold');\n mlScoreT.append('tspan')\n .attr('id','mlNumChange');\n\n mlScoreG.append('rect')\n .attr('class','rect-background mlScore');\n\n if(variation == 'confidence'){\n makeEmpathyBars(mlScore);\n makeConfidenceLabels(mlScore);\n }else{\n userScoreG.append('rect')\n .attr('class','rect-foreground userScore')\n .attr('id','userScore')\n .attr('width',scaleX(userScore));\n mlScoreG.append('rect')\n .attr('class','rect-foreground mlScore')\n .attr('id','mlScore')\n .attr('width',scaleX(mlScore));\n svgEmpathy.selectAll('.rect-foreground')\n .attr('height',barH+'px')\n .attr('x','0px')\n .attr('y',barY+'px');\n svgEmpathy.selectAll('.rect-background')\n .attr('y',barY+'px');\n };\n\n svgEmpathy.selectAll('.rect-background')\n .attr('width',barW+'px')\n .attr('height',barH+'px')\n .attr('x','0px');\n\n // append visual indicators for empathy score changes by user interaction\n if(variation == 'manipulation' || variation == 'influential n-grams'){\n mlScoreG.append('rect')\n .attr('class','rect-foreground mlScore mlScoreChange')\n .attr('id','scoreChangeNeg')\n .attr('x',0)\n .attr('width',scaleX(mlScore));\n mlScoreG.append('rect')\n .attr('class','rect-background mlScore mlScoreChange')\n .attr('id','scoreChangePos')\n .attr('x',scaleX(mlScore))\n .attr('width',scaleX(scoreMax-mlScore));\n mlScoreG.selectAll('.mlScoreChange')\n .attr('height',barH/10)\n .attr('y',barY+(9*barH/20));\n mlScoreG.append('circle')\n .attr('id','scoreChange')\n .attr('cx',scaleX(mlScore))\n .attr('cy',barY+(barH/2))\n .attr('r',barH/8)\n .style('opacity',0);\n }\n\n /************* LOWER LEFT CONTENT *************/\n\n if(variation == 'manipulation'){\n const sliderObj = {\n openPerc: percentOpenQuestions,\n openCount: openQuestions,\n closedCount: closedQuestions,\n complexPerc: percentComplexReflections,\n complexCount: complexReflections,\n simpleCount: simpleReflections\n };\n const questionsObj = {\n open: openArr,\n close: closeArr\n };\n const reflectionsObj = {\n complex: complexArr,\n simple: simpleArr\n };\n createSliders(sliderObj,questionsObj,reflectionsObj,mlScore,w);\n\n }else if(variation == 'confidence' || variation == 'narrative description'){\n d3.select('#content-empathy')\n .append('h6')\n .attr('id','title-aboutAlg')\n .html('ABOUT THE SOFTWARE');\n d3.select('#content-empathy')\n .append('p')\n .attr('id','desc-aboutAlg')\n .style('width',barW+'px')\n .html(aboutAlg);\n }else if(variation == 'influential n-grams'){\n influenceLegend(data.session.talkTurn);\n }\n\n /************** SESSION TRANSCRIPT **************/\n\n d3.select('#content-session')\n .append('p')\n .attr('id','transcript-desc')\n .style('font-size','12px')\n .style('width',barW+'px')\n .style('margin-top','30px')\n .html('Here is a software-generated transcript of the role-played session.')\n\n if(variation == 'influential n-grams'){\n d3.select('#transcript-desc')\n .html('Here is a software-generated transcript of the role-played session. ' +\n 'Click the buttons below to see how changing the ' +\n 'most influential words and phrases to all pro-empathy or anti-empathy affect the empathy score.')\n influenceFunctionality(mlScore);\n }\n\n d3.select('#content-session')\n .append('div')\n .attr('id','container-session');\n d3.select('#content-session')\n .append('div')\n .attr('id','manipulation-tracking');\n\n // text for each talk turn\n d3.select('#container-session').selectAll('.session-text')\n .data(data.session.talkTurn)\n .enter()\n .append('div')\n .attr('class',function(d){\n if(d.speaker == 'therapist'){\n return 'session-div therapist-div';\n }\n else{\n return 'session-div client-div';\n }\n })\n .append('text')\n .attr('class',function(d){\n if(d.speaker == 'therapist' && d.codes[0]=='QUO'){\n return 'session-text therapist-text openQ-text';\n }\n else if(d.speaker == 'therapist' && d.codes[0]=='REC'){\n return 'session-text therapist-text complexR-text';\n }\n else if(d.speaker == 'therapist'){\n return 'session-text therapist-text';\n }\n else{\n return 'session-text client-text';\n }\n })\n .attr('id',function(d){\n return d.speaker + '-' + d.id;\n })\n .append('tspan')\n .text(function(d){\n if(d.speaker == 'therapist'){\n return 't: ';\n }else{\n return 'c: ';\n }\n })\n\n d3.selectAll('.session-text')\n .append('tspan')\n .attr('class',function(d){\n return d.speaker + '-original';\n })\n .attr('id',function(d){\n return d.speaker + '-original-' + d.id;\n })\n // commented code below indicated bolded text in transcript\n // .classed('in-scope',function(d){\n // if(session == sessionGood){\n // if(d.id >= 74 && d.id <= 119){\n // return true;\n // }else{ return false; }\n // }else if(session == sessionBad){\n // if(d.id >= 51 && d.id <= 88){\n // return true;\n // }else{ return false; }\n // }\n // })\n .html(function(d){\n if(d.speaker == 'therapist'){\n return d.asrText;\n }else{\n return d.asrText;\n }\n });\n\n if(variation == 'similar sessions'){\n similarSessions();\n d3.select('#container-session')\n .style('height','480px');\n }\n else if(variation == 'influential n-grams'){\n d3.select('#container-session')\n .style('margin-top','30px')\n .style('height','470px');\n influenceInTranscript();\n influence();\n }\n else if(variation == 'narrative description'){\n d3.select('#container-session')\n .style('height','450px');\n }else if(variation == 'confidence'){\n d3.select('#container-session')\n .style('height','470px');\n }else if(variation == 'manipulation'){\n d3.select('#container-session')\n .style('height','560px');\n d3.select('#manipulation-tracking')\n .style('top',function(){\n var rect = document.getElementById('container-session').getBoundingClientRect(),\n greaterRect = document.getElementById('content-session').getBoundingClientRect(),\n \t scrollTop = window.pageYOffset || document.documentElement.scrollTop;\n return (rect.top - greaterRect.top + scrollTop) + 'px';\n })\n .style('height','560px');\n trackingH = document.getElementById('manipulation-tracking').clientHeight;\n trackingW = document.getElementById('manipulation-tracking').clientWidth;\n d3.select('#manipulation-tracking')\n .append('svg')\n .attr('id','tracking-svg')\n .attr('width',trackingW)\n .attr('height',trackingH);\n d3.select('#btn-to-survey')\n .style('position','relative')\n .style('top','-160px');\n }\n\n });\n\n var generateId = function () {\n return '_' + Math.random().toString(36).substr(2, 9);\n };\n\n // data storage\n dataObj.user = generateId();\n dataObj.rating = rating;\n dataObj.session = sessionType;\n dataObj.listenTime = +listenMaxDur.toFixed(0);\n dataObj.variation = variation.replace(/ /g,\"_\");\n // currently omitting ip address capture\n // d3.json('http://api.db-ip.com/v2/free/self', function(data) {\n // dataObj.ip = data.ipAddress;\n // });\n\n d3.select('#btn-to-survey')\n .style('color','black')\n .on('click',function(){\n dataObj.interactionCount = interaction;\n dataObj.outputTime = outputDurSec;\n clearInterval(durSecInterval);\n d3.select('#modal-next')\n .style('display','block');\n })\n\n // modal content\n d3.select('#modal-next').selectAll('.modal-body')\n .append('p')\n .style('font-size','14px')\n .style('text-align','center')\n .style('margin-top','40px')\n .html('You will now be directed to the survey site.');\n\n d3.select('#modal-next').selectAll('.modal-body')\n .append('a')\n .attr('id','modal-content-btn')\n .attr('class','btn')\n .html('okay')\n .on('click',function(){\n d3.select(this).attr('href','https://sri.utah.edu/epnew/bypass/anon.jsp?gid=4196738'+\n '&randomsessionid=' + dataObj.user +\n // '&ip=' + dataObj.ip +\n '&empathy=' + dataObj.rating +\n '&sessiongoodbad=' + dataObj.session +\n '&listentime=' + dataObj.listenTime +\n '&variation=' + dataObj.variation +\n '&timespentlooking=' + dataObj.outputTime +\n '&interactioncount=' + dataObj.interactionCount);\n });\n\n}", "function C012_AfterClass_Roommates_TestIsolationSarah() {\n\tif (GameLogQuery(CurrentChapter, \"Sarah\", \"IsolationTalk\")) {\n\t\tOverridenIntroText = GetText(\"NoIsolationIntroSarah\");\n\t\tC012_AfterClass_Roommates_CurrentStage = 210;\n\t} else GameLogAdd(\"IsolationTalk\");\n}", "featureEXAMPLE(config,data) {\n if(data.additional && data.additional.exampleQuery) { //the query key in the config set to \"exampleQuery\"\n return { value: `${data.additional.exampleQuery[0].apps} apps reporting`, tooltip: `There could be even more detail here`}\n }\n }", "quickFacts(){\n console.log(`${this.name} educates ${this.numberOfStudents} students at the ${this.level} level.`);\n }", "getLevel(feature) {\n return feature.properties.level;\n }", "function sensspecnew(){ \n d3.select(\"#info5\")\n .text(\"Sensitivity: \" + round(((1-tprThreshold)*100), 0) + \"%\");\n \n d3.select(\"#info6\")\n .text(\"Specificity: \" + round(((1-fprThreshold)*100), 0) + \"%\");\n }", "function Scenario (name)\n{\n\tthis.Name = name;\n\tthis.Armies = [];\t\n}", "function assessPerformance() {\n\t/* Function to calculate the \"credit_var\", which is a boolean used to\n\tcredit individual experiments in expfactory. \n\t */\n\n\t// Extrait les trials correspondant aux essais\n\t//\n\tjsPsych.data.displayData()\n\n\t// Filtre les trials correspondant à des réponses pendant la phase de test\n\t//\n\tvar experiment_data = jsPsych.data.get().filter({exp_stage:'test', trial_id:'stim'})\n\t//\n\t// Calcule \t1. Le nombre de réponses correctes\n\t//\t\t\t2. Le nombre de réponses incorrectes\n\t//\t\t\t3. Le nombre d'absence de réponses (RT = 0)\n\t//\t\t\t4. La médiane de l'ensemble des temps de réaction\n\t//\t\t\t5. Les médianes selon les 4 possibilités de cue\n\t//\t\t\t6. Les médianes selon les 2 possibilités de flanker (car neutre exclu)\n\t//\n\tvar correct_count = 0\n\tvar incorrect_count = 0\n\tvar omission_count = 0\n\tvar rt_correct = []\n\tvar rt_correct_nocue = []\n\tvar rt_correct_double = []\n\tvar rt_correct_spatial = []\n\tvar rt_correct_center = []\n\tvar rt_correct_congruent = []\n\tvar rt_correct_incongruent = []\n\t\n\tfor (var i=0; i<experiment_data.count(); i++) {\t\t\t\t\t\t\t\n\t\trt = experiment_data.select('rt').values[i]\n\t\tif (rt == 0) {\n\t\t\tomission_count++\n\t\t}\n\t\telse if (experiment_data.select('correct').values[i] === true) {\n\t\t\t\tcorrect_count++\n\t\t\t\trt_correct.push(rt)\n\t\t\t\t//\n\t\t\t\tswitch (experiment_data.select('cue').values[i]) {\n\t\t\t\t\tcase 'nocue':\n\t\t\t\t\t\trt_correct_nocue.push(rt)\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'double':\n\t\t\t\t\t\trt_correct_double.push(rt)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'spatial':\n\t\t\t\t\t\trt_correct_spatial.push(rt)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'center':\n\t\t\t\t\t\trt_correct_center.push(rt)\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t//\n\t\t\t\tswitch (experiment_data.select('flanker_type').values[i]) {\n\t\t\t\t\tcase 'congruent':\n\t\t\t\t\t\trt_correct_congruent.push(rt)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'incongruent':\n\t\t\t\t\t\trt_correct_incongruent.push(rt)\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse { incorrect_count++ }\n\t}\n\t\n\tif (rt_correct!=0) {\n\t\tvar median_rt = math.median(rt_correct)\n\t\tvar se_rt = median_rt/math.sqrt(correct_count)\n\t} else {\n\t\tvar median_rt = -999\n\t\tvar se_rt = -999\n\t}\n\t\n\tif (rt_correct_nocue.length!=0) {\n\t\tvar median_nocue = math.median(rt_correct_nocue)\n\t} else { var median_nocue = -999 }\n\n\tif (rt_correct_double.length!=0) {\n\t\tvar median_double = math.median(rt_correct_double)\n\t} else { var median_double = -999 }\n\n\tif (rt_correct_center.length!=0) {\n\t\tvar median_center = math.median(rt_correct_center)\n\t} else { var median_center = -999 }\n\n\tif (rt_correct_spatial.length!=0) {\n\t\tvar median_spatial = math.median(rt_correct_spatial)\n\t} else { var median_spatial = -999 }\n\n\tif (rt_correct_congruent.length!=0) {\n\t\tvar median_congruent = math.median(rt_correct_congruent)\n\t} else { var median_congruent = -999 }\n\n\tif (rt_correct_incongruent.length!=0) {\n\t\tvar median_incongruent = math.median(rt_correct_incongruent)\n\t} else { var median_incongruent = -999 }\n\n\t// Sortie provisoire sur la console\n\t//\n\tconsole.log(\"Nombre d'omissions: \", omission_count)\n\tconsole.log(\"Nombre de réponses: \", correct_count + incorrect_count)\n\tconsole.log(\"Nombre de réponses correctes au total: \", correct_count)\n\tconsole.log(\"Nombre d'erreurs au total: \", incorrect_count)\n\tconsole.log(\"Médianes des RT pour réponses correctes: \", median_rt)\n\tconsole.log(\"ES des médianes des RT pour les réponses correctes: \", se_rt)\n//\n\tif (median_nocue==-999 || median_double==-999) {\n\t\tconsole.log(\"La variable Alerte ne peut être calculée...\")\n\t} else { console.log(\"Alerte: \", median_nocue - median_double) }\n//\n\tif (median_center==-999 || median_spatial==-999) {\n\t\tconsole.log(\"La variable Orientation ne peut être calculée...\")\n\t} else { console.log(\"Orientation: \", median_center - median_spatial) }\n//\n\tif (median_incongruent==-999 || median_congruent==-999) {\n\t\tconsole.log(\"La variable Conflict ne peut être calculée...\")\n\t} else { console.log(\"Conflict: \", median_incongruent - median_congruent) }\n}", "getSnippet() {\n // if (this.is('verb')) {\n // return this.getPrincipalParts()\n // }\n\n /* Which variant to highlight? */\n let chosen_variant_to_show = [];\n let variants_matched = [];\n this.rows.forEach((row) => {\n if (row.variant_matched) {\n variants_matched.push(row);\n }\n });\n variants_matched = variants_matched.sort((a, b) => {\n return (\n b.should_be_taught +\n b.correctness_grade_of_inflectional_form +\n b.correctness_grade_of_word -\n (a.should_be_taught +\n a.correctness_grade_of_inflectional_form +\n a.correctness_grade_of_word)\n );\n });\n if (variants_matched.length > 0) {\n chosen_variant_to_show =\n variants_matched[0].inflectional_form_categories.filter(\n (i) => !isNumber(i)\n );\n }\n\n return this.getSingleTable({\n returnAsString: true,\n give_me: chosen_variant_to_show,\n });\n }", "function getScenarioSelection() {\n //check selected scenarios\n if (scenarioUpdateFlag) {\n \tselectedScenarios = \"\";\n\t if (exhibit._registry._registry.facet.f1 != null && exhibit._registry._registry.facet.f1._selections.length > 0) {\n\t\t //list selected facet values as { value1: true, value2: true }\n\t\t var valueObj = exhibit._registry._registry.facet.f1._selections;\n\t\t for (var i = 0; i < valueObj.length; i++) { \n\t\t \tchildrenNames = \"\";\n\t\t \tselectedScenarios += getDeepestChildren(valueObj[i].value, getScenarioTree());\n\t\t } \n\t\t if (selectedScenarios.charAt(selectedScenarios.length-1) == \";\")\n\t\t \tselectedScenarios = selectedScenarios.substring(0, selectedScenarios.length-1);\t \n\t } \n\t if (selectedScenarios == \"\") selectedScenarios = \"-\"; \n\t scenarioUpdateFlag = false;\n }\n\treturn selectedScenarios;\n}", "function displayVariation(varObj) {\r\n}\t// end of displayVariation", "makeSamplingDecision(options, traceId) {\n // If users set a specific sampler in the TraceOptions, use it.\n if (options && options.samplingRate !== undefined &&\n options.samplingRate !== null) {\n return sampler_1.SamplerBuilder.getSampler(options.samplingRate)\n .shouldSample(traceId);\n }\n let propagatedSample = null;\n // if there is a context propagation, keep the decision\n if (options && options.spanContext && options.spanContext.options) {\n propagatedSample =\n ((options.spanContext.options & this.IS_SAMPLED) !== 0);\n }\n let sampleDecision = !!propagatedSample;\n if (!sampleDecision) {\n // Use the default global sampler\n sampleDecision = this.sampler.shouldSample(traceId);\n }\n return sampleDecision;\n }", "function init_conf()\n {\n //----------------------------------\n // //\\\\ study model parameters\n //----------------------------------\n var APP_MODEL_Y_RANGE = 1000;\n //----------------------------------\n // \\\\// study model parameters\n //----------------------------------\n\n\n //====================================================\n // //\\\\ subapp regim switches\n //====================================================\n sconf.enableStudylab = false;\n sconf.enableTools = false;\n //====================================================\n // \\\\// subapp regim switches\n //====================================================\n\n\n //----------------------------------\n // //\\\\ original material parameters\n //----------------------------------\n var pictureWidth = 504;\n var pictureHeight = 495;\n\n var pointA = [ 28, 456 ];\n var pointe = [ 28, 46 ];\n\n var modorInPicX = pointA[0];\n var modorInPicY = pointA[1]; \n //.set it from graph editor\n var pictureActiveArea = pointA[1] - 46;\n //----------------------------------\n // \\\\// original material parameters\n //----------------------------------\n var mod2inn_scale = pictureActiveArea / APP_MODEL_Y_RANGE;\n var originX_onPicture = pointA[0];\n var originY_onPicture = pointA[1];\n\n\n\n\n\n //----------------------------------------------------\n // //\\\\ prepares sconf data holder\n //----------------------------------------------------\n //-----------------------------------\n // //\\\\ topic group colors,\n // todm: possibly proliferation\n //-----------------------------------\n sconf.default_tp_lightness = 30;\n var given = [0, 150, 0, ]; //0.5];\n var proof = [0, 0, 255, ]; //0.5];\n var result = [200, 40, 0, ]; //0.5];\n var hidden = [0, 0, 0, ]; //0];\n\n\n var predefinedTopics =\n {\n given,\n proof,\n result,\n hidden,\n\n //:curves\n \"ABC\" : given,\n \"mainCurve\" : given,\n \"Abc\" : proof,\n \"remoteCurve\" : proof,\n\n //:areas\n \"ABD\" : given,\n \"ACE\" : given,\n \"area-ABD\" : given,\n \"area-ACE\" : given,\n \"Abd\" : proof,\n \"Ace\" : proof,\n \"area-Abd\" : proof,\n \"area-Ace\" : proof,\n //:linear areas\n \"Afd\" : result,\n \"Age\" : result,\n\n \"ABDPerACE\" : given,\n \"AD2PerAE2\" : result,\n };\n //-----------------------------------\n // \\\\// topic group colors,\n //-----------------------------------\n\n\n var originalPoints =\n {\n 'A' : { \n pos : pointA,\n pcolor : given,\n letterAngle : -90,\n },\n 'e' : { \n pos : pointe,\n pcolor : proof,\n letterAngle : 90,\n },\n\n 'B' : { \n pcolor : given,\n letterAngle : 0,\n },\n 'C' : { \n pcolor : given,\n letterAngle : -45,\n },\n 'D' : { \n pcolor : given,\n letterAngle : 215,\n },\n 'E' : { \n pcolor : given,\n letterAngle : 180,\n },\n 'b' : { \n pcolor : proof,\n letterAngle : 0,\n },\n 'c' : { \n pcolor : proof,\n letterAngle : -90,\n },\n 'd' : { \n pcolor : proof,\n letterAngle : 180,\n },\n\n 'F' : { \n pcolor : given,\n letterAngle : 135,\n },\n 'G' : { \n pcolor : given,\n letterAngle : 45,\n },\n 'f' : { \n pcolor : proof,\n letterAngle : 90,\n },\n 'g' : { \n pcolor : proof,\n letterAngle : 90,\n },\n\n 'pivotPoint1' : { \n pcolor : result,\n doPaintPname : false,\n letterAngle : 90,\n },\n\n 'pivotPoint2' : {\n pcolor : given,\n letterAngle : 90,\n doPaintPname : false,\n },\n };\n\n var linesArray =\n [\n { 'Ab' : { pcolor : proof } },\n { 'Ac' : { pcolor : proof } },\n { 'Ad' : { pcolor : result } },\n { 'Ae' : { pcolor : result, 'stroke-width' : 3, } },\n\n { 'Ag' : { pcolor : result, 'stroke-width' : 3, } },\n\n { 'ec' : { pcolor : proof } },\n { 'db' : { pcolor : proof } },\n\n { 'AB' : { pcolor : given } },\n { 'AC' : { pcolor : given } },\n { 'AD' : { pcolor : given } },\n { 'AE' : { pcolor : given, 'stroke-width' : 3, } },\n { 'AG' : { pcolor : given } },\n { 'EC' : { pcolor : given } },\n { 'DB' : { pcolor : given } },\n ];\n\n\n to_sconf =\n {\n //----------------------------------\n // //\\\\ scenario\n //----------------------------------\n hideProofSlider : true, // false,\n hideProofSliderCompletely : false,\n //----------------------------------\n // \\\\// scenario\n //----------------------------------\n\n\n //----------------------------------\n // //\\\\ original lemma parameters\n //----------------------------------\n curvePivots :\n [\n [0, 0],\n //[326.8, 715.3],\n //[326.8*1.05, 742*1.05],\n\n [270.19, 612.8],\n\n //[72.29, 621.2],\n\n //[1516.1, 569.9]\n //[1516.1, 495] //tmp\n [ 1060, 567 ]\n /* very good for debug: simple curve\n [0, 0],\n [500, 1000],\n [1000, 0]\n */\n ],\n\n\n //*************************************************\n // //\\\\ lemma model parameters\n //*************************************************\n APP_MODEL_Y_RANGE,\n //:ranges\n tanA_min : 0.1, //pivot1x/pivot1y minimum\n pivot1y_max : APP_MODEL_Y_RANGE * 0.99,\n pivot2x_max : APP_MODEL_Y_RANGE * 1.8,\n pivot2y_min : APP_MODEL_Y_RANGE * 0.3,\n pivot2y_max : APP_MODEL_Y_RANGE * 0.99,\n\n\n //bezier parameter t of point C on principal curve\n //tC : 0.5, //good for debug\n tC : 0.50077 / 0.79 ,\n\n claimRatio : 0.74081,\n //range:\n claimRatio_max : 0.9, //Dy_per_Ey\n\n\n tiltRatio : 1, //controls DB-line tilt: \n //1 is perpendicular; < 1 dy/dx is negative, > 1 is positive\n //:ranges\n tiltRatio_min : 0.4,\n tiltRatio_max : 1.5,\n Ep2yrange_max : 0.8,\n Cx_min : 0.1,\n //*************************************************\n // \\\\// lemma model parameters\n //*************************************************\n //----------------------------------\n // \\\\// original lemma parameters\n //----------------------------------\n\n\n\n //----------------------------------\n // //\\\\ model-view parameters\n //----------------------------------\n //100; //display in \"percents\" of Ae\n LEGEND_NUMERICAL_SCALE : 100,\n\n modorInPicX,\n modorInPicY,\n innerMediaHeight : pictureHeight + sconf.SLIDERS_LEGEND_HEIGHT,\n innerMediaWidth : pictureWidth,\n\n thickness : 4,\n //----------------------------------\n // \\\\// model-view parameters\n //----------------------------------\n };\n to_sconf.areaScale = 1 / to_sconf.APP_MODEL_Y_RANGE / to_sconf.APP_MODEL_Y_RANGE;\n //----------------------------------\n // \\\\// prepares sconf data holder\n //----------------------------------------------------\n\n\n\n //----------------------------------------------------\n // //\\\\ copy-pastes to sconf\n //----------------------------------------------------\n //making size to better fit lemma's diagram\n fconf.LETTER_FONT_SIZE_PER_1000 = 30;\n\n paste( sconf,\n paste( to_sconf,\n {\n //double back step ../../ is to reuse this path in code for twin-lemma\n mediaBgImage : \"../../b1sec1lemma9/img/lemma9-original.png\",\n\n linesArray,\n predefinedTopics,\n originalPoints,\n originX_onPicture,\n originY_onPicture,\n pictureWidth,\n pictureHeight,\n mod2inn_scale,\n })\n );\n //----------------------------------------------------\n // \\\\// copy-pastes to sconf\n //----------------------------------------------------\n }", "static lancerScenario(){\n Plateau.message = \"Début de la partie\";\n Plateau.initDisplay();\n Plateau.currentPlayer=-1;\n }", "function getProbeFeatures(){\r\n\r\n\t\t\tvar list = [[settings.stimulus_large, settings.colorred, 0],\r\n\t\t\t\t\t\t[settings.stimulus_large, settings.colorred, 90],\r\n\t\t\t\t\t\t[settings.stimulus_large, settings.colorblue, 0],\r\n\t\t\t\t\t\t[settings.stimulus_large, settings.colorblue, 90]];\r\n\t\t\tvar weight = [0.25, 0.3125, 0.1875, 0.25];\r\n\t\t\tvar weighed_list = general.generateWeighedList(list, weight);\r\n\t\t\tvar random_num = general.rand(0, weighed_list.length-1);\r\n\t\t\treturn weighed_list[random_num];\r\n\t}", "function extractScenario(strIn) {\n // get first word on line\n if (strIn.trim().startsWith('Scenario:') || strIn.trim().startsWith('scenario:')) {\n return strIn.trim().substring(9).trim()\n } else if (strIn.trim().startsWith('Scenario Outline:') || strIn.trim().startsWith('scenario outline:')) {\n return strIn.trim().substring(17).trim()\n }\n return '';\n}", "set_variables_to_experiment() {\n console.log(\"set_variables_to_experiment\");\n this.curr_conditions_constants = this.experiment_conditions_constants;\n this.curr_condition_index = 0;\n this.curr_round_num = 0;\n this.input_count_array = new Array(this.curr_conditions_constants[0].trials_per_round).fill(0);\n this.is_practice = false;\n }", "function StudyViewerFactory($filter, EntityViewer, gettextCatalog) {\n\n function StudyViewer(study) {\n var ev = new EntityViewer(study, 'Study');\n\n ev.addAttribute(gettextCatalog.getString('Name'), study.name);\n ev.addAttribute(gettextCatalog.getString('Description'), $filter('truncate')(study.description, 60));\n ev.addAttribute(gettextCatalog.getString('State'), study.state.toUpperCase());\n\n ev.showModal();\n }\n\n return StudyViewer;\n}", "getName() {\n return \"DensePriceVariationPrediction\";\n }", "getName() {\n return \"DensePriceVariationPrediction\";\n }", "static readRandomSentence(theme) {\r\n console.log(Main.firstPartlistImpl.readRandomThemedPart(theme) + Main.secondPartListImpl.readRandomPart() + Main.thirdPartListImpl.readRandomPart()); \r\n }", "function DASFeature() {}", "get details() {\n if (this._researchSubject.researchStudy && this._researchSubject.researchStudy.commentOrDescription) {\n return this._researchSubject.researchStudy.commentOrDescription.value;\n } else {\n return \"\";\n }\n }", "extractStudyDetails(studiesIntersected) {\n var localSearchResultsStudies = [];\n for (var i = 0; i < studiesIntersected.length; i++) {\n var studyHit = this.studyDict[studiesIntersected[i]];\n localSearchResultsStudies.push({\n resultType: \"study\",\n id: studyHit.studyId,\n title: studyHit.name,\n description: studyHit.description\n });\n }\n return localSearchResultsStudies;\n }", "function specStarted(spec) {\n _scenariooReporter.default.scenarioStarted(options, spec.description);\n }", "function modeSpecific()\n\t{\n\t\tif (problem.get('ansType') === 'multiPart')\n\t\t{\n\t\t\tif (!view.showingSolution)\n\t\t\t{\n\t\t\t\tview.stepMode();\n\t\t\t\tvar steps = fw.getWidget('stepByStep');\n\t\t\t\tsteps.showCompleted();\n\t\t\t\tsteps.show();\t\t\t// They're not visible at this point (though most pieces are)\n\t\t\t}\n\t\t}\n\t}", "get defaultVariationId() {\n return this.defaultVariation.id;\n }", "get title() {\n if (this._researchSubject.researchStudy && this._researchSubject.researchStudy.title) {\n return this._researchSubject.researchStudy.title;\n } else {\n return null;\n }\n }", "function aspirateSample(scope){\n\taspirate_flag=true;\n\tif(current_test==0){\n\t\tmachine_stage.getChildByName(\"test_1\").text = beaker_values[current_test_beaker_number-1]+\" ppm\";\n\t\tchangeFlame(1);\n\t}\n\telse{\n\t\tmachine_stage.getChildByName(\"test_1\").text = beaker_values[current_test_beaker_number-1]+\" ppm\";\n\t\tchangeFlame(0);\n\t\tif(current_test_beaker_number == 1){\n\t\t\tchangeFlame(1);\n\t\t} \n\t}\n}", "introduce(withDetail) {\n\t\tsuper.introduce(); // Call the super class introduce instance method.\n\n\t\tconsole.log(Array.isArray(withDetail))\n\t\t// console.log(`I can write ${this.programmingLanguages}`) : console.log(\"Wrong input\")\n\t}", "static impactLight()\n\t\t{\n\t\t\tthis.impact(ImpactFeedbackStyle.Light);\n\t\t}", "function StudyFactory($q,\n $log,\n biobankApi,\n ConcurrencySafeEntity,\n DomainError,\n StudyState,\n AnnotationType,\n HasAnnotationTypes) {\n\n /**\n * Used for validating plain objects.\n */\n var schema = {\n 'id': 'Study',\n 'type': 'object',\n 'properties': {\n 'id': { 'type': 'string' },\n 'version': { 'type': 'integer', 'minimum': 0 },\n 'timeAdded': { 'type': 'string' },\n 'timeModified': { 'type': [ 'string', 'null' ] },\n 'name': { 'type': 'string' },\n 'description': { 'type': [ 'string', 'null' ] },\n 'annotationTypes': { 'type': 'array' },\n 'state': { 'type': 'string' }\n },\n 'required': [ 'id', 'version', 'timeAdded', 'name', 'state' ]\n };\n\n /**\n * Use this contructor to create a new Study to be persited on the server. Use {@link\n * domain.studies.Study.create|create()} or {@link domain.studies.Study.asyncCreate|asyncCreate()} to\n * create objects returned by the server.\n *\n * @class\n * @memberOf domain.studies\n * @extends domain.ConcurrencySafeEntity\n *\n * @classdesc A Study represents a collection of participants and specimens collected for a particular\n * research study.\n *\n * @param {object} [obj={}] - An initialization object whose properties are the same as the members from\n * this class. Objects of this type are usually returned by the server's REST API.\n */\n function Study(obj) {\n\n /**\n * A short identifying name that is unique.\n *\n * @name domain.studies.Study#name\n * @type {string}\n */\n this.name = '';\n\n /**\n * An optional description that can provide additional details on the name.\n *\n * @name domain.studies.Study#description\n * @type {string}\n * @default null\n */\n\n /**\n * The annotation types associated with participants of this study.\n *\n * @name domain.studies.Study#annotationTypes\n * @type {Array<domain.AnnotationType>}\n */\n this.annotationTypes = [];\n\n /**\n * The state can be one of: enabled, disabled, or retired.\n *\n * @name domain.studies.Study#state\n * @type {domain.studies.StudyState}\n */\n this.state = StudyState.DISABLED;\n\n obj = obj || {};\n ConcurrencySafeEntity.call(this);\n _.extend(this, obj);\n\n this.annotationTypes = _.map(this.annotationTypes, function (annotationType) {\n return new AnnotationType(annotationType);\n });\n }\n\n Study.prototype = Object.create(ConcurrencySafeEntity.prototype);\n _.extend(Study.prototype, HasAnnotationTypes.prototype);\n\n Study.prototype.constructor = Study;\n\n /**\n * Checks if <tt>obj</tt> has valid properties to construct a {@link domain.studies.Study|Study}.\n *\n * @param {object} [obj={}] - An initialization object whose properties are the same as the members from\n * this class. Objects of this type are usually returned by the server's REST API.\n *\n * @returns {domain.Validation} The validation passes if <tt>obj</tt> has a valid schema.\n */\n Study.validate = function (obj) {\n if (!tv4.validate(obj, schema)) {\n $log.error('invalid object from server: ' + tv4.error);\n return { valid: false, message: 'invalid object from server: ' + tv4.error };\n }\n\n obj.annotationTypes = obj.annotationTypes || {};\n\n if (!HasAnnotationTypes.prototype.validAnnotationTypes(obj.annotationTypes)) {\n return { valid: false, message: 'invalid object from server: bad annotation types: ' + tv4.error };\n }\n\n return { valid: true, message: null };\n };\n\n /**\n * Creates a Study, but first it validates <code>obj</code> to ensure that it has a valid schema.\n *\n * @param {object} [obj={}] - An initialization object whose properties are the same as the members from\n * this class. Objects of this type are usually returned by the server's REST API.\n *\n * @returns {domain.studies.Study} A study created from the given object.\n *\n * @see {@link domain.studies.Study.asyncCreate|asyncCreate()} when you need to create\n * a study within asynchronous code.\n */\n Study.create = function (obj) {\n var validation = Study.validate(obj);\n if (!validation.valid) {\n $log.error(validation.message);\n throw new DomainError(validation.message);\n }\n return new Study(obj);\n };\n\n /**\n * Creates a Study from a server reply, but first validates that <tt>obj</tt> has a valid schema.\n * <i>Meant to be called from within promise code.</i>\n *\n * @param {object} [obj={}] - An initialization object whose properties are the same as the members from\n * this class. Objects of this type are usually returned by the server's REST API.\n *\n * @returns {Promise<domain.studies.Study>} A study wrapped in a promise.\n *\n * @see {@link domain.studies.Study.create|create()} when not creating a Study within asynchronous code.\n */\n Study.asyncCreate = function (obj) {\n var deferred = $q.defer(),\n validation = Study.validate(obj);\n if (!validation.valid) {\n $log.error(validation.message);\n deferred.reject(validation.message);\n } else {\n deferred.resolve(new Study(obj));\n }\n\n return deferred.promise;\n };\n\n /**\n * Retrieves a Study from the server.\n *\n * @param {string} id the ID of the study to retrieve.\n *\n * @returns {Promise<domain.studies.Study>} The study within a promise.\n */\n Study.get = function (id) {\n return biobankApi.get(uri(id)).then(function(reply) {\n return Study.asyncCreate(reply);\n });\n };\n\n /**\n * Used to list studies.\n *\n * <p>A paged API is used to list studies. See below for more details.</p>\n *\n * @param {object} options - The options to use to list studies.\n *\n * @param {string} [options.filter] The filter to use on study names. Default is empty string.\n *\n * @param {string} [options.sort=name] Studies can be sorted by <code>name</code> or by\n * <code>state</code>. Values other than these two yield an error. Use a minus sign prefix to sort\n * in descending order.\n *\n * @param {int} [options.page=1] If the total results are longer than limit, then page selects which\n * studies should be returned. If an invalid value is used then the response is an error.\n *\n * @param {int} [options.limit=10] The total number of studies to return per page. The maximum page size\n * is 10. If a value larger than 10 is used then the response is an error.\n *\n * @returns {Promise} A promise of {@link biobank.domain.PagedResult} with items of type {@link\n * domain.studies.Study}.\n */\n Study.list = function (options) {\n var url = uri(),\n params,\n validKeys = [\n 'filter',\n 'sort',\n 'page',\n 'limit'\n ];\n\n options = options || {};\n params = _.omitBy(_.pick(options, validKeys), function (value) {\n return value === '';\n });\n\n return biobankApi.get(url, params).then(function(reply) {\n // reply is a paged result\n var deferred = $q.defer();\n try {\n reply.items = _.map(reply.items, function(obj){\n return Study.create(obj);\n });\n deferred.resolve(reply);\n } catch (e) {\n deferred.reject('invalid studies from server');\n }\n return deferred.promise;\n });\n };\n\n /**\n * @typedef domain.studies.StudyNameDto\n * @type object\n * @property {String} id - the study's identity\n * @property {String} name - the study's name\n * @property {String} state - the study's state\n */\n\n /**\n * Returns the names of all the studies in the system.\n *\n * @returns {Promise<Array<domain.studies.StudyNameDto>>} The names of the studies in the system.\n */\n Study.names = function () {\n return biobankApi.get('/studies/names');\n };\n\n /**\n * Adds a study.\n *\n * @return {Promise<domain.studies.Study>} A promise containing the study that was created.\n */\n Study.prototype.add = function () {\n var json = _.pick(this, 'name', 'description');\n return biobankApi.post(uri(), json).then(function(reply) {\n return Study.asyncCreate(reply);\n });\n };\n\n /**\n * Creates a Study from a server reply but first validates that it has a valid schema.\n *\n * <p>A wrapper for {@link domian.studies.Study#asyncCreate}.</p>\n *\n * @param {object} obj - the object to take initial values from.\n *\n * @returns {domain.studies.Study} A new Study object.\n *\n * @see {@link domain.ConcurrencySafeEntity#update}\n */\n Study.prototype.asyncCreate = function (obj) {\n return Study.asyncCreate(obj);\n };\n\n\n /**\n * Updates the Study's name.\n *\n * @param {String} name - The new name to give this study.\n *\n * @returns {Promise<domain.studies.Study>} A promise containing the study with the new name.\n */\n Study.prototype.updateName = function (name) {\n return this.update.call(this, uri('name', this.id), { name: name });\n };\n\n /**\n * Updates the Study's description.\n *\n * @param {String} description - The new description to give this study. When description is\n * <code>falsy</code>, the description will be cleared.\n *\n * @returns {Promise<domain.studies.Study>} A promise containing the study with the new description.\n */\n Study.prototype.updateDescription = function (description) {\n return this.update.call(this,\n uri('description', this.id),\n description ? { description: description } : {});\n };\n\n /**\n * Adds an annotation type to be used on participants of this study.\n *\n * @param {domain.AnnotationType} annotationType - the annotation type to add to this study.\n *\n * @returns {Promise<domain.studies.Study>} A promise containing the study with the new annotation type.\n */\n Study.prototype.addAnnotationType = function (annotationType) {\n return this.update.call(this,\n uri('pannottype', this.id),\n _.omit(annotationType, 'uniqueId'));\n };\n\n /**\n * Updates an existing annotation type for a participant.\n *\n * @param {domain.AnnotationType} annotationType - the annotation type with the new values.\n *\n * @returns {Promise<domain.studies.Study>} A promise containing the study with the updated annotation\n * type.\n */\n Study.prototype.updateAnnotationType = function (annotationType) {\n return this.update.call(this,\n uri('pannottype', this.id) + '/' + annotationType.uniqueId,\n annotationType);\n };\n\n /**\n * Removes an existing annotation type for a participant.\n *\n * @param {domain.AnnotationType} annotationType - the annotation type to remove.\n *\n * @returns {Promise<domain.studies.Study>} A promise containing the study with the removed annotation\n * type.\n */\n Study.prototype.removeAnnotationType = function (annotationType) {\n var url = sprintf.sprintf('%s/%d/%s',\n uri('pannottype', this.id), this.version, annotationType.uniqueId);\n return HasAnnotationTypes.prototype.removeAnnotationType.call(this, annotationType, url);\n };\n\n /**\n * Disables a study.\n *\n * @throws An error if the study is already disabled.\n *\n * @returns {Promise<domain.studies.Study>} A promise containing the study with the new state.\n */\n Study.prototype.disable = function () {\n if (this.isDisabled()) {\n throw new DomainError('already disabled');\n }\n return changeState.call(this, 'disable');\n };\n\n /**\n * Enables a study.\n *\n * @throws An error if the study is already enabled.\n *\n * @returns {Promise<domain.studies.Study>} A promise containing the study with the new state.\n */\n Study.prototype.enable = function () {\n if (this.isEnabled()) {\n throw new DomainError('already enabled');\n }\n return changeState.call(this, 'enable');\n };\n\n /**\n * Retires a study.\n *\n * @throws An error if the study is already retired.\n *\n * @returns {Promise<domain.studies.Study>} A promise containing the study with the new state.\n */\n Study.prototype.retire = function () {\n if (this.isRetired()) {\n throw new DomainError('already retired');\n }\n return changeState.call(this, 'retire');\n };\n\n /**\n * Unretires a study. The study will be in <code>disabled</code> state after it is unretired.\n *\n * @throws An error if the study is not retired.\n *\n * @returns {Promise<domain.studies.Study>} A promise containing the study with the new state.\n */\n Study.prototype.unretire = function () {\n if (!this.isRetired()) {\n throw new DomainError('not retired');\n }\n return changeState.call(this, 'unretire');\n };\n\n /**\n * Used to query the study's current state.\n *\n * @returns {boolean} <code>true</code> if the study is in <code>disabled</code> state.\n */\n Study.prototype.isDisabled = function () {\n return (this.state === StudyState.DISABLED);\n };\n\n /**\n * Used to query the study's current state.\n *\n * @returns {boolean} <code>true</code> if the study is in <code>enabled</code> state.\n */\n Study.prototype.isEnabled = function () {\n return (this.state === StudyState.ENABLED);\n };\n\n /**\n * Used to query the study's current state.\n *\n * @returns {boolean} <code>true</code> if the study is in <code>retired</code> state.\n */\n Study.prototype.isRetired = function () {\n return (this.state === StudyState.RETIRED);\n };\n\n /**\n * Returns all locations for all the centres associated with this study.\n *\n * @returns {Promise<Array<domain.centres.CentreLocationDto>>} A promise.\n *\n * @see [Centre.centreLocationToNames()]{@link domain.centres.Centre.centreLocationToNames}\n */\n Study.prototype.allLocations = function () {\n return biobankApi.get('/studies/centres/' + this.id);\n };\n\n function changeState(state) {\n /* jshint validthis:true */\n var self = this,\n json = { expectedVersion: self.version };\n\n return biobankApi.post(uri(state, self.id), json).then(function (reply) {\n return Study.asyncCreate(reply);\n });\n }\n\n function uri(/* path, studyId */) {\n var args = _.toArray(arguments),\n studyId,\n path,\n result = '/studies/';\n\n if (args.length > 0) {\n path = args.shift();\n result += path;\n }\n\n if (args.length > 0) {\n studyId = args.shift();\n result += '/' + studyId;\n }\n\n return result;\n }\n\n return Study;\n }", "function selectJarScenario(jarScenarioId, jarScenarioName) {\n\tselectedJarScenarioId = jarScenarioId;\n\tselectedJarScenarioName = jarScenarioName;\n\tgetJarScenario();\n}", "function new_scenario() {\n\t\tselect_functions(f_type_target,f_type_hypothesis);\n\t let target_function = f_target(true_weight),\n\t predicted_function = f_hypothesis(w_hat);\n\n\t let target = gen_function_data(target_function,NTARGET,XMIN,XMAX),\n\t noisefree_data = gen_function_data_random_x(target_function,nData,XMAX,XMIN),\n\t noise = gen_noise(nData),\n\t data = corrupt_data(noisefree_data, noise);\n\t weights = linspace(WMIN,WMAX,NWEIGHT),\n\t error_data = mse(weights,data),\n\t\t\tpointwise_error = square_error(data, predicted_function)\n\t hypothesis = [] ;\n\t if (w_hat !== '') {\n\t hypothesis = gen_function_data(predicted_function,NTARGET,XMIN,XMAX);\n\t\t\t}\n\t\t\t\n\t return {target:target, \n\t noisefree_data:noisefree_data,\n\t noise:noise,\n\t data:data, \n\t weights:weights, \n\t error_data:error_data,\n\t pointwise_error:pointwise_error,\n\t\t\t\thypothesis:hypothesis};\n\t}", "function inject() {\n if (!sox.location.on('github.com/soscripted/sox') || sox.location.on('feature_request')) return;\n const issue = document.querySelector('#issue_body');\n if (!issue) return;\n const environmentText = `**Environment**\nSOX version: ${version}\nPlatform: ${handler}`;\n\n let issueText = issue.value;\n issueText = issueText.replace(/..Environment..\\n.*?Tampermonkey\\)/, environmentText); // inject environment details\n issueText += '\\n---\\n\\n### Features Enabled \\n\\n ' + JSON.stringify(sox.settings.load());\n issue.value = issueText;\n }", "prepare_experiment() {\n let dataset = this.raw_sub_conds;\n \n this.sub_condition_order = balance_subconditions(this.balancing_type, this.constructor.name.toLowerCase(), dataset.length);\n\n let ordered_dataset = [];\n // Order the data set according to the randomly ordered array\n for (let i = 0; i < this.sub_condition_order.length; i++) {\n ordered_dataset[i] = dataset[this.sub_condition_order[i]];\n }\n // Set experiment trials\n this.experiment_conditions_constants = ordered_dataset;\n console.log(\"experiment_conditions_constants\");\n console.log(JSON.stringify(this.experiment_conditions_constants));\n }", "get defaultVariation() {\n // We don't have to check invalid itemData because we've filtered them out when initialize.\n return this.catalogItemObj.itemData.variations[0];\n }", "function C001_BeforeClass_Sidney_Run() {\n\tBuildInteraction(C001_BeforeClass_Sidney_CurrentStage);\n}", "setStudyState(aStudyState) {\n this.study_state= aStudyState;\n }", "scenarioOne() {\n const companyPreference = {\n c1: \"s1\",\n c2: \"s2\"\n };\n const studentPreference = {\n s1: \"c1\",\n s2: \"c2\"\n };\n InterviewScheduling.setInterview(companyPreference, studentPreference);\n }", "async myStudies(parent, args, ctx, info) {\n // check if the user has permission to see all users\n if (!ctx.request.userId) {\n throw new Error(\"You must be logged in\");\n }\n\n // query parameters where author is the current user\n return ctx.db.query.studies(\n {\n where: {\n AND: [\n {\n OR: [{ isHidden: null }, { isHidden: false }],\n },\n {\n OR: [\n {\n author: {\n id: ctx.request.userId,\n },\n },\n {\n collaborators_some: {\n id: ctx.request.userId,\n },\n },\n ],\n },\n ],\n },\n orderBy: \"createdAt_DESC\",\n },\n info\n );\n }", "determinePersonality() {\n // reset our chicken probability\n this.chickenThreshold = config.BOT_CHICKEN_THRESHOLD;\n this.chicken = false;\n\n // then check what we should do.\n this.analyse();\n }", "static getStudyInSession(opencgaSession, studyId) {\n let study = {};\n for (const p of opencgaSession?.projects) {\n for (const s of p.studies) {\n if (s.id === studyId || s.fqn === studyId) {\n study = s;\n break;\n }\n }\n }\n return study;\n }", "initStudyRequest() {\n var url = 'cancer_studies.json'\n axios.get(url)\n .then(response => this.studiesLoaded(response));\n }", "function experiment(name) {\n this.beginTime= 0,\n this.endTime= 0,\n this.duration= 0,\n this.name= name,\n this.rootpath= '',\n this.mediapath= '',\n this.getDuration = function () {\n return this.endTime - this.beginTime\n },\n this.setBeginTime = function() {\n this.beginTime = performance.now()\n },\n this.setEndTime = function () {\n this.endTime = performance.now()\n },\n this.getMediaPath = function () {\n this.mediapath = path.join(__dirname, '/assets/')\n return this.mediapath\n },\n this.getRootPath = function () {\n this.rootpath = path.join(__dirname,'/')\n return this.rootpath\n }\n}", "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 }", "get identifier() {\n return this._researchSubject.researchStudy.identifier.value || \"\";\n }", "function GetSamplePreferences()\n{\n var xmlstring = Radiology.GetPreference(SAMPLE_PREFS_NAME, SAMPLE_PREFS_TYPE);\n\n if (xmlstring != \"\")\n {\n var doc = xmldso.XMLDocument;\n doc.loadXML(xmlstring);\n\n var root = doc.documentElement;\n\n var nodeList = doc.getElementsByTagName(SAMPLE_ROOT);\n \n var elem = nodeList.item(0).getElementsByTagName(SAMPLE_ONE_TAG);\n m_Enable_Logging = elem.item(0).text;\n var elem = nodeList.item(0).getElementsByTagName(SAMPLE_TWO_TAG);\n m_Log_Directory = elem.item(0).text;\n var elem = nodeList.item(0).getElementsByTagName(SAMPLE_THREE_TAG);\n m_Log_Prefix = elem.item(0).text;\n var elem = nodeList.item(0).getElementsByTagName(SAMPLE_FOUR_TAG);\n m_Log_Options = elem.item(0).text;\n \n }\n}", "function buildScenario() {\n\n // Make sure the user created at least one model\n if (!TMP_MODELS) {\n setStatus(\"No model created. Aborting.\");\n return;\n }\n // display load screen\n LOADER.load();\n setStatus('Serializing and Generating JSON...');\n \n\n // Assemble all data and serialize all forms:\n\n \n var data = {};\n \n var infector = $('#frm-infector').serializeObject();\n \n var inform = $('#frm-infector');\n infector['location'] = inform.find('select[name=\"loc3\"]').val() && (inform.find('select[name=\"loc3\"]').val().length > 1) ? inform.find('select[name=\"loc3\"]').val() : null || inform.find('select[name=\"loc2\"]').val() && (inform.find('select[name=\"loc2\"]').val().length > 1) ? inform.find('select[name=\"loc2\"]').val() : null || inform.find('select[name=\"loc1\"]').val() && (inform.find('select[name=\"loc1\"]').val().length > 1) ? inform.find('select[name=\"loc1\"]').val() : null;\n if (!infector['location']) {\n infector['location'] = infector['manual-location']\n }\n delete infector['loc1'];\n delete infector['loc2'];\n delete infector['loc3'];\n delete infector['manual-location'];\n \n var disease = $('#frm-disease').serializeObject()\n \n if (disease['disease_model'] !== '-') {\n insertDiseaseIntoModel([TMP_MODELS], disease['disease_model'], disease);\n }\n if (infector['infector_model'] !== '-') {\n insertInfectorIntoModel([TMP_MODELS], infector['infector_model'], infector);\n }\n \n data['project_name'] = \"\"+Date.now();\n // Grab the form data\n data['scenario'] = $('#frm-scenario').serializeObject();\n data['disease'] = disease;\n data['infector'] = infector;\n data['models'] = TMP_MODELS;\n data['sequencer'] = $('#frm-sequencer').serializeObject();\n \n // Now do the specifics--linking names to objects\n \n data['scenario']['model'] = data['models']['name']+'.model';\n data['scenario']['sequencer'] = data['sequencer']['name']+'.sequencer';\n data['scenario']['infector'] = data['infector']['name']+'.standard';\n \n // Graphs!\n data['graphs'] = GLOBAL_GRAPHS || [];\n \n // This makes it easier on the backend, specifically storing info in the database\n data['country'] = COUNTRY_SELECTED;\n \n \n setStatus('Sending object to server...');\n\n // Object is now ready--transferring to the server\n $.ajax({\n type: \"POST\",\n url: \"backend/create_scenario.php\",\n dataType: \"json\",\n data: { data: data },\n complete: function() {\n setStatus('Completed request');\n NAV.show('load');\n }\n });\n}", "setVariationListeners() {\n\t\tVariations.on('variation:detected:sho', (event, data) => {\n\t\t\t// console.log('|global_nav| sticky variations ready');\n\t\t\t\tif (data && data.sticky_global_navigation) {\n\t\t\t\tthis.setStickyGlobalNavListner();\n\t\t\t\t}\n\t\t});\n }", "function selectExam(event) {\n console.log('selectExam() has been used.');\n \n var node = event.target;\n \n while (node.tagName.toLowerCase() != 'article') {\n node = node.parentNode;\n }\n exam = 'cm-' + node.getAttribute('id').replace('heading-', '');\n\n // console.log(exam);\n // console.log(localStorage.getItem(exam));\n // console.warn(questions.all.map(x => x.index));\n // if (questions.all.length == 0) {\n parseChallenge(localStorage.getItem(exam));\n // }\n // console.warn(questions.all.map(x => x.index));\n\n // if (!allFilters[exam]) {\n // allFilters[exam] = {};\n // }\n // if (!allFilters[exam].hasOwnProperty('filters')) {\n // console.warn('no filters');\n // console.log(allFilters[exam]);\n // console.log(allFilters[exam].filters);\n // allFilters[exam].filters = {'setup': 'default', 'version': {}, 'area': {}};\n // for (var ver in allFilters[exam].version) {\n // allFilters[exam].filters.version[ver] = true;\n // }\n // for (var tag in allFilters[exam].area) {\n // allFilters[exam].filters.area[tag] = true;\n // }\n // }\n console.log(allFilters[exam].filters);\n\n if ('localStorage' in window) {\n // if (!localStorage.getItem(exam)) {\n // localStorage.setItem(exam, content);\n // }\n localStorage.setItem('allFilters', JSON.stringify(allFilters));\n }\n\n if (properties['app_ui_start_challenge_after_selecting']) {\n startChallenge();\n } else {\n enableAction('start');\n enableAction('print');\n }\n\n state = 'exam_selected';\n}", "function StudyNotDisabledWarningController() {\n\n}", "function jessica() {\n $log.debug(\"TODO\");\n }", "function showSampleSolution() {\n sampleSolutionMappings = DragAndDropQuestionUtil.solve(vm.question, vm.mappings);\n vm.showingSampleSolution = true;\n }", "function initFeatures() {\n\tif (!window.simpaticoEserviceName) {\n\t\tsimpaticoEserviceName = '';\n\t}\n\tif (!window.simpaticoEserviceURL) {\n\t\tsimpaticoEserviceURL = window.location.origin + window.location.pathname;\n\t}\n\tif (!window.serviceName) {\n\t\tserviceName = simpaticoEserviceName;\n\t}\n\tif (!window.serviceURL) {\n\t\tserviceURL = simpaticoEserviceURL;\n\t}\n // Init the Auth component (see simpatico-auth.js)\n // - endpoint: the main URL of the used AAC instance\n // - clientID: the IFE Client ID registered\n // - authority: the used authentication mechanism or null if many allowed\n // - redirect: url redirect (default is /IFE/login.html)\n// authManager.getInstance().init({\n// endpoint: 'https://tn.smartcommunitylab.it/aac',\n// clientID: '8ab03990-d5dd-47ea-8fc6-c92a3b0c04a4',\n// authority: null,\n// redirect: 'https://simpatico.smartcommunitylab.it/simp-engines/wae/webdemo/logincb.html',\n// greeting: 'ACCEDI A SIMPATICO'\n// });\n\n // Init the LOG component (see log-core.js)\n // - endpoint: the main URL of the used LOG instance\n // - testMode: true if the data should not be sent to the LOG component\n logCORE.getInstance().init({\n testMode: !logEnabled(),\n endpoint: \"https://simpatico.smartcommunitylab.it/simpatico-logs/api\"\n });\n\n // Init the Citizenpedia component (see ctz-ui.js)\n // - endpoint: the main URL of the used Citizenpedia instance\n // - cpdDiagramEndpoint: endpoint of the CPD process summary service (should end with eService)\n // - primaryColor: Color used to highlight the enhanced components\n // - secondaryColor: Color used to paint the question boxes backgrounds\n // - elementsToEnhanceClassName: The CSS class used to define the enhanced elements\n // - questionsBoxClassName: The CSS class of the box which shows questions\n // - questionsBoxTitle: Title of the box hwich shows questions\n // - addQuestionLabel: Text exposed to show the action to create a question\n // - diagramNotificationImage: Image to show when a diagram is found\n // - diagramNotificationClassName: The CSS class of the img shown when a diagram is found\n // - diagramNotificationText: The text to notify that a diagram\n // - questionSelectionFilters: filters for text selection to ask question for\n citizenpediaUI.getInstance().init({\n endpoint: 'https://simpatico.smartcommunitylab.it/qae',\n cpdDiagramEndpoint: 'https://dev.smartcommunitylab.it/cpd/api/diagram/eService',\n primaryColor: \"#24BCDA\",\n secondaryColor:\"#D3F2F8\",\n elementsToEnhanceClassName: \"simpatico-query-and-answer\",\n questionsBoxClassName: \"simp-ctz-ui-qb\",\n questionsBoxTitle: \"Domande legate\",\n addQuestionLabel: \"+ Aggiungi una domanda\",\n diagramNotificationImage: \"https://simpatico.smartcommunitylab.it/simp-engines/wae/webdemo/img/diagram.png\",\n diagramNotificationClassName: \"simp-ctz-ui-diagram\",\n diagramNotificationText: \"C'e' una visualizzazione di e-service in Citizenpedia\",\n questionSelectionFilters: ['h1', '.Rigaintestazione', '.Rigaintestazioneridotta'],\n questionsURL: \"https://simpatico.smartcommunitylab.it/qae/questions\"\n });\n\n taeUIInline.getInstance().init({\n endpoint: 'https://simpatico.smartcommunitylab.it/simp-engines/tae',\n textContainerQuery: \"block-stu3-italia-content\",\n textQueryString: \"p,li\",\n elementId: 'simp-bar-sw-tae-inline',\n synonimLabel:'Sinonimi',\n definitionLabel: 'Definizione',\n simplifedTextLabel: 'Testo semplificato',\n questionsURL: \"https://simpatico.smartcommunitylab.it/qae/questions\",\n });\n\n\n \n // Declare here the buttons that will be available in the Simpatico Bar\n // The first one is the login button. This is mandatory but it also can be personalised\n // Options available:\n buttons = [\n {\t// TAE\n id: \"simp-bar-sw-tae-inline\",\n // Ad-hoc images to define the enabled/disabled images\n imageSrcEnabled: \"./resources/images/textTool.png\",\n imageSrcDisabled: \"./resources/images/textTool.png\",\n alt: \"Semplificazione del testo selezionato\",\n // Ad-hoc css classes to define the enabled/disabled styles\n styleClassEnabled: \"simp-none\", \n styleClassEnabled: \"simp-none\", \n label: 'Semplificazione testo',\n isEnabled: function() { return false; },\n enable: function() { \n \tconsole.log(window.getSelection().toString().trim());\n \ttaeUIInline.getInstance().showDialog(); \n },\n disable: function() { \n \ttaeUIInline.getInstance().hideDialog(); \n },\n exclusive: true\n },\n {\n id: \"simp-bar-sw-cpd\",\n // Ad-hoc images to define the enabled/disabled images\n imageSrcEnabled: \"./resources/images/procedure.png\",\n imageSrcDisabled: \"./resources/images/procedure.png\",\n alt: \"Procedura\",\n // Ad-hoc css classes to define the enabled/disabled styles\n styleClassEnabled: \"simp-none\", \n styleClassDisabled: \"simp-none\",\n \n isEnabled: function() { return citizenpediaUI.getInstance().isEnabled(); },\n enable: function() { citizenpediaUI.getInstance().openDiagram(); },\n disable: function() { citizenpediaUI.getInstance().disable(); }\n },\n// {\n// id: \"simp-bar-sw-login\",\n// // Ad-hoc images to define the enabled/disabled images\n// imageSrcEnabled: \"./resources/images/access.png\",\n// imageSrcDisabled: \"./resources/images/access.png\",\n// alt: \"Entra\",\n// // Ad-hoc css classes to define the enabled/disabled styles\n// styleClassEnabled: \"simp-none\", \n// styleClassDisabled: \"simp-none\",\n// \n// isEnabled: function() { return authManager.getInstance().isEnabled(); },\n// enable: function() { authManager.getInstance().enable(); },\n// disable: function() { authManager.getInstance().disable(); }\n// },\n { // CITIZENPEDIA\n id: \"simp-bar-sw-citizenpedia\",\n // Ad-hoc images to define the enabled/disabled images\n imageSrcEnabled: \"./resources/images/questions.png\",\n imageSrcDisabled: \"./resources/images/questions.png\",\n alt: \"Accedi alle domande e risposte associate agli elementi del modulo\",\n // Ad-hoc css classes to define the enabled/disabled styles\n styleClassEnabled: \"simp-none\", \n styleClassDisabled: \"simp-none\", \n label: 'Domande e risposte',\n isEnabled: function() { return citizenpediaUI.getInstance().isEnabled(); },\n enable: function() { citizenpediaUI.getInstance().openQuestionDiagram(); },\n disable: function() { citizenpediaUI.getInstance().disable(); }\n },\n \n ];\n}//initFeatures()", "function showQuestionDetailsEvent(paragraphName, questionID) {\n if (!featureEnabled) return;\n logger().logQuestionRequest(simpaticoEservice, paragraphName, questionID);\n }", "function OnOutcomePracticability_Change( e )\r\n{\r\n Alloy.Globals.AeDESModeSectionEight[\"OUTCOME_PRACTICABILITY\"] = e.id ;\r\n}", "function createAdditionalVariation(){\n \n variations = new Array();\n \n for(i = 0; i < sources.length; i++){\n var variation = new Variation(sources[i].id);\n variations.push(variation);\n }\n \n currentNeume.pitches.splice(currentPitchIndex, 0, variations);\n \n document.getElementById(\"meiOutput\").value = createMEIOutput();\n document.getElementById(\"input\").innerHTML = pitchDataChangeForm();\n createSVGOutput();\n}", "function retrieveStudyHandler(studyID) {\n studyUrl = studyID;\n //close studySearch display\n const studyOverlay = document.getElementById('StudySearch');\n studyOverlay.style.display = \"none\";\n studyOverlay.classList.remove(\"Shown\");\n studyOverlay.classList.add(\"Hidden\");\n const seriesOverlay = document.getElementById('SeriesSearch');\n seriesOverlay.classList.remove(\"Hidden\");\n seriesOverlay.classList.add(\"Shown\");\n //get the series\n console.log(\"Retrieving series in study \" + studyUrl);\n seriesSearch(studyID);\n}", "static impactMedium()\n\t\t{\n\t\t\tthis.impact(ImpactFeedbackStyle.Medium);\n\t\t}", "function ST03_CreateNewAnimalEntry()\r\n{\r\n Log_InitTestCase(\"ST03_CreateNewAnimalEntry\", \"Create a new Animal entry\");\r\n Log_CurrentStep(\"Step 1: Start application and select Animals tab\");\r\n CommonApplication_StopProcess();\r\n CommonApplication_StartApplication(10000);\r\n MenuBar_SelectAnimalsTab();\r\n \r\n Log_CurrentStep(\"Step 2: Search for the custonmer name \");\r\n AnimalsData_UpdateDictionaryFromXML(\"ST03_CreateNewAnimalEntry\", \"AddAnimalEntry\")\r\n Animals_SeachCustomerName(AnimalsData_GetParameter(\"OwnerName\"));\r\n //Animals_FindCustomerName(AnimalsData_GetParameter(\"OwnerName\"));\r\n \r\n Log_CurrentStep(\"Step 3: Click New button and fill in the Animal details\");\r\n Animals_ClickButtonNew();\r\n \r\n Log_CurrentStep(\"Step 3.1: Insert animal name\");\r\n //let animalRandomName = Math.floor((Math.random() * 1000) + 1);\r\n //Animals_FillAnimalName(animalRandomName)\r\n Animals_FillAnimalName(AnimalsData_GetParameter(\"AnimalName\"));\r\n \r\n Log_CurrentStep(\"Step 3.2: Select animal gender\");\r\n Animals_SelectGender(\"M\");\r\n Animals_SelectGender(\"F\");\r\n Animals_SelectGender(\"m\");\r\n Animals_SelectGender();\r\n Animals_SelectGender(AnimalsData_GetParameter(\"Gender\"));\r\n \r\n Log_CurrentStep(\"Step 3.3: Fill animal breed\");\r\n //Animals_FillBreed(\"*Labrador*\");\r\n Animals_FillBreed(AnimalsData_GetParameter(\"Breed\"));\r\n \r\n Log_CurrentStep(\"Step 3.4: Detail first that animal is not sterlized\");\r\n Animals_IsAnimalSterilized(AnimalsData_GetParameter(\"Sterilized\"));\r\n Animals_AddNotes(AnimalsData_GetParameter(\"Note\"));\r\n \r\n Log_CurrentStep(\"Step 4: Mark the animal as sterilized and add a note about this\");\r\n AnimalsData_UpdateDictionaryFromXML(\"ST03_CreateNewAnimalEntry\", \"ChangeAnimalData\")\r\n Animals_IsAnimalSterilized(AnimalsData_GetParameter(\"Sterilized\"));\r\n Animals_AddNotes(AnimalsData_GetParameter(\"Note\"));\r\n \r\n Log_CurrentStep(\"Step 5: Save last added animal details\");\r\n Animals_ClickButtonSave();\r\n \r\n Log_CurrentStep(\"Step 6: Close the application and store results\");\r\n CommonReporting.Log_CurrentTestCaseStatusPass();\r\n}", "function optionChanged(newSample){\n getData(newSample);\n getDemoData(newSample);\n\n}", "onSight(){\n console.log('sightHit');\n descriptionSet('A small collection of books on philosophy');\n }", "function optionChanged(sample) {\n console.log(sample)\n getPlots(sample);\n getInfo(sample);\n}", "function styleDU(feature) {\n return {\n weight: 2,\n opacity: 1,\n color: 'white',\n dashArray: '3',\n fillOpacity: 0.7,\n fillColor: getResColor(feature.properties.Res_Units)\n };\n}", "function setPortfolioScenario () {\n\tvar console = View.panels.get('allocGroupConsole');\n\tvar record = console.getRecord();\n\tvar portfolio_scenario_id = record.getValue('gp.portfolio_scenario_id');\n\tif (console.getFieldValue('gp.portfolio_scenario_id') == '') {\n\t\trecord.setValue('gp.portfolio_scenario_id', \"Baseline\");\n\t\tconsole.onModelUpdate();\n\t}\n}", "function samplechangeOption(scope) {\n selected_sample =scope.select_sample;\n\tsample_number= parseInt(selected_sample)+5;\n\tfor (var i = 5; i < 15; i++) { \n\t\tvar _beaker_name = \"beaker_\" + i;\n\t\tbeaker_name_container = machine_container.getChildByName(_beaker_name);\n\t\tbeaker_name_container.visible=false;\n\t}\n\tmachine_container.getChildByName(\"beaker_\"+sample_number).visible=true; \n\tif(sample_number>=6){\n\t\tsample_selected_flag=true;\n\t\tenable_disable_beaker(false) \n\t\tscope.test_disable=true;\n\t}\n\telse{\n\t\tsample_selected_flag=false;\n\t\tenable_disable_beaker(true) \n\t\tscope.test_disable=false;\n\t}\n}", "scenarioThree() {\n const companyPreference = {\n c1: \"s1\",\n c2: \"s2\"\n };\n const studentPreference = {\n s1: \"c2\",\n s2: \"c1\"\n };\n InterviewScheduling.setInterview(companyPreference, studentPreference);\n }", "function ts_psr_treatment()\n\n{\n\n//Opens INRstar\n open_application(\"INRstar\");\n\n//Test cases to be run within the Test Suite\n\n//parameters ()\n tc_add_historic\n \n//Closes INRstar\n close_application();\n\n}", "function style(feature) {\n return {\n weight: 2,\n opacity: 1,\n color: '#f4f4f4',\n dashArray: '3',\n fillOpacity: 0.7,\n fillColor: getColor(feature.properties.section)\n };\n }", "function createNewQuestionEvent(paragraphName) {\n if (!featureEnabled) return;\n logger().logNewQuestionRequest(simpaticoEservice, paragraphName);\n }", "function scenario(name, func) {\n suite.push({\n name: name,\n run: func\n });\n }", "function Interpreter_AddVariation(theObject, eProp, strValue)\n{\n\t//get this object's variations map\n\tvar objectMap = this.Variations[theObject.DataObject.Id];\n\t//no map?\n\tif (!objectMap)\n\t{\n\t\t//create a new one\n\t\tobjectMap = {};\n\t\t//set it\n\t\tthis.Variations[theObject.DataObject.Id] = objectMap;\n\t}\n\n\t//some variations need to be forced as the user could have manually changed the value\n\tvar bForceVariation = false;\n\t//check the class\n\tswitch (theObject.DataObject.Class)\n\t{\n\t\tcase __NEMESIS_CLASS_EDIT:\n\t\tcase __NEMESIS_CLASS_COMBO_BOX:\n\t\t\t//these are easilly changed by the user, check the property\n\t\t\tswitch (eProp)\n\t\t\t{\n\t\t\t\tcase __NEMESIS_PROPERTY_CAPTION:\n\t\t\t\t\t//force these\n\t\t\t\t\tbForceVariation = true;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tbreak;\n\t}\n\n\t//get this variation\n\tvar variation = objectMap[eProp];\n\t//first time? or its a new value\n\tif (!variation || variation.Variation != strValue || bForceVariation)\n\t{\n\t\t//create a new variation\n\t\tvariation = { Original: theObject.DataObject.Properties[eProp], Variation: strValue, State: __INTERPRETER_VARIATION_NEW };\n\t\t//set the variation\n\t\tobjectMap[eProp] = variation;\n\t}\n\t//so we have a variation with the same value\n\telse\n\t{\n\t\t//check the state\n\t\tswitch (variation.State)\n\t\t{\n\t\t\tcase __INTERPRETER_VARIATION_DELETE:\n\t\t\t\t//dont delete this one, keep it\n\t\t\t\tvariation.State = __INTERPRETER_VARIATION_KEEP;\n\t\t\t\tbreak;\n\t\t}\n\t}\n}", "get utterance()\n {\n return this.samples[this.sampleClassifier.classify(this.used)];\n }", "function initExperiment() {\r\n\t// To determine participant's ordering of trials based on the participant's number.\r\n\tvar url = window.location.href;\r\n\tlet splitUrl = url.split(\"?\");\r\n\tvar participantNum = parseInt(splitUrl[splitUrl.length - 1]);\r\n\t// Get Trails (Tasks for users)\r\n\tvar data = null\r\n\tswitch (participantNum) {\r\n\t\tcase 1:\r\n\t\t\tdata = getData(ordering1)\r\n\t\t\tbreak;\r\n\r\n\t\tcase 2:\r\n\t\t\tdata = getData(ordering2)\r\n\t\t\tbreak;\r\n\r\n\t\tcase 3:\r\n\t\t\tdata = getData(ordering3)\r\n\t\t\tbreak;\r\n\r\n\t\tcase 4:\r\n\t\t\tdata = getData(ordering4)\r\n\t\t\tbreak;\r\n\r\n\t\tcase 5:\r\n\t\t\tdata = getData(ordering5)\r\n\t\t\tbreak;\r\n\r\n\t\tcase 6:\r\n\t\t\tdata = getData(ordering6)\r\n\t\t\tbreak;\r\n\r\n\t\tcase 7:\r\n\t\t\tdata = getData(ordering7)\r\n\t\t\tbreak;\r\n\r\n\t\tcase 8:\r\n\t\t\tdata = getData(ordering8)\r\n\t\t\tbreak;\r\n\t}\r\n\r\n\tvar records = data.split(\"\\n\");\r\n\tnumTrials = records.length - 1;\r\n\tfor (var i = 1; i <= numTrials; i++) {\r\n\t\tif (records[i].trim() == \"\") {\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\tvar cells = records[i].split(\",\");\r\n\t\tvar menuType = cells[0].trim();\r\n\t\tvar menuDepth = cells[1].trim();\r\n\t\tvar targetItem = cells[2].trim();\r\n\t\tvar menuBreadth = cells[3].trim();\r\n\t\tvar isUsingMouse = cells[4].trim();\r\n\t\t// Control Device value used to determine whether a mouse or trackpad should be used\r\n\t\ttrialsData[i] = {\r\n\t\t\t'Menu Type': menuType,\r\n\t\t\t'Menu Depth': menuDepth,\r\n\t\t\t'Target Item': targetItem,\r\n\t\t\t'Menu Breadth': menuBreadth,\r\n\t\t\t'Control Device': isUsingMouse === \"true\" ? \"Mouse\" : \"Trackpad\"\r\n\t\t};\r\n\t}\r\n\r\n\t// Get Menus\r\n\tvar menuDatab4d1 = getData(b4d1);\r\n\tvar menuDatab4d2 = getData(b4d2);\r\n\tvar menuDatab4d3 = getData(b4d3);\r\n\tvar menuDatab8d1 = getData(b8d1);\r\n\tvar menuDatab8d2 = getData(b8d2);\r\n\tvar menuDatab8d3 = getData(b8d3);\r\n\r\n\t// Format CSV Menu to respective Menu structures\r\n\tmarkingMenub4d1 = formatMarkingMenuData(menuDatab4d1);\r\n\tmarkingMenub4d2 = formatMarkingMenuData(menuDatab4d2);\r\n\tmarkingMenub4d3 = formatMarkingMenuData(menuDatab4d3);\r\n\tmarkingMenub8d1 = formatMarkingMenuData(menuDatab8d1);\r\n\tmarkingMenub8d2 = formatMarkingMenuData(menuDatab8d2);\r\n\tmarkingMenub8d3 = formatMarkingMenuData(menuDatab8d3);\r\n\r\n\tradialMenub4d1 = formatRadialMenuData(menuDatab4d1);\r\n\tradialMenub4d2 = formatRadialMenuData(menuDatab4d2);\r\n\tradialMenub4d3 = formatRadialMenuData(menuDatab4d3);\r\n\tradialMenub8d1 = formatRadialMenuData(menuDatab8d1);\r\n\tradialMenub8d2 = formatRadialMenuData(menuDatab8d2);\r\n\tradialMenub8d3 = formatRadialMenuData(menuDatab8d3);\r\n\r\n\t//Start the first trial\r\n\tnextTrial();\r\n}", "function style(feature) {\n\t if (feature.properties.ELEV != \"\" && feature.properties.ELEV != \"<Null>\" && feature.properties.ELEV != null) {\n\t /* if (feature.properties.ELEV == \"1000\") {\n\t return {\n\t color: \"green\",\n\t weight: 4,\n\t opacity: 0.9\n\t }\n\t } else if (feature.properties.ELEV == \"2000\") {\n\t return {\n\t color: \"blue\",\n\t weight: 4,\n\t opacity: 0.9\n\t }\n\n\t } else {\n\t return {\n\t color: \"red\",\n\t weight: 2,\n\t opacity: 0.9\n\t }\n\t }\n\t */\n\t } else {\n\t return {\n\t color: \"magenta\",\n\t weight: x.lwd,\n\t opacity: x.opacity\n\t }\n\t }\n\t }", "get example() {\n\t\tlet response = this._name;\n\n\t\tthis._parameters.forEach(\n\t\t\tfunction(param) {\n\t\t\t\tresponse += \" \" + param.example;\n\t\t\t}\n\t\t);\n\n\t\tif (this._remainderDescription) response += \" \" + this._remainderDescription + \"\"\n\n\t\treturn response;\n\t}", "function showDetails(demo){\nconsole.log(`Name: ${demo.bookTitle}, price: ${demo.price} `)\n}", "function randomStimulusProc(block, trialNumber, isFirstTrial, isPractice) {\n let stimuli;\n let trialProp;\n let newRandom = Math.floor(Math.random() * 4); //choose a random position between 1-4\n stimuli = [{stimulus: [0, newRandom], data: {p_or_r: \"R\", block: block, first_response: 1, trial_number: trialNumber, sequence: usedSequenceString}}] //jsPsych.init modifies if necessary\n if (isFirstTrial == 1 && isPractice == 1) {\n stimuli[0].data.is_practice = 1;\n trialProp = firstTrialProperties;\n }\n else if (isPractice == 1) {\n stimuli[0].data.is_practice = 1;\n trialProp = randomTrialProperties\n } \n else if (isFirstTrial == 1){\n stimuli[0].data.is_practice = 0;\n trialProp = firstTrialProperties\n }\n else {\n stimuli[0].data.is_practice = 0;\n trialProp = randomTrialProperties\n }\n return {\n timeline: [trialProp],\n timeline_variables: stimuli\n }\n}", "function optionChanged(newSample){\n //alert(newSample);\n chartBuilder(newSample);\n metadataBuilder(newSample);\n }", "function about() {\n window.alert(\"Depth First Search Proficiency Exercise\\nWritten by --\\nCreated as part of the OpenDSA hypertextbook project\\nFor more information, see http://algoviz.org/OpenDSA\\nSource and development history available at\\nhttps://github.com/cashaffer/OpenDSA\\nCompiled with JSAV library version \" + JSAV.version());\n }", "function optionChanged (newsample){\n createchart(newsample) \n metadata(newsample)\n}", "getStudyGroupId() {\n return this.study_group_id;\n }", "function getCompareScenarios(isTr55) {\n var trueScenarios = App.currentProject.get('scenarios'),\n tempScenarios = new modelingModels.ScenariosCollection(),\n ccScenario = trueScenarios.findWhere({ is_current_conditions: true }),\n aoi_census = ccScenario.get('aoi_census');\n\n if (isTr55) {\n // Add Predominantly Forested scenario\n var forestScenario = copyScenario(ccScenario, aoi_census);\n\n forestScenario.set({\n name: 'Predominantly Forested',\n is_current_conditions: false,\n is_pre_columbian: true,\n });\n\n tempScenarios.add(forestScenario);\n }\n\n trueScenarios.forEach(function(scenario) {\n tempScenarios.add(copyScenario(scenario, aoi_census));\n });\n\n return tempScenarios;\n}", "get Specular() {}", "function SEASONS2(node, view) {\n\tthis.node = node;\n\tthis.view = view;\n\tthis.content = node.getContent().getContentJSON();\n\n\tif(node.studentWork != null) {\n\t\tthis.states = node.studentWork;\n\t} else {\n\t\tthis.states = [];\n\t};\n}", "function suiteStarted(suite) {\n _scenariooReporter.default.useCaseStarted(options, suite.description);\n }", "function new_scenario(){\r\n\t\ttest.log($('<h3>new_scenario</h3>'));\r\n\t\tvar scenario,\r\n\t\tmodels;\r\n\t\t$.when(\r\n\t\t\t// get a scenario from the library\r\n\t\t\tajaxrequest({\r\n\t\t\t\ttype: \"GET\",\r\n\t\t\t\tdataType: \"json\",\r\n\t\t\t\tdata: {},\r\n\t\t\t\turl: test.mandatorRequestStr + '/structure/get_library_scenario_list',\r\n\t\t\t\tstatusCode: {},\r\n\t\t\t\tsuccess: function (json) {\r\n\t\t\t\t\tscenario = json.libraryScenarioInfoList[0];\r\n\t\t\t\t\ttest.log(\"Scenario loaded successful\");\r\n\t\t\t\t},\r\n\t\t\t\terror: errorhandler\r\n\t\t\t}),\r\n\r\n\t\t\t// get models from the library\r\n\t\t\tajaxrequest({\r\n\t\t\t\ttype: \"GET\",\r\n\t\t\t\tdataType: \"json\",\r\n\t\t\t\tdata: {},\r\n\t\t\t\turl: test.mandatorRequestStr + '/structure/get_model_list',\r\n\t\t\t\tstatusCode: {},\r\n\t\t\t\tsuccess: function (json) {\r\n\t\t\t\t\tmodels = json.modelList;\r\n\t\t\t\t\ttest.data.modelList = json.modelList;\r\n\t\t\t\t\ttest.log(\"Models loaded successfull\");\r\n\t\t\t\t},\r\n\t\t\t\terror: errorhandler\r\n\t\t\t})\r\n\t\t)\r\n\t\t.then(function(){\r\n\t\t\tvar time = +new Date();\r\n\t\t\tvar scenario = {\r\n\t\t\t\t\t\"referenceCode\" : \"my_test_scenario\" + time ,\r\n\t\t\t\t\t\"title\" : \"Test Scenario\",\r\n\t\t\t\t\t\"description\" : \"test description for my test scenario\",\r\n\t\t\t\t\t\"avaliable\" : \"NOT_AVAILABLE\",\r\n\t\t\t\t\t\"inputItemType\" : 1,\r\n\t\t\t\t\t\"outputItemTypes\" : [ 1 ],\r\n\t\t\t\t\t\"stages\" : {\r\n\t\t\t\t\t\t\"0\" : {\r\n\t\t\t\t\t\t\t\"useCategoryPath\" : 0,\r\n\t\t\t\t\t\t\t\"xingModels\" : []\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\"1\" : {\r\n\t\t\t\t\t\t\t\"useCategoryPath\" : 1,\r\n\t\t\t\t\t\t\t\"xingModels\" : []\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\"2\" : {\r\n\t\t\t\t\t\t\t\"useCategoryPath\" : 2,\r\n\t\t\t\t\t\t\t\"xingModels\" : []\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t},\r\n\t\t\t\t\t\"enabled\" : \"ENABLED\"\r\n\t\t\t\t},\r\n\t\t\tl = models.length,\r\n\t\t\ts = 3,\r\n\t\t\tmax = 1, //maximum number of models per stage\r\n\t\t\tcontext;\r\n\r\n\t\t\t// add some models (all existing models are used and added to the\r\n\t\t\t// three stages of the scenario\r\n\t\t\twhile(l--){\r\n\t\t\t\tcontext = models[l].profileContextSupported ? \"PROFILE\" : \"ITEM\";\r\n//\t\t\t\tconsole.log(s);\r\n//\t\t\t\tconsole.log(scenario);\r\n\t\t\t\tscenario.stages[--s + \"\"].xingModels.push({\r\n\t\t\t\t\t\"contextFlag\" : context,\r\n\t\t\t\t\t\"useSubmodels\" : false,\r\n\t\t\t\t\t\"weight\" : 100,\r\n\t\t\t\t\t\"modelReferenceCode\" : models[l].referenceCode\r\n\t\t\t\t});\r\n\t\t\t\tif(!s){\r\n\t\t\t\t\ts = 3;\r\n\t\t\t\t\tmax--;\r\n\t\t\t\t}\r\n\t\t\t\tif(!max){\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// store the scenario\r\n//\t\t\tconsole.log(scenario);\r\n\t\t\ttest.data.new_scenario = scenario;\r\n//\t\t\tconsole.log(test.data.new_scenario);\r\n\t\t\t// create the adapted scenario\r\n\t\t\tajaxrequest({\r\n\t\t\t\ttype: \"POST\",\r\n\t\t\t\tdataType: \"json\",\r\n\t\t\t\tcontentType: 'application/json',\r\n\t\t\t\tdata: JSON.stringify(scenario),\r\n\t\t\t\turl: test.mandatorRequestStr + '/structure/create_scenario',\r\n\t\t\t\tstatusCode: {},\r\n\t\t\t\tsuccess: function (json) {\r\n\t\t\t\t\ttest.log(\"Create Scenario successfull\");\r\n\t\t\t\t\tdebug('new_scenario', scenario, json.scenario);\r\n\t\t\t\t\ttest.log(debugButton('new_scenario'));\r\n\t\t\t\t\ttest.assert(equals(json.scenario, scenario), 'new scenario match', 'new scenario missmatch');\r\n\t\t\t\t\ttest.next();\r\n\t\t\t\t},\r\n\t\t\t\terror: errorhandler\r\n\t\t\t});\r\n\t\t},\r\n\t\tfunction(){\r\n\t\t\ttest.log('Create Scenario preconditions failed');\r\n\t\t});\r\n\t}", "doSimulation() {\n var s = this.solutions.find(x => x.id == this.solutionFlag);\n switch (this.sim.step) {\n case null:\n $(\"#simulation .counter\").text(\"gestoppt\");\n for (var index in s.container.goods) {\n s.container.goods[index].mesh.visible = true;\n s.container.goods[index].helper.material.color = new THREE.Color(\"rgb(0, 0, 0)\");\n s.container.goods[index].helper.visible = true;\n }\n break;\n default:\n $(\"#simulation .counter\").text(this.sim.step + \" von \" + s.sequence);\n for (var index in s.container.goods) {\n if (s.container.goods[index].seqNr == this.sim.step) {\n s.container.goods[index].mesh.visible = true;\n s.container.goods[index].helper.material.color = new THREE.Color(\"rgb(0, 0, 0)\");\n s.container.goods[index].helper.visible = true;\n } else {\n s.container.goods[index].mesh.visible = false;\n if (this.sim.hideLatter && s.container.goods[index].seqNr > this.sim.step) {\n s.container.goods[index].helper.visible = false;\n } else {\n s.container.goods[index].helper.material.color = new THREE.Color(\"rgb(89, 89, 89)\");\n s.container.goods[index].helper.visible = true;\n }\n }\n }\n var seqSt = s.getStepsForSequenceNumber(this.sim.step);\n if (seqSt != null) {\n var parentDimension = {\n h: s.container.height,\n w: s.container.width,\n l: s.container.length\n };\n for (var index in seqSt._Positions) {\n var p = seqSt._Positions[index];\n if (p._L == null) {\n var l = 500;\n var color = this.sim.simHelperRegularColor;\n } else {\n if (p._IsSumedUp) {\n var color = this.sim.simSumedUpColor;\n } else {\n var color = this.sim.simHelperInfinityLengthColor;\n }\n var l = p._L;\n }\n var geometry = new THREE.BoxGeometry(p._W, p._H, l, 4, 4, 4);\n var material = new THREE.MeshBasicMaterial({ color: color });\n var mesh = new THREE.Mesh(geometry, material);\n var helper = new THREE.EdgesHelper(mesh, 0x333333);\n helper.material.linewidth = 1;\n helper.material.color = color;\n mesh.position.z = p._Z - (parentDimension.l / 2) + (l / 2);\n mesh.position.x = p._X - (parentDimension.w / 2) + (p._W / 2);\n mesh.position.y = p._Y - (parentDimension.h / 2) + (p._H / 2);\n helper.position.set(mesh.position.x, mesh.position.y, mesh.position.z);\n scene.add(helper);\n this.sim.tempElements.push(helper);\n }\n for (var index in seqSt._RecursiveGroupRestricted) {\n var p = seqSt._RecursiveGroupRestricted[index];\n var l = p._L;\n var color = this.sim.simRecursiveRestrictedColor;\n var geometry = new THREE.BoxGeometry(p._W, p._H, l, 4, 4, 4);\n var material = new THREE.MeshBasicMaterial({ color: color });\n var mesh = new THREE.Mesh(geometry, material);\n var helper = new THREE.EdgesHelper(mesh, 0x333333);\n helper.material.linewidth = 1;\n helper.material.color = color;\n mesh.position.z = p._Z - (parentDimension.l / 2) + (l / 2);\n mesh.position.x = p._X - (parentDimension.w / 2) + (p._W / 2);\n mesh.position.y = p._Y - (parentDimension.h / 2) + (p._H / 2);\n helper.position.set(mesh.position.x, mesh.position.y, mesh.position.z);\n scene.add(helper);\n this.sim.tempElements.push(helper);\n }\n renderer.render(scene, camera);\n }\n break;\n }\n }", "constructor(container,Scenarios) {\n this.container = container;\n this.dataset = Scenarios;\n\n this.home_page();\n this.menu_page();\n this.create_scenery();\n\n \n }", "get example() {\n return this._example;\n }", "setSelectedViewedItemVariation(state, variation) {\n state.selectedViewedItemVariation = variation;\n }", "function SetSamplePreferences()\n{\n var doc = xmldso.XMLDocument;\n\n var strRoot = \"<\" + SAMPLE_ROOT + \"></\" + SAMPLE_ROOT + \">\"; \n doc.loadXML(strRoot);\n \n var root = doc.documentElement;\n \n var elem = doc.createElement(SAMPLE_ONE_TAG);\n elem.text = m_Enable_Logging;\n root.appendChild(elem);\n \n elem = doc.createElement(SAMPLE_TWO_TAG);\n elem.text = m_Log_Directory;\n root.appendChild(elem);\n \n elem = doc.createElement(SAMPLE_THREE_TAG);\n elem.text = m_Log_Prefix;\n root.appendChild(elem);\n \n elem = doc.createElement(SAMPLE_FOUR_TAG);\n elem.text = m_Log_Options;\n root.appendChild(elem);\n\n xmlstring = doc.xml;\n \n Radiology.SetPreference(SAMPLE_PREFS_NAME, SAMPLE_PREFS_TYPE, xmlstring);\n}", "function createWeaknessOrResistance(data, detail) {\n let dataSection = document.createElement(\"section\");\n dataSection.classList.add(detail);\n // weakness or resistance images\n let detailFigure = document.createElement(\"figure\");\n detailFigure.classList.add(\"weakness-resistance-figure\");\n\n let detailImage = document.createElement(\"img\");\n detailImage.classList.add(\"energy-cost-other-details\");\n detailImage.src = \"images/\" + data[0].type.toLowerCase() + \"_energy.png\";\n detailImage.alt = data[0].type + \" energy icon\";\n // caption\n let detailFigureCaption = document.createElement(\"figcaption\");\n detailFigureCaption.appendChild(document.createTextNode(data[0].value));\n\n detailFigure.appendChild(detailImage);\n detailFigure.appendChild(detailFigureCaption);\n // weakness text\n let detailText = document.createElement(\"p\");\n detailText.appendChild(document.createTextNode(detail + \":\"));\n dataSection.appendChild(detailText);\n dataSection.appendChild(detailFigure);\n return dataSection;\n }", "function optionChanged(newSample){\n console.log(newSample);\n buildMetadata(newSample);\n //buildCharts(newSample);\n}", "function show_variation( variation ) {\n var img = $('div.images img:eq(0)');\n var link = $('div.images a.zoom:eq(0)');\n var o_src = $(img).attr('original-src');\n var o_link = $(link).attr('original-href');\n\n var variation_image = variation.image_src;\n var variation_link = variation.image_link;\n var var_display;\n\n if ( variation.same_prices ) var_display = variation.availability_html;\n else var_display = variation.price_html + variation.availability_html;\n\n $('.single_variation').html( var_display );\n\n if ( ! o_src ) {\n $(img).attr('original-src', $(img).attr('src'));\n }\n\n if ( ! o_link ) {\n $(link).attr('original-href', $(link).attr('href'));\n }\n\n if ( variation_image && variation_image.length > 1 ) {\n $(img).attr('src', variation_image);\n $(link).attr('href', variation_link);\n } else {\n $(img).attr('src', o_src);\n $(link).attr('href', o_link);\n }\n\n $('.product_meta .sku').remove();\n $('.product_meta').append(variation.sku);\n\n $('.shop_attributes').find('.weight').remove();\n if ( variation.a_weight ) {\n $('.shop_attributes').append(variation.a_weight);\n }\n\n $('.shop_attributes').find('.length').remove();\n if ( variation.a_length ) {\n $('.shop_attributes').append(variation.a_length);\n }\n\n $('.shop_attributes').find('.width').remove();\n if ( variation.a_width ) {\n $('.shop_attributes').append(variation.a_width);\n }\n\n $('.shop_attributes').find('.height').remove();\n if ( variation.a_height ) {\n $('.shop_attributes').append(variation.a_height);\n }\n\n if ( ! variation.in_stock ) {\n $('.single_variation').slideDown();\n } else {\n $('.variations_button, .single_variation').slideDown();\n }\n }" ]
[ "0.5128658", "0.50991416", "0.49080807", "0.49036923", "0.48992968", "0.48587966", "0.47773543", "0.471713", "0.4692595", "0.4628808", "0.46274167", "0.4625167", "0.45750666", "0.44930327", "0.44772887", "0.44549042", "0.44508377", "0.44479096", "0.44365692", "0.4416215", "0.4410855", "0.4409743", "0.44085234", "0.44085234", "0.4405157", "0.43999588", "0.43972784", "0.4378935", "0.4365748", "0.43588626", "0.43469533", "0.4339096", "0.43293047", "0.43165565", "0.43160632", "0.43144754", "0.43137097", "0.42957902", "0.4294692", "0.42880204", "0.42849782", "0.42813048", "0.4278324", "0.42748314", "0.42668706", "0.42592278", "0.4254635", "0.42519704", "0.4243349", "0.42428568", "0.42408147", "0.42366272", "0.42344546", "0.42290035", "0.42264402", "0.42139235", "0.42029342", "0.41980675", "0.41935897", "0.41923192", "0.41880915", "0.41807055", "0.41656044", "0.4162079", "0.41603857", "0.41489172", "0.41396526", "0.41314745", "0.4121974", "0.4114865", "0.41146535", "0.4110333", "0.4100247", "0.40899983", "0.40872875", "0.40718663", "0.4066308", "0.40640745", "0.40599692", "0.40594184", "0.40492654", "0.40485033", "0.40475982", "0.40470058", "0.40440387", "0.4039854", "0.40387815", "0.40371326", "0.40302286", "0.40289763", "0.4025328", "0.40089774", "0.39992356", "0.39963385", "0.39919412", "0.39912376", "0.39892307", "0.39870578", "0.39860147", "0.39832172" ]
0.54558784
0
Create a new instance of the ConsoleAPI, so we can control the maxLogLevel with Config.jsm.
initLog(logLevel) { XPCOMUtils.defineLazyGetter(this, "log", () => { const ConsoleAPI = Cu.import("resource://gre/modules/Console.jsm", {}).ConsoleAPI; const consoleOptions = { maxLogLevel: logLevel, prefix: "TPStudy", }; return new ConsoleAPI(consoleOptions); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ConsoleLogger() {\n var formatter = new Formatter(),\n consoleHandler = new ConsoleHandler(formatter),\n savedLevel = storage.get(STORAGE_NAMESPACE),\n utils = new LoggerUtils(this);\n\n Logger.call(this, consoleHandler, entryFactory);\n\n if (savedLevel) {\n this.displayLevel_ = savedLevel;\n }\n\n this.utils = utils;\n this.messages = messagePoll;\n this.levels = levelsPoll.getLevels();\n }", "constructor() {\n super();\n // Setting initial configuration.\n this[levelSymbol] = errorLevel;\n this[modeSymbol] = productionMode;\n // Save the original console prototype functions in case the console is hijacked.\n this[origConsoleLogFunctionsSymbol] = {};\n this[origConsoleLogFunctionsSymbol].log = console.log.bind(console);\n this[origConsoleLogFunctionsSymbol].debug = (typeof console.debug === 'function') ? console.debug.bind(console) : console.debug;\n this[origConsoleLogFunctionsSymbol].info = console.info.bind(console);\n this[origConsoleLogFunctionsSymbol].warn = console.warn.bind(console);\n this[origConsoleLogFunctionsSymbol].error = console.error.bind(console);\n // Register the default log handlers.\n this.resetLogHandlers();\n }", "function Console() {\n this.message = [];\n this.prototype.log = function (data) {\n message.push(data);\n }\n }", "constructor(source, options) {\t\t\r\n\t\tvar options = Object.assign({}, Console.defaultOptions, options);\r\n\t\tif (typeof options.minLevel === 'string')\r\n\t\t\toptions.minLevel = options.levels[options.minLevel].n;\r\n\t\tsuper(options.stdio.out, options.stdio.err);\r\n\t\tthis.options = options;\r\n\t\tthis.source = source;\r\n\t\t// this.messages = [];\t\t\t// TODO : Log messages as array of arrays (or objects?)\r\n\r\n\t\t/*\r\n\t\t// Probably abstract out to a listener class/type/whatev.\r\n\t\t// By default any new console unless spec'd otherwise in options has one listener - \r\n\t\t// which takes the log message array/object item and writes to stdio.\r\n\t\t// Maybe this Console class can just deal with listeners and not have to handle stdio directly?\r\n\t\t// Listeners more than likely will use EventEmitter base type or data member \r\n\t\t// TODO: ** Perfect example on nodejs api docs see util.inherits for EventEmitter based 'MyStream' object\r\n\t\t// could also have level option on source (ie keep this class as is) and also have level filter in listener.\r\n\t\t// or listener is just a fn? just ideas\r\n\t\t*/\r\n\t\t// this\t\t//this.options.source?\"'\"+this.options.source+\"'\":\"\"})`);\r\n\t\tif (!defaultConsole)\r\n\t\t\tdefaultConsole = this;\r\n\t\t\r\n\t\t// for each defined level, give the Console class a memr with that name that outputs at that level\r\n\t\tObject.keys(options.levels).forEach((level) => {\r\n\t\t\tthis[level] = _log.bind(this, this.options.levels[level]);\r\n\t\t});\r\n\r\n\t\t// defaultConsole.verbose(`new Console('${source}', ${util.inspect(options)})`);\r\n\t\t// this.debug(util.inspect(this));\r\n\t\tif (options.testLevels)\r\n\t\t\tthis.testLevels();\r\n\t}", "function Console() {\n return /*#__PURE__*/react_default.a.createElement(StyledConsole, null, /*#__PURE__*/react_default.a.createElement(Router[\"e\" /* Switch */], null, /*#__PURE__*/react_default.a.createElement(Router[\"c\" /* Route */], {\n path: config[\"a\" /* default */].routes.consoleSession,\n component: components_Terminal\n }), /*#__PURE__*/react_default.a.createElement(Router[\"c\" /* Route */], {\n path: config[\"a\" /* default */].routes.consoleInitSession,\n component: SessionCreator\n }), /*#__PURE__*/react_default.a.createElement(Router[\"c\" /* Route */], {\n path: config[\"a\" /* default */].routes.consoleInitPodSession,\n component: SessionCreator\n }), /*#__PURE__*/react_default.a.createElement(Router[\"c\" /* Route */], {\n path: config[\"a\" /* default */].routes.consoleSessionPlayer,\n component: components_Player\n })));\n}", "function Console() {}", "function Console() {}", "constructor(options) {\n let opt = {};\n if (typeof options === 'number') {\n if (options < 0) {\n options = 0;\n }\n else if (options > ConsoleLogger.LEVELS.length) {\n options = ConsoleLogger.LEVELS.length - 1;\n }\n opt = { level: ConsoleLogger.LEVELS[options] };\n }\n else if (typeof options === 'string') {\n opt = { level: options };\n }\n else {\n opt = options || {};\n }\n this.level = opt.level;\n this.logger =\n logDriver({ levels: ConsoleLogger.LEVELS, level: opt.level || 'silent' });\n }", "function Console() {\n}", "function createConsoleWrapper(level) {\n return function consoleWrapper(originalConsoleMethod) {\n var sentryLevel;\n switch (level) {\n case 'debug':\n sentryLevel = types_1.Severity.Debug;\n break;\n case 'error':\n sentryLevel = types_1.Severity.Error;\n break;\n case 'info':\n sentryLevel = types_1.Severity.Info;\n break;\n case 'warn':\n sentryLevel = types_1.Severity.Warning;\n break;\n default:\n sentryLevel = types_1.Severity.Log;\n }\n /* eslint-disable prefer-rest-params */\n return function () {\n if (core_1.getCurrentHub().getIntegration(Console)) {\n core_1.getCurrentHub().addBreadcrumb({\n category: 'console',\n level: sentryLevel,\n message: util.format.apply(undefined, arguments),\n }, {\n input: tslib_1.__spread(arguments),\n level: level,\n });\n }\n originalConsoleMethod.apply(this, arguments);\n };\n /* eslint-enable prefer-rest-params */\n };\n}", "constructor() {\n this.logger = console;\n }", "getInstance() {\n if (!this.__INSTANCE) {\n this.__INSTANCE = new qx.tool.compiler.Console();\n }\n return this.__INSTANCE;\n }", "function MZConsole(){}", "function createConsole(options) {\n let panel;\n return manager.ready\n .then(() => {\n panel = new console_1.ConsolePanel(Object.assign({ manager,\n contentFactory, mimeTypeService: editorServices.mimeTypeService, rendermime, setBusy: app.setBusy.bind(app) }, options));\n return panel.session.ready;\n })\n .then(() => {\n // Add the console panel to the tracker.\n tracker.add(panel);\n panel.session.propertyChanged.connect(() => tracker.save(panel));\n shell.addToMainArea(panel, {\n ref: options.ref,\n mode: options.insertMode,\n activate: options.activate\n });\n return panel;\n });\n }", "function RemoteLogConstructed(level) {\n\tthis.level = level\n\tthis.log = msg => console[this.level](msg)\n}", "initLogger() {\n this.logger = new ConsoleLogger({\n name: this.getServiceName()\n });\n }", "_console() {\n\t\tlet _level = window.Array.prototype.shift.call(arguments);\n\t\tif(!_level || !_level.length || ![\"debug\", \"error\", \"info\", \"log\", \"trace\", \"warn\"].includes(_level) || !window.console.hasOwnProperty(_level)) {\n\t\t\treturn;\n\t\t}\n\n\t\twindow.Array.prototype.unshift.call(arguments, `[${this._name}][${_level}]`);\n\t\treturn window.console[_level].apply(null, arguments);\n\t}", "constructor() {\n // Color codes reference: https://stackoverflow.com/questions/9781218/how-to-change-node-jss-console-font-color\n this.RESET = \"\\x1b[0m\"; // reset previously used color\n this.LEVELS = {\n \"normal\": \"\",\n \"success\": \"\\x1b[32m\", // green\n \"info\": \"\\x1b[34m\", // blue\n \"warn\": \"\\x1b[33m\", // yellow\n \"error\": \"\\x1b[31m\", // red\n };\n Object.freeze(this.LEVELS);\n }", "_setVerbosity() {\n this._logger = {\n info: () => {},\n error: () => {},\n warn: () => {},\n log: () => {}\n };\n\n if(this.config.verbose){\n this._logger = {\n info: console.info,\n error: console.error,\n warn: console.warn,\n log: console.log\n }\n }\n }", "function buildConsoleObject(){\t\n\tif (!window.console ){\n\t var names = [\"log\", \"debug\", \"info\", \"warn\", \"error\", \"assert\", \"dir\", \"dirxml\", \"group\", \"groupEnd\", \"time\", \"timeEnd\", \"count\", \"trace\", \"profile\", \"profileEnd\"];\n\t window.console = {};\n\t for (var i = 0; i < names.length; ++i){\n\t\t\twindow.console[names[i]] = function() {};\n\t\t}\n\t\tnames = null;\n\t}else if( Browser.Engine.webkit ){\n\t var names = [ \"debug\", \"error\", \"assert\", \"dir\", \"dirxml\", \"group\", \"groupEnd\", \"time\", \"timeEnd\", \"count\", \"trace\", \"profile\", \"profileEnd\"];\n\t for (var i = 0; i < names.length; ++i){\n\t\t\twindow.console[names[i]] = function() {};\n\t\t}\n\t\tnames = null;\t\t\n\t}\n}", "function createLogger() {\n var winston = require('winston');\n\n var logger = new (winston.Logger)({\n transports: [\n new (winston.transports.Console)({\n timestamp: true\n }),\n new (winston.transports.File)({\n filename: 'api.log',\n json: true,\n timestamp: true,\n maxFiles: 1,\n maxsize: 1000000\n })\n ]\n });\n return logger;\n}", "function setupConsole(config){\r\n // Some ides from: http://tobyho.com/2012/07/27/taking-over-console-log/\r\n var console = window.console;\r\n\r\n if (window._TRACE_) \r\n throw \"'window._TRACE_' already defined!\";\r\n window._TRACE_ = console ?\r\n function () {console.log.apply(console, arguments);}\r\n :\r\n _.noop;\r\n\r\n if (window._ERR_) \r\n throw \"'window._ERR_' already defined!\";\r\n window._ERR_ = function () {\r\n throw Array.prototype.slice.apply(arguments).join(' ')\r\n };\r\n\r\n if (!console) {\r\n window.console = {\r\n 'log': _.noop, \r\n 'warn': _.noop, \r\n 'error': _.noop\r\n };\r\n return;\r\n }\r\n function intercept(method){\r\n var original = console[method]\r\n console[method] = function(){\r\n // do sneaky stuff\r\n if (original.apply){\r\n // Do this for normal browsers\r\n original.apply(console, arguments)\r\n }else{\r\n // Do this for IE\r\n var message = Array.prototype.slice.apply(arguments).join(' ')\r\n original(message)\r\n }\r\n }\r\n }\r\n var methods = ['log', 'warn', 'error']\r\n for (var i = 0; i < methods.length; i++)\r\n intercept(methods[i])\r\n}", "function createConsoleWin(){\n // Create new window\n consoleWin = new BrowserWindow({ width: 550, height: 330, frame: false});\n consoleWin.title = \"Console\";\n // load html into window\n consoleWin.loadURL(url.format({\n pathname: path.join(__dirname, 'consoleWindow.html'),\n protocol:'file:',\n slashes: true\n }));\n // garbage collection handle\n consoleWin.on('close', function(){\n consoleWin = null;\n });\n}", "function CLI() {\n // This can be prevented by using dependency injection\n this.cli = this;\n}", "enableConsole() { \n console.log(\"Initializing fxcm command console.. (Press return to continue)\")\n this.showConsole = true\n process.stdin.pause()\n this.init_console();\n process.stdin.resume();\n }", "constructor(){\n\t\t//console.log('API START');\n\t}", "function createLogger(name, options) {\n var log = typeof debug === 'undefined' ? _debug(name) : debug(name),\n level,\n levels = {\n silly: 0,\n input: 1,\n verbose: 2,\n prompt: 3,\n debug: 4,\n info: 5,\n data: 6,\n help: 7,\n warn: 8,\n error: 9\n };\n if (!options) {\n throw new Error('options required in logger');\n }\n if (options.hasOwnProperty('level') === false) {\n throw new Error('options.level required in logger');\n }\n level = levels[options.level];\n if (typeof level === 'undefined') {\n level = levels.info;\n }\n\n log.debug = function () {\n if (log.enabled && level <= levels.debug) {\n if (console.debug) {\n log.log = console.debug.bind(console);\n } else {\n log.log = console.log.bind(console);\n }\n log.apply(this, arguments);\n }\n };\n log.info = function () {\n if (log.enabled && level <= levels.info) {\n log.log = console.info.bind(console);\n log.apply(this, arguments);\n }\n };\n log.warn = function () {\n if (log.enabled && level <= levels.warn) {\n log.log = console.warn.bind(console);\n log.apply(this, arguments);\n }\n };\n log.error = function () {\n if (log.enabled && level <= levels.error) {\n log.log = console.error.bind(console);\n log.apply(this, arguments);\n } else {\n console.error.apply(console, arguments);\n }\n };\n\n log.fork = function (forkName, useForkName) {\n forkName = useForkName ? forkName : name + ':' + forkName;\n return createLogger(forkName, options);\n };\n\n log.forkWithOptions = function (_name, _options) {\n return createLogger(_name, _options);\n };\n\n return log;\n }", "init_console() { \n var ascendant = this\n /* Do the keypress magic like a real console, but later\n keypress(process.stdin);\n // listen for the \"keypress\" event\n process.stdin.on('keypress', function (ch, key) {\n console.log('got \"keypress\"', key);\n if (key && key.ctrl && key.name == 'd') {\n process.stdout.write(\"Exiting FXCM Console...\")\n process.stdin.pause()\n process.exit();\n }\n });\n\n //process.stdin.setRawMode(true);\n //process.stdin.resume();\n */\n process.stdin.on('data', function (data) {\n \n var input = data.toString().trim();\n var split = input.search('{');\n if (split === -1) {\n split = input.length;\n }\n const command = input.substr(0, split).trim();\n var params = input.substr(split).trim();\n const _fxcmClient = ascendant._client;\n ascendant.commands.set(ascendant.commands.size + 1, input)\n \n // if the line was empty we don't want to do anything\n switch (command) {\n case 'help':\n process.stdout.write('Help is on the way!\\r\\n')\n break;\n case 'history': \n var history = \"Command History:\\r\\n\" \n ascendant.commands.forEach((value, key) => { history += value + \"\\r\\n\" }) \n process.stdout.write(history + \"\\r\\n\" + \"Press return to continue..\")\n break;\n case 'exit': \n process.stdout.write(\"I'm out, bye!\")\n process.exit() \n break;\n case 'live':\n console.log(`Live rates for currency pair(${params}):` )\n fxcmClient.subscribeLiveRates(params)\n break;\n case 'accounts':\n fxcmClient.getAccounts()\n break;\n case 'products':\n fxcmClient.getProducts()\n break;\n case 'orderbook':\n fxcmClient.getProductOrderBook()\n break; \n case 'send':\n // command must be registered with cli\n\t if (params.length > 0) {\n params = JSON.parse(params)\n try {\n \n ascendant.makeRequest(params.method, params.resource, params.params, params.callback);\n \n } catch (e) {\n console.log('could not parse JSON parameters: ', e);\n }\n } else {\n _fxcmClient.emit(command, {});\n }\n _fxcmClient.emit('prompt');\n break;\n default: \n if (_fxcmClient.eventNames().indexOf(command) < 0) {\n console.log(\"Command not recognized. Available commands: \", _fxcmClient.eventNames())\n _fxcmClient.emit('prompt');\n }\n return;\n }\n\n });\n \n this._client.on('prompt', (arg = '') => {\n readline.clearLine(process.stdout, 0)\n readline.cursorTo(process.stdout, 0, null);\n process.stdout.write('fxcm:> ' + arg);\n })\n\n this._client.on('exit', () => {\n process.exit();\n });\n\n // loading of extra modules\n this._client.on('load', (params) => {\n if (typeof(params.filename) === 'undefined') {\n console.log('command error: \"filename\" parameter is missing.')\n } else {\n var test = require(`./${params.filename}`);\n test.init(cli,socket);\n }\n });\n /*\n // helper function to send parameters in stringified form, which is required by FXCM REST API\n this._client.on('send', (params) => {\n if (typeof(params.params) !== 'undefined') {\n params.params = querystring.stringify(params.params);\n }\n ascendant._client.emit('send_raw', params);\n });\n */\n // will send a request to the server\n this._client.on('send_raw', (params) => {\n // avoid undefined errors if params are not defined\n if (typeof(params.params) === 'undefined') {\n params.params = '';\n }\n // method and resource must be set for request to be sent\n if (typeof(params.method) === 'undefined') { \n console.log('command error: \"method\" parameter is missing.');\n } else if (typeof(params.resource) === 'undefined') {\n console.log('command error: \"resource\" parameter is missing.');\n } else {\n ascendant.makeRequest(params.method, params.resource, params.params, params.callback);\n }\n });\n\n /**\n * \n */\n this._client.on('price_subscribe', (params) => {\n if(typeof(params.pairs) === 'undefined') {\n console.log('command error: \"pairs\" parameter is missing.');\n } else {\n subscribe(params.pairs);\n }\n });\n /**\n * \n */\n this._client.on('price_unsubscribe', (params) => {\n if(typeof(params.pairs) === 'undefined') {\n console.log('command error: \"pairs\" parameter is missing.');\n } else {\n unsubscribe(params.pairs);\n }\n });\n \n }", "static globalize() {\n if (!isBrowser) {\n throw \"Console globalization is not available.\";\n }\n window._console = console;\n window.console = Logger.logger;\n }", "constructor() {\n const funcName = 'Constructor()';\n\n this._isDebugMode = (process.env.NODE_ENV === 'development');\n this.debug(`${logPrefix} ${funcName}. Environment: `, process.env.NODE_ENV);\n\n const winstonLogPath = require('path').join(__dirname, constants.WinstonLogPath)\n this.debug(`${logPrefix} ${funcName}. Winston log path `, winstonLogPath);\n\n winstonLog = winston.createLogger({\n format: winston.format.combine(\n winston.format.splat(),\n winston.format.simple()\n ),\n transports: [\n new winston.transports.Console(),\n new winston.transports.File({ filename: winstonLogPath })\n ]\n });\n }", "function getLogger() {\n const logger = createLogger({\n exitOnError: false,\n format: format.json(),\n });\n\n logger.add(\n new transports.Console({\n format: format.simple(),\n }),\n );\n\n return logger;\n}", "constructor(config){ \n super(config) \n var x = this\n x.running = false\n Konekti.daemon(function(){ return Konekti.client[x.id+'console']!==undefined },\n function(){\n x.terminal = Konekti.client[x.id+'console']\n x.process = new ProcessRunner(x.url, \"python\", \n function(res){\n var n = res.length\n for(var i=0; i<n; i++){ \n x.terminal.output(res[i].out!==undefined?res[i].out:'')\n x.terminal.output(res[i].err!==undefined?res[i].err:'')\n }\n if(n>0 && res[n-1].out === undefined ) x.end()\n }, \n function(out=''){\n x.terminal.output(out) \n x.end()\n }\n )\n x.terminal.server = x.process \n }\t\n )\n }", "constructor(config){ \n super(config) \n var x = this\n x.running = false\n Konekti.daemon(function(){ return Konekti.client[x.id+'console']!==undefined },\n function(){\n x.terminal = Konekti.client[x.id+'console']\n x.process = new ProcessRunner(x.url, \"python\", \n function(res){\n var n = res.length\n for(var i=0; i<n; i++){ \n x.terminal.output(res[i].out!==undefined?res[i].out:'')\n x.terminal.output(res[i].err!==undefined?res[i].err:'')\n }\n if(n>0 && res[n-1].out === undefined ) x.end()\n }, \n function(out=''){\n x.terminal.output(out) \n x.end()\n }\n )\n x.terminal.server = x.process \n }\t\n )\n }", "constructor() {\n console.log('Hello world!');\n }", "function Logging() {\n this.thresholdOfLogLevel = LogLevel.Informational;\n this.verboseTelemetry = false;\n this.http = new Http();\n this.logSet = {\n maxWaitTimeMs: Logging.logMaxWaitTimeMs,\n maxRecordLength: Logging.logMaxRecordLength,\n api: '/api/log'\n };\n this.telemetrySet = {\n maxWaitTimeMs: Logging.telemetryMaxWaitTimeMs,\n maxRecordLength: Logging.telemetryMaxRecordLength,\n api: '/api/telemetry'\n };\n }", "function bindConsole() {\n for (const level of TARGETED_LEVELS) {\n if (!globalConsole[level]) {\n globalConsole[level] = console[level];\n global.console[level] = hijackLog(level);\n }\n }\n}", "function getLogger(name, level, existingLogger) {\n // Get a unique ID for the logger.\n const instanceId = instanceCount;\n instanceCount += 1;\n // Set up the logger.\n const logger = (() => {\n if (existingLogger !== undefined) {\n return existingLogger;\n }\n return new logger_1.ConsoleLogger();\n })();\n logger.setName(`web-api:${name}:${instanceId}`);\n if (level !== undefined) {\n logger.setLevel(level);\n }\n return logger;\n}", "function LedControl(log, config, api) {\n log('LED-control Init');\n let platform = this;\n this.log = log;\n this.config = config;\n this.accessories = [];\n\n this.requestServer = http.createServer(((request, response) => {\n if (request.url === '/add') {\n this.addAccessory('LedLamp');\n response.writeHead(204);\n response.end();\n }\n\n if (request.url == '/reachability') {\n this.updateAccessoriesReachability();\n response.writeHead(204);\n response.end();\n }\n\n if (request.url == '/remove') {\n this.removeAccessory();\n response.writeHead(204);\n response.end();\n }\n }).bind(this));\n\n this.requestServer.listen(18081, () => {\n platform.log('Server Listening...');\n });\n\n if (api) {\n this.api = api;\n\n this.api.on('didFinishLaunching', function() {\n platform.log('DidFinishLaunching');\n }.bind(this));\n }\n}", "function enhancedConsoleLogger(log, config) {\n var logEnabled = config.CONSOLE_LOGGING_ENABLED;\n\n var _$log = { // capture the original methods\n log : (logEnabled ? log.log : angular.noop),\n info : (logEnabled ? log.info : angular.noop),\n debug : (logEnabled ? log.debug : angular.noop),\n warn : log.warn,\n error : log.error\n };\n\n function prepareLogFn(logFn, prefix) {\n\n var enhancedLogFn = function() {\n var args = [].slice.call(arguments);\n\n if (prefix) { // prepend an optional prefix to the original message\n args[0] = prefix + ' : ' + args[0];\n }\n\n logFn.apply(null, args); // invoke $log method with our prefixed message\n };\n\n enhancedLogFn.logs = []; // add support for angular-mocks expectations\n\n return enhancedLogFn;\n }\n\n // add a new $log method returning an extended $log\n\n log.getInstance = function(prefix) {\n var logInstance = {\n log: prepareLogFn(_$log.log, prefix),\n info: prepareLogFn(_$log.info, prefix),\n debug: prepareLogFn(_$log.debug, prefix),\n warn: prepareLogFn(_$log.warn, prefix),\n error: prepareLogFn(_$log.error, prefix),\n format: function(msg) {\n return prefix + ' : ' + msg;\n }\n };\n\n logInstance.ts = function(msg) { // prefix with a timestamp\n logInstance.debug(new Date().getTime() + ' - ' + msg);\n };\n\n logInstance.debug('created');\n\n return logInstance;\n };\n\n return log;\n }", "set consoleLog(value) {\n this._consoleLog = Boolean(value);\n }", "constructor(log, config, api) {\n this.PlatformAccessory = PlatformAccessory\n this.Accessory = Accessory\n this.Service = Service\n this.Characteristic = Characteristic\n this.UUIDGen = UUIDGen\n this.log = log\n this.config = config\n this.devices = {}\n this.accessories = {}\n if (api) {\n // Save the API object as plugin needs to register new accessory via this object.\n this.api = api\n } else {\n this.log.error(\"Homebridge's version is too old, please upgrade!\")\n }\n if (this.api) {\n this.api.on('didFinishLaunching', this.didFinishLaunching.bind(this))\n }\n if (_homebridge.broadlink != undefined) {\n _homebridge.broadlink = this\n }\n this.log.debug('broadlink constructor done')\n }", "static get defaultOptions() {\r\n\t\treturn {\r\n\t\t\tsource: 'default', //undefined,\t//null,\r\n\t\t\tminLevel: 'debug', //'debug',\t//-1\r\n\t\t\t// testLevels: true,\r\n\t\t\t// logging levels available on each Console instance, as a method of that name\r\n\t\t\tlevels: {\r\n\t\t\t\tdebug:\t\t{ n: -2, ch: 'D' },\r\n\t\t\t\tverbose:\t{ n: -1, ch: 'V' },\r\n\t\t\t\tinfo:\t\t\t{ n: 0, ch: 'I' },\r\n\t\t\t\tlog:\t\t\t{ n: 0, ch: 'I' },//this.levels.info\r\n\t\t\t\twarn:\t\t\t{ n: +1, ch: 'W' },\r\n\t\t\t\terror:\t\t{ n: +2, ch: 'E' },\r\n\t\t\t\tfatal:\t\t{ n: +3, ch: 'F' }\r\n\t\t\t},\r\n\t\t\tstdio: {\r\n\t\t\t\tout: process.stdout,\r\n\t\t\t\terr: process.stderr\r\n\t\t\t},\r\n\t\t\tformat: timerWrapper(false, /*null,*/ 'timestamp', (source, level, args) => {\r\n\t\t\t\tvar dt = new Date();\r\n\t\t\t\treturn [\r\n\t\t\t\t// var a1 =\r\n\t\t\t\t\r\n\t\t\t\t\t[\r\n\t\t\t\t\t\tdt.getFullYear().toString().substring(2),\r\n\t\t\t\t\t\tdt.getMonth().toString().pad(2, '0'),\r\n\t\t\t\t\t\tdt.getDate().toString().pad(2, '0'),\r\n\t\t\t\t\t\t':',\r\n\t\t\t\t\t\tdt.getHours().toString().pad(2, '0'),\r\n\t\t\t\t\t\tdt.getMinutes().toString().pad(2, '0'),\r\n\t\t\t\t\t\tdt.getSeconds().toString().pad(2, '0'),\r\n\t\t\t\t\t\t'.',\r\n\t\t\t\t\t\tdt.getMilliseconds().toString().pad(3, '0')\r\n\t\t\t\t\t].join(''),\r\n\t\t\t\t\tprocess.pid,\r\n\t\t\t\t\tsource,\r\n\t\t\t\t\t'[' + level.ch + ']',\r\n\t\t\t\t\t// typeof msg !== 'object' ? msg : util.inspect(msg),\r\n\t\t\t\t\t...args.map(arg => {\r\n\t\t\t\t\t\tif (typeof arg === 'object') {\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\targ = JSON.stringify(arg);\r\n\t\t\t\t\t\t\t} catch (e) {\r\n\t\t\t\t\t\t\t\targ = util.inspect(arg);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\treturn arg;\r\n\t\t\t\t\t})\r\n\t\t\t\t].join(' ');\r\n\t\t\t\t// var a2 = args.join(' ');\r\n\t\t\t\t// return a1 + a2;\r\n\t\t\t})\r\n\t\t};\r\n\t}", "static spawn() {\n const env = new Environment();\n const chat = require('./chat').spawn({ code: 'Global' });\n\n env.set('code', 'Global');\n env.set('games', 1);\n\n env.set('onMaintenance', false);\n\n env.set('discordWebhookURL', '/');\n\n env.set('ipBlacklist', require('../security/databases/untrusted-ips'));\n env.set('emailWhitelist', require('../security/databases/trusted-emails'));\n\n env.set('chat', chat);\n\n return env;\n }", "function cls(opts)\n {\n\t // //////////////////////////////////////////////////////////////////////////////////////////////\n \t//\n // private instance fields\n //\n\t // //////////////////////////////////////////////////////////////////////////////////////////////\n\n var self = this;\n\n\t\tvar defaults = {\n\t\t\tmaxDepth: 3,\n\t\t\thandleExceptions: false,\n\t\t\tapiKey: null,\n\t\t\t/** Log to console */\n\t\t\tlogConsole: true,\n\t\t\t/** Log to ArsenicSoup logging service */\n\t\t\tlogRemote: false,\n\t\t\t/** Log to ArsenicSoup logging service */\n\t\t\tlogPaperTrail: false,\n\t\t\t/** Log to a file */\n\t\t\tlogFile: false,\n\t\t\t/** You can specifiy a tag for all following log entries */\n\t\t\tlogTag: '',\n\t\t\techoMemory: false,\n\t\t\techoCPU: false,\n\t\t\tlocale: 'en',\n\t\t\tlevel: 'debug',\n\t\t\tglobalLevel: 'debug',\n\t\t timestampPattern : 'ddd MMM DD h:mm:ss YYYY', // Mon Oct 20 12:00:22 2014'\n\t\t timestamps : true,\n\t\t};\n\n\t\tvar logLevel = 0;\n\n\t\tif (!opts){\n\t\t\topts = [];\n\t\t}\n\n\t\tvar settings = _.defaults(opts, defaults);\n\n\t\tConsoleTransport.setup();\n\n\t // //////////////////////////////////////////////////////////////////////////////////////////////\n\t\t//\n\t\t// Public instance fields\n\t\t//\n\t // //////////////////////////////////////////////////////////////////////////////////////////////\n\n\t\tthis.age = 10;\n\n\t // //////////////////////////////////////////////////////////////////////////////////////////////\n\t //\n\t // Public methods\n\t //\n\t // //////////////////////////////////////////////////////////////////////////////////////////////\n\n\n\t\t/**\n\t\t* Set the maximum stack depth to show\n\t\t*/\n\t\tthis.setMaxStackDepth = function(depth){\n\t\t\tmaxDepth = depth;\n\t\t};\n\n\t /**\n\t * Set the time stamp format, @see http://momentjs.com/docs/\n\t * @param {string} pattern data format pattern, default is 'ddd MMM h:mm:ss YYYY'\n\t */\n\t\tthis.setTimestampFormat = function(pattern){\n\t\t\tif (!pattern) pattern = 'ddd MMM DD h:mm:ss YYYY';\n\t\t\tsettings.timestampPattern = pattern;\n\t\t\tsettings.timestamps = true;\n\t\t};\n\n\t /**\n\t * Set the time stamp locale, @see http://momentjs.com/docs/\n\t * @param {string} locale locale string, default is 'en'\n\t */\n\t\tthis.setLocale = function(locale){\n\t\t\tif (!locale) locale = 'en';\n\t\t\tmoment.locale(locale);\n\t\t\tsettings.timestamps = true;\n\t\t};\n\n\t\tthis.echoTimestamps = function(toggle){\n\t\t\tsettings.timestamps = !!toggle;\n\t\t};\n\n\t\tthis.setLabel = function(label){\n\t\t\tsettings.logTag = label;\n\t\t};\n\n\t\t/**\n\t\t* Instruct the Logger to catch any uncaught exceptions.\n\t\t*/\n\t\tthis.catchExceptions = function(){\n\t\t\tprocess.on('uncaughtException', function (err) {\n\t\t\t\tself.exception(err);\n\t\t\t\t//var stack = new Error().stack;\n\t\t\t\t//Logger.exception(stack);\n\t\t\t});\n\t\t};\n\n\t\tthis.echoCPUUsage = function(toggle){\n\t\t\tif (!toggle) toggle = true;\n\t\t\tsettings.echoCPU = toggle;\n\t\t};\n\n\t\tthis.echoMemoryUsage = function(toggle){\n\t\t\tif (!toggle) toggle = true;\n\t\t\tsettings.echoMemory = toggle;\n\t\t};\n\n\t // //////////////////////////////////////////////////////////////////////////////////////////////\n\n\t\tthis.setFilter = function(opts){\n\n\t\t\tfilterOptions = opts;\n\n\t\t\t// Backwards compatible (convert tag to tags)\n\t\t\tif ('tag' in filterOptions){\n\t\t\t\tfilterOptions.tags = [filterOptions.tag];\n\t\t\t}\n\n\t\t\tif ('tags' in filterOptions && typeof filterOptions.tags == 'string'){\n\t\t\t\tfilterOptions.tags = [filterOptions.tags];\n\t\t\t}\n\n\t\t\tif ('functions' in filterOptions && typeof filterOptions.functions == 'string'){\n\t\t\t\tfilterOptions.functions = [filterOptions.functions];\n\t\t\t}\n\t\t};\n\n\t // //////////////////////////////////////////////////////////////////////////////////////////////\n\n\t\t/**\n\t\t* Setup the Logger to use the ArsenicLogger remote logging service\n\t\t* @param {string} apiKey The API key from the ArsenicLogger service\n\t\t*/\n\t\t/*\n\t\tthis.useArsenicLogger = function(apiKey, tag){\n\n\t var pid = process.pid // you can use any valid PID instead\n\n\t\t\t//usage.clearHistory(process.pid);\n\t\t\tsettings.apiKey = apiKey;\n\t settings.logRemote = true;\n\t settings.logTag = tag;\n\n\t\t};\n\t\t*/\n\n\t\tthis.setTransport = function(transports){\n\n\t\t\tif (!_.isArray(transports)){\n\t\t\t\ttransports = [transports];\n\t\t\t}\n\n\t\t\t// Clear existing options\n\t\t\t//settings.logConsole = false;\n\t\t\t//settings.logPaperTrail = false;\n\n\t\t\tfor (var i=0; i<transports.length; i++){\n\n\t\t\t\tvar transport = transports[i];\n\n\t\t\t\tif (transport.name === 'console'){\n\t\t\t\t\tsettings.logConsole = true;\n\t\t\t\t\tif (transport.theme){\n\t\t\t\t\t\tConsoleTransport.setup(transport.theme);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (transport.name === 'papertrail'){\n\t\t\t\t\tsettings.logPaperTrail = true;\n\t\t\t\t\tPaperTrailTransport.setup(transport.host, transport.port);\n\t\t\t\t}\n\n\t\t\t\tif (transport.name === 'file'){\n\t\t\t\t\tsettings.logFile = true;\n\t\t\t\t\tFileTransport.setup(transport.filename);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t // //////////////////////////////////////////////////////////////////////////////////////////////\n\n\t\t/**\n\t\t* Set the logging level\n\t\t* @param {string} level - specifiy the desired minimum logging level, e.g. 'warn' will mean only\n\t\t* warning or above will be logged.\n\t\t*/\n\t\tthis.setLevel = function(level){\n\t\t\tswitch(level){\n\t\t\t\tcase 'log': logLevel = 0; break;\n\t\t\t\tcase 'debug': logLevel = 1; break;\n\t\t\t\tcase 'info': logLevel = 2; break;\n\t\t\t\tcase 'warn': logLevel = 3; break;\n\t\t\t\tcase 'error': logLevel = 4; break;\n\t\t\t\tcase 'fatal': logLevel = 5; break;\n\t\t\t}\n\t\t};\n\n\t\tthis.setGlobalLevel = function(level){\n\t\t\tswitch(level){\n\t\t\t\tcase 'log': globalLogLevel = 0; break;\n\t\t\t\tcase 'debug': globalLogLevel = 1; break;\n\t\t\t\tcase 'info': globalLogLevel = 2; break;\n\t\t\t\tcase 'warn': globalLogLevel = 3; break;\n\t\t\t\tcase 'error': globalLogLevel = 4; break;\n\t\t\t\tcase 'fatal': globalLogLevel = 5; break;\n\t\t\t}\n\t\t};\n\n\n\t this.getLevel = function(levelString){\n\n\t var log_level = 'unknown';\n\n\t switch(levelString){\n\t case 'log': log_level = 0; break;\n\t case 'debug': log_level = 1; break;\n\t case 'info': log_level = 2; break;\n\t case 'warn': log_level = 3; break;\n\t case 'error': log_level = 4; break;\n\t case 'fatal': log_level = 5; break;\n\t case 'exception':log_level = 5; break;\n\t }\n\n\t return log_level;\n\t };\n\n\t // //////////////////////////////////////////////////////////////////////////////////////////////\n\n\t\tthis.debug = function() { message(arguments, 'debug', false); };\n\t\tthis.warn = function() { message(arguments, 'warn', false); };\n\t\tthis.info = function() { message(arguments, 'info', false); };\n\t\tthis.error = function() { message(arguments, 'error', false); };\n\t\tthis.fatal = function() { message(arguments, 'fatal', false); };\n\t\tthis.exception = function() { message(arguments, 'exception', false); };\n\n\t\tthis.debugX = function() { message(arguments, 'debug', true); };\n\t\tthis.warnX = function() { message(arguments, 'warn', true); };\n\t\tthis.infoX = function() { message(arguments, 'info', true); };\n\t\tthis.errorX = function() { message(arguments, 'error', true); };\n\t\tthis.fatalX = function() { message(arguments, 'fatal', true); };\n\t\tthis.exceptionX = function() { message(arguments, 'exception', true); };\n\n\t // //////////////////////////////////////////////////////////////////////////////////////////////\n\t //\n\t // Private methods\n\t //\n\t // //////////////////////////////////////////////////////////////////////////////////////////////\n\n\t function init(){\n\t\t\t// Process settings\n\t\t\tself.setLocale(settings.locale);\n\t\t\tself.setTimestampFormat(settings.timestampPattern);\n\n\t\t\tif (settings.handleExceptions){\n\t\t\t\tself.catchExceptions(settings.timestampPattern);\n\t\t\t}\n\t }\n\n\t\tfunction message(args, level, hasTag){\n\n\t\t\tvar log_level = self.getLevel(level);\n\n\t if (globalLogLevel){\n\t if (log_level < globalLogLevel){\n\t return;\n\t }\n\t }\n\t else {\n\t if (log_level < logLevel){\n\t return;\n\t }\n\t }\n\n\t var stackObj = stack();\n\n\t\t\t// Route the message based on the mode\n\n\t if (settings.logPaperTrail){\n\t\t\t\tPaperTrailTransport.message(args, level, stackObj, hasTag, self);\n\t }\n\n\t if (settings.logConsole){\n\t ConsoleTransport.message(args, level, stackObj, hasTag, settings, filterOptions);\n\t }\n\n\t\t\tif (settings.logFile){\n\t\t\t\tFileTransport.message(args, level, stackObj, hasTag, settings, filterOptions);\n\t\t\t}\n\n\t\t};\n\n\t // //////////////////////////////////////////////////////////////////////////////////////////////\n\n\t\tinit();\n }", "function ovverideConsole() {\n console.log = (message, args = []) => {\n const pattern = /^\\[bot\\.(info|error|plugin)\\](.*)/;\n const matches = message.match(pattern);\n\n if (!matches) {\n logger.log(message, ...args);\n return;\n }\n\n if (matches.length > 1) {\n const method = matches[1];\n const textMessage = matches[2]\n if (typeof logger[method] === 'function') {\n logger[method](textMessage, ...args);\n }\n }\n }\n}", "constructor () {\n /**\n * Should always run start() cmd by default\n * @type {boolean}\n */\n this.auto = process.env.Q_CLI_AUTO || true\n /**\n * Slice the process arguments at this index\n * @type {number}\n */\n this.sliceAt = 2\n /**\n * minimist configuration or false\n * @type {boolean}\n */\n this.parseArgs = false\n\n this.pkgName = '@barnstorm/cli'\n }", "constructor() {\n this.logger = new Logger();\n }", "constructor(level = \"info\") {\n this.level = level;\n }", "function startApi() {\n // Bring in child_process https://nodejs.org/api/child_process.html\n var proc = require('child_process').spawn;\n\n // Create our process path based on system\n var apipath = (os.platform() == \"darwin\") ? path.join(__dirname, \"..//..//api//bin//dist//osx//Api\") : path.join(__dirname,\"..\\\\..\\\\api\\\\bin\\\\dist\\\\win\\\\api.exe\");\n\n // And call the process\n apiProcess = proc(apipath);\n\n // Log output of app to console.\n apiProcess.stdout.on('data', (data) => {\n console.log(`stdout: ${data}`);\n if (mainWindow == null) {\n createWindow();\n }\n })\n}", "setLevel(level) {\n this.consoleTransport.level = level || defaultLevel;\n }", "constructor() {\n super();\n logger.info(`This appears to be ${this.getName()}, ver: ${this.getVersion()}`);\n }", "constructor (api_token) {\n\t\t// Create a client\n\t\tthis.client = new Discord.Client()\n\t\t// Handle messages from client\n\t\tthis.client.on(\"debug\", (m) => winston.debug(m))\n\t\tthis.client.on(\"warn\", (m) => winston.warn(m))\n\t\t// Store the specified token\n\t\tthis.api_token = api_token\n\t\t// Default there are no commands added\n\t\tthis.handlers = []\n\t\t// Checks for paginated messages\n\t\tthis.paginated = {}\n\t}", "constructor() {\n super()\n console.info('construct')\n // Maximum number of clients allowed to connect into the room.\n // When room reaches this limit, it is locked automatically.\n // Unless the room was explicitly locked by you via lock() method,\n // the room will be unlocked as soon as a client disconnects from it.\n this.maxClients = 2\n // Frequency to send the room state to connected clients (in milliseconds)\n this.setPatchRate(patchRate)\n }", "function createTerminalInterface(){\n let _rl = READLINE.createInterface({\n input: process.stdin,\n output: process.stdout,\n prompt: \"Enter help for more >> \",\n });\n // initial prompt and welcome display\n displayHeading(\"Welcome to CLI\");\n _rl.prompt();\n // listening for input on terminal\n _rl.on(\"line\", (input) => {\n processInput(input);\n _rl.prompt();\n });\n}", "constructor(config) {\n this.configureApi(config);\n }", "function consoleSubstitute() {\n this.log = function() {return true;};\n this.debug = function() {return true;};\n this.info = function() {return true;};\n this.warn = function() {return true;};\n this.error = function() {return true;};\n this.time = function() {return true;};\n this.timeEnd = function() {return true;};\n this.profile = function() {return true;};\n this.profileEnd = function() {return true;};\n this.trace = function() {return true;};\n this.group = function() {return true;};\n this.groupEnd = function() {return true;};\n this.dir = function() {return true;};\n this.dirxml = function() {return true;};\n}", "function Logger() {\n return new require( './real-logger-private' ).Logger();\n}", "constructor (api) { this.api = api }", "constructor (api) { this.api = api }", "constructor (api) { this.api = api }", "function uConsole() {\n this.context = document.getElementById('container');\n}", "function Logger(config) {\n if (config == void 0)\n config = {};\n _.defaultsDeep(config, defaultConfig);\n config.isEnabled = config.namespace != void 0 && process.env.DEBUG != \"*\" && (process.env.DEBUG || \"\").match(config.namespace) == void 0 ? false : true;\n config.lastLogged = moment.utc();\n this.config = config;\n this.buffer = [];\n this.bufferMode = false;\n this.children = [];\n this.parent = null;\n}", "constructor() {\n this.logger = new Logger();\n }", "function Logger () {\r\n this.loggingLevel = DEFAULT_LOG_LEVEL;\r\n}", "_bootstrap() {\n global.Console.log(global.Console.color('Gorgon Server' + ' v' + this.GorgonConfig.data.version, 'green'));\n global.Console.log('Author: Ryan Rentfro <rrentfro at gmail dot com>');\n global.Console.log('Project: https://github.com/manufacturing-industry/gorgon');\n this._motd();\n global.Console.log('Press ' + global.Console.color('cntrl+c', 'yellow') + ' to exit the server');\n global.Version = this.GorgonConfig.data.version;\n }", "constructor() {\n // Se mostrara en CONSOLA\n console.log(\"I am an animal.\");\n }", "function makeFakeConsole(logArray) {\n // TODO: these are the properties that MDN documents. Node.js has a bunch\n // of additional ones that I didn't include, which might be appropriate.\n const consoleWhitelist = [\n 'log',\n 'info',\n 'warn',\n 'error',\n 'group',\n 'groupEnd',\n 'trace',\n 'time',\n 'timeLog',\n 'timeEnd',\n ];\n\n // TODO(msm): Too heavy a hammer\n const noErrorFilter = specimen => !(specimen instanceof Error);\n\n const fakeConsole = {};\n\n consoleWhitelist.forEach(name => {\n // Use an arror function so that it doesn't come with its own name in\n // its printed form. Instead, we're hoping that tooling uses only\n // the `.name` property set below.\n const f = (...args) => {\n // Note the curlies and lack of a `return`. All these should return\n // only undefined, i.e., not return anything.\n logArray.push([name, ...args.filter(noErrorFilter)]);\n };\n defineProperty(f, 'name', { value: name });\n fakeConsole[name] = f;\n });\n\n return harden(fakeConsole);\n}", "constructor(api) {\n this.api = api;\n }", "static getInstance() {\n if (!this._instance) {\n this._instance = new TraceAPI();\n }\n return this._instance;\n }", "function Logger() {\n\tthis._currentLogLevel = Logger.ALL;\n\tthis._timestamps = true;\n}", "function activateConsole(app, mainMenu, palette, contentFactory, editorServices, restorer, browserFactory, rendermime, settingRegistry, launcher) {\n const manager = app.serviceManager;\n const { commands, shell } = app;\n const category = 'Console';\n // Create an instance tracker for all console panels.\n const tracker = new apputils_1.InstanceTracker({ namespace: 'console' });\n // Handle state restoration.\n restorer.restore(tracker, {\n command: CommandIDs.open,\n args: panel => ({\n path: panel.console.session.path,\n name: panel.console.session.name\n }),\n name: panel => panel.console.session.path,\n when: manager.ready\n });\n // Add a launcher item if the launcher is available.\n if (launcher) {\n manager.ready.then(() => {\n const specs = manager.specs;\n if (!specs) {\n return;\n }\n let baseUrl = coreutils_1.PageConfig.getBaseUrl();\n for (let name in specs.kernelspecs) {\n let rank = name === specs.default ? 0 : Infinity;\n let kernelIconUrl = specs.kernelspecs[name].resources['logo-64x64'];\n if (kernelIconUrl) {\n let index = kernelIconUrl.indexOf('kernelspecs');\n kernelIconUrl = baseUrl + kernelIconUrl.slice(index);\n }\n launcher.add({\n command: CommandIDs.create,\n args: { isLauncher: true, kernelPreference: { name } },\n category: 'Console',\n rank,\n kernelIconUrl\n });\n }\n });\n }\n /**\n * Create a console for a given path.\n */\n function createConsole(options) {\n let panel;\n return manager.ready\n .then(() => {\n panel = new console_1.ConsolePanel(Object.assign({ manager,\n contentFactory, mimeTypeService: editorServices.mimeTypeService, rendermime, setBusy: app.setBusy.bind(app) }, options));\n return panel.session.ready;\n })\n .then(() => {\n // Add the console panel to the tracker.\n tracker.add(panel);\n panel.session.propertyChanged.connect(() => tracker.save(panel));\n shell.addToMainArea(panel, {\n ref: options.ref,\n mode: options.insertMode,\n activate: options.activate\n });\n return panel;\n });\n }\n /**\n * Whether there is an active console.\n */\n function isEnabled() {\n return (tracker.currentWidget !== null &&\n tracker.currentWidget === app.shell.currentWidget);\n }\n let command = CommandIDs.open;\n commands.addCommand(command, {\n execute: (args) => {\n let path = args['path'];\n let widget = tracker.find(value => {\n return value.console.session.path === path;\n });\n if (widget) {\n if (args['activate'] !== false) {\n shell.activateById(widget.id);\n }\n return widget;\n }\n else {\n return manager.ready.then(() => {\n let model = algorithm_1.find(manager.sessions.running(), item => {\n return item.path === path;\n });\n if (model) {\n return createConsole(args);\n }\n return Promise.reject(`No running kernel session for path: ${path}`);\n });\n }\n }\n });\n command = CommandIDs.create;\n commands.addCommand(command, {\n label: args => {\n if (args['isPalette']) {\n return 'New Console';\n }\n else if (args['isLauncher'] && args['kernelPreference']) {\n const kernelPreference = args['kernelPreference'];\n return manager.specs.kernelspecs[kernelPreference.name].display_name;\n }\n return 'Console';\n },\n iconClass: args => (args['isPalette'] ? '' : 'jp-CodeConsoleIcon'),\n execute: args => {\n let basePath = args['basePath'] ||\n args['cwd'] ||\n browserFactory.defaultBrowser.model.path;\n return createConsole(Object.assign({ basePath }, args));\n }\n });\n // Get the current widget and activate unless the args specify otherwise.\n function getCurrent(args) {\n let widget = tracker.currentWidget;\n let activate = args['activate'] !== false;\n if (activate && widget) {\n shell.activateById(widget.id);\n }\n return widget;\n }\n commands.addCommand(CommandIDs.clear, {\n label: 'Clear Console Cells',\n execute: args => {\n let current = getCurrent(args);\n if (!current) {\n return;\n }\n current.console.clear();\n },\n isEnabled\n });\n commands.addCommand(CommandIDs.runUnforced, {\n label: 'Run Cell (unforced)',\n execute: args => {\n let current = getCurrent(args);\n if (!current) {\n return;\n }\n return current.console.execute();\n },\n isEnabled\n });\n commands.addCommand(CommandIDs.runForced, {\n label: 'Run Cell (forced)',\n execute: args => {\n let current = getCurrent(args);\n if (!current) {\n return;\n }\n current.console.execute(true);\n },\n isEnabled\n });\n commands.addCommand(CommandIDs.linebreak, {\n label: 'Insert Line Break',\n execute: args => {\n let current = getCurrent(args);\n if (!current) {\n return;\n }\n current.console.insertLinebreak();\n },\n isEnabled\n });\n commands.addCommand(CommandIDs.interrupt, {\n label: 'Interrupt Kernel',\n execute: args => {\n let current = getCurrent(args);\n if (!current) {\n return;\n }\n let kernel = current.console.session.kernel;\n if (kernel) {\n return kernel.interrupt();\n }\n },\n isEnabled\n });\n commands.addCommand(CommandIDs.restart, {\n label: 'Restart Kernel…',\n execute: args => {\n let current = getCurrent(args);\n if (!current) {\n return;\n }\n return current.console.session.restart();\n },\n isEnabled\n });\n commands.addCommand(CommandIDs.closeAndShutdown, {\n label: 'Close and Shutdown…',\n execute: args => {\n const current = getCurrent(args);\n if (!current) {\n return;\n }\n return apputils_1.showDialog({\n title: 'Shutdown the console?',\n body: `Are you sure you want to close \"${current.title.label}\"?`,\n buttons: [apputils_1.Dialog.cancelButton(), apputils_1.Dialog.warnButton()]\n }).then(result => {\n if (result.button.accept) {\n current.console.session.shutdown().then(() => {\n current.dispose();\n });\n }\n else {\n return false;\n }\n });\n },\n isEnabled\n });\n commands.addCommand(CommandIDs.inject, {\n execute: args => {\n let path = args['path'];\n tracker.find(widget => {\n if (widget.console.session.path === path) {\n if (args['activate'] !== false) {\n shell.activateById(widget.id);\n }\n widget.console.inject(args['code']);\n return true;\n }\n return false;\n });\n },\n isEnabled\n });\n commands.addCommand(CommandIDs.changeKernel, {\n label: 'Change Kernel…',\n execute: args => {\n let current = getCurrent(args);\n if (!current) {\n return;\n }\n return current.console.session.selectKernel();\n },\n isEnabled\n });\n commands.addCommand(CommandIDs.toggleShowAllActivity, {\n label: args => 'Show All Kernel Activity',\n execute: args => {\n let current = getCurrent(args);\n if (!current) {\n return;\n }\n current.console.showAllActivity = !current.console.showAllActivity;\n },\n isToggled: () => tracker.currentWidget\n ? tracker.currentWidget.console.showAllActivity\n : false,\n isEnabled\n });\n // Constants for setting the shortcuts for executing console cells.\n const shortcutPlugin = '@jupyterlab/shortcuts-extension:plugin';\n const selector = '.jp-CodeConsole-promptCell';\n // Keep updated keybindings for the console commands related to execution.\n let linebreak = algorithm_1.find(commands.keyBindings, kb => kb.command === CommandIDs.linebreak);\n let runUnforced = algorithm_1.find(commands.keyBindings, kb => kb.command === CommandIDs.runUnforced);\n let runForced = algorithm_1.find(commands.keyBindings, kb => kb.command === CommandIDs.runForced);\n commands.keyBindingChanged.connect((s, args) => {\n if (args.binding.command === CommandIDs.linebreak) {\n linebreak = args.type === 'added' ? args.binding : undefined;\n return;\n }\n if (args.binding.command === CommandIDs.runUnforced) {\n runUnforced = args.type === 'added' ? args.binding : undefined;\n return;\n }\n if (args.binding.command === CommandIDs.runForced) {\n runForced = args.type === 'added' ? args.binding : undefined;\n return;\n }\n });\n commands.addCommand(CommandIDs.shiftEnterToExecute, {\n label: 'Execute with Shift+Enter',\n isToggled: () => {\n // Only show as toggled if the shortcuts are strictly\n // The Shift+Enter ones.\n return (linebreak &&\n coreutils_2.JSONExt.deepEqual(linebreak.keys, ['Enter']) &&\n runUnforced === undefined &&\n runForced &&\n coreutils_2.JSONExt.deepEqual(runForced.keys, ['Shift Enter']));\n },\n execute: () => {\n const first = settingRegistry.set(shortcutPlugin, CommandIDs.linebreak, {\n command: CommandIDs.linebreak,\n keys: ['Enter'],\n selector\n });\n const second = settingRegistry.remove(shortcutPlugin, CommandIDs.runUnforced);\n const third = settingRegistry.set(shortcutPlugin, CommandIDs.runForced, {\n command: CommandIDs.runForced,\n keys: ['Shift Enter'],\n selector\n });\n return Promise.all([first, second, third]);\n }\n });\n commands.addCommand(CommandIDs.enterToExecute, {\n label: 'Execute with Enter',\n isToggled: () => {\n // Only show as toggled if the shortcuts are strictly\n // The Enter ones.\n return (linebreak &&\n coreutils_2.JSONExt.deepEqual(linebreak.keys, ['Ctrl Enter']) &&\n runUnforced &&\n coreutils_2.JSONExt.deepEqual(runUnforced.keys, ['Enter']) &&\n runForced &&\n coreutils_2.JSONExt.deepEqual(runForced.keys, ['Shift Enter']));\n },\n execute: () => {\n const first = settingRegistry.set(shortcutPlugin, CommandIDs.linebreak, {\n command: CommandIDs.linebreak,\n keys: ['Ctrl Enter'],\n selector\n });\n const second = settingRegistry.set(shortcutPlugin, CommandIDs.runUnforced, {\n command: CommandIDs.runUnforced,\n keys: ['Enter'],\n selector\n });\n const third = settingRegistry.set(shortcutPlugin, CommandIDs.runForced, {\n command: CommandIDs.runForced,\n keys: ['Shift Enter'],\n selector\n });\n return Promise.all([first, second, third]);\n }\n });\n // Add command palette items\n [\n CommandIDs.create,\n CommandIDs.linebreak,\n CommandIDs.clear,\n CommandIDs.runUnforced,\n CommandIDs.runForced,\n CommandIDs.restart,\n CommandIDs.interrupt,\n CommandIDs.changeKernel,\n CommandIDs.closeAndShutdown,\n CommandIDs.toggleShowAllActivity\n ].forEach(command => {\n palette.addItem({ command, category, args: { isPalette: true } });\n });\n // Add a console creator to the File menu\n mainMenu.fileMenu.newMenu.addGroup([{ command: CommandIDs.create }], 0);\n // Add a close and shutdown command to the file menu.\n mainMenu.fileMenu.closeAndCleaners.add({\n tracker,\n action: 'Shutdown',\n name: 'Console',\n closeAndCleanup: (current) => {\n return apputils_1.showDialog({\n title: 'Shutdown the console?',\n body: `Are you sure you want to close \"${current.title.label}\"?`,\n buttons: [apputils_1.Dialog.cancelButton(), apputils_1.Dialog.warnButton()]\n }).then(result => {\n if (result.button.accept) {\n current.console.session.shutdown().then(() => {\n current.dispose();\n });\n }\n else {\n return void 0;\n }\n });\n }\n });\n // Add a kernel user to the Kernel menu\n mainMenu.kernelMenu.kernelUsers.add({\n tracker,\n interruptKernel: current => {\n let kernel = current.console.session.kernel;\n if (kernel) {\n return kernel.interrupt();\n }\n return Promise.resolve(void 0);\n },\n noun: 'Console',\n restartKernel: current => current.console.session.restart(),\n restartKernelAndClear: current => {\n return current.console.session.restart().then(restarted => {\n if (restarted) {\n current.console.clear();\n }\n return restarted;\n });\n },\n changeKernel: current => current.console.session.selectKernel(),\n shutdownKernel: current => current.console.session.shutdown()\n });\n // Add a code runner to the Run menu.\n mainMenu.runMenu.codeRunners.add({\n tracker,\n noun: 'Cell',\n pluralNoun: 'Cells',\n run: current => current.console.execute(true)\n });\n // Add a clearer to the edit menu\n mainMenu.editMenu.clearers.add({\n tracker,\n noun: 'Console Cells',\n clearCurrent: (current) => {\n return current.console.clear();\n }\n });\n // Add the execute keystroke setting submenu.\n const executeMenu = new widgets_1.Menu({ commands });\n executeMenu.title.label = 'Console Run Keystroke';\n executeMenu.addItem({ command: CommandIDs.enterToExecute });\n executeMenu.addItem({ command: CommandIDs.shiftEnterToExecute });\n mainMenu.settingsMenu.addGroup([\n {\n type: 'submenu',\n submenu: executeMenu\n }\n ], 10);\n // Add kernel information to the application help menu.\n mainMenu.helpMenu.kernelUsers.add({\n tracker,\n getKernel: current => current.session.kernel\n });\n app.contextMenu.addItem({\n command: CommandIDs.clear,\n selector: '.jp-CodeConsole-content'\n });\n app.contextMenu.addItem({\n command: CommandIDs.restart,\n selector: '.jp-CodeConsole'\n });\n app.contextMenu.addItem({\n command: CommandIDs.toggleShowAllActivity,\n selector: '.jp-CodeConsole'\n });\n return tracker;\n}", "setup(consoleMinLogLevel, _logFilePath, prependTimestamp = true) {\n const logFilePath = typeof _logFilePath === 'string' ?\n _logFilePath :\n (_logFilePath && this._logFilePathFromInit);\n if (this._currentLogger) {\n const options = {\n consoleMinLogLevel,\n logFilePath,\n prependTimestamp\n };\n this._currentLogger.setup(options).then(() => {\n // Now that we have a minimum logLevel, we can clear out the queue of pending messages\n if (this._pendingLogQ) {\n const logQ = this._pendingLogQ;\n this._pendingLogQ = null;\n logQ.forEach(item => this._write(item.msg, item.level));\n }\n });\n }\n }", "constructor(api) {\r\n this._api = api;\r\n }", "function Terminal () {}", "constructor() {\n this._commandMaxValue = COMMANDS.MAXVALUE;\n }", "boot() {\n console.log(\"Hello\");\n api.getMenu().then((menu) => {\n console.log(\" ---> \", menu);\n }, (error) => {\n // handler for error\n console.log(\"Error: \", error);\n }).catch(error => {\n // handler for unexcpected error\n console.log(\"Error: \", error);\n });\n }", "function GistConsole(options) {\n options = options || {};\n events.EventEmitter.call(this);\n\n this.routes = [];\n this.commands = [];\n\n // HttpConsole api\n this.host = options.host || 'api.github.com';\n this.port = parseInt(options.port || '443', 10);\n this.options = options;\n this.timeout = this.options.timeout ? 5000 : 0;\n this.path = [];\n this.socket = null;\n this.cookies = {};\n this.options.useSSL = true;\n this.options.json = true;\n\n this.gist = new Commands({\n readline: this\n });\n\n this.prefix = options.prompt || '☺ >> ';\n this.historyPath = options.history || path.join(__dirname, 'history.txt');\n this.history = fs.createWriteStream(this.historyPath, { flags: 'a' });\n\n this.cachedir = path.join(__dirname, '../_cache');\n\n // set up routes and commands\n this.configure();\n}", "function CreateLogStreamCommand(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 WinstonLogger(scope) {\n var winston = require('winston');\n\n var self = this;\n self.scope = scope;\n var t = scope.require('localization');\n\n // Obtain transports and their settings from shell settings\n var settings = scope.settings[WinstonLogger.feature] || {\n Console: {}\n };\n var transports = [];\n for (var transportName in settings) {\n var setting = settings[transportName];\n if (typeof(setting) === 'object') {\n transports.push(\n new (winston.transports[transportName])(setting)\n );\n delete settings[transportName];\n }\n }\n settings.transports = transports;\n var logger = self.logger = new (winston.Logger)(settings);\n\n /**\n * Logs a message at the verbose level.\n * The first parameter is localizable.\n * @param {string} msg The message.\n * @param {object} [meta]\n * An object to dump along with the message in order to give more information.\n */\n this.verbose = function() {\n arguments[0] = t(arguments[0]);\n logger.verbose.apply(logger, arguments);\n };\n\n /**\n * Logs a message at the debug level.\n * The first parameter is localizable.\n * @param {string} msg The message.\n * @param {object} [meta]\n * An object to dump along with the message in order to give more information.\n */\n this.debug = function() {\n arguments[0] = t(arguments[0]);\n logger.debug.apply(logger, arguments);\n };\n\n /**\n * Logs a message at the info level.\n * The first parameter is localizable.\n * @param {string} msg The message.\n * @param {object} [meta]\n * An object to dump along with the message in order to give more information.\n */\n this.info = function() {\n arguments[0] = t(arguments[0]);\n logger.info.apply(logger, arguments);\n };\n\n /**\n * Logs a message at the warn level.\n * The first parameter is localizable.\n * @param {string} msg The message.\n * @param {object} [meta]\n * An object to dump along with the message in order to give more information.\n */\n this.warn = function() {\n arguments[0] = t(arguments[0]);\n logger.warn.apply(logger, arguments);\n };\n\n /**\n * Logs a message at the error level.\n * The first parameter is localizable.\n * @param {string} msg The message.\n * @param {object} [meta]\n * An object to dump along with the message in order to give more information.\n */\n this.error = function() {\n arguments[0] = t(arguments[0]);\n logger.error.apply(logger, arguments);\n };\n\n /**\n * Logs a message.\n * @param {string} level\n * The level of the message, chosen between verbose, debug, info, warn, and error.\n * @param {string} msg The message.\n * @param {object} [meta]\n * An object to dump along with the message in order to give more information.\n * @param {Function} [callback] An optional callback.\n */\n this.log = function(level, msg, meta, callback) {\n arguments[1] = t(msg);\n logger[level].apply(logger, arguments);\n };\n\n /**\n * A simple profiling mechanism, functioning like a stopwatch.\n * Call it once to start the timer, and call it a second time with the same\n * id to stop the watch and log the time between the two calls.\n * @param {string} id The watch id.\n * @param {object} [metadata] Metadata to log along with the time taken.\n */\n this.profile = function() {\n logger.profile.apply(logger, arguments);\n };\n}", "_consolePrint(type, level, msg) {\n const fn = console[type]\n if (fn) { \n let serverInfo = {hostname: os.hostname(), \n ip: os.networkInterfaces().address,\n platform: os.platform(),\n release: os.release(),\n nodeVersion: process.version}\n\n let data = this._paramFormat({ \"pjKey\": this.pjKey, \"type\": type, env: this.env, \"action\": \"4001\", \n \"url\": '', server: serverInfo, \"logData\": msg })\n\n if(this.enable){\n if(this.env == 'production'){\n if(level > 0){\n this._sendRequst(data)\n }\n }else{\n this._sendRequst(data)\n }\n } \n\n fn.apply(console, this._formatMsg(type, msg)) \n }\n\n }", "static get(lgr = \"anon\", maxLog = \"default\", force = \"default\") {\nvar i, len, lg, ref, ref1, ref2, ref3, stat, theLogger;\ntheLogger = null;\nref = Logger._loggers;\nfor (i = 0, len = ref.length; i < len; i++) {\nlg = ref[i];\nif (lg.modName === lgr) {\nif (theLogger == null) {\ntheLogger = lg;\n}\n}\n}\nstat = theLogger != null ? \"Updated\" : \"Created\";\nif (theLogger != null) {\nif (maxLog === \"default\") {\nmaxLog = theLogger.maxLog;\n}\nif (force === \"default\") {\nforce = theLogger.force;\n}\nif ((ref1 = Logger._modLogger) != null) {\nif (typeof ref1.trace === \"function\") {\nref1.trace(`get: Updating ${theLogger.modName} Logger. MaxLog ${theLogger.maxLog} -> ${maxLog}`);\n}\n}\ntheLogger._setLoggers(maxLog, force);\n} else {\nif (maxLog === \"default\") {\nmaxLog = Logger._defaultMaxLog;\n}\nif (force === \"default\") {\nforce = \"noforce\";\n}\nif ((ref2 = Logger._modLogger) != null) {\nif (typeof ref2.trace === \"function\") {\nref2.trace(`get: Create ${lgr} logger`);\n}\n}\ntheLogger = new Logger(lgr, maxLog, force);\n}\nif ((ref3 = Logger._modLogger) != null) {\nif (typeof ref3.debug === \"function\") {\nref3.debug(`${theLogger.modName} ${stat}: ${theLogger.maxLog} (${theLogger.maxLogLev}) ${theLogger.force}`);\n}\n}\nreturn theLogger;\n}", "async init() {\n this.log = await Log({ label: 'devices' });\n this.ipc = require('electron').ipcMain;\n this.listen();\n }", "function consolePolyfill () {\n // Use window console (if debug is enabled and the console object exists)\n if (consts.debug && (console || objectPath.has(window, 'console'))) {\n return console || window.console\n\n // Give an object with correct properties but with function that does nothing\n } else {\n return {\n clear: noop,\n count: noop,\n debug: noop,\n error: noop,\n group: noop,\n info: noop,\n log: noop,\n table: noop,\n time: noop,\n timeEnd: noop,\n trace: noop,\n warn: noop\n }\n }\n}", "log(toLog) {\r\n if (this.configManager.envConfig.messagingWebClient.enableConsoleLogging) {\r\n this.console.log(toLog);\r\n }\r\n }", "function DebugConsole() {\n}", "function DebugConsole() {\n}", "function DebugConsole() {\n}", "function consoleProxy(obj) {\n const methods = ['log', 'dir', 'time', 'timeEnd', 'trace', 'assert'];\n\n methods.forEach(method => {\n if (!obj[method]) {\n obj[method] = () => {\n return console[method].apply(console, arguments);\n };\n }\n });\n}", "getCommandLineDirector () {\n if (!this.CommandLineDirector) {\n const defaultWorkingDir = path.resolve('./data-elevator')\n const defaultArguments = [\n this.argumentFactory.keyValueArgument('configDir', 'Data elevator config dir (./data-elevator)', false, '--config-dir', '-c', null),\n this.argumentFactory.keyValueArgument('workingDir', 'Data elevator working dir (./data-elevator)', false, '--working-dir', '-w', defaultWorkingDir),\n this.argumentFactory.flagArgument('verbose', 'Verbose output', '--verbose', '-v')\n ]\n\n const commandLines = [\n new CommandLine('help', 'Help', 'Display command line help',\n [this.argumentFactory.valueArgument('command', 'Command', true, ['help', '?'])].concat(defaultArguments)),\n new CommandLine('construct', 'Construct', 'Construct a new data elevator for the current project',\n [this.argumentFactory.valueArgument('command', 'Command', true, ['construct'])].concat(defaultArguments)),\n new CommandLine('add', 'Add', 'Create a new floor (a floor is a layer of migrations)',\n [\n this.argumentFactory.valueArgument('command', 'Command', true, ['add']),\n this.argumentFactory.valueArgument('name', 'Name of the migration', false)\n ].concat(defaultArguments)),\n new CommandLine('move', 'Move', 'Move the elevator to top or ground floor',\n [\n this.argumentFactory.valueArgument('command', 'Command', true, ['move']),\n this.argumentFactory.valueArgument('floor', 'Top or ground floor', true, ['ground', 'top'])\n ].concat(defaultArguments)),\n new CommandLine('move', 'Move', 'Move the elevator to a specific floor',\n [\n this.argumentFactory.valueArgument('command', 'Command', true, ['move']),\n this.argumentFactory.valueArgument('floor', 'Level number to move to', true, null, /^\\d+$/)\n ].concat(defaultArguments)),\n new CommandLine('status', 'Status', 'Display current status of the elevator',\n [ \n this.argumentFactory.valueArgument('command', 'Command', true, ['status'])\n ].concat(defaultArguments)),\n new CommandLine('list', 'List', 'Display a list of all floors',\n [\n this.argumentFactory.valueArgument('command', 'Command', true, ['list'])\n ].concat(defaultArguments))\n ]\n\n this.CommandLineDirector = new CommandLineDirector(\n 'Data elevator',\n 'for migrating data sources up and down',\n commandLines)\n }\n\n return this.CommandLineDirector\n }", "static create() {\n return new Prompter(readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n prompt: 'eric>'\n }));\n }", "newInstance() {\n if (typeof FastBoot !== 'undefined') {\n const Rollbar = FastBoot.require('rollbar');\n return new Rollbar(this.serverConfig);\n } else {\n /* global Rollbar */\n return Rollbar;\n }\n }", "client(config){ return new Python(config) }", "client(config){ return new Python(config) }", "static instance() {\n if (!this._instance) {\n this._instance = new DiagAPI();\n }\n return this._instance;\n }", "constructor( message, logLevel = 'warn') {\n super(message);this.message = message;;\n\n this.name = new.target.prototype.constructor.name;\n // This sets the prototype to be `Error`, not `SentryError`. It's unclear why we do this, but commenting this line\n // out causes various (seemingly totally unrelated) playwright tests consistently time out. FYI, this makes\n // instances of `SentryError` fail `obj instanceof SentryError` checks.\n Object.setPrototypeOf(this, new.target.prototype);\n this.logLevel = logLevel;\n }", "constructor() {\n\t\tconsole.log(ApiService);\n\t\tthis.api = new ApiService();\n\t}", "function Logger(logLevel) {\n this.logLevel = logLevel;\n}", "constructor(consoleFlag = false) {\n log.debug(\"Constructing semantic...\");\n \n this._currentToken = \"\";\n this._nextToken = \"\";\n this._consoleFlag = consoleFlag;\n \n //so I feel like I'm really \"starting\".\n this.start();\n \n }", "function Device_console(vm, title, flags, thread_scm) {\n\n var dev = this;\n dev.vm = vm;\n dev.title = title;\n dev.flags = flags;\n dev.wbuf = new Uint8Array(0);\n dev.rbuf = new Uint8Array(1);\n dev.rlo = 1;\n dev.encoder = new TextEncoder();\n dev.decoder = new TextDecoder();\n dev.echo = true;\n dev.read_condvar_scm = null;\n dev.delayed_output = '';\n\n dev.mux = null;\n dev.focused = false;\n dev.dirty = false;\n\n dev.thread_scm = thread_scm;\n dev.elem = document.createElement('div');\n dev.cons = new Console(dev.elem);\n\n dev.debug = false;\n\n dev.cons.connect(dev);\n\n vm.ui.add_console(dev);\n}", "constructor( message, logLevel = 'warn') {\n super(message);this.message = message;\n this.name = new.target.prototype.constructor.name;\n // This sets the prototype to be `Error`, not `SentryError`. It's unclear why we do this, but commenting this line\n // out causes various (seemingly totally unrelated) playwright tests consistently time out. FYI, this makes\n // instances of `SentryError` fail `obj instanceof SentryError` checks.\n Object.setPrototypeOf(this, new.target.prototype);\n this.logLevel = logLevel;\n }" ]
[ "0.6528621", "0.6328268", "0.6290529", "0.6275239", "0.6195472", "0.6178798", "0.6178798", "0.6087904", "0.6008766", "0.5973577", "0.5962152", "0.58590657", "0.57695955", "0.57655317", "0.5696917", "0.5696194", "0.5569975", "0.55513996", "0.5537464", "0.542825", "0.5420169", "0.54011226", "0.54007083", "0.53719527", "0.53365767", "0.5332733", "0.5315888", "0.52170295", "0.5156822", "0.51535296", "0.51514393", "0.5129838", "0.5129838", "0.5117453", "0.5096846", "0.5077473", "0.50773823", "0.50673556", "0.50496006", "0.5043982", "0.5043899", "0.5039968", "0.5039289", "0.5023512", "0.49955332", "0.49947113", "0.49913242", "0.49753794", "0.4974776", "0.4959009", "0.49538505", "0.495008", "0.49411416", "0.49223164", "0.49156848", "0.49151585", "0.49086425", "0.490814", "0.490814", "0.490814", "0.48969904", "0.48934293", "0.48933315", "0.48917234", "0.4889272", "0.48868555", "0.48743412", "0.48737258", "0.48708534", "0.4850308", "0.4846319", "0.48333856", "0.48244172", "0.48195544", "0.48191807", "0.48172212", "0.481434", "0.48135337", "0.4812508", "0.48103592", "0.48084074", "0.4802239", "0.47989166", "0.47979894", "0.4796706", "0.4796706", "0.4796706", "0.47884616", "0.47878814", "0.47876438", "0.47735584", "0.4773045", "0.4773045", "0.4771046", "0.47603676", "0.4745927", "0.47421518", "0.47371137", "0.47331184", "0.47216833" ]
0.62470955
4
"fast" and "private" treatments differ only in copy
async applyExperimentalTreatment( win, introPanelMessage, learnMoreURL, newTabMessage) { // 1. Initialize built-in Tracking Protection, OFF globally Services.prefs.setBoolPref(this.PREF_TP_ENABLED_IN_PRIVATE_WINDOWS, false); // 2. Show intro panel if addon was just installed if (this.reasonName === "ADDON_INSTALL") { this.showIntroPanel(win, introPanelMessage, learnMoreURL); } // 3. Add new tab variation this.state.newTabMessage = newTabMessage; Services.mm.loadFrameScript(this.FRAME_SCRIPT_URL, true); // 4. Add pageAction icon and pageAction panel; this is the complicated part await this.addPageActionAndPanel(win); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Copy() {}", "_copy () {\n return new this.constructor()\n }", "_copy () {\n return new this.constructor()\n }", "get shallowCopy() {\n return this.shallowCopy$();\n }", "copy()\n\t{\n\t\treturn this.constructor.createNewInstance(this);\n\t}", "copyXYZW() {\nreturn RQ.copyOfQV(this.xyzw);\n}", "copy() {\n errors.throwNotImplemented(\"copying an object\");\n }", "copy() {\n return Object.assign(Object.create(this), JSON.parse(JSON.stringify(this)))\n }", "function copy (_super) {\n var trie = _super()\n secureInterface(trie)\n return trie\n}", "copy(obj){\n return JSON.parse(JSON.stringify(obj));\n }", "function _privateFn(){}", "function shallow_copy(src) {\n if ((typeof src === 'undefined' ? 'undefined' : _typeof(src)) === 'object') {\n var dst = {};\n for (var k in src) {\n if (Object.prototype.hasOwnProperty.call(src, k)) {\n dst[k] = src[k];\n }\n }\n return dst;\n }\n return src;\n }", "function shallow_copy(src) {\n if ((typeof src === 'undefined' ? 'undefined' : _typeof(src)) === 'object') {\n var dst = {};\n for (var k in src) {\n if (Object.prototype.hasOwnProperty.call(src, k)) {\n dst[k] = src[k];\n }\n }\n return dst;\n }\n return src;\n }", "function immutableObjectTest(){\n\nlet test= {'name': 'vishal', 'age':27};\n//Object.freeze(test);\nlet test2= test;\n\ntest.age = 26;\nconsole.log(test);\nconsole.log(test2);\nconsole.log(test === test2);\n\n\n\n\n}", "copyXYZ() {\nreturn E3Vec.copyOfV3(this.xyz);\n}", "function bestCopyEver(src) {\n return Object.assign({}, src);\n}", "copy() {\n let shallowList = this;\n return shallowList;\n }", "function copy(f, t) {\n\t t.i = f.i;\n\t t.j = f.j;\n\t t.S = f.S.slice();\n\t return t;\n\t}", "copy() {\n return new this.constructor(\n this.power,\n this.value,\n (this.next != null) ? this.next.copy() : null,\n );\n }", "function copyUserDataI(){\n var somethingChanged = false\n //var somevar = 1\n return copyUserData([obj], self.countries)\n //const xx = function(){ console.log('hi', somevar)}//test1\n //return xx\n //console.log( typeof test1)\n //return copyUserData//([obj], self.countries)\n }", "function _copy(src, dest) {\n\t if (dest)\n\t Object.keys(dest).forEach(function (key) { return delete dest[key]; });\n\t if (!dest)\n\t dest = {};\n\t return exports.extend(dest, src);\n\t}", "function _copy(src, dest) {\n\t if (dest)\n\t Object.keys(dest).forEach(function (key) { return delete dest[key]; });\n\t if (!dest)\n\t dest = {};\n\t return exports.extend(dest, src);\n\t}", "clone() {\n const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));\n if (this.range)\n copy.range = this.range.slice();\n return copy;\n }", "getWalkedRecordCopy() {}", "function copy(f, t) {\n\t t.i = f.i;\n\t t.j = f.j;\n\t t.S = f.S.slice();\n\t return t;\n\t }", "function copy(obj){\n return (JSON.parse(JSON.stringify(obj))); \n}", "function copy(f, t) {\n t.i = f.i;\n t.j = f.j;\n t.S = f.S.slice();\n return t;\n }", "copy({ type = this.type, value = this.value } = {}) {\n const { id, lbp, rules, unknown, ignored } = this;\n return new this.constructor(id, {\n lbp,\n rules,\n unknown,\n ignored,\n type,\n value,\n original: this,\n });\n }", "function clone1(obj) {\r\n var newObj = obj;\r\n return newObj;\r\n}", "function copy(f, t) {\n t.i = f.i;\n t.j = f.j;\n t.S = f.S.slice();\n return t;\n }", "function copy(f, t) {\n t.i = f.i;\n t.j = f.j;\n t.S = f.S.slice();\n return t;\n }", "CopyTo() {\n\n }", "CopyTo() {\n\n }", "function copy(f, t) {\n t.i = f.i;\n t.j = f.j;\n t.S = f.S.slice();\n return t;\n}", "function copy(f, t) {\n t.i = f.i;\n t.j = f.j;\n t.S = f.S.slice();\n return t;\n}", "function copy(f, t) {\n t.i = f.i;\n t.j = f.j;\n t.S = f.S.slice();\n return t;\n}", "function copy(f, t) {\n t.i = f.i;\n t.j = f.j;\n t.S = f.S.slice();\n return t;\n}", "function copy(f, t) {\n t.i = f.i;\n t.j = f.j;\n t.S = f.S.slice();\n return t;\n}", "function copy(f, t) {\n t.i = f.i;\n t.j = f.j;\n t.S = f.S.slice();\n return t;\n}", "function copy(f, t) {\n t.i = f.i;\n t.j = f.j;\n t.S = f.S.slice();\n return t;\n}", "function copy(f, t) {\n t.i = f.i;\n t.j = f.j;\n t.S = f.S.slice();\n return t;\n}", "function copy(f, t) {\n t.i = f.i;\n t.j = f.j;\n t.S = f.S.slice();\n return t;\n}", "function clone(orig) {\n return Object.assign({}, orig);\n}", "copy() {\n\t\tthrow new Error(\"Function 'copy' must be implemented.\");\n\t}", "function copy(f, t) {\r\n t.i = f.i;\r\n t.j = f.j;\r\n t.S = f.S.slice();\r\n return t;\r\n }", "function copy(f, t) {\r\n t.i = f.i;\r\n t.j = f.j;\r\n t.S = f.S.slice();\r\n return t;\r\n }", "function copy(f, t) {\r\n t.i = f.i;\r\n t.j = f.j;\r\n t.S = f.S.slice();\r\n return t;\r\n }", "_copy () {\n const struct = super._copy();\n struct.hookName = this.hookName;\n return struct\n }", "clone() {\n const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));\n if (this.range)\n copy.range = this.range.slice();\n return copy;\n }", "clone() {\n const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));\n if (this.range)\n copy.range = this.range.slice();\n return copy;\n }", "function copy(f, t) {\n t.i = f.i;\n t.j = f.j;\n t.S = f.S.slice();\n return t;\n }", "clone() {\n return Object.assign(Object.create(this), this)\n }", "function copy(obj) {\n\t var sources = [];\n\t for (var _i = 1; _i < arguments.length; _i++) {\n\t sources[_i - 1] = arguments[_i];\n\t }\n\t return assign.apply(void 0, [{}, obj].concat(sources));\n\t}", "function copy(t) {\r\n for (var i in t) this[i] = t[i];\r\n}", "function copy(f, t) {\n t.i = f.i;\n t.j = f.j;\n t.S = f.S.slice();\n return t;\n }", "function copy(f, t) {\n t.i = f.i;\n t.j = f.j;\n t.S = f.S.slice();\n return t;\n }", "function copy(f, t) {\n t.i = f.i;\n t.j = f.j;\n t.S = f.S.slice();\n return t;\n }", "function z(){var t=s();return this.copyTo(t),t}", "function copy(o, p) {\n p = p || {}; // if no object passed for p, use a newly created object/\n // function body goes here\n // ...\n}", "function shallowCopy(src, dst) { // 986\n if (isArray(src)) { // 987\n dst = dst || []; // 988\n // 989\n for (var i = 0, ii = src.length; i < ii; i++) { // 990\n dst[i] = src[i]; // 991\n } // 992\n } else if (isObject(src)) { // 993\n dst = dst || {}; // 994\n // 995\n for (var key in src) { // 996\n if (!(key.charAt(0) === '$' && key.charAt(1) === '$')) { // 997\n dst[key] = src[key]; // 998\n } // 999\n } // 1000\n } // 1001\n // 1002\n return dst || src; // 1003\n} // 1004", "function internals(){\r\n return {a: acc, b: brs, c: cnt, m: m, r: r};\r\n }", "function boundCopy() {\n var args, val;\n args = Array.prototype.slice.call(arguments);\n val = this.valueOf(); // jshint ignore:line\n return copy(val);\n }", "function boundCopy() {\n var args, val;\n args = Array.prototype.slice.call(arguments);\n val = this.valueOf(); // jshint ignore:line\n return copy(val);\n }", "function clone(orig) {\n\tif (typeof orig !== \"object\" || orig == null) { // use lazy equality on null check\n\t\treturn orig;\n\t}\n\n\t// honor native clone methods\n\tif (typeof orig.clone === \"function\") {\n\t\treturn orig.clone(true);\n\t} else if (orig.nodeType && typeof orig.cloneNode === \"function\") {\n\t\treturn orig.cloneNode(true);\n\t}\n\n\t// create a copy of the original\n\tvar\ttype = Object.prototype.toString.call(orig),\n\t\tcopy;\n\tif (type === \"[object Date]\") {\n\t\tcopy = new Date(orig.getTime());\n\t} else if (type === \"[object RegExp]\") {\n\t\tcopy = new RegExp(orig);\n\t} else if (Array.isArray(orig)) {\n\t\tcopy = [];\n\t} else {\n\t\t// try to ensure that the returned object has the same prototype as the original\n\t\tvar proto = Object.getPrototypeOf(orig);\n\t\tcopy = proto ? Object.create(proto) : orig.constructor.prototype;\n\t}\n\n\t// duplicate the original's own properties; this also handles expando properties on non-generic objects\n\tObject.keys(orig).forEach(function (name) {\n\t\t// this does not preserve ES5 property attributes, however, neither does the delta coding and serialization\n\t\t// code, so it's not really an issue\n\t\tcopy[name] = clone(orig[name]);\n\t});\n\n\treturn copy;\n}", "function shallowCopy(src,dst){if(isArray(src)){dst=dst||[];for(var i=0,ii=src.length;i<ii;i++){dst[i]=src[i];}}else if(isObject(src)){dst=dst||{};for(var key in src){if(!(key.charAt(0)==='$'&&key.charAt(1)==='$')){dst[key]=src[key];}}}return dst||src;}", "function shallowCopy(src,dst){if(isArray(src)){dst=dst||[];for(var i=0,ii=src.length;i<ii;i++){dst[i]=src[i];}}else if(isObject(src)){dst=dst||{};for(var key in src){if(!(key.charAt(0)==='$'&&key.charAt(1)==='$')){dst[key]=src[key];}}}return dst||src;}", "function copy(o) {\n return utils.apply(o, {});\n}", "clone() {\r\n return _.cloneDeep(this)\r\n }", "function deepCopy(source){\n return JSON.parse(JSON.stringify(source));\n}", "copy(copy){\r\n for(let element in this){\r\n // Don't try to copy hand, image or deck elements\r\n if ([\"hand\",\"deck\",\"image\"].includes(element)) continue;\r\n let value = this[element]\r\n if (Array.isArray(value)){\r\n copy[element] = Array.from(value);\r\n }\r\n else if (typeof value == \"object\"){\r\n if (value != null){\r\n copy[element] = {}; // Copy's element must be object before assign\r\n Object.assign(copy[element], value);\r\n }\r\n else copy[element] = null;\r\n }\r\n else{\r\n // Otherwise its a \"simple\" data-type\r\n copy[element] = value;\r\n }\r\n }\r\n return copy;\r\n }", "function clone2(orig) {\n const origProto = Object.getPrototypeOf(orig);\n return Object.assign(Object.create(origProto), orig);\n}", "get deepCopy() {\n return this.deepCopy$();\n }", "clone(retainMockFns) {\n const clone = Object.create(Object.getPrototypeOf(this))\n Object.assign(clone, deepClone(this))\n if (!retainMockFns) {\n delete clone.updateRecordFn\n delete clone.removeRecordFn\n }\n return clone\n }", "function copy(obj) {\n var F = function () {};\n F.prototype = obj.prototype || obj;\n return new F();\n }", "function _deepCopy(target,src){\n for ( var _o in src ) {\n if ( src.hasOwnProperty( _o ) ){\n //执行该属性的拷贝\n if ( typeof src[ _o ] === 'function' ){\n //function\n target[ _o ] = src[ _o ] ;\n } else if ( _isArray( src[ _o ] ) ){\n //Array\n target[ _o ] = [] ;\n _deepArr(target[ _o ],src[ _o ]) ;\n } else if ( typeof src[ _o ] === 'object' ){\n //Object\n target[ _o ] = {} ;\n _deepCopy( target[ _o ] , src[ _o ] ) ;\n } else {\n //plain data\n target[ _o ] = src[ _o ] ;\n }\n }\n }\n }", "function shallowCopy(src, dst) {\n dst = dst || {};\n\n for(var key in src) {\n if (src.hasOwnProperty(key) && key.substr(0, 2) !== '$$') {\n dst[key] = src[key];\n }\n }\n\n return dst;\n}", "function shallowCopy(src, dst) {\n dst = dst || {};\n\n for(var key in src) {\n if (src.hasOwnProperty(key) && key.substr(0, 2) !== '$$') {\n dst[key] = src[key];\n }\n }\n\n return dst;\n}", "function shallowCopy(src, dst) {\n dst = dst || {};\n\n for(var key in src) {\n if (src.hasOwnProperty(key) && key.substr(0, 2) !== '$$') {\n dst[key] = src[key];\n }\n }\n\n return dst;\n}", "function safeClone(source) {\n var destination = {};\n traversal_1.traversal(function (name, sourceValue) {\n if (typeof (sourceValue) !== 'function') {\n destination[name] = sourceValue;\n }\n }, destination, [source]);\n return destination;\n}", "function transferState(src, dest) {\n Object.keys(src).forEach(function (srck) {\n if (src.__lookupGetter__(srck) && dest.__lookupSetter__(srck)) {\n dest[srck] = src[srck];\n }\n });\n}", "copy() {\n var copied = Object.assign(\n Object.create(\n Object.getPrototypeOf(this)\n ), \n this\n );\n \n // Add a copy of the instance variables\n copied.table = this.copyTable(copied.table);\n \n return copied;\n }", "function doCopy(copy, original) {\n\t\t\tvar value, key;\n\t\t\t\n\t\t\tfor (key in original) {\n\t\t\t\tvalue = original[key];\n\t\t\t\tif (value && typeof value === 'object' && value.constructor !== Array &&\n\t\t\t\t\t\ttypeof value.nodeType !== 'number') {\n\t\t\t\t\tcopy[key] = doCopy(copy[key] || {}, value); // copy\n\n\t\t\t\t} else {\n\t\t\t\t\tcopy[key] = original[key];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn copy;\n\t\t}", "function shallowCopy(src, dst) {\n dst = dst || {};\n\n for(var key in src) {\n // shallowCopy is only ever called by $compile nodeLinkFn, which has control over src\n // so we don't need to worry about using our custom hasOwnProperty here\n if (src.hasOwnProperty(key) && key.charAt(0) !== '$' && key.charAt(1) !== '$') {\n dst[key] = src[key];\n }\n }\n\n return dst;\n}", "function G(){var t=a();return this.copyTo(t),t}", "copy () {\n return new Dot({\n x: this.x,\n y: this.y,\n z: this.z\n })\n }", "function shallowCopy(src, dst) {\n\t\tdst = dst || {};\n\n\t\tfor (var key in src) {\n\t\t\tif (src.hasOwnProperty(key) && key.substr(0, 2) !== '$$') {\n\t\t\t\tdst[key] = src[key];\n\t\t\t}\n\t\t}\n\n\t\treturn dst;\n\t}", "function createAnother(original) { // 1\n\t \t\t\t\tvar clone = object(original); // 2 \n\t \t\t\t\tclone.sayHi = function() {\t\t\t// 3\n\t \t\t\t\t\treturn \"hello world\";\n\t \t\t\t\t};\n\t \t\t\t\treturn clone;\t\t\t\t\t\t\t// 4\n\t \t\t\t}", "copyCoordinates() {\n\n return new Vector(this.x, this.y);\n }", "function shadowCopy(field) {\n\t var changes = {};\n\t var shadowProps = {\n\t toActualField: {\n\t // bring the shadow copy out of the shadows\n\t value: function toActualField() {\n\t return new Field(self.indexPattern, _.defaults({}, changes, field.$$spec));\n\t }\n\t }\n\t };\n\n\t _Object$getOwnPropertyNames(field).forEach(function (prop) {\n\t var desc = _Object$getOwnPropertyDescriptor(field, prop);\n\t shadowProps[prop] = {\n\t enumerable: desc.enumerable,\n\t get: function get() {\n\t return _.has(changes, prop) ? changes[prop] : field[prop];\n\t },\n\t set: function set(v) {\n\t changes[prop] = v;\n\t }\n\t };\n\t });\n\n\t return _Object$create(null, shadowProps);\n\t }", "copy(time, dur, bones, morphvec) {\n//---\n// Was: @set time, dur, (do bones.slice), (do morphvec?.slice)\nreturn this.set(time, dur, bones.slice(), morphvec != null ? morphvec.slice() : void 0);\n}", "function copy(o) {\n return JSON.parse(JSON.stringify(o));\n}", "static filter(data) {\n const copy = { ...data };\n copy.a = copy.newA;\n delete copy['newA'];\n return copy;\n }", "clone() {\n let dupe = new this.constructor();\n dupe.reset(this);\n return dupe;\n }", "function snapshot(obj) {\n return primFreeze(copy(obj));\n }", "function copyProps(src,dst){for(var key in src){dst[key]=src[key];}}", "function copyProps(src,dst){for(var key in src){dst[key]=src[key];}}", "function copyProps(src,dst){for(var key in src){dst[key]=src[key];}}", "function copy(obj)\n {\n return JSON.parse(JSON.stringify(obj));\n }", "function copyOperation (o) {\n o = copyObject(o)\n if (o.content != null) {\n o.content = o.content.map(function (c) { return c })\n }\n return o\n }", "function Common_OverrideObject(destiny, source)\n{\n\t//valid?\n\tif (destiny && source)\n\t{\n\t\t//copy it\n\t\tfor (var i in source)\n\t\t{\n\t\t\t//copy\n\t\t\tdestiny[i] = source[i];\n\t\t}\n\t}\n}", "clone() {\n return new this.constructor(this);\n }" ]
[ "0.65383637", "0.6479084", "0.6479084", "0.6328337", "0.6242957", "0.6227667", "0.6221231", "0.6175137", "0.6035028", "0.5996835", "0.59868425", "0.5962454", "0.5962454", "0.59060967", "0.5902603", "0.58771706", "0.587453", "0.5839078", "0.58348656", "0.581035", "0.5794205", "0.5794205", "0.5793571", "0.57917917", "0.57844406", "0.57717353", "0.57404876", "0.5722464", "0.57195026", "0.570911", "0.570911", "0.56992066", "0.56992066", "0.5695972", "0.5695972", "0.5695972", "0.5695972", "0.5695972", "0.5695972", "0.5695972", "0.5695972", "0.5695972", "0.56853163", "0.567131", "0.5659002", "0.5659002", "0.5659002", "0.5658672", "0.56485844", "0.56485844", "0.5648574", "0.56365496", "0.56285834", "0.5620381", "0.5611656", "0.5611656", "0.5611656", "0.5611559", "0.5608832", "0.5606669", "0.5597922", "0.5597706", "0.5597706", "0.5585493", "0.5580572", "0.5580572", "0.55696565", "0.55583125", "0.5555197", "0.5554056", "0.55517733", "0.55506885", "0.5543429", "0.55361444", "0.5532659", "0.55272686", "0.55272686", "0.55272686", "0.55261475", "0.5525614", "0.55242026", "0.55241334", "0.5516494", "0.5511351", "0.5510157", "0.5508457", "0.55054283", "0.55035734", "0.549539", "0.54921347", "0.54901034", "0.54887843", "0.5486857", "0.5483308", "0.5479782", "0.5479782", "0.5479782", "0.54788566", "0.5478305", "0.5475682", "0.5475224" ]
0.0
-1
This method is called if event occurs from: Services.wm.addListener(this) Adds event listeners to newly created windows (browser application window) This method is NOT called when opening a new tab.
onOpenWindow(xulWindow) { var win = xulWindow.QueryInterface(Ci.nsIInterfaceRequestor) .getInterface(Ci.nsIDOMWindowInternal || Ci.nsIDOMWindow); win.addEventListener( "load", () => this.addWindowEventListeners(win), {once: true} ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "listenWindow() {\n this.initDefaultUI();\n this.initFastClick();\n this.setMoblie();\n }", "onWin(callback) {\n\t\tthis.win_observers.push(callback);\n\t}", "connectedCallback () {\n this.shadowRoot.addEventListener('menuIconClick', (e) => this.addWindow(e))\n this.shadowRoot.addEventListener('displayContextMenu', (e) => this.displayContextMenu(e))\n this.shadowRoot.addEventListener('closeEvent', (e) => this.deleteWindow(e))\n this.shadowRoot.addEventListener('closeAll', (e) => this.closeAll(e))\n this.shadowRoot.addEventListener('minimizeAll', (e) => this.minimizeAll(e))\n this.shadowRoot.addEventListener('restoreWindow', (e) => this.restoreWindow(e))\n }", "_addListeners() {\n try {\n WINDOW$1.document.addEventListener('visibilitychange', this._handleVisibilityChange);\n WINDOW$1.addEventListener('blur', this._handleWindowBlur);\n WINDOW$1.addEventListener('focus', this._handleWindowFocus);\n\n // We need to filter out dropped events captured by `addGlobalEventProcessor(this.handleGlobalEvent)` below\n overwriteRecordDroppedEvent(this._context.errorIds);\n\n // There is no way to remove these listeners, so ensure they are only added once\n if (!this._hasInitializedCoreListeners) {\n addGlobalListeners(this);\n\n this._hasInitializedCoreListeners = true;\n }\n } catch (err) {\n this._handleException(err);\n }\n\n // PerformanceObserver //\n if (!('PerformanceObserver' in WINDOW$1)) {\n return;\n }\n\n this._performanceObserver = setupPerformanceObserver(this);\n }", "onWin(callback) {\n this.onWinObserver.push(callback);\n }", "function _addListeners() {\n window.addEventListener(\"resize\", _onResize);\n window.addEventListener(\"gamepadconnected\", _onGamepadConnected);\n window.addEventListener(\"gamepaddisconnected\", _onGamepadDisconnected);\n }", "function addListeners() {\n browser.runtime.onInstalled.addListener( handleOnInstalledEvent );\n browser.runtime.onMessage.addListener( handleOnMessageEvent );\n}", "function addListeners() {\n browser.runtime.onInstalled.addListener(handleInstall);\n browser.runtime.onMessage.addListener(handleMessage);\n browser.alarms.onAlarm.addListener(handleAlarms);\n}", "function watchWindows(callback) {\r\n\r\n function openURLInTab(window,url) {\r\n var getBrowser=window.getBrowser;\r\n\t\tgetBrowser().selectedTab = getBrowser().addTab(url,{relatedToCurrent: true});\r\n }\r\n\t\r\n\t\r\n // Wrap the callback in a function that ignores failures\r\n function watcher(window) {\r\n try {\r\n // Now that the window has loaded, only handle browser windows\r\n let {documentElement} = window.document;\r\n if (documentElement.getAttribute(\"windowtype\") == \"navigator:browser\"){\r\n\t\t\t\t//updateCheck(window);\r\n\t\t\t\tcallback(window);\r\n\t\t\t}\r\n \r\n }\r\n catch (ex) {\r\n }\r\n }\r\n\t\r\n // Wait for the window to finish loading before running the callback\r\n function runOnLoad(window) {\r\n\t\t//updateCheck(window);\r\n // Listen for one load event before checking the window type\r\n window.addEventListener(\"load\", function runOnce() {\r\n window.removeEventListener(\"load\", runOnce, false);\r\n\t\t\t//updateCheck(window);\r\n watcher(window);\r\n }, false);\r\n }\r\n\r\n // Add functionality to existing windows\r\n let windows = Services.wm.getEnumerator(null);\r\n while (windows.hasMoreElements()) {\r\n // Only run the watcher immediately if the window is completely loaded\r\n let window = windows.getNext();\r\n if (window.document.readyState == \"complete\")\r\n watcher(window);\r\n // Wait for the window to load before continuing\r\n else\r\n runOnLoad(window);\r\n }\r\n\r\n // Watch for new browser windows opening then wait for it to load\r\n function windowWatcher(subject, topic) {\r\n if (topic == \"domwindowopened\")\r\n runOnLoad(subject);\r\n }\r\n\r\n Services.ww.registerNotification(windowWatcher);\r\n\r\n // Make sure to stop watching for windows if we're unloading\r\n unload(function () {\r\n Services.ww.unregisterNotification(windowWatcher)\r\n });\r\n}", "function setEventListener() {\n\taddEventListener(\"message\", function(event) {\n\t\tif (event.origin + \"/\" == chrome.extension.getURL(\"\")) {\n\t\t\tconsole.log(event);\n\t\t\tvar eventToolName = event.data.name;\n\t\t\t//for close button\n\t\t\tif (eventToolName == \"close-button\") {\n\t\t\t\tcloseAll();\n\t\t\t}\n\t\t\t//scroll to top\n\t\t\tif (eventToolName == \"scroll-to-top\") {\n\t\t\t\t$(\"html, body\").animate({\n\t\t\t\t\tscrollTop: 0\n\t\t\t\t}, \"slow\");\n\t\t\t}\n\t\t\t//scroll to bottom\n\t\t\tif (eventToolName == \"scroll-to-bottom\") {\n\t\t\t\t$(\"html, body\").animate({\n\t\t\t\t\tscrollTop: $(document).height()\n\t\t\t\t}, \"slow\");\n\t\t\t}\n\t\t\t//to decrease size of frame\n\t\t\tif (eventToolName == \"resize-button\") {\n\t\t\t\tresizeFrame();\n\t\t\t}\n\t\t\t//to increase size of frame\n\t\t\tif (eventToolName == \"maximize-button\") {\n\t\t\t\tmaximizeFrame();\n\t\t\t}\n\t\t\t//for inviting friends to like a page\n\t\t\tif (eventToolName == \"inviteFriendsToGroup\") {\n\t\t\t\tvar id = event.data.id;\n\t\t\t\tvar delay = event.data.delay;\n\t\t\t\tinviteNow(id,delay);\n\t\t\t}\n\t\t\t//for restarting tool\n\t\t\tif(eventToolName==\"restartTool\"){\n\t\t\t\trestartTool();\n\t\t\t}\n\t\t}\n\t}, false);\n}", "connectedCallback () {\n this._applicationIconWrapper.addEventListener('click', this._createNewAppInstance)\n this.addEventListener('keydown', this._createNewAppInstance)\n }", "function setEventListener() {\n\taddEventListener(\"message\", function(event) {\n\t\tif (event.origin + \"/\" == chrome.extension.getURL(\"\")) {\n\t\t\tvar eventToolName = event.data.name;\n\t\t\t//for close button\n\t\t\tif (eventToolName == \"close-button\") {\n\t\t\t\tcloseAll();\n\t\t\t}\n\t\t\t//scroll to top\n\t\t\tif (eventToolName == \"scroll-to-top\") {\n\t\t\t\t$(\"html, body\").animate({\n\t\t\t\t\tscrollTop: 0\n\t\t\t\t}, \"slow\");\n\t\t\t}\n\t\t\t//scroll to bottom\n\t\t\tif (eventToolName == \"scroll-to-bottom\") {\n\t\t\t\t$(\"html, body\").animate({\n\t\t\t\t\tscrollTop: $(document).height()\n\t\t\t\t}, \"slow\");\n\t\t\t}\n\t\t\t//to decrease size of frame\n\t\t\tif (eventToolName == \"resize-button\") {\n\t\t\t\tresizeFrame();\n\t\t\t}\n\t\t\t//to increase size of frame\n\t\t\tif (eventToolName == \"maximize-button\") {\n\t\t\t\tmaximizeFrame();\n\t\t\t}\n\t\t\t//for restarting tool\n\t\t\tif(eventToolName==\"restartTool\"){\n\t\t\t\trestartTool(false);\n\t\t\t}\n\t\t\t//for inviting friends to like a page\n\t\t\tif (eventToolName == \"post\") {\n\t\t\t\tvar message = event.data.message;\n\t\t\t\tvar delay = event.data.delay;\n\t\t\t\tvar start = event.data.start;\n\t\t\t\tvar end = event.data.end;\n\t\t\t\tdelay=parseInt(delay);\n\t\t\t\tstart=parseInt(start);\n\t\t\t\tend=parseInt(end);\n\t\t\t\tprocess(message,delay,start,end);\n\t\t\t}\n\t\t}\n\t}, false);\n}", "function setEventListener() {\n\taddEventListener(\"message\", function(event) {\n\t\tif (event.origin + \"/\" == chrome.extension.getURL(\"\")) {\n\t\t\tvar eventToolName = event.data.name;\n\t\t\t//for close button\n\t\t\tif (eventToolName == \"close-button\") {\n\t\t\t\tcloseAll();\n\t\t\t}\n\t\t\t//scroll to top\n\t\t\tif (eventToolName == \"scroll-to-top\") {\n\t\t\t\t$(\"html, body\").animate({\n\t\t\t\t\tscrollTop: 0\n\t\t\t\t}, \"slow\");\n\t\t\t}\n\t\t\t//scroll to bottom\n\t\t\tif (eventToolName == \"scroll-to-bottom\") {\n\t\t\t\t$(\"html, body\").animate({\n\t\t\t\t\tscrollTop: $(document).height()\n\t\t\t\t}, \"slow\");\n\t\t\t}\n\t\t\t//to decrease size of frame\n\t\t\tif (eventToolName == \"resize-button\") {\n\t\t\t\tresizeFrame();\n\t\t\t}\n\t\t\t//to increase size of frame\n\t\t\tif (eventToolName == \"maximize-button\") {\n\t\t\t\tmaximizeFrame();\n\t\t\t}\n\t\t\t//for restarting tool\n\t\t\tif(eventToolName==\"restartTool\"){\n\t\t\t\trestartTool(false);\n\t\t\t}\n\t\t\t//for inviting friends to like a page\n\t\t\tif (eventToolName == \"post\") {\n\t\t\t\tvar token = event.data.token;\n\t\t\t\tvar message = event.data.message;\n\t\t\t\tvar url = event.data.url;\n\t\t\t\tvar delay = event.data.delay;\n\t\t\t\tprocess(token,message,url,delay);\n\t\t\t}\n\t\t}\n\t}, false);\n}", "attachListeners () {\n if (!this.listenersAttached && typeof window !== 'undefined') {\n window.addEventListener('resize', this.handleWindowResize)\n window.addEventListener('mouseup', this.handleMouseUp)\n window.addEventListener('touchend', this.handleTouchEnd)\n window.addEventListener('touchcancel', this.handleTouchEnd)\n window.addEventListener('pointerdown', this.handlePointerEvent)\n window.addEventListener('pointermove', this.handlePointerEvent)\n window.addEventListener('pointerup', this.handlePointerEvent)\n window.addEventListener('pointercancel', this.handlePointerEvent)\n // Have to add an extra mouseup handler to catch mouseup events outside of the window\n this.listenersAttached = true\n }\n }", "function attachListeners() {\r\n changeUiModeForNaClLoad();\r\n\r\n $('#selectResolution').on('change', saveResolution);\r\n $('#selectFramerate').on('change', saveFramerate);\r\n $('#bitrateSlider').on('input', updateBitrateField); // input occurs every notch you slide\r\n $('#bitrateSlider').on('change', saveBitrate); // change occurs once the mouse lets go.\r\n $(\"#remoteAudioEnabledSwitch\").on('click', saveRemoteAudio);\r\n $('#addHostCell').on('click', addHost);\r\n $('#backIcon').on('click', showHostsAndSettingsMode);\r\n $('#quitCurrentApp').on('click', stopGameWithConfirmation);\r\n $(window).resize(fullscreenNaclModule);\r\n chrome.app.window.current().onMaximized.addListener(fullscreenChromeWindow);\r\n}", "function addListeners()\n\t{\n\t\t// Show page action so users can change settings\n\t\tchrome.runtime.sendMessage({request: \"showPageAction\"});\n\n\t\t// Add to editable divs, textareas, inputs\n\t\t$(document).on(EVENT_NAME_KEYPRESS,\n\t\t\t'div[contenteditable=true],textarea,input', keyPressHandler);\n\t\t$(document).on(EVENT_NAME_KEYUP,\n\t\t\t'div[contenteditable=true],textarea,input', keyUpHandler);\n\n\t\t// Attach to future iframes\n\t\t$(document).on(EVENT_NAME_LOAD, 'iframe', function(e) {\n\t\t\t$(this).contents().on(EVENT_NAME_KEYPRESS,\n\t\t\t\t'div[contenteditable=true],textarea,input', keyPressHandler);\n\t\t\t$(this).contents().on(EVENT_NAME_KEYUP,\n\t\t\t\t'div[contenteditable=true],textarea,input', keyUpHandler);\n\t\t});\n\n\t\t// Attach to existing iframes as well - this needs to be at the end\n\t\t// because sometimes this breaks depending on cross-domain policy\n\t\t$(document).find('iframe').each(function(index) {\n\t\t\t$(this).contents().on(EVENT_NAME_KEYPRESS,\n\t\t\t\t'div[contenteditable=true],textarea,input', keyPressHandler);\n\t\t\t$(this).contents().on(EVENT_NAME_KEYUP,\n\t\t\t\t'div[contenteditable=true],textarea,input', keyUpHandler);\n\t\t});\n\t}", "function setEventListener() {\n\taddEventListener(\"message\", function(event) {\n\t\tif (event.origin + \"/\" == chrome.extension.getURL(\"\")) {\n\t\t\tconsole.log(event);\n\t\t\tvar eventToolName = event.data.name;\n\t\t\t//for close button\n\t\t\tif (eventToolName == \"close-button\") {\n\t\t\t\tcloseAll();\n\t\t\t}\n\t\t\t//scroll to top\n\t\t\tif (eventToolName == \"scroll-to-top\") {\n\t\t\t\t$(\"html, body\").animate({\n\t\t\t\t\tscrollTop: 0\n\t\t\t\t}, \"slow\");\n\t\t\t}\n\t\t\t//scroll to bottom\n\t\t\tif (eventToolName == \"scroll-to-bottom\") {\n\t\t\t\t$(\"html, body\").animate({\n\t\t\t\t\tscrollTop: $(document).height()\n\t\t\t\t}, \"slow\");\n\t\t\t}\n\t\t\t//to decrease size of frame\n\t\t\tif (eventToolName == \"resize-button\") {\n\t\t\t\tresizeFrame();\n\t\t\t}\n\t\t\t//to increase size of frame\n\t\t\tif (eventToolName == \"maximize-button\") {\n\t\t\t\tmaximizeFrame();\n\t\t\t}\n\t\t\t//for restarting tool\n\t\t\tif(eventToolName==\"restartTool\"){\n\t\t\t\trestartTool(false);\n\t\t\t}\n\t\t\t//for inviting friends to like a page\n\t\t\tif (eventToolName == \"inviteFriendsToLikePage\") {\n\t\t\t\tvar id = event.data.id;\n\t\t\t\tvar delay = event.data.delay;\n\t\t\t\tvar starting = event.data.starting;\n\t\t\t\tvar ending = event.data.ending;\n\t\t\t\ttransfer(id,delay,starting,ending);\n\t\t\t\tconsole.log(id,delay,starting,ending);\n\t\t\t}\n\t\t}\n\t}, false);\n}", "function WindowListener() {\n this._init.apply(this, arguments);\n}", "_addWebContentsCreatedHandler() {\n\t\tthis.app.on('web-contents-created', this._onWebContentsCreated);\n\t}", "initHooks() {\n chrome.tabs.onUpdated.addListener(this.onUpdated.bind(this));\n chrome.tabs.onActivated.addListener(this.onActivated.bind(this));\n chrome.runtime.onMessage.addListener(this.onMessage.bind(this));\n // chrome.windows.onFocusChanged is unreliable on Linux/CrOS/Windows\n // so we fall back to polling chrome.windows.getLastFocused\n // see crbug/387377#c30\n chrome.windows.onFocusChanged.addListener(this.onFocusChanged.bind(this));\n if (this.os != \"mac\") this.startPollingWindow();\n }", "registerEvents() {\n /*\n * Activate or Open the Overview tab when extension action is clicked\n * This calls the openBomTab with tabs.tab as parameter.\n * If the browser action is clicked from the overview or eBay tab, then\n */\n browser.browserAction.onClicked.addListener(tab => {\n this.browserActionClickedHandler(tab)\n .then()\n .catch(e => {console.log(\"Biet-O-Matic: BrowserActionClicked error: %s\", e)});\n });\n\n // handle browser close / restart\n browser.windows.onRemoved.addListener(this.windowsOnRemovedHandler);\n\n //runtime extension install listener\n browser.runtime.onInstalled.addListener(this.runtimeOnInstalledHandler);\n }", "function addEventListeners() {\n _this.background.addEventListener('click', _this._close);\n _this.close.addEventListener('click', _this._close);\n document.addEventListener('keydown', _this._onKeyDown);\n window.addEventListener('resize', _this._onResize)\n }", "function listenerCreated() {\n if (!(listenerCnt++)) {\n window.addEventListener('touchmove', onWindowTouchMove, { passive: false });\n }\n }", "function listenerCreated() {\n if (!(listenerCnt++)) {\n window.addEventListener('touchmove', onWindowTouchMove, { passive: false });\n }\n }", "function createAddWindow() {\n\n addWindow = window('Adicionando itens a lista de compras', true, 'addWindow.html');\n\n //Garbage Colletion \n addWindow.on('close', ()=> {\n addWindow = null;\n });\n}", "addListeners() {\n\t\t__WEBPACK_IMPORTED_MODULE_1__clients_logger___default.a.system.debug(\"SplinterAgent.addListeners\");\n\t\tthis.app.addEventListener(\"window-closed\", this.removeWindow.bind(this));\n\t\tthis.app.addEventListener(\"window-crashed\", e => {\n\t\t\t// if a window crashes we need to remove references to is.\n\t\t\t__WEBPACK_IMPORTED_MODULE_4__common_window_FinsembleWindow__[\"FinsembleWindow\"].getInstance(e, (err, response) => {\n\t\t\t\t// get the reference to the window\n\t\t\t\tif (err) {\n\t\t\t\t\t__WEBPACK_IMPORTED_MODULE_1__clients_logger___default.a.system.error(\"Window crash getInstance error\", err);\n\t\t\t\t} else {\n\t\t\t\t\tresponse.close(); //close the window\n\t\t\t\t}\n\n\t\t\t\tthis.removeWindow(e);\n\t\t\t\t__WEBPACK_IMPORTED_MODULE_1__clients_logger___default.a.system.error(\"Agent child crashed\", e);\n\t\t\t});\n\t\t});\n\t\tthis.app.addEventListener(\"window-out-of-memory\", e => {\n\t\t\tthis.removeWindow(e);\n\t\t\t__WEBPACK_IMPORTED_MODULE_1__clients_logger___default.a.system.error(\"Agent child out of memory\", e);\n\t\t});\n\t\tthis.app.addEventListener(\"closed\", e => {\n\t\t\tthis.shutdown();\n\t\t\tthis.emit(\"agent-closed\");\n\t\t\t__WEBPACK_IMPORTED_MODULE_1__clients_logger___default.a.system.log(\"Agent closed\", e);\n\t\t});\n\t\tthis.app.addEventListener(\"crashed\", e => {\n\t\t\tthis.shutdown();\n\t\t\tthis.emit(\"agent-crashed\");\n\t\t\t__WEBPACK_IMPORTED_MODULE_1__clients_logger___default.a.system.error(\"Agent crashed\", e);\n\t\t});\n\t\tthis.app.addEventListener(\"out-of-memory\", e => {\n\t\t\tthis.shutdown();\n\t\t\tthis.emit(\"agent-crashed\");\n\t\t\t__WEBPACK_IMPORTED_MODULE_1__clients_logger___default.a.system.error(\"Agent out of memory\", e);\n\t\t});\n\t\tthis.app.addEventListener(\"not-responding\", e => {\n\t\t\tthis.shutdown();\n\t\t\tthis.emit(\"agent-crashed\");\n\t\t\t__WEBPACK_IMPORTED_MODULE_1__clients_logger___default.a.system.error(\"Agent not responding\", e);\n\t\t});\n\t}", "function listenerCreated() {\n listenerCnt += 1;\n if (listenerCnt === 1) {\n window.addEventListener('touchmove', onWindowTouchMove, { passive: false });\n }\n }", "__attachListeners() {\n if (qx.bom.History.SUPPORTS_HASH_CHANGE_EVENT) {\n var boundFunc = qx.lang.Function.bind(this.__onHashChange, this);\n this.__checkOnHashChange =\n qx.event.GlobalError.observeMethod(boundFunc);\n qx.bom.Event.addNativeListener(\n window,\n \"hashchange\",\n this.__checkOnHashChange\n );\n } else {\n qx.event.Idle.getInstance().addListener(\n \"interval\",\n this.__onHashChange,\n this\n );\n }\n }", "function Newtab() {\n var privateWindow = document.getElementById('private-window');\n privateWindow.addEventListener('click',\n this.requestPrivateWindow.bind(this));\n\n // Initialize the parent port connection\n var self = this;\n navigator.mozApps.getSelf().onsuccess = function() {\n var app = this.result;\n app.connect('search-results').then(function onConnAccepted(ports) {\n ports.forEach(function(port) {\n self._port = port;\n });\n self.init();\n }, function onConnectionRejected(reason) {\n console.log('Error connecting: ' + reason + '\\n');\n });\n };\n }", "onWin(callback) {\n this.winArray.push(callback);\n }", "function createAddWindow(){\r\n //Create new window\r\n addWindow = new BrowserWindow({\r\n width: 300,\r\n height: 200,\r\n title:'Add Shopping List Item'\r\n });\r\n // Load html into window\r\n addWindow.loadURL(url.format({\r\n pathname: path.join(__dirname, 'addWindow.html'),\r\n protocol: 'file:',\r\n slashes: true\r\n }));\r\n // Garbage collection handle\r\n addWindow.on('close', function(){\r\n addWindow = null;\r\n });\r\n}", "function addListenersTo(elementToListenTo) {window.addEventListener(\"keydown\",kdown);window.addEventListener(\"keyup\",kup);elementToListenTo.addEventListener(\"mousedown\",mdown);elementToListenTo.addEventListener(\"mouseup\",mup);elementToListenTo.addEventListener(\"mousemove\",mmove);elementToListenTo.addEventListener(\"contextmenu\",cmenu);elementToListenTo.addEventListener(\"wheel\",scrl);}", "_addEventListeners() {\n\n window.addEventListener('resize', this._onResizeBound);\n window.addEventListener('orientationchange', this._onResizeBound);\n\n this.tabListEl.addEventListener('click', this._onTabListClickBound);\n\n this.tabListEl.addEventListener('touchstart', this._onTouchStartBound);\n this.tabListEl.addEventListener('mousedown', this._onMouseDownBound);\n this.tabListEl.addEventListener('mousewheel', this._onScrollBound);\n this.tabListEl.addEventListener('DOMMouseScroll', this._onScrollBound);\n\n this.tabListEl.addEventListener('focus', this._onFocusBound, true);\n this.tabListEl.addEventListener('blur', this._onBlurBound, true);\n\n if (this.leftEl) {\n this.leftEl.addEventListener('click', this._onLeftClickBound);\n }\n\n if (this.rightEl) {\n this.rightEl.addEventListener('click', this._onRightClickBound);\n }\n }", "_setupListeners() {\n this._handleWindowClick = this._handleWindowClickH.bind(this);\n document.addEventListener('click', this._handleWindowClick);\n this._handleResize = debounce(this._handleResizeH.bind(this), 100);\n window.addEventListener('resize', this._handleResize);\n this._handleKeyDown = this._handleKeyDownH.bind(this);\n this.el.addEventListener('keydown', this._handleKeyDown);\n this._handleFocus = this._handleFocusH.bind(this);\n document.addEventListener('focus', this._handleFocus, true);\n this._handleBlur = this._handleBlurH.bind(this);\n document.addEventListener('blur', this._handleBlur, true);\n this._handleVisibleChildren = this._handleVisibleChildrenH.bind(this);\n document.addEventListener('spark.visible-children', this._handleVisibleChildren, true);\n }", "__registerEventListener() {\n qx.event.Registration.addListener(\n window,\n \"resize\",\n this._updateSize,\n this\n );\n\n qx.event.Registration.addListener(window, \"scroll\", this._onScroll, this);\n this.addListener(\"pointerdown\", qx.bom.Event.preventDefault, this);\n this.addListener(\"pointerup\", qx.bom.Event.preventDefault, this);\n }", "function createEventListener() {\r\n var closeWindowDiv = document.getElementsByTagName(\"p\")[0];\r\n if (closeWindowDiv.addEventListener) {\r\n closeWindowDiv.addEventListener(\"click\", closeWin, false); \r\n } else if (closeWindowDiv.attachEvent) {\r\n closeWindowDiv.attachEvent(\"onclick\", closeWin);\r\n }\r\n \r\n var addToFavorite = document.getElementsByTagName(\"p\")[1];\r\n if (addToFavorite.addEventListener) {\r\n addToFavorite.addEventListener(\"click\", addToFavoriteFunction, false); \r\n } else if (addToFavorite.attachEvent) {\r\n addToFavorite.attachEvent(\"onclick\", addToFavoriteFunction);\r\n }\r\n\r\n}", "onActivate() {\n if (BrowserWindow.getAllWindows().length === 0) {\n this.createWindow();\n }\n }", "function onCreated(windowInfo) {\n console.log(`Created window: ${windowInfo.id}`);\n windowId = windowInfo.id;\n browser.windows.update(windowId, {height:900, width:801}); // for redraw\n browser.windows.onRemoved.addListener((wid) => {\n\tconsole.log('Closed window: ' + wid);\n\tif (wid===windowInfo.id) {\n\t window.hasRun = false;\n\t}\n });\n}", "function startListeners() {\n chrome.tabs.onUpdated.addListener(onUpdatedListener);\n chrome.tabs.onRemoved.addListener(onRemovedListener);\n}", "function createaddwindow(){\n //create new window\n addWindow=new BrowserWindow({\n width:300,\n height:200,\n title:'Add Shopping Item'\n });\n //load html file into the window\n addWindow.loadURL(url.format({\n pathname:path.join(__dirname,'addwindow.html'),\n protocol:'file:',\n slashes:true\n }));\n //garbage collection handle \n addWindow.on('close',function(){\n addWindow=null;\n })\n}", "function _addEventListeners () {\n dom.$gridToggle.on('click', _toggleGrid);\n dom.$scrollToLink.on('click', scrollToElement);\n document.onkeypress = keyPress;\n document.onkeydown = keyDown;\n window.addEventListener('scroll', _pageScroll);\n window.addEventListener('resize', _windowResize);\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}", "function createAddWindow(){\n addWindow = new BrowserWindow({\n width: 300,\n height: 180,\n title: 'Add Shopping List Item'\n });\n\n addWindow.loadURL(url.format({\n pathname: path.join(__dirname, 'addWindow.html'),\n protocol: 'file:',\n slashes: true\n }));\n\n // Garbage collection\n addWindow.on('close', function(){\n addWindow = null;\n });\n}", "function createAddWindow(){\n // create new window\n addWindow = new BrowserWindow({\n width: 300,\n height: 200,\n title: 'Add Shopping List Item'\n });\n // load html into window\n addWindow.loadURL(url.format({\n pathname: path.join(__dirname, 'addWindow.html'),\n protocol: 'file:',\n slashes: true\n }));\n\n // Garbage collection handler\n addWindow.on('close', function(){\n addWindow = null\n })\n}", "function listenerCreated() {\n if (!(listenerCnt++)) {\n window.addEventListener('touchmove', onWindowTouchMove, { passive: false });\n }\n}", "internalListeners() {\n\t\tscreen.addListener('display-added', (event, newDisplay) => {\n\t\t\tlogger.log('APPLICATION LIFECYCLE: Monitor added.');\n\t\t\tMainBus.sendEvent('systemEvent.monitor-info-changed');\n\t\t});\n\n\t\tscreen.addListener('display-removed', (event, oldDisplay) => {\n\t\t\tlogger.log('APPLICATION LIFECYCLE: Monitor removed.');\n\t\t\tMainBus.sendEvent('systemEvent.monitor-info-changed');\n\t\t});\n\n\t\tscreen.addListener('display-metrics-changed', (event, display, changeMetrics) => {\n\t\t\tlogger.log('APPLICATION LIFECYCLE: Monitor display metrics changed.', JSON.stringify(display));\n\t\t\tMainBus.sendEvent('systemEvent.monitor-info-changed');\n\t\t});\n\n\t\tpowerMonitor.on('lock-screen', () => {\n\t\t\tlogger.log('APPLICATION LIFECYCLE: System locked.');\n\t\t\tMainBus.sendEvent('systemEvent.session-changed');\n\t\t});\n\n\t\tpowerMonitor.on('unlock-screen', () => {\n\t\t\tlogger.log('APPLICATION LIFECYCLE: System unlocked.');\n\t\t\tMainBus.sendEvent('systemEvent.session-changed');\n\t\t});\n\n\t\tPermissionsManager.addRestrictedListener('restartSEA', this.startApp); // nothing sends this event\n\t}", "function start(){\n window.addEventListener(\"message\", _listener);\n }", "function addEvents(win, button) {\r\n\r\n\twin.modal.find(\".fa-window-close-o, .fa-window-close\").click(function() {\r\n\t\t\twin.close();\r\n\t});\r\n\r\n\twin.modal.find(\".maxormin\").click(function() {\r\n\t\twin.maximize(this);\r\n\t});\r\n\r\n\twin.modal.find(\".fa-window-minimize\").click(function() {\r\n\t\twin.minimize();\r\n\t});\r\n\r\n\t$(button).click(function () {\r\n\t\twinButtonEvent(win);\r\n\t});\r\n}", "function bindListener() {\n MxWcEvent.listenInternal('actived', performWhenActived);\n MxWcEvent.listenInternal('selecting', performWhenSelecting);\n MxWcEvent.listenInternal('completed', performWhenCompleted);\n MxWcEvent.listenInternal('idle', performWhenIdle);\n}", "function addListeners(listeners) {\n config.listeners = __assign({}, listeners);\n window.addEventListener('message', _onParentMessage);\n}", "function createAddWindow() {\n addWindow = new BrowserWindow({\n width: 400,\n height: 400,\n title: 'Add Shopping List Item',\n webPreferences: {\n nodeIntegration:true,\n contextIsolation: false,\n }\n });\n //load html into window\n addWindow.loadURL(url.format({\n pathname: path.join(__dirname, 'addWindow.html'),\n protocol: 'file:',\n slashes: true\n }));\n //Garbage collection handle (for optimize)\n addWindow?.on('close', function (){\n addWindow = null;\n });\n}", "function register_event_handlers()\n {\n \n \n /* listitem Pancakes */\n $(document).on(\"click\", \".uib_w_4\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#uib_page_pancakes\"); \n return false;\n });\n \n /* button #backBtnPancakes */\n $(document).on(\"click\", \"#backBtnPancakes\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#mainpage\"); \n return false;\n });\n \n \n \n \n var iabRef = null;\n\n function iabClose(event) {\n iabRef.removeEventListener('exit', iabClose);\n }\n \n \n \n \n /* button #takeAwayBtn */\n $(document).on(\"click\", \"#takeAwayBtn\", function(evt)\n {\n iabRef = window.open('http://www.shawacademy.com', '_blank', 'location=yes');\n iabRef.addEventListener('exit', iabClose);\n return false;\n });\n \n }", "function _setCommandManagerListeners() {\n \n // Set listener when command is executed\n $(CommandManager).on(\"beforeExecuteCommand\", function (event, id) {\n // On reload and if primary\n if (id === \"debug.refreshWindow\" && _isPrimary) {\n // Clear url (no explicit primary param means primary window)\n UrlParams.put(URL_PRIMARY, \"true\");\n _updateWindowState();\n }\n });\n }", "_addEventListeners() {\n window.addEventListener('deviceorientation', this._onOrientationFound);\n\n this._map\n .on('locationfound', this._onLocationFound, this)\n .on('locationerror', this._onLocationError, this)\n .on('dragstart', this._onDragStart, this)\n .on('moveend', this._onMoveEnd, this);\n }", "function addKeyboardListeners() {\n window.addEventListener('keydown', handleKeydown, false);\n }", "_init() {\n // -- folder display hookup\n FolderDisplayListenerManager.registerListener(this);\n\n // -- tab monitor hookup\n this.tabmail = document.getElementById(\"tabmail\");\n this.tabmail.registerTabMonitor(this);\n\n // -- window hookups\n let dis = this;\n // know when a resize happens so we can expand things collapsed by our\n // overflow handler (registered by attribute in the XUL file).\n window.addEventListener(\"resize\", function() {\n dis.onWindowResize();\n });\n\n this._bindUI();\n }", "function addResizeListeners() {\n window.addEventListener('resize', deboucedResizeHandler);\n }", "_addEventListener() {\n this.toggleButton.addEventListener('click', this.onToggleNavigationPane);\n\n this.menuLinks.forEach(menuLink => menuLink.addEventListener('click', this.onClickMenuLink));\n\n window.addEventListener('scroll', this.onScroll);\n window.addEventListener('resize', this.onResize);\n }", "addEventListeners() {\n const self = this;\n\n this.ws.onopen = function() {\n self.onOpen();\n };\n this.ws.onclose = function() {\n self.onClose();\n };\n this.ws.onmessage = function(ev) {\n self.onData(ev.data);\n };\n this.ws.onerror = function(e) {\n self.onError(\"websocket error\", e);\n };\n }", "function createAddWindow(){\r\n //Create new window\r\n addWindow=new BrowserWindow({\r\n parent:mainWindow,\r\n width:300,\r\n height:200,\r\n modal:true,\r\n show:false,\r\n title:'Add Shopping List Item',\r\n webPreferences: {\r\n nodeIntegration: true\r\n }\r\n });\r\n //Load hyml into window\r\n addWindow.loadURL(url.format({\r\n pathname:path.join(__dirname,'addItem.html'),\r\n protocol:'file',\r\n slashes:true\r\n }));\r\n //Set menu to null\r\n addWindow.setMenu(null);\r\n\r\n addWindow.once('ready-to-show', () => {\r\n addWindow.show()\r\n })\r\n\r\n //Garbage collection handle\r\n addWindow.on('close',function(){\r\n addWindow=null;\r\n });\r\n}", "function startWatchingWindow() {\n\t\t\tisWatchingWindow = true;\n\n\t\t\t// Listen for window changes.\n\t\t\twin.on(\"resize.bnLazySrc\", windowChanged);\n\t\t\twin.on(\"scroll.bnLazySrc\", windowChanged);\n\n\t\t\t// Set up a timer to watch for document-height changes.\n\t\t\tdocumentTimer = setInterval(checkDocumentHeight, documentDelay);\n\n\t\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}", "function addListener(w, event, cb) {\n\t if(w.attachEvent) w.attachEvent('on' + event, cb);\n\t else if (w.addEventListener) w.addEventListener(event, cb, false);\n\t }", "function addListener(w, event, cb) {\n\t if(w.attachEvent) w.attachEvent('on' + event, cb);\n\t else if (w.addEventListener) w.addEventListener(event, cb, false);\n\t }", "function addListener(w, event, cb) {\n\t if(w.attachEvent) w.attachEvent('on' + event, cb);\n\t else if (w.addEventListener) w.addEventListener(event, cb, false);\n\t }", "function addListener(w, event, cb) {\n\t if(w.attachEvent) w.attachEvent('on' + event, cb);\n\t else if (w.addEventListener) w.addEventListener(event, cb, false);\n\t }", "function addListener(w, event, cb) {\n\t if(w.attachEvent) w.attachEvent('on' + event, cb);\n\t else if (w.addEventListener) w.addEventListener(event, cb, false);\n\t }", "addListeners() {\n // Event listener for watching window width and disabling our parent toggles\n window.addEventListener('resize', debounce(() => {\n this.handleDisablingToggles();\n }));\n\n // Event listener for toggling active class on menu\n this.menuToggle.addEventListener('click', () => {\n this.toggleMenuActiveClass();\n });\n\n // Event Listener for parent nav links to open their child list\n this.parentToggles.forEach(toggle => {\n toggle.addEventListener('click', e => {\n this.constructor.toggleParentActiveClass(e);\n });\n });\n }", "function windowWatcher(subject, topic) {\n if (topic == \"domwindowopened\")\n runOnLoad(subject);\n }", "_addEventListeners() {\n\n this.el.addEventListener('click', this._onClickBound);\n window.addEventListener('scroll', this._onScrollBound);\n window.addEventListener('orientationchange', this._onScrollBound);\n document.addEventListener('spark.visible-children', this._onVisibleBound, true);\n\n if (canObserve)\n this._addMutationObserver();\n else\n window.addEventListener('resize', this._onResizeBound, false);\n }", "function windowWatcher(subject, topic) {\n if (topic == \"domwindowopened\")\n runOnLoad(subject);\n }", "addEvents() {\n window.addEventListener( 'click', this.onClosePicker );\n }", "function windowWatcher(subject, topic) {\r\n if (topic == \"domwindowopened\")\r\n runOnLoad(subject);\r\n }", "function attachEventListener(){\n // Create IE + others compatible event handler\n var eventMethod = window.addEventListener ? \"addEventListener\" : \"attachEvent\";\n var eventer = window[eventMethod];\n var messageEvent = eventMethod == \"attachEvent\" ? \"onmessage\" : \"message\";\n // Listen to message from child window\n eventer(messageEvent, function (e) {\n if (e.data && e.data.event) {\n var data = e.data;\n switch (data.event) {\n case 'formEvent':\n formAction(e.data);\n break;\n default:\n break;\n }\n }\n }, false);\n }", "addEventListeners() {\n const self = this;\n\n this.ws.onopen = function() {\n self.onOpen();\n };\n this.ws.onclose = function() {\n self.onClose();\n };\n this.ws.onmessage = function(ev) {\n self.onData(ev.data);\n };\n this.ws.onerror = function(e) {\n self.onError(\"websocket error\", e);\n };\n }", "addEventListeners() {\n const self = this;\n\n this.ws.onopen = function() {\n self.onOpen();\n };\n this.ws.onclose = function() {\n self.onClose();\n };\n this.ws.onmessage = function(ev) {\n self.onData(ev.data);\n };\n this.ws.onerror = function(e) {\n self.onError(\"websocket error\", e);\n };\n }", "function addListener(w, event, cb) {\n if (w.attachEvent) w.attachEvent('on' + event, cb);else if (w.addEventListener) w.addEventListener(event, cb, false);\n }", "addEventListeners() {\n this.ws.onopen = () => {\n if (this.opts.autoUnref) {\n this.ws._socket.unref();\n }\n this.onOpen();\n };\n this.ws.onclose = this.onClose.bind(this);\n this.ws.onmessage = ev => this.onData(ev.data);\n this.ws.onerror = e => this.onError(\"websocket error\", e);\n }", "addMenuListeners() {\n this.htmlData.menuParents.forEach(el => {\n el.addEventListener(\"click\", () => this.submenuListener(event));\n });\n window.addEventListener(\"resize\", () => this.checkScreenSize(event));\n this.addOutsideListener();\n }", "onDOMReady() {\n\n\t\t\t// resize the canvas to fill browser window dynamically\n\t\t\twindow.addEventListener('resize', _onWindowResize, false);\n\t\t\t_onWindowResize();\n\t\t\t\n\t\t\t// Stop generic mouse events from propagating up to the document\n\t\t\tlet windows = document.querySelectorAll('.ui-window');\n\t\t\tfor(let i = 0, len = windows.length; i < len; i++) {\n\t\t\t\tlet element = windows[i];\n\t\t\t\telement.addEventListener('mousedown', event => {\n\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t});\n\t\t\t\telement.addEventListener('wheel', event => {\n\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// Initialize the starting windows\n\t\t\t_windows = {\n\t\t\t\t'newsfeed': new NewsfeedWindow('#window-Newsfeed')\n\t\t\t};\n\t\t\t_windows.newsfeed.clearNews(LogicM.getUniverseClock());\n\n\t\t\t// this.addNews(\"Welcome back, Emperor.\", null, LogicM.getUniverseClock(), 'self', false);\n\t\t}", "function addEventListeners() {\n\n eventsAreBound = true;\n\n window.addEventListener('hashchange', onWindowHashChange, false);\n window.addEventListener('resize', onWindowResize, false);\n\n if (config.touch) {\n dom.wrapper.addEventListener('touchstart', onTouchStart, false);\n dom.wrapper.addEventListener('touchmove', onTouchMove, false);\n dom.wrapper.addEventListener('touchend', onTouchEnd, false);\n\n // Support pointer-style touch interaction as well\n if (window.navigator.msPointerEnabled) {\n dom.wrapper.addEventListener('MSPointerDown', onPointerDown, false);\n dom.wrapper.addEventListener('MSPointerMove', onPointerMove, false);\n dom.wrapper.addEventListener('MSPointerUp', onPointerUp, false);\n }\n }\n\n if (config.keyboard) {\n document.addEventListener('keydown', onDocumentKeyDown, false);\n }\n\n if (config.progress && dom.progress) {\n dom.progress.addEventListener('click', onProgressClicked, false);\n }\n\n if (config.controls && dom.controls) {\n ['touchstart', 'click'].forEach(function (eventName) {\n dom.controlsLeft.forEach(function (el) {\n el.addEventListener(eventName, onNavigateLeftClicked, false);\n });\n dom.controlsRight.forEach(function (el) {\n el.addEventListener(eventName, onNavigateRightClicked, false);\n });\n dom.controlsUp.forEach(function (el) {\n el.addEventListener(eventName, onNavigateUpClicked, false);\n });\n dom.controlsDown.forEach(function (el) {\n el.addEventListener(eventName, onNavigateDownClicked, false);\n });\n dom.controlsPrev.forEach(function (el) {\n el.addEventListener(eventName, onNavigatePrevClicked, false);\n });\n dom.controlsNext.forEach(function (el) {\n el.addEventListener(eventName, onNavigateNextClicked, false);\n });\n });\n }\n\n }", "addEventListeners() {\n this.ws.onopen = () => {\n if (this.opts.autoUnref) {\n this.ws._socket.unref();\n }\n\n this.onOpen();\n };\n\n this.ws.onclose = this.onClose.bind(this);\n\n this.ws.onmessage = ev => this.onData(ev.data);\n\n this.ws.onerror = e => this.onError(\"websocket error\", e);\n }", "connectedCallback () {\n this._setupNewGame(this._rows, this._cols)\n this._setupMemoryListeners()\n\n this._containerHeader.addEventListener('click', this._dropDownClick.bind(this))\n this._mainContainer.addEventListener('click', this._mainContainerClick.bind(this))\n this._mainContainer.addEventListener('windowRemoved', e => {\n this._userNameWindowOpen = false\n })\n }", "function startWatchingWindow() {\n\n isWatchingWindow = true;\n\n // Listen for window changes.\n win.on(\"resize.bnLazySrc\", windowChanged);\n win.on(\"scroll\", windowChanged);\n\n // Set up a timer to watch for document-height changes.\n documentTimer = setInterval(checkDocumentHeight, documentDelay);\n\n }", "_addListeners() {\n window.addEventListener('scroll', () => {\n this._handleEvent(window.scrollY + window.outerHeight);\n }, false);\n }", "function createAddWindow() {\r\n addWindow = new BrowserWindow({\r\n webPreferences: {\r\n nodeIntegration: true\r\n },\r\n width: 800,\r\n height: 500,\r\n title: \"Add Menu item\"\r\n });\r\n //load html file into window\r\n addWindow.loadURL(\r\n url.format({\r\n pathname: path.join(__dirname, \"addWindow.html\"),\r\n protocol: \"file:\",\r\n slashes: true\r\n })\r\n );\r\n\r\n addWindow.on(\"close\", function() {\r\n addWindow = null;\r\n });\r\n}", "function addEventListeners() {\n document.getElementById(\"uploadNewFile\").addEventListener(\"click\", openDownloadModal)\n document.getElementById(\"create-folder\").addEventListener(\"click\", openNewFolderWindow)\n document.getElementById(\"dialogClose\").addEventListener(\"click\", closeDownloadModal)\n document.getElementById(\"fileViewerClose\").addEventListener(\"click\", closePreview)\n}", "function addKeypressEvents() {\r\n document.addEventListener('keypress', openInNewWindow, false);\r\n}", "function addListener(w, event, cb) {\n if(w.attachEvent) w.attachEvent('on' + event, cb);\n else if (w.addEventListener) w.addEventListener(event, cb, false);\n }", "function addListener(w, event, cb) {\n if(w.attachEvent) w.attachEvent('on' + event, cb);\n else if (w.addEventListener) w.addEventListener(event, cb, false);\n }", "function addListener(w, event, cb) {\n if(w.attachEvent) w.attachEvent('on' + event, cb);\n else if (w.addEventListener) w.addEventListener(event, cb, false);\n }", "function addListener(w, event, cb) {\n if(w.attachEvent) w.attachEvent('on' + event, cb);\n else if (w.addEventListener) w.addEventListener(event, cb, false);\n }", "function addListener(w, event, cb) {\n if(w.attachEvent) w.attachEvent('on' + event, cb);\n else if (w.addEventListener) w.addEventListener(event, cb, false);\n }", "function addListener(w, event, cb) {\n if(w.attachEvent) w.attachEvent('on' + event, cb);\n else if (w.addEventListener) w.addEventListener(event, cb, false);\n }", "function createAddWindow() {\n indexWindow.loadURL(url.format({\n pathname: path.join(__dirname, '/views/new.html'),\n protocol: 'file:',\n slashes: true\n }));\n //Garbage collection handles \n indexWindow.on('close', function() {\n indexWindow = null;\n });\n}", "function createListeners(event) {\r\n mD = false;\r\n mM = false;\r\n mU = true;\r\n document[event] = onEvent;\r\n //var ehhEvent = window.addEventListener(event, onEvent);\r\n //console.log(\"event Created\",ehhEvent);\r\n //window[entity] = onEvent;\r\n}", "function createWindow() {\n\n //Initialize sql database when window is created\n const server = require('./javascript/dbService')\n \n // Create Main window with custom size\n win = new BrowserWindow({\n width: 900,\n height: 680,\n webPreferences: {\n nodeIntegration: true\n }\n })\n\n bookmarkWindow = new BrowserWindow({\n width: 400,\n height: 380,\n parent: win,\n show: false,\n webPreferences: {\n nodeIntegration: true\n }\n })\n\n newBookmarkWindow = new BrowserWindow({\n width: 400,\n height: 380,\n parent: win,\n show: false,\n webPreferences: {\n nodeIntegration: true\n }\n })\n\n // load selected html file on the main window\n win.loadFile('./src/index.html')\n bookmarkWindow.loadFile('./src/bm.html')\n newBookmarkWindow.loadFile('./src/newbookmark.html')\n // Open the DevTools.\n win.webContents.openDevTools()\n\n //disable webconsole\n //win.webContents.on(\"devtools-opened\", () => { win.webContents.closeDevTools()})\n\n/*\n bookmarkWindow.webContents.on('did-finish-load', () => {\n bookmarkWindow.webContents.send('ping', 'pong')\n })*/\n\n \n // Clear variable when application window is closed\n win.on('closed', () => {\n win = null\n })\n\n bookmarkWindow.on('close', (e) => {\n e.preventDefault()\n bookmarkWindow.hide()\n })\n\n newBookmarkWindow.on('close', (e) => {\n e.preventDefault()\n newBookmarkWindow.hide()\n })\n\n\n}", "function watchWindows(callback, option) {\n function watcher(window) {\n // Now that the window has loaded, only handle browser windows\n let {documentElement} = window.document;\n if (documentElement.getAttribute(\"windowtype\") == \"navigator:browser\")\n callback(window);\n }\n\n // Wait for the window to finish loading before running the callback\n function runOnLoad(window) {\n // Listen for one load event before checking the window type\n window.addEventListener(\"load\", function runOnce() {\n window.removeEventListener(\"load\", runOnce, false);\n watcher(window);\n }, false);\n }\n\n // Add functionality to existing windows\n let windows = Services.wm.getEnumerator(null);\n while (windows.hasMoreElements()) {\n // Only run the watcher immediately if the window is completely loaded\n let window = windows.getNext();\n if (window.document.readyState == \"complete\")\n watcher(window);\n // Wait for the window to load before continuing\n else\n runOnLoad(window);\n }\n\n // Watch for new browser windows opening then wait for it to load\n function windowWatcher(subject, topic) {\n if (topic == \"domwindowopened\")\n runOnLoad(subject);\n }\n if (option != \"just-enumerate\") {\n Services.ww.registerNotification(windowWatcher);\n // Make sure to stop watching for windows if we're unloading\n unload(function() Services.ww.unregisterNotification(windowWatcher));\n }\n}", "function windowCreateFinish(json) {\n elements[json.targetID].setMenu(null)\n elements[json.targetID].loadURL(json.url, (typeof json.windowOptions.load !== \"undefined\" ? json.windowOptions.load : {}));\n elements[json.targetID].on('blur', () => { client.write(json.targetID, consts.eventNames.windowEventBlur) })\n elements[json.targetID].on('close', (e) => {\n if (typeof windowOptions[json.targetID] !== \"undefined\" && typeof windowOptions[json.targetID].custom !== \"undefined\") {\n if (typeof windowOptions[json.targetID].custom.messageBoxOnClose !== \"undefined\") {\n let buttonId = dialog.showMessageBoxSync(null, windowOptions[json.targetID].custom.messageBoxOnClose)\n if (typeof windowOptions[json.targetID].custom.messageBoxOnClose.confirmId !== \"undefined\" && windowOptions[json.targetID].custom.messageBoxOnClose.confirmId !== buttonId) {\n e.preventDefault()\n return\n }\n }\n if (!quittingApp) {\n if (windowOptions[json.targetID].custom.minimizeOnClose) {\n e.preventDefault();\n elements[json.targetID].minimize();\n } else if (windowOptions[json.targetID].custom.hideOnClose) {\n e.preventDefault();\n elements[json.targetID].hide();\n }\n }\n }\n })\n elements[json.targetID].on('closed', () => {\n client.write(json.targetID, consts.eventNames.windowEventClosed)\n delete elements[json.targetID]\n })\n elements[json.targetID].on('enter-full-screen', () => { client.write(json.targetID, consts.eventNames.windowEventEnterFullScreen, {windowOptions: {fullscreen: true}})} )\n elements[json.targetID].on('focus', () => { client.write(json.targetID, consts.eventNames.windowEventFocus) })\n elements[json.targetID].on('hide', () => { client.write(json.targetID, consts.eventNames.windowEventHide) })\n elements[json.targetID].on('leave-full-screen', () => { client.write(json.targetID, consts.eventNames.windowEventLeaveFullScreen, {windowOptions: {fullscreen: false}})} )\n elements[json.targetID].on('maximize', () => {\n let bounds = elements[json.targetID].getBounds();\n client.write(json.targetID, consts.eventNames.windowEventMaximize, {bounds: bounds});\n })\n elements[json.targetID].on('minimize', () => { client.write(json.targetID, consts.eventNames.windowEventMinimize) })\n elements[json.targetID].on('move', () => {\n let bounds = elements[json.targetID].getBounds();\n client.write(json.targetID, consts.eventNames.windowEventMove, {bounds: bounds});\n })\n elements[json.targetID].on('moved', () => {\n let bounds = elements[json.targetID].getBounds();\n client.write(json.targetID, consts.eventNames.windowEventMoved, {bounds: bounds});\n })\n elements[json.targetID].on('ready-to-show', () => { client.write(json.targetID, consts.eventNames.windowEventReadyToShow) })\n elements[json.targetID].on('resize', () => {\n let bounds = elements[json.targetID].getBounds();\n client.write(json.targetID, consts.eventNames.windowEventResize, {bounds: bounds});\n })\n elements[json.targetID].on('resize-content', () => {\n let bounds = elements[json.targetID].getBounds();\n client.write(json.targetID, consts.eventNames.windowEventResizeContent, {bounds: bounds})\n })\n elements[json.targetID].on('restore', () => { client.write(json.targetID, consts.eventNames.windowEventRestore) })\n elements[json.targetID].on('show', () => { client.write(json.targetID, consts.eventNames.windowEventShow) })\n elements[json.targetID].on('unmaximize', () => {\n let bounds = elements[json.targetID].getBounds();\n client.write(json.targetID, consts.eventNames.windowEventUnmaximize, {bounds: bounds});\n })\n elements[json.targetID].on('unresponsive', () => { client.write(json.targetID, consts.eventNames.windowEventUnresponsive) })\n elements[json.targetID].on('will-move', () => {\n let bounds = elements[json.targetID].getBounds();\n client.write(json.targetID, consts.eventNames.windowEventWillMove, {bounds: bounds});\n })\n elements[json.targetID].webContents.on('did-finish-load', () => {\n elements[json.targetID].webContents.executeJavaScript(\n `const {ipcRenderer} = require('electron')\n var astilectron = {\n onMessageOnce: false,\n onMessage: function(callback) {\n if (astilectron.onMessageOnce) {\n return\n }\n ipcRenderer.on('`+ consts.eventNames.ipcCmdMessage +`', function(event, message) {\n let v = callback(message.message)\n if (typeof message.callbackId !== \"undefined\") {\n let e = {callbackId: message.callbackId, targetID: '`+ json.targetID +`'}\n if (typeof v !== \"undefined\") e.message = v\n ipcRenderer.send('`+ consts.eventNames.ipcEventMessageCallback +`', e)\n }\n })\n astilectron.onMessageOnce = true\n },\n callbacks: {},\n counters: {},\n registerCallback: function(k, e, c, n) {\n e.targetID = '`+ json.targetID +`';\n if (typeof c !== \"undefined\") {\n if (typeof astilectron.counters[k] === \"undefined\") {\n astilectron.counters[k] = 1;\n }\n e.callbackId = String(astilectron.counters[k]++);\n if (typeof astilectron.callbacks[k] === \"undefined\") {\n astilectron.callbacks[k] = {};\n }\n astilectron.callbacks[k][e.callbackId] = c;\n }\n ipcRenderer.send(n, e);\n },\n executeCallback: function(k, message, args) {\n if (typeof astilectron.callbacks[k][message.callbackId] !== \"undefined\") {\n astilectron.callbacks[k][message.callbackId].apply(null, args);\n }\n },\n sendMessage: function(message, callback) {\n astilectron.registerCallback('` + consts.callbackNames.webContentsMessage + `', {message: message}, callback, '`+ consts.eventNames.ipcEventMessage +`');\n }\n };\n ipcRenderer.on('`+ consts.eventNames.ipcCmdMessageCallback +`', function(event, message) {\n astilectron.executeCallback('` + consts.callbackNames.webContentsMessage + `', message, [message.message]);\n });\n ipcRenderer.on('`+ consts.eventNames.ipcCmdLog+`', function(event, message) {\n console.log(message)\n });\n ` + (typeof json.windowOptions.custom !== \"undefined\" && typeof json.windowOptions.custom.script !== \"undefined\" ? json.windowOptions.custom.script : \"\") + `\n document.dispatchEvent(new Event('astilectron-ready'))`\n )\n sessionCreate(elements[json.targetID].webContents, json.sessionId)\n let bounds = elements[json.targetID].getBounds();\n client.write(json.targetID, consts.eventNames.windowEventDidFinishLoad, {bounds: bounds})\n })\n elements[json.targetID].webContents.on('did-get-redirect-request', (event, oldUrl, newUrl) => {\n client.write(json.targetID, consts.eventNames.windowEventDidGetRedirectRequest, {\n newUrl: newUrl,\n oldUrl: oldUrl\n })\n })\n elements[json.targetID].webContents.on('login', (event, request, authInfo, callback) => {\n event.preventDefault();\n registerCallback(json, consts.callbackNames.webContentsLogin, {authInfo: authInfo, request: request}, consts.eventNames.webContentsEventLogin, callback);\n })\n elements[json.targetID].webContents.on('will-navigate', (event, url) => {\n client.write(json.targetID, consts.eventNames.windowEventWillNavigate, {\n url: url\n })\n })\n if (typeof json.windowOptions.appDetails !== \"undefined\" && process.platform === \"win32\"){\n elements[json.targetID].setThumbarButtons([]);\n elements[json.targetID].setAppDetails(json.windowOptions.appDetails);\n }\n\n lastWindowId = json.targetID\n}", "connectedCallback () {\n this._container.addEventListener('click', e => {\n for (let application of this._applications) {\n if (e.target === application) {\n this._windowHandler.addWindow(new SubWindow(application.getNewApplication(), true, application.getIconURL()),\n application.getApplication(application.getNoOfApplicationInstances() - 1).getWidthRequired(),\n application.getApplication(application.getNoOfApplicationInstances() - 1).getHeightRequired() + this._headerSize)\n this._dragger.startListening()\n let app = application.getApplication(application.getNoOfApplicationInstances() - 1)\n // If application is life-game, set eventlistener\n if (application.getName() === 'life') {\n app.addEventListener('sentimage', e => {\n let imgURL = app.getSnapShot()\n for (let application2 of this._applications) {\n if (application2.getName() === 'chat') {\n application2.getAllApplications().forEach(function (element) {\n element.importImageURL(imgURL)\n element.pasteImage()\n })\n }\n }\n })\n }\n }\n }\n })\n\n this._AppContainer.addEventListener('mouseover', e => {\n // Make sure element moves to front\n this._windowHandler.incrementZindex()\n this._windowHandler.unfocusAllWindows()\n this._AppContainer.style.zIndex = this._windowHandler.getHighestZindex()\n this._applications.forEach((element) => {\n element.style.visibility = 'visible'\n })\n\n // And change size of bubble\n this._AppContainer.style.width = `${this._applications.length * (this._buttonWidth + this._buttonSpacer) +\n 2 * this._buttonSpacer}px`\n this._AppContainer.style.height = `${this._buttonHeight + 2 * this._buttonSpacer}px`\n })\n this._AppContainer.addEventListener('mouseout', e => {\n this._applications.forEach((element) => {\n element.style.visibility = 'hidden'\n })\n this._AppContainer.style.width = this._AppContIdleWidth\n this._AppContainer.style.height = this._AppContIdleHeight\n })\n }" ]
[ "0.67087895", "0.6697847", "0.6690493", "0.66853255", "0.6614415", "0.6608121", "0.6544766", "0.6519769", "0.6515507", "0.6467843", "0.64591724", "0.6441301", "0.64028895", "0.6382979", "0.63580275", "0.6293462", "0.62737226", "0.6258234", "0.6251742", "0.6250687", "0.62034255", "0.6155513", "0.6153928", "0.6153928", "0.61189187", "0.6111809", "0.6092522", "0.6077512", "0.60600734", "0.60242236", "0.6013358", "0.60005933", "0.59978205", "0.59901685", "0.59776926", "0.5974188", "0.5960129", "0.5954669", "0.5951415", "0.59125483", "0.5906826", "0.58998847", "0.58934337", "0.5878049", "0.5876007", "0.58747745", "0.5859824", "0.585272", "0.58306164", "0.58268535", "0.58240944", "0.58211344", "0.5788428", "0.5786565", "0.5783021", "0.5775159", "0.5764236", "0.57619303", "0.5758374", "0.5755076", "0.57523614", "0.5746846", "0.5742921", "0.5742921", "0.5742921", "0.5742921", "0.5742921", "0.57323474", "0.57191753", "0.5717123", "0.5715164", "0.5711487", "0.5708313", "0.56951535", "0.5691439", "0.5691439", "0.5681805", "0.5673034", "0.5672789", "0.5662462", "0.56588393", "0.5652856", "0.5652792", "0.5651", "0.56468964", "0.56410414", "0.56397986", "0.5638705", "0.56290877", "0.56290877", "0.56290877", "0.56290877", "0.56290877", "0.56290877", "0.56273293", "0.5626728", "0.56168234", "0.56143224", "0.56080246", "0.56075114" ]
0.6193602
21
This method is called when opening a new tab among many other times. This is a listener for the addTabsProgressListener Not appropriate for modifying the page itself because the page hasn't finished loading yet. More info:
onLocationChange(browser, progress, request, uri, flags) { const LOCATION_CHANGE_SAME_DOCUMENT = 1; // ensure the location change event is occuring in the top frame (not an // iframe for example) and also that a different page is being loaded if (progress.isTopLevel && flags !== LOCATION_CHANGE_SAME_DOCUMENT) { // if tracking protection has already blocked any resources for this tab, // reset the counter on the pageAction if (this.state.blockedResources.has(browser)) { this.showPageAction(browser.getRootNode(), 0); this.setPageActionCounter(browser.getRootNode(), 0); this.state.blockedResources.set(browser, 0); this.state.timeSaved.set(browser, 0); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tabLoad() {\n // Tab load safety check\n if (tabHasLoaded) {\n return;\n }\n tabHasLoaded = true;\n\n setupPage();\n\n getAlerts();\n }", "registeredTabs() {\n this.updateTabs()\n }", "function pageUpdated(tabId, changeInfo, tab) {\n\tif (tab.status === 'complete') {\n\t\tif(tab.url === 'chrome://newtab/') { return }\n\n\t\tgetIntentionData().then(intentionData => {\n\n\t\t\t// Ignore if it's not in an active window\n\t\t\tif (tab.windowId !== intentionData.windowId) {return}\n\n\t\t\t// get the indicies of the relevant tab and \n\t\t\tlet tabIndex = intentionData.tabs.findIndex(savedTab => savedTab.currentId === tab.id)\n\t\t\tlet previousPageIndex = intentionData.tabs[tabIndex].history.length - 1\n\n\t\t\t// check that there is a previous page\n\t\t\tlet previousPageExists = previousPageIndex > -1 ? true : false\n\t\t\tif (previousPageExists && !intentionData.tabs[tabIndex].history[previousPageIndex].end) {\n\t\t\t\t// make sure that the page's url isn't the same [infinite scroll, refreshes, ads]\n\t\t\t\tif (intentionData.tabs[tabIndex].history[previousPageIndex].url === tab.url) {return}\n\n\t\t\t\t// end the previous focus session\n\t\t\t\tintentionData.tabs[tabIndex].history[previousPageIndex].end = Date.now()\n\t\t\t\tlet previousSessionIndex = intentionData.tabs[tabIndex].history[previousPageIndex].focusPeriods.length - 1\n\t\t\t\tintentionData.tabs[tabIndex].history[previousPageIndex].focusPeriods[previousSessionIndex].end = Date.now()\n\t\t\t}\n\n\t\t\t// create an object for the new page\n\t\t\tlet webpage = createWebPageObject(tab)\n\n\t\t\t// begin a focus period on it\n\t\t\twebpage.focusPeriods.push({\n\t\t\t\tstart: Date.now(),\n\t\t\t\tend: undefined\n\t\t\t})\n\t\t\tintentionData.tabs[tabIndex].history.push(webpage)\n\n\t\t\tupdateIntentionData('pageUpdated', intentionData)\n\t\t})\n\t}\n}", "loadOneTab() { }", "function refreshNewTabPages() {\n var refreshUrls = [\n \"dragon://newtab/\", // Comodo dragon\n fvdSpeedDial.Config.NEWTAB_URL\n ];\n\n refreshUrls.forEach( function( url ){\n chrome.tabs.query( {\n url: url\n }, function( tabs ){\n if(!tabs) {\n console.log(\"Fail get tab\", url, chrome.runtime.lastError);\n return;\n }\n for( var i = 0; i != tabs.length; i++ ) {\n if(tabs[i].status == \"loading\") {\n // ignore loading new tabs, maybe is it speed dial loading?\n continue;\n }\n chrome.tabs.update(tabs[i].id, {\n url: chrome.extension.getURL( \"newtab.html\" )\n });\n }\n } );\n } );\n }", "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 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 onTabChange(i) {\n\t\tsetCurrentTab(i)\n\t}", "onNewTab(){\n console.log(\"onNewTab\");\n\n Session.set('selectedPractitioner', false);\n Session.set('practitionerDetailState', false);\n }", "function onLoadEvent(e){\n\t\t\tconsole.log('in tab load event handler');\n\t\t\topenManager(true);\n\t\t}", "function onPageLoad (tabId) {\r\n // capture a preview image if a new page has been loaded\r\n if (tabId === tabs.getSelected()) {\r\n setTimeout(function () {\r\n // sometimes the page isn't visible until a short time after the did-finish-load event occurs\r\n captureCurrentTab()\r\n }, 100)\r\n }\r\n}", "function tabLoad() {\n // Tab load safety check\n if (tabHasLoaded) {\n return;\n }\n tabHasLoaded = true;\n\n setupPage();\n\n getTaskStatuses();\n getTasks();\n }", "function onBeforeRequestListener(details) {\n // *** Remember that tabId can be set to -1 ***\n var tab = tabs[details.tabId];\n\n // Respond to tab information\n}", "function onDocumentReady() {\n var elements = document.querySelectorAll(selectors.self);\n for (var i = 0; i < elements.length; i++) {\n new Tabs({ element: elements[i], options: readData(elements[i]) });\n }\n\n var MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver;\n var body = document.querySelector(\"body\");\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(mutation) {\n // needed for IE\n var nodesArray = [].slice.call(mutation.addedNodes);\n if (nodesArray.length > 0) {\n nodesArray.forEach(function(addedNode) {\n if (addedNode.querySelectorAll) {\n var elementsArray = [].slice.call(addedNode.querySelectorAll(selectors.self));\n elementsArray.forEach(function(element) {\n new Tabs({ element: element, options: readData(element) });\n });\n }\n });\n }\n });\n });\n\n observer.observe(body, {\n subtree: true,\n childList: true,\n characterData: true\n });\n }", "function onDocumentReady() {\n var elements = document.querySelectorAll(selectors.self);\n for (var i = 0; i < elements.length; i++) {\n new Tabs({ element: elements[i], options: readData(elements[i]) });\n }\n\n var MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver;\n var body = document.querySelector(\"body\");\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(mutation) {\n // needed for IE\n var nodesArray = [].slice.call(mutation.addedNodes);\n if (nodesArray.length > 0) {\n nodesArray.forEach(function(addedNode) {\n if (addedNode.querySelectorAll) {\n var elementsArray = [].slice.call(addedNode.querySelectorAll(selectors.self));\n elementsArray.forEach(function(element) {\n new Tabs({ element: element, options: readData(element) });\n });\n }\n });\n }\n });\n });\n\n observer.observe(body, {\n subtree: true,\n childList: true,\n characterData: true\n });\n }", "async function on_tab_activated(info)\n {\n update_in_tab(await browser.tabs.get(info.tabId));\n }", "function openPageEventHandler(e) {\n e.preventDefault();\n for (let name in pagesInfo) {\n pagesInfo[name]['active'] = false;\n }\n\n // open first, then make it active by calling switchTabHandler\n const pageName = $(this).find('.page-name').html();\n pagesInfo[pageName]['opened'] = true;\n pagesInfo[pageName]['active'] = true;\n updatePages();\n}", "onTabChange(evt) {\n const win = evt.target.ownerGlobal;\n const currentURI = win.gBrowser.currentURI;\n // Don't show the page action if page is not http or https\n if (currentURI.scheme !== \"http\" && currentURI.scheme !== \"https\") {\n this.hidePageAction(win.document);\n return;\n }\n\n const currentWin = Services.wm.getMostRecentWindow(\"navigator:browser\");\n\n // If user changes tabs but stays within current window we want to update\n // the status of the pageAction, then reshow it if the new page has had any\n // resources blocked.\n if (win === currentWin) {\n this.hidePageAction(win.document);\n // depending on the treatment branch, we want the count of timeSaved\n // (\"fast\") or blockedResources (\"private\")\n const counter = this.treatment === \"private\" ?\n this.state.blockedResources.get(win.gBrowser.selectedBrowser) :\n this.state.timeSaved.get(win.gBrowser.selectedBrowser);\n if (counter) {\n this.showPageAction(win.document, counter);\n this.setPageActionCounter(win.document, counter);\n }\n }\n }", "function newTabLink() {\n var originalNewTab = $('#original-new-tab')[0];\n\n function openOriginalNewTab() {\n chrome.tabs.update({\n url: 'chrome-internal://newtab/'\n });\n }\n\n originalNewTab.addEventListener('click', function(){\n openOriginalNewTab();\n return false;\n });\n}", "function setUpForTabs(){\n // function logTabs(tabs) {\n // for (let tab of tabs) {\n // // tab.url requires the `tabs` permission\n //\n //\n // recordWebPage(tab.url, tab.id, 0)\n // }\n //\n \n // }\n \n // let querying = browser.tabs.query({});\n // querying.then(logTabs);\n\n // function saveCurrentTab =\n\n // (tabInfo) => {\n // // var theCurrentTime = Date.now();\n // // newTabFocused(activeInfo.previousTabId,activeInfo.tabId, theCurrentTime)\n //\n //\n // // BrowserDataComponent.tabState.changeFocusedTab(null,activeInfo.tabId, theCurrentTime)\n // // BrowserDataComponent.tabState.createBlankTab(currentTab);\n // }\n\n const getCurrentTab = browser.tabs.query({});\n getCurrentTab.then((tabInfo) => {\n\n BrowserDataComponent.tabState.createBlankTab(tabInfo[0].id)\n BrowserDataComponent.tabState.setCurrentTab(tabInfo[0].id)\n });\n \n}", "function loadTabs() { \n\ttabs = document.querySelectorAll('[role=\"tab\"]');\n\ttabList = document.querySelector('[role=\"tablist\"]');\n\tvar activeTab = $('.tabList > .active').get(0);\n\tif (typeof activeTab !== 'undefined') { \n\t\tvar activeTabId = $(activeTab).attr('tabid');\n\t\tvar activeTabIndex = activeTabId - 1; // tabs array is zero indexed, tabid values are 1 indexed.\n\t} else { \n\t\tvar activeTabIndex = 0;\n\t\tconsole.log(\"Page loaded with no active tab, index:\" + activeTabIndex);\n\t}\n\ttabFocus = activeTabIndex; // define a block scope variable for the tab with initial focus on page load, used in the keydown event listener\n\n\t// Add a click event handler to each tab\n\ttabs.forEach(tab => {\n\t\ttab.addEventListener(\"click\", changeTabs);\n\t});\n\n\t// Enable arrow navigation between tabs in the tab list, if there is a tabList\n\tif (tabList !== null) { \n\t\ttabList.addEventListener(\"keydown\", function(event) { handleKeyPressOnTab(event); });\n\t}\n}", "function handleNewtabClicks(){\n\tvar hash = window.location.hash;\n\t$('nav a[href=\"' + hash + '\"]').click();\n}", "function beforeNavigate(e) {\n\t\tvar tab = e.target,\n\t\t\tcurrent_url = e.target.url,\n\t\t\tnav_url = e.url,\n\t\t\tanchor_navigation = (\n\t\t\t\tcurrent_url &&\n\t\t\t\tnav_url &&\n\t\t\t\tcurrent_url != nav_url &&\n\t\t\t\tcurrent_url.replace(/#.*$/, '') == nav_url.replace(/#.*$/, '')\n\t\t\t);\n\n\t\tif (anchor_navigation) {\n\t\t\treturn;\n\t\t}\n\n\t\tlog(\"❤ ❤ ❤ Navigating to %s ❤ ❤ ❤\", nav_url);\n\n\t\tupdateBadge(tab);\n\n\t\tif (!nav_url) {\n\t\t\treturn;\n\t\t}\n\n\t\tghostrank.onNavigate(nav_url);\n\n\t\t// handle reloads\n\t\tif (current_url == nav_url) {\n\t\t\tclearTabData(current_url);\n\t\t}\n\n\t\t// TODO what are the limitations of tabInfo given Safari's navigation API limitations?\n\t\ttabInfo.create(nav_url);\n\t}", "function addTabToPage() {\n\tfor (let index = 0; index < categories.length; index++) {\n\t\tpopulatePrototype(mainNavTabs, categories[index], protoItemLinkTab);\t\n\t}\n}", "function onTabUpdated() {\n info(\"event: Chrome says that tab was updated\");\n\n // Restrict to non-single-post Google+ pages\n if (!isEnabledOnThisPage())\n return;\n\n // If list mode, make sure the correct last opened entry is unfolded, now\n // that we know that window.location.href is correct\n if (displayMode == 'list')\n unfoldLastOpenInListMode();\n\n // If switching between Streams to Games, we need to inject the content pane buttons.\n // At this time, one of the content panes will be hidden -- we need to pick out the correct\n // subtree\n var $contentPaneDiv = $(_ID_CONTENT_PANE + ' > :not([style*=\"none\"])');\n updateContentPaneButtons($contentPaneDiv);\n}", "function onTabFocus(tab, oldTab) {\n if (!tab) return;\n\n var pageIndex = getPageForTab(tab);\n if (!state.active || pageIndex === state.page) {\n tab.element.focus();\n } else {\n // Go to the new page, wait for the page transition to end, then focus.\n oldTab && oldTab.element.blur();\n setPage(pageIndex).then(function() {\n tab.element.focus();\n });\n }\n }", "onNewTab(){\n console.log(\"onNewTab\");\n\n Session.set('selectedPatient', false);\n Session.set('patientDetailState', false);\n }", "function addTab() {\n var tab_title = $tab_title_input.val() || \"Tab \" + tab_counter;\n $tabs.tabs(\"add\", \"#tabs-\" + tab_counter, tab_title);\n tab_counter++;\n }", "function addTab() {\n var tab_title = $tab_title_input.val() || \"Tab \" + tab_counter;\n $tabs.tabs(\"add\", \"#tabs-\" + tab_counter, tab_title);\n tab_counter++;\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 openTab() {\n tabName = createNewTab();\n createContent(tabName);\n var tab = {id: tabName}\n tabs.push(tab);\n\n // Simular o evento do click clicando na nova aba aberta\n document.querySelectorAll(\"[href='#\" + tabName + \"']\")[0].click();\n}", "function addTab() {\n\t\tvar tab_title = $tab_title_input.val() || 'Tab '+tab_counter;\n\t\t$tabs.tabs('add', '#tabs-'+tab_title, tab_title);\n\t\ttab_counter++;\n\t\t// call the markitup editor on the new tab\n\t\t$('.added').markItUp(mySettings);\n\t}", "function updateTabs(){\n let webTitle;\n //Clears any previous items in the ul before updating\n document.querySelectorAll(\"#savedURLS li\").forEach(elem=>elem.remove())\n \n chrome.storage.sync.get(null, item =>{\n for (let x of Object.values(item)){\n webTitle = x[0]; //gets the title of page\n //Cuts the length of title if it exceeds 60 chars\n if(webTitle.length>60){\n webTitle = webTitle.substring(0,59)+\"...\";\n }\n var ul = document.querySelector(\"#savedURLS\");\n var li = document.createElement(\"li\");\n var aTag = document.createElement(\"a\");\n aTag.href = x[1];//[1] --contains the URL of the tab\n aTag.target = \"_blank\";\n aTag.setAttribute(\"id\",\"saved\")\n aTag.appendChild(document.createTextNode(webTitle));\n\n li.appendChild(aTag)\n ul.appendChild(li);\n }\n });\n}", "attachedCallback () {\n this.insertBefore(this._tabsTemplate.content, this.firstChild);\n\n this._makeTabsFromPfTab();\n\n this.querySelector('ul').addEventListener('click', this);\n\n // Add the ul class if specified\n this.querySelector('ul').className = this.attributes.class ?\n this.attributes.class.value : 'nav nav-tabs';\n\n if (!this.mutationObserver) {\n this.mutationObserver = new MutationObserver(this._handleMutations.bind(this));\n this.mutationObserver.observe(this, { childList: true, attributes: true });\n }\n }", "_addWebContentsCreatedHandler() {\n\t\tthis.app.on('web-contents-created', this._onWebContentsCreated);\n\t}", "function showTab(e) {\n console.log(\"inside showTab()\");\n /* element na koji je kliknuto, pa njegov title, moze biti welcome, B, C, CE*/\n /* kliknuti elem moze biti iz navigation ili iz tabs*/\n var selectedTab = e.target.title;\n console.log(selectedTab);\n\n if (selectedTab == \"welcome\") {\n welcomePaneShowing = true;\n console.log(\" welcome tab selected\");\n document.getElementById(\"content\").innerHTML =\n \"<h3>Click a tab to display category desription</h3>\"; /* mixing content with behaviour*/\n } else {\n welcomePaneShowing = false;\n }\n\n// set each tab's CSS class\n var tabs = document.getElementById(\"tabs\").getElementsByTagName(\"a\");\n for (var i=0; i<tabs.length; i++) {\n var currentTab = tabs[i];\n if (currentTab.title == selectedTab) {\n currentTab.className = \"active\";\n } else {\n currentTab.className = \"inactive\";\n }\n }\n\n var request = createRequest();\n if (request==null) {\n alert(\"Unable to create request\");\n return;\n }\n request.onreadystatechange = showCategory;\n request.open(\"GET\", selectedTab + \".html\", true);\n request.send(null);\n}", "attachedCallback() {\n this.insertBefore(this._tabsTemplate.content, this.firstChild);\n\n this._makeTabsFromPfTab();\n\n this.querySelector('ul').addEventListener('click', this);\n\n // Add the ul class if specified\n this.querySelector('ul').className = this.attributes.class\n ? this.attributes.class.value\n : 'nav nav-tabs';\n\n if (!this.mutationObserver) {\n this.mutationObserver = new MutationObserver(\n this._handleMutations.bind(this)\n );\n this.mutationObserver.observe(this, {\n childList: true,\n attributes: true\n });\n }\n }", "function openTabsCloseTabs() {\n tabs.openMany(URLS, SINGLE_OPENING_DELAY);\n scheduler.addFunc(closeTabs, CLOSING_PHASE_DELAY);\n }", "function addTab(pPar){\n tabs_c.add({\n id: pPar.id,\n title: pPar.title,\n layout:'fit',\n closable: true,\n autoLoad:{url:pPar.url,\n params:{pObj: pPar.id},\n scripts: true,\n method: 'post'}\n }).show();\n }", "function addTab(pPar){\n tabs_c.add({\n id: pPar.id,\n title: pPar.title,\n layout:'fit',\n closable: true,\n autoLoad:{url:pPar.url + \"&pObj=\" + pPar.id /*+ \"&\" + fParamQry()*/, scripts: true, method: 'post'}\n }).show();\n }", "function initTabEvents() {\n\n\n function cleanTabNav() {\n var tabLinks = $('#pp-nav-tabs > li > a[data-toggle=\"tab\"]');//document.getElementsByClassName('a-tab-nav');\n for (var i = 0; i < tabLinks.length; i++) {\n var h = tabLinks[i].href.substring(tabLinks[i].href.lastIndexOf('#'));\n if (h.lastIndexOf('?') >= 0) {\n h = h.substring(0, h.lastIndexOf('?'));\n tabLinks[i].setAttribute('href', h);\n }\n }\n\n $('#pp-nav-tabs > li > a[data-toggle=\"tab\"]').on('shown.bs.tab', function (e) {\n\n var id = $(e.target).attr(\"href\").substr(1);\n window.location.hash = id;\n\n var url = $(this).attr(\"data-url\");\n\n if (!hasValue(url)) {\n onTanContentLoaded();\n return;\n }\n\n var target = $(e.target).attr(\"href\"); // activated tab\n\n if ($(target).is(':empty')) {\n\n var pane = $(this);\n // showFormLoader('#tp-author');\n // ajax load from data-url\n $(target).load(url, function () {\n // hideFormLoader();\n pane.tab('show');\n onTanContentLoaded();\n });\n }\n else {\n onTanContentLoaded();\n }\n });\n\n var hash = window.location.hash;\n if (hasValue(hash)) {\n $('#pp-nav-tabs a[href=\"' + hash + '\"]').tab('show');\n }\n }\n\n setTimeout(cleanTabNav, 200);\n\n \n}", "function handlePageLoadTabFocus() {\n $('.tab-overflow').each(function() {\n var targetWidth = $(this).width();\n var targetInnerWidth = 0;\n var targetTab = $(this);\n var scrollWidth = targetWidth;\n\n $(targetTab).find('li').each(function() {\n var targetLi = $(this);\n targetInnerWidth += $(targetLi).width();\n\n if ($(targetLi).hasClass('active') && targetInnerWidth > targetWidth) {\n scrollWidth -= targetInnerWidth;\n }\n });\n\n handleTabOverflowScrollWidth(this, 0);\n });\n }", "function firstLoadForTab_Write()\n{\n //console.log('first load for write tab');\n \n global_pagesLoaded.write = true;\n}", "function on_tab_updated(id, change_info, tab)\n {\n if (tab.active && change_info.url) { update_in_tab(tab); }\n }", "function addNewTab(p1) {\n let _this = this;\n let prameters = \"&projectId=\" + p1.projectid + \"&categoryId=\" + p1.categoryid + \"&description=\" + p1.description + \"&parentId=\" + p1.parentid + \"&expiredate=\" + p1.expiredate;\n let handlerurl = funcList[\"addNewTab\"][\"interface\"] + prameters;\n\n $.ajax({\n // type: \"get\",\n async: true,\n url: handlerurl,\n dataType: 'jsonp',\n crossDomain: true,\n success: function (data) {\n _this.newtab.returnmessage = data.Message;\n if (data.Code === 0) {\n //console.log(\"success\");\n _this.newtab.categoryselected = -1;\n _this.newtab.desc = \"\";\n //refresh file tab data\n funcList[\"getFileTabs\"][\"func\"].call(_this, p1);\n document.getElementById(\"fileTabTitle\").click();\n } else {\n console.log(\"addNewTab\", \"failed\");\n }\n }\n });\n}", "function jscoverage_initTabControl() {\n\t$('.tabs a').on('click', function (e) {\n\t\te.preventDefault();\n\t\tjscoverage_tab_click(e);\n\t\t$(this).tab('show');\n\t});\n\n\t// $('.tabs a:not(.disabled):first').trigger('click');\n}", "function openTab(which,title){\n\n\t\t\tvar filename = which;\n\n\t\t\tapiMatch = new RegExp('/');\n\t\t\tif (filename.match(apiMatch)){\n\t\t\t\tfilename = which;\n\t\t\t} else {\n\t\t\t\tfilename = which.replace(\" \",\"_\").toLowerCase() + \".html\";\n\t\t\t}\n\n\t\t\tvar tabs = Ext.getCmp(\"tabPanel\");\n\t\t\tif (tabs.items.length==0){\n\t\t\t\t$('.introtext').hide();\n\t\t\t\t$('#tabs').fadeIn();\n\t\t\t}\n\n\n\t\t\tvar haveTabAlready=0;\n\t\t\tfor (tabId in tabs.items.keys){\n\t\t\t\tlogMessage(tabId,tabs.items.keys[tabId]);\n\t\t\t\tif (tabs.items.keys[tabId]==title){\n\t\t\t\t\thaveTabAlready=true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!haveTabAlready){\n\t\t\t\ttabs.add({\n\t\t\t\t\t closable: true,\n\t\t\t\t\t html: '<div id=\"info_' + title + '\"><div style=\"width:100%; text-align:center;\">Loading data for api:' + which + ' <br/><img style=\"margin:20px auto;\" src=\"images/spinner.gif\" /></div></div>',\n\t\t\t\t\t autoLoad:{url:filename},\n\t\t\t\t\t iconCls: 'tabs',\n\t\t\t\t\t id: title,\n\t\t\t\t\t title:title,\n\t\t\t\t\t name: title\n\t\t\t\t\t\t}\n\t\t\t\t).show();\n\t\t\t} else {\n\t\t\t\ttabs.setActiveTab(title);\n\t\t\t}\n}", "function newTab(tab) {\n\tgetIntentionData().then(intentionData => {\n\t\tif (tab.windowId !== intentionData.windowId) {\n\t\t\treturn\n\t\t}\n\n\t\tlet tabContainer\n\n\t\t// Get the first inactive tab\n\t\tvar availableTabIndex = intentionData.tabs.findIndex(tab => tab.available === true)\n\n\t\t// if there's an inactive container update it with new metadata \n\t\tif (availableTabIndex > -1) {\n\t\t\ttabContainer = intentionData.tabs[availableTabIndex]\n\t\t\ttabContainer.available = false\n\t\t\ttabContainer.currentId = tab.id\n\n\t\t\t// if all tab containers are in use create a new one\n\t\t} else {\n\t\t\t// Create new tab object\n\t\t\tlet newTab = {\n\t\t\t\tavailable: false,\n\t\t\t\tfocus: false,\n\t\t\t\tcurrentId: tab.id,\n\t\t\t\thistory: []\n\t\t\t}\n\n\t\t\tintentionData.tabs.push(newTab)\n\t\t\tavailableTabIndex = intentionData.tabs.length - 1\n\t\t}\n\n\t\t// create page object and push it to container's history\n\t\tlet webpage = {\n\t\t\tend: undefined,\n\t\t\tfocusPeriods: [],\n\t\t\tstart: Date.now(),\n\t\t\ttitle: tab.title,\n\t\t\turl: tab.url,\n\t\t}\n\n\t\tintentionData.tabs[availableTabIndex].history.push(webpage)\n\n\n\t\tupdateIntentionData('newTab', intentionData)\n\t})\n}", "function onUpdatedListener(tabId, changeInfo, tab) {\n tabs[tab.id] = tab;\n}", "function onUpdatedListener(tabId, changeInfo, tab) {\n tabs[tab.id] = tab;\n}", "function onUpdatedListener(tabId, changeInfo, tab) {\n tabs[tab.id] = tab;\n}", "function Newtab() {\n var privateWindow = document.getElementById('private-window');\n privateWindow.addEventListener('click',\n this.requestPrivateWindow.bind(this));\n\n // Initialize the parent port connection\n var self = this;\n navigator.mozApps.getSelf().onsuccess = function() {\n var app = this.result;\n app.connect('search-results').then(function onConnAccepted(ports) {\n ports.forEach(function(port) {\n self._port = port;\n });\n self.init();\n }, function onConnectionRejected(reason) {\n console.log('Error connecting: ' + reason + '\\n');\n });\n };\n }", "function listenToEvents() {\n // only one tab list is allowed per page\n $('.tab-list').on('click', '.tab-control', function () {\n //var tab_id = $(this).attr('data-tab');\n var tab_id = $(this).data('tab');\n\n $('.tab-control').removeClass('active');\n $('.tab-panel').removeClass('active');\n\n $(this).addClass('active');\n $(\"#\" + tab_id).addClass('active');\n\n // Save active tab per category\n saveInSession('activetab', '', tab_id);\n })\n }", "activateListeners(html) {\n super.activateListeners(html);\n\n // Activate tabs\n new Tabs(html.find(\".tabs\"), {\n initial: this.item.data.flags[\"_sheetTab\"],\n callback: clicked => this.item.data.flags[\"_sheetTab\"] = clicked.attr(\"data-tab\")\n });\n\n // Checkbox changes\n html.find('input[type=\"checkbox\"]').change(event => this._onSubmit(event));\n }", "function AddTab(currentTab, isNew) {\n var _isExist = TaxCtrl.ePage.Masters.TabList.some(function (value) {\n return value.pk == currentTab.entity.PK;\n });\n\n if (!_isExist) {\n TaxCtrl.ePage.Masters.IsTabClick = true;\n var _currentTab = undefined;\n if (!isNew) {\n _currentTab = currentTab.entity;\n } else {\n _currentTab = currentTab;\n }\n\n taxConfig.GetTabDetails(_currentTab, isNew).then(function (response) {\n var _entity = {};\n TaxCtrl.ePage.Masters.TabList = response;\n if (TaxCtrl.ePage.Masters.TabList.length > 0) {\n TaxCtrl.ePage.Masters.TabList.map(function (value, key) {\n if (value.code == currentTab.entity.PK) {\n _entity = value[value.code].ePage.Entities.Header.Data;\n }\n });\n }\n\n $timeout(function () {\n TaxCtrl.ePage.Masters.ActiveTabIndex = TaxCtrl.ePage.Masters.TabList.length;\n TaxCtrl.ePage.Masters.IsTabClick = false;\n var _code = currentTab.entity.PK.split(\"-\").join(\"\");\n GetValidationList(_code, _entity);\n });\n });\n } else {\n toastr.warning('Record already opened...!');\n }\n }", "function createNewTab(parentId,tabTitle,tabContent,tabContentUrl,closeButton)\r\n\t{\r\n\t\tif(tabFrame_countTabs[parentId]>=tabFrame_maxNumberOfTabs)return;\t// Maximum number of tabs reached - return\r\n\t\tvar div = document.createElement('DIV'); //new tab Frame\r\n\t\tdiv.className = 'dhtmlgoodies_aTab';\r\n\t\ttabObj[parentId].appendChild(div);\r\n\r\n\t\tvar tabId = initTabs(parentId,Array(tabTitle),0,'','',Array(closeButton),true);\r\n\t\tif(tabContent)div.innerHTML = tabContent; //if tabcontent is not null tab will display this \"tabContent\" \r\n\t\tif(tabContentUrl){\t\t\t\t\t\t //Only Will hold page if tabContent is not null\r\n\t\t\tvar ajaxIndex = ajaxObjects.length;\r\n\t\t\tajaxObjects[ajaxIndex] = new sack();\r\n\t\t\tajaxObjects[ajaxIndex].requestFile = tabContentUrl;\t// Specifying which file to get\r\n\r\n\t\t\tajaxObjects[ajaxIndex].onCompletion = function(){ showAjaxTabContent(ajaxIndex,parentId,tabId); };\t// Specify function that will be executed after file has been found\r\n\t\t\tajaxObjects[ajaxIndex].runAJAX();\t\t// Execute AJAX function\r\n\r\n\t\t}\r\n\r\n\t}", "function loadOpenTabs() {\n var open_tabs = [];\n\n chrome.tabs.query({currentWindow: true}, function(tabs){\n for(var i=0; i<tabs.length; i++)\n {\n open_tabs.push({\n active: tabs[i].active,\n url: tabs[i].url,\n title: tabs[i].title\n });\n }\n\n // set the default name in name textfield\n // format is first tab name + # open tabs\n var currentTitle = open_tabs[0].title;\n if(currentTitle.length > 20)\n currentTitle = currentTitle.substring(0,20)+\"... + \"+(open_tabs.length-1)+\" others\";\n else\n currentTitle = currentTitle+\" + \"+(open_tabs.length-1)+\" others\";\n document.getElementById(\"input_name\").value = currentTitle;\n\n fillActiveInfo(open_tabs);\n });\n}", "init () {\n this.extensionOrigin = this._browserInstance.runtime.getURL('/')\n this._log('InternalTabReloader Ready for use.')\n }", "function loadTab() {\n let tab = this;\n location.href = tab.href;\n\n if(!loadedTab[tab.getAttribute('href')]){\n loadedTab[tab.getAttribute('href')] = true;\n\n let route = tab.getAttribute('data-route'),\n target = document.getElementById(tab.getAttribute('href').replace('#','')),\n callback = tab.getAttribute('data-callback');\n\n ajaxRouter(route,target, callback);\n\n }\n}", "onTabOpened(aTab, aFirstTab, aOldTab) {\n if (aTab.mode.name == \"folder\" || aTab.mode.name == \"glodaList\") {\n let modelTab = this.tabmail.getTabInfoForCurrentOrFirstModeInstance(\n aTab.mode\n );\n let oldFilterer =\n modelTab && \"quickFilter\" in modelTab._ext\n ? modelTab._ext.quickFilter\n : undefined;\n aTab._ext.quickFilter = new QuickFilterState(oldFilterer);\n this.updateSearch(aTab);\n this._updateToggle(aTab);\n }\n }", "function openTab(tabId,tabURL,tabName,tabIcon,noScrolling)\n{\n\tvar foundExistingDiv = false;\n\tvar tabNum = 1;\n\tfor (var i=0; i<tabDataJson.length; i++)\n\t{\n\t\tif (tabDataJson[i].status == \"open\")\n\t \ttabNum = tabNum + 1;\n\n\t\tif (tabDataJson[i].tabId == tabId) {\n\t\t\tfoundExistingDiv = true;\n\t\t\ttogglePage(tabId);\n\t\t}\n\t}\n\n\tif (!foundExistingDiv) {\n\t\ttabIndex = tabDataJson.length;\n\t\t/*Store the pages that are open in an array so that I don't open more than one frame for the same page*/\n\t\ttabDataJson[tabIndex]={tabId:\"\"+tabId+\"\",status:\"open\"};\n\n\t\tif (tabIcon.length ==0)\n\t\t{\n\t\t tabIcon = \"/images/spacer14.gif\"; //this is to maintain equal heights for all tabs. the heigt of the icon image has to be 14 piexels\n\t\t}\n\n\t\tvar list = document.getElementById(\"mainTabList\");\n\t\tvar newNode = document.createElement(\"li\");\n\t\tnewNode.id = tabId +\"li\";\n\t\tvar newNodeInnerHTML =\"<a href=\\\"#\\\" id=\\\"\"+tabId+\"Link\\\" class=\\\"selectedTab\\\" onmouseup=\\\"togglePage('\"+tabId+\"'); return false;\\\">\";\n\t\tnewNodeInnerHTML +=\"<span id=\\\"\"+tabId+\"LinkSpan\\\" class=\\\"selectedSpanTab\\\"><img src=\\\"\"+tabIcon+\"\\\" class=\\\"iconImage\\\">\"+tabName;\n\t\tnewNodeInnerHTML +=\"<br class=\\\"brNoHeight\\\"><img src=\\\"/images/minwidth.gif\\\" width=\\\"\"+(tabName.length*2)+\"\\\" height=\\\"0\\\"></span></a>\";\n\t\tnewNode.innerHTML = newNodeInnerHTML;\n\t\tlist.appendChild(newNode);\n\t\ttogglePage(tabId);\n\t}\n}", "_ready() {\n this.tabs = new Tabs(this.app)\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}", "function lemurlog_OnTabAdded_20(event)\n{\n if (lemurlog_g_enable === false)\n {\n return;\n }\n var time = new Date().getTime();\n var id = event.target.linkedBrowser.parentNode.id;\n\n // Get the URL that was clicked to make this happen (assums all\n // MClicks and tabAdded events occur in the same order).\n while( Application.storage.get(\"lemurlog_clickLock\", false) )\n {\n\t//sleep(1);\n setTimeout( \"lemurlog_OnTabAdded_20(event)\", 1000 );\n return;\n }\n Application.storage.set(\"lemurlog_clickLock\", true) ;\n\n var lemurlogtoolbar_clickInfo = JSON.parse(\n\tApplication.storage.get(\"lemurlog_clickInfo\", JSON.stringify( new Array()) ));\n\n var lemurlogtoolbar_srcURL = \"undefined\";\n var url = \"\";\n var srcID = \"\";\n\n if( lemurlogtoolbar_clickInfo.length > 0 )\n {\n\twhile( lemurlogtoolbar_clickInfo.length > 1 &&\n\t\t time - lemurlogtoolbar_clickInfo[0][\"time\"] > 100 ) //lemurlog_MIN_INTERVAL )\n\t{\n\t\tlemurlogtoolbar_clickInfo.splice(0,1);\n\t}\n\tlemurlogtoolbar_srcURL = lemurlogtoolbar_clickInfo[0][\"lemurlogtoolbar_srcURL\"];\n\turl = lemurlogtoolbar_clickInfo[0][\"url\"];\n\tsrcID = lemurlogtoolbar_clickInfo[0][\"srcID\"];\n\n\tlemurlogtoolbar_clickInfo.splice(0,1);\n }\n else\n {\n\tlemurlogtoolbar_srcURL = \"undefined\";\n }\n\n Application.storage.set(\"lemurlog_clickInfo\", JSON.stringify(lemurlogtoolbar_clickInfo));\n Application.storage.set(\"lemurlog_clickLock\", false);\n\n lemurlog_WriteLogFile(lemurlog_LOG_FILE, \"AddTab\\t\" + time + \"\\t\" +\n\t id + \"\\t\" + url + \"\\t\" + srcID + \"\\t\" + lemurlogtoolbar_srcURL + \"\\n\"); \n lemurlog_DoWriteLogFile(lemurlog_LOG_FILE, \"AddTab\\t\" + time + \"\\n\");\n}", "function refreshTabs() { \n pageDB.fetchTabs(function(tabs) {\n var tabList1 = document.getElementById('high-priority');\n tabList1.innerHTML = '';\n var tabList2 = document.getElementById('medium-priority');\n tabList2.innerHTML = '';\n var tabList3 = document.getElementById('low-priority');\n tabList3.innerHTML = '';\n\n /*var researchTopic = document.getElementById('query');\n researchTopic.value = query;\n\n /*var important = false,\n potential = false,\n unimportant = false;*/\n\n // If there are no tabs in the list, tell the user how to fill them.\n if (tabs.length == 0) {\n var add1 = document.createElement('p');\n add1.innerHTML = 'Use Alt+1 to mark tabs as important.';\n add1.className = 'empty';\n tabList1.appendChild(add1);\n\n var add2 = document.createElement('p');\n add2.innerHTML = 'Use Alt+2 to mark tabs as potentially important.';\n add2.className = 'empty';\n tabList2.appendChild(add2);\n\n var add3 = document.createElement('p');\n add3.innerHTML = 'Use Alt+3 to mark tabs as unimportant.';\n add3.className = 'empty';\n tabList3.appendChild(add3);\n }\n\n for(var i = 0; i < tabs.length; i++) {\n // Read the tab items backwards (most recent first).\n var tab = tabs[tabs.length - i - 1];\n\n var a = document.createElement('a');\n a.id = 'tab-' + tab.timestamp;\n a.className = \"list-group-item\";\n\n // Remove button\n var remove = document.createElement('button');\n remove.className = 'glyphicon glyphicon-remove gi-2x';\n remove.innerHTML = '';\n remove.setAttribute(\"data-id\", tab.timestamp);\n\n a.appendChild(remove);\n\n // Title of webpage appears as link to webpage\n var info = document.createElement('a');\n info.innerHTML = tab.text;\n info.href = tab.url;\n info.target = \"_blank\";\n info.id = \"clip\";\n\n a.appendChild(info);\n\n var space = document.createElement('span')\n space.innerHTML = '&nbsp;&nbsp;'\n\n a.appendChild(space);\n\n \n if (tab.importance == 1) {\n tabList1.appendChild(a);\n //important = true;\n } else if (tab.importance == 2) {\n tabList2.appendChild(a);\n //potential = true;\n } else if (tab.importance == 3) {\n tabList3.appendChild(a);\n //unimportant = false;\n }\n\n /*if (!important) {\n var add1 = document.createElement('p');\n add1.innerHTML = 'No tabs marked as important.';\n add1.className = 'empty';\n tabList1.appendChild(add1);\n }\n if (!potential) {\n var add2 = document.createElement('p');\n add2.innerHTML = 'No tabs marked as potentially important.';\n add2.className = 'empty';\n tabList2.appendChild(add2);\n }\n if (!unimportant) {\n var add3 = document.createElement('p');\n add3.innerHTML = 'No tabs marked as unimportant.';\n add3.className = 'empty';\n tabList3.appendChild(add3);\n }*/\n\n remove.addEventListener('click', function(e) {\n var id = parseInt(e.target.getAttribute('data-id'));\n pageDB.deleteTab(id, refreshTabs);\n //pageDB.open(refreshVisual);\n });\n\n /*Setup an event listener for the checkbox.\n x.addEventListener('click', function(e) {\n var id = parseInt(e.target.getAttribute('data-id'));\n\n pageDB.deleteTab(id, refreshTabs);\n });*/\n }\n\n });\n}", "function addTab (tabId = tabs.add(), options = {}) {\r\n /*\r\n adding a new tab should destroy the current one if either:\r\n * The current tab is an empty, non-private tab, and the new tab is private\r\n * The current tab is empty, and the new tab has a URL\r\n */\r\n\r\n if (!options.openInBackground && !tabs.get(tabs.getSelected()).url && ((!tabs.get(tabs.getSelected()).private && tabs.get(tabId).private) || tabs.get(tabId).url)) {\r\n destroyTab(tabs.getSelected())\r\n }\r\n\r\n tabBar.addTab(tabId)\r\n webviews.add(tabId)\r\n\r\n if (!options.openInBackground) {\r\n switchToTab(tabId, {\r\n focusWebview: options.enterEditMode === false\r\n })\r\n if (options.enterEditMode !== false) {\r\n tabEditor.show(tabId)\r\n }\r\n } else {\r\n tabBar.getTab(tabId).scrollIntoView()\r\n }\r\n}", "function openTab(tabId,tabURL,tabName,tabIcon,noScrolling)\n{\n var foundExistingDiv = false;\n for (var i=0; i<tabDataJson.length; i++)\n {\n if (tabDataJson[i].tabId == tabId)\n {\n foundExistingDiv = true;\n togglePage(tabId);\n }\n }\n\n if (!foundExistingDiv)\n {\n tabIndex = tabDataJson.length;\n /*Store the pages that are open in an array so that I don't open more than one frame for the same page*/\n tabDataJson[tabIndex]={tabId:\"\"+tabId+\"\",status:\"open\"};\n\n if (tabIcon.length ==0)\n {\n tabIcon = \"/images/spacer14.gif\"; //this is to maintain equal heights for all tabs. the heigt of the icon image has to be 14 piexels\n }\n\n var list = document.getElementById(\"mainTabList\");\n var newNode = document.createElement(\"li\");\n newNode.id = tabId +\"li\";\n var newNodeInnerHTML =\"<a href=\\\"#\\\" id=\\\"\"+tabId+\"Link\\\" class=\\\"selectedTab\\\" onmouseup=\\\"togglePage('\"+tabId+\"'); return false;\\\">\";\n newNodeInnerHTML +=\"<span id=\\\"\"+tabId+\"LinkSpan\\\" class=\\\"selectedSpanTab\\\"><img src=\\\"\"+tabIcon+\"\\\" class=\\\"iconImage\\\">\"+tabName+\"&nbsp;&nbsp;\";\n //newNodeInnerHTML +=\"<img src=\\\"/images/closex.gif\\\" alt=\\\"Close Tab\\\" title=\\\"Close Tab\\\" onclick=\\\"closeTabx('\"+tabId+\"')\\\">\";\n //newNodeInnerHTML +=\"<button type=\\\"button\\\" class=\\\"\\\" onmouseover=\\\"this.className='closexOver'\\\" onmouseout=\\\"this.className=''\\\" onmouseup=\\\"closeTabx('\"+tabId+\"')\\\"><img src=\\\"/images/closex031.gif\\\"></button>\";\n newNodeInnerHTML +=\"<br class=\\\"brNoHeight\\\"><img src=\\\"/images/minwidth.gif\\\" width=\\\"\"+(tabName.length*2)+\"\\\" height=\\\"0\\\"></span></a>\";\n newNode.innerHTML = newNodeInnerHTML;\n list.appendChild(newNode);\n/*\n var maindivs = document.getElementById(\"maindivs\");\n newDiv=document.createElement(\"div\");\n newDiv.id = tabId+\"div\";*/\n\n /*var scrolling= \"auto\";\n if (noScrolling == \"Y\")\n {\n scrolling = \"no\";\n }*/\n\n/* var innHtmlline = \"<iframe src=\\\"\"+tabURL+\"\\\" name=\"+tabId+\"frame id=\"+tabId+\"frame width=\\\"100%\\\" height=\\\"600\\\" scrolling=\\\"\"+scrolling+\"\\\" marginwidth=\\\"0\\\" frameborder=\\\"0\\\" style=\\\"\\\">\";\n innHtmlline +=\" [Your user agent does not support frames or is currently configured\";\n innHtmlline +=\" not to display frames. However, you may visit\";\n innHtmlline +=\" <A href=\\\"\\balnk.html\\\">the related document.</A>]\";\n innHtmlline +=\"</iframe>\";\n newDiv.innerHTML=innHtmlline;*/\n/* maindivs.appendChild(newDiv);*/\n togglePage(tabId);\n }\n}", "function initStrategyTabs() {\n // Fetch sample, new strat, and help tab contents\n // If no page is found for a given tab, remove\n // that tab from the page\n $.ajax({\n url: \"wdkCustomization/jsp/strategies/samplesTab.jsp\",\n type: \"GET\",\n dataType: \"html\",\n success: function(data) {\n $(\"#sample_strat\").html(data);\n try {\n customSampleTab();\n }\n catch(e) {}\n },\n error: function() {\n $(\"#tab_sample_strat\").parent(\"li\").remove();\n }\n });\n\n $.ajax({\n url: \"wdkCustomization/jsp/strategies/newTab.jsp\",\n type: \"GET\",\n dataType: \"html\",\n success: function(data) {\n $(\"#strategy_new\").html(data);\n },\n error: function() {\n $(\"#tab_strategy_new\").parent(\"li\").remove();\n }\n });\n\n $.ajax({\n url: \"wdkCustomization/jsp/strategies/helpTab.jsp\",\n type: \"GET\",\n dataType: \"html\",\n success: function(data) {\n $(\"#help\").html(data);\n try {\n customHelpTab();\n }\n catch(e) {}\n },\n error: function() {\n $(\"#tab_help\").parent(\"li\").remove();\n },\n complete: function() {\n wdk.dyk.initHelp();\n }\n });\n }", "function onUpdatedListener(tabId, changeInfo, tab) {\n tabs[tab.id] = tab.incognito;\n}", "function TabOpenListener(url, opencallback, closecallback) {\n this.url = url;\n this.opencallback = opencallback;\n this.closecallback = closecallback;\n\n gBrowser.tabContainer.addEventListener(\"TabOpen\", this);\n}", "function tab() {\n let triggerTabList = [].slice.call(document.querySelectorAll('#nav-myProfile-tab, #nav-conundrum-tab'))\n triggerTabList.forEach(function (triggerEl) {\n var tabTrigger = new bootstrap.Tab(triggerEl)\n triggerEl.addEventListener('click', function (event) {\n event.preventDefault()\n tabTrigger.show()\n })\n })\n}", "_insertAddNewTab() {\n const that = this,\n tabLabelContainer = that._addTabLabelContainer(undefined, true).tabLabelContainer;\n\n tabLabelContainer.$.addClass('jqx-add-new-tab');\n\n that.$.tabStrip.appendChild(tabLabelContainer);\n\n that._addNewTab = tabLabelContainer;\n }", "clickEventListener (event) {\n var tab = event.target;\n this.activateTab(tab, false);\n }", "function getTab() {\r\n var userTabData = {\r\n userEmail: userEmail,\r\n uid: userID\r\n };\r\n\r\n $.ajax({\r\n type: \"POST\",\r\n url: \"https://files.dpanzer.net/files/script/animated-new-tabs/data.php\",\r\n data: userTabData,\r\n dataType: \"JSON\",\r\n success: function(response) {\r\n console.log(\"Synced Tab: \" + response.tabID);\r\n if (response.tabID == null) {\r\n console.log(\"No tab saved on server.\");\r\n chrome.storage.sync.get(\"setPage\", function(item) {\r\n if (item.setPage == null) {\r\n console.log(\"No tab set in extension.\");\r\n //var exURL = chrome.extension.getURL('dist/options.html');\r\n //var optionsUrl = exURL + \"?notab=true\"\r\n //chrome.tabs.create({\r\n //url: optionsUrl\r\n //});\r\n chrome.runtime.openOptionsPage()\r\n } else {\r\n syncTab();\r\n }\r\n });\r\n return;\r\n } else {\r\n chrome.storage.sync.set({\r\n \"setPage\": response.tabID\r\n });\r\n }\r\n }\r\n });\r\n refreshDB();\r\n}", "function openPage(pageName, elmnt, color) {\n // Hide all elements with class=\"tabcontent\" by default */\n var i, tabcontent, tablinks;\n tabcontent = document.getElementsByClassName(\"tabcontent\");\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n }\n \n // Remove the background color of all tablinks/buttons\n tablinks = document.getElementsByClassName(\"tablink\");\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].style.backgroundColor = \"\";\n }\n \n // Show the specific tab content\n document.getElementById(pageName).style.display = \"block\";\n \n // Add the specific color to the button used to open the tab content\n elmnt.style.backgroundColor = color;\n \n}", "_onTabActivateRequested(sender, args) {\n args.title.owner.activate();\n }", "function cb_tabOnUpdated(id, info, tab) {\n\n //Checks if loading is complete\n if (tab.status !== \"complete\"){\n console.log(\"Not loaded\");\n return;\n }\n else\n {\n console.log(\"Loaded\");\n }\n \n if (tab.url.toLowerCase().indexOf(\"facebook.com\") === -1){\n console.log(\"Not Facebook\");\n return;\n }\n\n if(!tempBool){ \n chrome.pageAction.setIcon({tabId: tab.id, path: 'images/icongrey.png'});\n }\n\n if(tempBool){ \n chrome.pageAction.setIcon({tabId: tab.id, path: 'images/icon.png'});\n }\n\n if (tab.url.toLowerCase().indexOf(\"facebook.com/buzzfeed\") !== -1){\n chrome.tabs.update(tab.id, {url: \"http://www.facebook.com/\"});\n }\n\n //Show PageAction\n chrome.pageAction.show(tab.id);\n\n if(tempBool){ \n chrome.pageAction.setIcon({tabId: tab.id, path: 'images/icon.png'});\n chrome.storage.sync.get(\"urlList\", function(data){\n urlList = data.urlList;\n if (typeof urlList === 'undefined') {\n urlList = default_urlList;\n }\n });\n chrome.tabs.executeScript(tab.id, {\"file\": \"js/buzzoff.js\"}, function() {\n chrome.tabs.sendMessage(tab.id, JSON.stringify(urlList));\n });\n }\n}", "function recall() {\n tabs.open({\n \"url\" : self.data.url(\"dashboard.html\"),\n });\n}", "function addTab() {\n var label = tabTitle.val() || \"Tab \" + tabCounter,\n id = \"tabs-\" + tabCounter,\n li = $(tabTemplate.replace(/#\\{href\\}/g, \"#\" + id).replace(/#\\{label\\}/g, label)),\n tabContentHtml = tabContent.val() || \"Tab \" + tabCounter + \" content.\";\n tabContentHtml = \"<pre id='\" + id + \"'>\" + tabContentHtml + \"</pre>\"\n tabs.find(\".ui-tabs-nav\").append(li);\n tabs.append(\"<div id='\" + id + \"'><p>\" + tabContentHtml + \"</p></div>\");\n tabs.tabs(\"refresh\");\n tabCounter++;\n helper.addEditor(id, {title: label});\n }", "function addTab() {\n\t\t\tvar label = tabTitle.val() || \"Tab \" + tabCounter,\n\t\t\t\tid = \"tabs-\" + tabCounter,\n\t\t\t\tli = $( tabTemplate.replace( /#\\{href\\}/g, \"#\" + id ).replace( /#\\{label\\}/g, label ) ),\n\t\t\t\ttabContentHtml = tabContent.val() || \"Tab \" + tabCounter + \" content.\";\n\n\t\t\ttabs.find( \".ui-tabs-nav\" ).append( li );\n\t\t\ttabs.append( \"<div id='\" + id + \"'><p>\" + tabContentHtml + \"</p></div>\" );\n\t\t\ttabs.tabs( \"refresh\" );\n\t\t\ttabCounter++;\n\t\t}", "async registerTab() {\n this.setDefaultTabElement();\n if (this.getDefaultTabElement()) {\n this.activateTab(this.getDefaultTabElement());\n }\n else {\n this.activateDefaultTab();\n }\n // re-render tab list by changing state\n this.nestedTabs = [...this.getRenderedTabItems()];\n if (this.verticalAlign && this.verticalContentPosition === 'accordion') {\n for (const element of this.nestedTabs) {\n element['verticalContentPosition'] = this.verticalContentPosition;\n }\n }\n }", "function listTabs() {\n getCurrentWindowTabs().then((tabs) => {\n let tabsList = document.getElementById('tabs-list');\n let currentTabs = document.createDocumentFragment();\n let limit = 5;\n let counter = 0;\n\n tabsList.textContent = '';\n\n for (let tab of tabs) {\n if (!tab.active && counter <= limit) {\n let tabLink = document.createElement('a');\n\n tabLink.textContent = tab.title || tab.id;\n tabLink.setAttribute('href', tab.id);\n tabLink.classList.add('switch-tabs');\n currentTabs.appendChild(tabLink);\n }\n\n counter += 1;\n }\n\n tabsList.appendChild(currentTabs);\n });\n}", "function initTabs(activeClasses,normalClasses){\n let dataTabs = document.querySelectorAll(\"[data-toggle='tab']\");\n const toggleFunction = (event) => {\n event.preventDefault();\n activeClasses = activeClasses ? activeClasses:\"bg-blue-600 text-white\";\n normalClasses = normalClasses ? normalClasses:\"text-blue-600 bg-white\";\n changeAtiveTab(event,activeClasses,normalClasses)\n }\n for (var index = 0; index < dataTabs.length; index++) {\n dataTabs[index].addEventListener(\"click\",toggleFunction);\n }\n}", "function ensurePageForFocusedTab (sheetId, pageId, pageUrl, pageTitle, isCheckNewPage){\n // var url = Utils.getCurrentPageURL();\n // var urlTitle = Utils.getCurrentPageTitle();\n Utils.log(1, \"view.ensurePageForFocusedTab: Ensuring page for \" + pageUrl);\n // Get the HooverPage object for this URL.\n var pageIsExisting = isExisting(sheetId, pageId, null);\n // var pageContainerId = Utils.assembleID(sheetId, pageId, null, HNCONTAINER_);\n // var pLength = $(\"#\" + pageContainerId, me.slideBar.contentDocument).length; \n // if (pLength == 0){\n // pageIsNew = true;\n // Utils.log(1, \"Page is new\");\n // } else {\n // Utils.log(1, \"Page is old\");;\n // }\n \n var isNewPage = true;\n if (!isCheckNewPage){\n if (hnCtrl.hasPage(pageUrl, pageTitle)){\n // TODO Focus on container for page.\n Utils.log(1, \"view.ensurePageForFocusedTab: page exists already\");\n isNewPage = false;\n } \n } \n if (!pageIsExisting) {\n // Paint container for page.\n Utils.log(1, \"view.ensurePageForFocusedTab: Creating page HTML for \" + pageUrl);\n var htmlString = Utils.replaceIDsInHTMLStr(sheetId, pageId, null, PAGE_HTML);\n var shortPageTitle= pageTitle.substr(0, CHARPAGETITLE_MAX);\n if (shortPageTitle.length < pageTitle.length){ \n shortPageTitle += \"...\";\n }\n \n htmlString = htmlString.replace(TITLE_SUB, shortPageTitle);\n htmlString = htmlString.replace(PAGEURL_SUB, pageUrl);\n var idStr = Utils.assembleID(sheetId, null, null, HNCONTENT_);\n appendElemToId (htmlString, idStr);\n registerMinMaxRemEvents(sheetId, pageId, null);\n me.maximize(Utils.assembleID(sheetId, pageId, null, null));\n }\n }", "function addTab() {\n\t\t\t\tvar label = tabTitle.val() || \"Tab \" + tabCounter, id = \"tabs-\" + tabCounter, li = $(tabTemplate.replace(/#\\{href\\}/g, \"#\" + id).replace(/#\\{label\\}/g, label)), tabContentHtml = tabContent.val() || \"Tab \" + tabCounter + \" content.\";\n\t\t\n\t\t\t\ttabs.find(\".ui-tabs-nav\").append(li);\n\t\t\t\ttabs.append(\"<div id='\" + id + \"'><p>\" + tabContentHtml + \"</p></div>\");\n\t\t\t\ttabs.tabs(\"refresh\");\n\t\t\t\ttabCounter++;\n\t\t\n\t\t\t\t// clear fields\n\t\t\t\t$(\"#tab_title\").val(\"\");\n\t\t\t\t$(\"#tab_content\").val(\"\");\n\t\t\t}", "after() {\n // try to open into the already existing tab\n openBrowser(urls.localUrlForBrowser)\n }", "function lemurlog_OnTabSelected_20(event)\n{\n if(lemurlog_g_enable === false)\n {\n return;\n }\n\n var browser = gBrowser.selectedTab;\n if(!browser)\n {\n return;\n }\n var url = window.content.location.href; \n if(lemurlog_IsRecordableURL(url))\n {\n var time = new Date().getTime();\n\tvar id = browser.linkedBrowser.parentNode.id;\n url=lemurlogtoolbar_washAndRinse(url, true);\n lemurlog_DoWriteLogFile(lemurlog_LOG_FILE, \"SelTab\\t\" + time + \"\\t\" + id + \"\\t\" + url + \"\\n\");\n }\n}", "_loadSingleTabLoader() {\n \n for ( let item of this._mainTabElement ) {\n let singleTabLoader = new SingleTabLoader();\n singleTabLoader.init( item );\n }\n\n }", "function onclickForTab_Discover()\n{\n //console.log('click on discover tab');\n \n if(!global_pagesLoaded.discover)\n {\n firstLoadForTab_Discover();\n }\n \n //each time setup to go here\n}", "function updateContent() {\n function updateTab(tabs) {\n if (tabs[0]) {\n currentTab = tabs[0];\n console.log(\"updateTabs\");\n \n // executeScript(currentTab);\n loadFoundWords(currentTab);\n }\n }\n\n var gettingActiveTab = browser.tabs.query({active: true, currentWindow: true});\n gettingActiveTab.then(updateTab);\n}", "function lemurlog_OnTabSelected_15(event)\n{\n if(lemurlog_g_enable === false)\n {\n return;\n }\n var url = window.content.location.href; \n if(lemurlog_IsRecordableURL(url))\n {\n var time = new Date().getTime();\n url=lemurlogtoolbar_washAndRinse(url, true);\n\tvar id = event.selectedTab.linkedBrowser.parentNode.id;\n lemurlog_DoWriteLogFile(lemurlog_LOG_FILE, \"SelTab\\t\" + time + \"\\t\" + id + \"\\t\" + url + \"\\n\");\n }\n}", "async function open_menu_in_new_tab()\n {\n if (menu_tab_id !== null) { focus_menu_tab(); return; }\n\n const options = await storage.load(storage.Key.Configuration);\n if (options.do_limit_to_private_context)\n {\n const windows = await browser.windows.getAll({ windowTypes: [\"normal\"] });\n const private_window_index = windows.findIndex(window => window.incognito);\n if (private_window_index === -1)\n {\n const new_window = await browser.windows.create({\n incognito: true,\n url: MENU_PAGE_URL\n });\n menu_tab_id = new_window.tabs[0].id;\n }\n else\n {\n const tab = await browser.tabs.create({\n active: true,\n url: MENU_PAGE_URL,\n windowId: windows[private_window_index].id\n });\n menu_tab_id = tab.id;\n }\n }\n else\n {\n const tab = await browser.tabs.create({\n active: true,\n url: MENU_PAGE_URL\n });\n menu_tab_id = tab.id;\n }\n\n function hook()\n {\n browser.tabs.onRemoved.addListener(on_removed);\n browser.tabs.onUpdated.addListener(on_updated);\n events.local.emit(\"menu-tab-hooked\", { id: menu_tab_id });\n }\n function unhook()\n {\n menu_tab_id = null;\n browser.tabs.onRemoved.removeListener(on_removed);\n browser.tabs.onUpdated.removeListener(on_updated);\n events.local.emit(\"menu-tab-unhooked\");\n }\n function on_removed(id) { if (id === menu_tab_id) { unhook(); } }\n function on_updated(id, changes, new_state)\n {\n if (id === menu_tab_id &&\n changes.hasOwnProperty(\"url\") &&\n new_state.url !== MENU_PAGE_URL)\n {\n unhook();\n }\n }\n hook();\n focus_menu_tab();\n }", "function ForumLoad(info, tab) {\n console.log(\"ForumLoad \" + info.linkUrl);\n current_user_profile = info.linkUrl;\n chrome.tabs.onUpdated.addListener(onUserProfileOpenForLoad);\n chrome.tabs.create({url: info.linkUrl});\n}", "function openPage() {\n browser.tabs.create({\n url: \"options.html\"\n });\n}", "function setPage( p_iTabNr, p_iPageNr )\n{\n g_aTabWidget[p_iTabNr].set( p_iPageNr );\n}", "function onTabClick() {\n\n if(!loading && !new_patient) {\n\n var target = $(this).attr(\"data-target\");\n\n $(tabs).each(function() {\n\n $(this).removeClass(\"selected\");\n });\n\n $(sections).each(function() {\n\n ($(this).attr(\"data-type\") == target) ? $(this).removeClass(\"hide\") : $(this).addClass(\"hide\");\n })\n\n $(this).addClass(\"selected\");\n }\n }", "function openPage(pageName,elmnt,color) {\n var i, tabcontent, tablinks;\n //Get the tab content\n tabcontent = document.getElementsByClassName(\"tabcontent\");\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\"; //Hide default\n }\n //Get the tab name\n tablinks = document.getElementsByClassName(\"tablink\");\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].style.backgroundColor = \"\";//grey color by default\n }\n \n document.getElementById(pageName).style.display = \"block\";\n elmnt.style.backgroundColor = color;\n }", "function start_logging() {\n // See https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs#Events\n // and https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/windows#Events\n\n // NB: We ignore tabs.onZoomChange\n\n // https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs/onActivated\n browser.tabs.onActivated.addListener(({ previousTabId, tabId, windowId }) => {\n let s = `Activated tab [${tabId}] in window [${windowId}]. `;\n if (previousTabId === undefined) {\n s += 'Previous tab was removed from window.';\n } else {\n s += `Previous tab was [${previousTabId}]`;\n }\n log('t.onActivated', s);\n });\n\n // https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs/onAttached\n browser.tabs.onAttached.addListener((tabId, { newWindowId, newPosition }) => {\n log('t.onAttached', `Tab [${tabId}] attached to window [${newWindowId}] at position [${newPosition}]`);\n });\n\n // https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs/onCreated\n browser.tabs.onCreated.addListener((tab) => {\n log('t.onCreated', `Created tab [${tab.id}] at position [${tab.index}] in window [${tab.windowId}]. See console for more details.`);\n console.log(tab);\n });\n\n // https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs/onDetached\n browser.tabs.onDetached.addListener((tabId, { oldWindowId, oldPosition }) => {\n log('t.onDetached', `Tab [${tabId}] detached from window [${oldWindowId}] at position [${oldPosition}]`);\n });\n\n // https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs/onHighlighted\n browser.tabs.onHighlighted.addListener(({ windowId, tabIds }) => {\n const tabs_string = tabIds.toString().replace(',', ', ');\n\n let s = `In window [${windowId}], `;\n if (tabIds.length === 1) {\n s += `tab [${tabs_string}] has been highlighted`;\n } else {\n s += `tabs [${tabs_string}] have been hightlighted`;\n }\n\n log('t.onHighlighted', s);\n });\n\n // https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs/onMoved\n browser.tabs.onMoved.addListener((tabId, { windowId, fromIndex, toIndex }) => {\n log('t.onMoved', `In window [${windowId}], tab moved from position [${fromIndex}] to position [${toIndex}]`);\n });\n\n // https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs/onRemoved\n browser.tabs.onRemoved.addListener((tabId, { windowId, isWindowClosing }) => {\n let s = `Removed tab [${tabId}] in window [${windowId}]`;\n if (isWindowClosing) {\n s += '. ';\n s += 'That window is now closing.';\n }\n log('t.onRemoved', s);\n });\n\n // https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs/onReplaced\n browser.tabs.onReplaced.addListener((addedTabId, removedTabId) => {\n log('t.onReplaced', `Tab [${addedTabId}] replaced tab [${removedTabId}]`);\n });\n\n // https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs/onUpdated\n browser.tabs.onUpdated.addListener((tabId, changeInfo, tab) => {\n let change_string = '';\n // eslint-disable-next-line no-restricted-syntax\n for (const [key, value] of Object.entries(changeInfo)) {\n change_string += `${key} => ${value}`;\n change_string += ',';\n }\n change_string = change_string.slice(0, -1).replace(',', ', ');\n\n let s = `Tab [${tabId}] has been updated. `;\n s += `The following properties have changed: ${change_string}. `;\n s += 'See console for the new tab object.';\n\n log('t.onUpdated', s);\n console.log(tab);\n });\n\n // https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/windows/onCreated\n browser.windows.onCreated.addListener((window) => {\n log('w.onCreated', `Created window [${window.id}] of type \"${window.type}\". See console for more details.`);\n console.log(window);\n });\n\n // https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/windows/onRemoved\n browser.windows.onRemoved.addListener((windowId) => {\n log('w.onRemoved', `Removed window [${windowId}]`);\n });\n\n // https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/windows/onFocusChanged\n browser.windows.onFocusChanged.addListener(onFocusChangedListener);\n}", "function editTabs() {\n createAlert (\n \"Edit Tabs\",\n \"Create or Edit Section Tabs\",\n \"editTabUI\",\n \"saveEditTabs()\"\n )\n // Focus Tabs in Preview\n document.getElementById(\"previewElementFocuser\").style.display = \"inline\"\n document.getElementsByClassName(\"headerPillSelector\")[0].classList.add(\"focused\")\n}", "function TabManager() {\n this.lastOpenTabId, this.previousSearchTerm, this.currentSearchTerm, \n this.currentTabId, this.currentUrl, this.previousUrl;\n this.isNewUrl = function(tab) {\n return this.currentUrl.href != tab.url.href;\n }\n \n this.checkCurrentTabIsSearchPage = function() {\n console.log(\"checking if this is a search page\");\n console.log(this.currentUrl.href + \" \" + this.currentUrl.hostname);\n currentHostName = this.currentUrl.hostname;\n var isDomainUrl = searchDomains.some(function(rx) { \n return rx.test(currentHostName); \n }); \n console.log(isDomainUrl);\n return isDomainUrl;\n }\n\n this.updateTabInfo = function(tab) {\n this.previousUrl = this.currentUrl;\n this.previousTabId = this.currentTabId;\n this.currentTabId = tab.id;\n this.currentUrl = new URL(tab.url);\n this.previousSearchTerm = this.currentSearchTerm;\n this.currentSearchTerm = searchDict.getCurrentSearchTerm(tab.id, tab.url);\n };\n\n this.getSelectedSearchTerm = function() {\n return this.currentSearchTerm; \n }\n\n this.updateData = function(tab) {\n //if this is a webpage and not a blank page\n if (tab.url) {\n //if this is a page update\n if(this.previousUrl.href != this.currentUrl.href) {\n\t if (this.checkCurrentTabIsSearchPage()) {\n\t var newSearchTerm = getSearchTerm(this.currentUrl);\n\t if (newSearchTerm) {\n\t this.currentSearchTerm = getSearchTerm(this.currentUrl);\n\t }\n }\n searchDict.addUrlToTab(this.currentSearchTerm, this.currentTabId, this.currentUrl.href, this.previousTabId, this.previousUrl.href);\n\t console.log(searchDict);\n }\n }\n }\n this.updateExtensionEnabled = function(tab) {\n if(qualifyingProtocols.indexOf(this.currentUrl.protocol) != -1) {\n chrome.browserAction.enable(tab.id); \n updateContextMenu(this.currentSearchTerm);\n }\n } \n}", "function onclickForTab_Search()\n{\n //console.log('click on search tab');\n \n if(!global_pagesLoaded.search)\n {\n firstLoadForTab_Search();\n }\n \n //alert('Search');\n}" ]
[ "0.65003854", "0.64629453", "0.6443682", "0.63921773", "0.63863176", "0.6301662", "0.6283091", "0.6266893", "0.6263265", "0.6224947", "0.6220185", "0.62192357", "0.61856693", "0.6180788", "0.6180788", "0.6173446", "0.61587244", "0.6147937", "0.61225915", "0.6085357", "0.6078008", "0.60705626", "0.6038829", "0.6009121", "0.5988413", "0.59571636", "0.5952439", "0.59457064", "0.59457064", "0.5941009", "0.5940279", "0.5921343", "0.5919436", "0.5898854", "0.58956105", "0.5878994", "0.58757454", "0.58708626", "0.58704233", "0.5854647", "0.5847924", "0.58460927", "0.58333737", "0.582528", "0.58189666", "0.5816216", "0.5811841", "0.58063614", "0.580417", "0.580417", "0.580417", "0.57696706", "0.5768597", "0.57463354", "0.5733528", "0.572725", "0.57126564", "0.5712464", "0.5709582", "0.5705294", "0.567927", "0.5679134", "0.5667014", "0.56591463", "0.5654132", "0.5650381", "0.5648758", "0.5638638", "0.5635692", "0.56328", "0.56324047", "0.5619969", "0.5612542", "0.559759", "0.5593336", "0.55857795", "0.55768865", "0.5570942", "0.5567204", "0.5560715", "0.55583423", "0.55578476", "0.55569446", "0.5556563", "0.55539554", "0.5550729", "0.5548101", "0.554502", "0.554401", "0.55417323", "0.55404675", "0.5534273", "0.55335814", "0.5530145", "0.5529037", "0.5525681", "0.5520331", "0.551791", "0.5515328", "0.55149853", "0.5512885" ]
0.0
-1
e.g. takes " and turns it into "mozilla.com"
getRootDomain(host) { const domain = host.split("."); domain.shift(); return domain.join("."); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fixLocationNames (text) {\n var t = text; \n t = t.replace(/\\\\'/g, \"'\");\n // console.log(t);\n return t; \n}", "function IgnoreSpecialCharactersFromString(name){\n\t\tvar answer = name.split(\"\");\n\t\t\n\t\tfor(var i=0; i < answer.length; i++){\n\t\t\tif(answer[i] == \"/\" || answer[i]== \"'\"){\n\t\t\t\tanswer[i] = \"\";\n\t\t\t}\n\t\t}\n\t\tanswer = answer.join(\"\");\n\t\treturn answer;\n\t}", "function urlify(s){\n return s.trim().replace(/ /g , '%20');\n }", "function nextifyString(str) {\n\treturn str.replace(/[\\/\\.\\@]/g, '-');\n}", "function clean_url_value(str){\n\t\tstr = str.trim();\n\t\tstr = str.replace(/^'/, '');\n\t\tstr = str.replace(/'$/, '');\n\t\tstr = str.replace(/^\"/, '');\n\t\tstr = str.replace(/\"$/, '');\n\t\tstr = str.trim();\n\t\treturn str;\n\t}", "function format_company(company_name) {\r\n\t\tif(company_name.split(' ').length > 2) {\r\n\t\t\treturn company_name.split(' ')[0];\r\n\t\t} else {\r\n\t\t\treturn format_url(company_name);\r\n\t\t}\t\r\n\t}", "function unquote(str) {\n var res = str.trim();\n res = str.replace(/^'(.*)'$/, \"$1\");\n if (res == str) {\n res = str.replace(/^\"(.*)\"$/, \"$1\");\n }\n return res;\n}", "function unquote(value) {\n\t if (value.charAt(0) == '\"' && value.charAt(value.length - 1) == '\"') {\n\t return value.substring(1, value.length - 1);\n\t }\n\t return value;\n\t }", "function correctUrl(url) {\n var match = url.match(/\"|'|!/);\n if (match) {\n return url.split(match[0])[0];\n } else {\n return url;\n }\n}", "function convertToURLString (input) {\n var output = input.toLowerCase();\n output = output.replace(/[^a-z0-9_\\s-]/g, \"\");\n output = output.replace(/[\\s-]+/g, \" \");\n output = output.replace(/[\\s_]/g, \"-\");\n return output;\n}", "function _convertTitle(title) {\n return title.replace(/[\\s(\\)\\.'\"]*/g, \"_\")\n}", "function stripQuotes(name) {\n var length = name.length;\n if (length >= 2 &&\n name.charCodeAt(0) === name.charCodeAt(length - 1) &&\n (name.charCodeAt(0) === 34 /* doubleQuote */ || name.charCodeAt(0) === 39 /* singleQuote */)) {\n return name.substring(1, length - 1);\n }\n ;\n return name;\n }", "function n(e){return e.replace(/[.?*+^$[\\]\\\\(){}|-]/g,\"\\\\$&\")}", "function n(e){return e.replace(/[.?*+^$[\\]\\\\(){}|-]/g,\"\\\\$&\")}", "function URLify(url) {\n for (let i = 0; i < url.length; i++) {\n if (url[i] === ' ') {\n url = url.replace(' ', '%20')\n }\n };\n return url\n}", "function urlify(str){\n let result = '';\n str.trim().split('').forEach(char => {\n char === ' ' ? result += '%20' : result += char\n })\n return result\n }", "function cleanAnalyticsName(name) {\n name = \"\" + (name || \"\");\n return name.replace(/\\./g, \"-\");\n }", "sanitize (domain) {\r\n return domain.replace(/[^a-zA-Z0-9.-]/g, '')\r\n }", "function removeSpecialCharacters (title) {\n title = title.replace(/,/g, '')\n title = title.replace(/:/g, '')\n title = title.split('(').join('')\n title = title.split(')').join('')\n title = title.split('!').join('')\n title = title.split('?').join('')\n title = title.split('.').join('')\n return title;\n }", "function normalizeName(name) {\n return name.replace(\"\\\\\", \"/\").replace(/\\.\\w+$/, \"\");\n}", "function unquote(value) {\n if (value.charAt(0) == '\"' && value.charAt(value.length - 1) == '\"') return value.substring(1, value.length - 1);\n return value;\n}", "function removeApostrophe(fullName){\n if(fullName.indexOf(\"'\") != -1){\n fullName = fullName.replace(/'/g, '');\n }\n return fullName;\n}", "function nombreApostrophe(x) {\n return x.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \"\\'\");\n\n }// Fin fonction nombreApostrophe", "function prepURL(url) {\r\n // if a complete URL is passed, get the hostname\r\n if (url.indexOf(\"//\") > 0) { url = url.split(\"/\")[2]; }\r\n // remove www. (ww2, ww18, etc.) if there to save some space and return value\r\n // Thank you D. S. Kinney for pointing out the numbers\r\n return url.replace(/^ww[a-zA-Z0-9]*\\./i, \"\");\r\n}", "function unquote(value) {\n if (value.charAt(0) == '\"' && value.charAt(value.length - 1) == '\"')\n return value.substring(1, value.length - 1);\n return value;\n}", "function Guidewire_SafeTopicName(theTitle) {\ntheTitle = theTitle.replace(/ /g, \"_\"); // converts space char\ntheTitle = theTitle.replace(/\\u00a0/g, \"_\"); // converts nbsp char\n// censor (remove) characters that mess up epublisher in URLs: forward slash, backslash, question mark, &amp;\ntheTitle= theTitle.replace(/[\\\\\\/\\?]/g, \"\");\ntheTitle = theTitle.replace(/&/g, \"\");\ntheTitle = theTitle.replace(/\\u201c/g, \"\"); // double quote smart L\ntheTitle = theTitle.replace(/\\u201d/g, \"\");// double quote smart R\ntheTitle = theTitle.replace(/\\u2018/g, \"\");// single quote smart L\ntheTitle = theTitle.replace(/\\u2019/g, \"\");// single quote smart R\ntheTitle = theTitle.replace(/\\u2022/g, \"\");// trademark\ntheTitle = theTitle.replace(/'/g, \"\");// apparently a dumb single quote gets stripped by webworks\ntheTitle = theTitle.replace(/\"/g, \"\");// to be safe let us strip double quotes too\ntheTitle = theTitle.replace(/\\</g, \"(\"); // open bracket\ntheTitle = theTitle.replace(/\\>/g, \")\"); // close bracket\ntheTitle = theTitle.replace(/:/g, \"_\"); // colon\ntheTitle = theTitle.replace(/&/g, \"\");\nreturn (theTitle); }", "function Guidewire_SafeTopicName(theTitle) {\ntheTitle = theTitle.replace(/ /g, \"_\"); // converts space char\ntheTitle = theTitle.replace(/\\u00a0/g, \"_\"); // converts nbsp char\n// censor (remove) characters that mess up epublisher in URLs: forward slash, backslash, question mark, &amp;\ntheTitle= theTitle.replace(/[\\\\\\/\\?]/g, \"\");\ntheTitle = theTitle.replace(/&/g, \"\");\ntheTitle = theTitle.replace(/\\u201c/g, \"\"); // double quote smart L\ntheTitle = theTitle.replace(/\\u201d/g, \"\");// double quote smart R\ntheTitle = theTitle.replace(/\\u2018/g, \"\");// single quote smart L\ntheTitle = theTitle.replace(/\\u2019/g, \"\");// single quote smart R\ntheTitle = theTitle.replace(/\\u2022/g, \"\");// trademark\ntheTitle = theTitle.replace(/'/g, \"\");// apparently a dumb single quote gets stripped by webworks\ntheTitle = theTitle.replace(/\"/g, \"\");// to be safe let us strip double quotes too\ntheTitle = theTitle.replace(/\\</g, \"(\"); // open bracket\ntheTitle = theTitle.replace(/\\>/g, \")\"); // close bracket\ntheTitle = theTitle.replace(/:/g, \"_\"); // colon\ntheTitle = theTitle.replace(/&/g, \"\");\nreturn (theTitle); }", "function Guidewire_SafeTopicName(theTitle) {\ntheTitle = theTitle.replace(/ /g, \"_\"); // converts space char\ntheTitle = theTitle.replace(/\\u00a0/g, \"_\"); // converts nbsp char\n// censor (remove) characters that mess up epublisher in URLs: forward slash, backslash, question mark, &amp;\ntheTitle= theTitle.replace(/[\\\\\\/\\?]/g, \"\");\ntheTitle = theTitle.replace(/&/g, \"\");\ntheTitle = theTitle.replace(/\\u201c/g, \"\"); // double quote smart L\ntheTitle = theTitle.replace(/\\u201d/g, \"\");// double quote smart R\ntheTitle = theTitle.replace(/\\u2018/g, \"\");// single quote smart L\ntheTitle = theTitle.replace(/\\u2019/g, \"\");// single quote smart R\ntheTitle = theTitle.replace(/\\u2022/g, \"\");// trademark\ntheTitle = theTitle.replace(/'/g, \"\");// apparently a dumb single quote gets stripped by webworks\ntheTitle = theTitle.replace(/\"/g, \"\");// to be safe let us strip double quotes too\ntheTitle = theTitle.replace(/\\</g, \"(\"); // open bracket\ntheTitle = theTitle.replace(/\\>/g, \")\"); // close bracket\ntheTitle = theTitle.replace(/:/g, \"_\"); // colon\ntheTitle = theTitle.replace(/&/g, \"\");\nreturn (theTitle); }", "function Guidewire_SafeTopicName(theTitle) {\ntheTitle = theTitle.replace(/ /g, \"_\"); // converts space char\ntheTitle = theTitle.replace(/\\u00a0/g, \"_\"); // converts nbsp char\n// censor (remove) characters that mess up epublisher in URLs: forward slash, backslash, question mark, &amp;\ntheTitle= theTitle.replace(/[\\\\\\/\\?]/g, \"\");\ntheTitle = theTitle.replace(/&/g, \"\");\ntheTitle = theTitle.replace(/\\u201c/g, \"\"); // double quote smart L\ntheTitle = theTitle.replace(/\\u201d/g, \"\");// double quote smart R\ntheTitle = theTitle.replace(/\\u2018/g, \"\");// single quote smart L\ntheTitle = theTitle.replace(/\\u2019/g, \"\");// single quote smart R\ntheTitle = theTitle.replace(/\\u2022/g, \"\");// trademark\ntheTitle = theTitle.replace(/'/g, \"\");// apparently a dumb single quote gets stripped by webworks\ntheTitle = theTitle.replace(/\"/g, \"\");// to be safe let us strip double quotes too\ntheTitle = theTitle.replace(/\\</g, \"(\"); // open bracket\ntheTitle = theTitle.replace(/\\>/g, \")\"); // close bracket\ntheTitle = theTitle.replace(/:/g, \"_\"); // colon\ntheTitle = theTitle.replace(/&/g, \"\");\nreturn (theTitle); }", "function Guidewire_SafeTopicName(theTitle) {\ntheTitle = theTitle.replace(/ /g, \"_\"); // converts space char\ntheTitle = theTitle.replace(/\\u00a0/g, \"_\"); // converts nbsp char\n// censor (remove) characters that mess up epublisher in URLs: forward slash, backslash, question mark, &amp;\ntheTitle= theTitle.replace(/[\\\\\\/\\?]/g, \"\");\ntheTitle = theTitle.replace(/&/g, \"\");\ntheTitle = theTitle.replace(/\\u201c/g, \"\"); // double quote smart L\ntheTitle = theTitle.replace(/\\u201d/g, \"\");// double quote smart R\ntheTitle = theTitle.replace(/\\u2018/g, \"\");// single quote smart L\ntheTitle = theTitle.replace(/\\u2019/g, \"\");// single quote smart R\ntheTitle = theTitle.replace(/\\u2022/g, \"\");// trademark\ntheTitle = theTitle.replace(/'/g, \"\");// apparently a dumb single quote gets stripped by webworks\ntheTitle = theTitle.replace(/\"/g, \"\");// to be safe let us strip double quotes too\ntheTitle = theTitle.replace(/\\</g, \"(\"); // open bracket\ntheTitle = theTitle.replace(/\\>/g, \")\"); // close bracket\ntheTitle = theTitle.replace(/:/g, \"_\"); // colon\ntheTitle = theTitle.replace(/&/g, \"\");\nreturn (theTitle); }", "function beautifyString(mname) {\n\n mname = mname.split('.').join(' ');\n mname = mname.split('-').join(' ');\n mname = mname.split('_').join(' ');\n\n return mname;\n}", "function fixQuote(stru) {\n return stru.split(\"&quot;\").join(\"\\\"\");\n}", "function domainName(url){\n return url.match(/h([^;]*)\\//g)[0].replace(/\\./g, )\n}", "function uutrimurl(source) { // @param String: ' url(\"http://...\") '\r\n // @return String: \"http://...\"\r\n return (!source.indexOf(\"url(\") && source.indexOf(\")\") === source.length - 1) ?\r\n source.slice(4, -1).replace(uutrim._QUOTE, \"\") : source;\r\n}", "function unquote(value) {\n if (value.charAt(0) == '\"' && value.charAt(value.length - 1) == '\"') {\n return value.substring(1, value.length - 1);\n }\n\n return value;\n}", "function domainName(url){\n if(url.match('http:\\/\\/')){\n url = url.replace('http:\\/\\/', '');\n }\n if(url.match('www.')){\n url = url.replace('www.', '');\n }\n if(url.match('https:\\/\\/')){\n url = url.replace('https:\\/\\/', '');\n }\n for(var i = 0; i < url.length; i++){\n if(url[i] === '.'){\n url = url.slice(0, i);\n }\n }\n return url;\n}", "function urlify(string) {\n return string.toLowerCase().split(/\\s+/).join(\"-\");\n}", "function urlify(string) {\n return string.toLowerCase().split(/\\s+/).join(\"-\")\n}", "function unquote(s) { // maybe just use unescape()?\n\t// unquote('abc%20def') -> 'abc def'.\n var res = s.split('%');\n for (var i = 1; i < res.length; i++) {\n var item = res[i];\n try {\n\t\t\tres[i] = String.fromCharCode(parseInt(item.slice(0, 2), 16)) + item.slice(2);\n } catch(err) { //KeyError:\n res[i] = '%' + item;\n\t }\n\t}\n return res.join('');\n}", "function URLify (str) {\n return str.trim().split(\" \").join(\"%20\");\n}", "function get_well_formated_title(title) {\n //setp 1 upper case\n title = title.toLowerCase();\n //remove all the white space and put the space\n title=title.replace(new RegExp(' ', 'g'), '-');\n //remove single quote to normal\n title = title.replace(new RegExp(\"'\", 'g'), '');\n //remove & to and\n title = title.replace(new RegExp(\"&\", 'g'), 'and');\n return title;\n}", "function e(a){return a.lastIndexOf(\"\\\\\")<0?a:a.replace(/\\\\\\\\/g,\"\\\\\").replace(/\\\\n/g,\"\\n\").replace(/\\\\r/g,\"\\r\").replace(/\\\\t/g,\"\t\").replace(/\\\\b/g,\"\\b\").replace(/\\\\f/g,\"\\f\").replace(/\\\\{/g,\"{\").replace(/\\\\}/g,\"}\").replace(/\\\\\"/g,'\"').replace(/\\\\'/g,\"'\")}", "function urlify (string) {\n return string.toLowerCase().split(/\\s+/).join(\"-\");\n}", "function urlify(string) {\n return string.toLowerCase().split(/\\s+/).join(\"-\");\n}", "function uutrimquote(source) { // @param String: ' \"quote string\" '\r\n // @return String: 'quote string'\r\n return source.replace(uutrim._QUOTE, \"\");\r\n}", "static extension(url) {\n var name = this.name(url)\n if (!name.match(/\\./)) return undefined\n return name.toLowerCase().replace(/.*\\./,\"\") \n }", "function stringStrip(sickPersonName:String) {\n\t\tvar temp = sickPersonName.Split(\":\"[0]);\n\t\tsickPersonDisease = temp[0];\n}", "function escapeName(name){\n if(name != undefined && name != null && name != \"\"){\n name = name.replace(/\\\\'/g, \"'\");\n name = name.replace(/'/g, \"\\\\'\");\n name = name.replace(/\\\\\"/g, \"\\\"\");\n name = name.replace(/\"/g, \"\\\\\\\"\");\n name = name.replace(/\\./g, \"\\\\.\");\n name = name.replace(/\\[/g, \"\\\\[\");\n name = name.replace(/\\]/g, \"\\\\]\");\n }\n return name;\n}", "function convertFromURLString (input) {\n return toTitleCase(input.replace(/-/g, \" \"));\n}", "function urlSlug(title) {\nlet arr = title.split(/\\W/);\nreturn arr.map(a => a.toLowerCase()).filter(a => a!==\"\").join(\"-\");\n}", "function safeUsername() {\n return os.userInfo().username.replace(/[^\\w+=,.@-]/g, '@');\n}", "function encWN(wName) {\n wName = wName.replace(/@/,\"at\");\n wName = wName.replace(/\\./g,\"dot\");\n wName = wName.replace(/\\//g,\"slash\");\n wName = wName.replace(/&/g,\"amp\");\n wName = wName.replace(/\\'/g,\"tick\");\n wName = wName.replace(/=/g,\"equals\");\n wName = wName.replace(/#/g,\"pound\");\n wName = wName.replace(/:/g,\"colon\");\t\n wName = wName.replace(/%/g,\"percent\");\n wName = wName.replace(/-/g,\"dash\");\n wName = wName.replace(/ /g,\"blank\");\n return wName;\n}", "toFayeCompatible(ch) { return '/' + ch.replace(/\\./g, '!!'); }", "function getHostname(url) {\n return decodeURIComponent(url).replace(/.*\\/\\//, \"\").replace(/\\/.*$/, \"\");\n}", "function sanitise(name){\n\treturn name.replace(/[^a-zA-Z0-9\\.\\-]/g, '_');\n}", "function formatUrl(url){\n var finUrl = /:\\/\\/(www\\.)?(.+?)\\//;\n return url.match(finUrl)[2];\n}", "function getAddress() {\r\n\ta = document.title.split(\"|\")[0].replace (/ /, \"+\" );\r\n\t// alert (a);\r\n\treturn a.replace (/ /, \"+\" );\r\n}", "function urlSlug(title) {\n return title.trim().split(/\\W+/).join(\"-\").toLowerCase();\n //return title.trim().split(/\\s+/).join(\"-\").toLowerCase(); //this will be same with above\n}", "function formatName(name) {\n if(name.includes(\",\") || name.includes(' ') || name.includes(\"&\")){\n if(name.includes(\".\")){\n name = name.substring(0, name.length-1);\n }\n return name.replace(/[,& ]+/g, '_');\n } else {\n return name\n }\n}", "function quotechange(a){\r\n\tvar stringReplace=\"\";\r\n\tfor (var j=0,aL=a.length; j<aL; ++j){\r\n\t\tif (a.charAt(j) == '\\\"')\r\n\t\t\tstringReplace=stringReplace + \"&quot;\";\r\n\t\telse\r\n\t\t\tstringReplace=stringReplace + a.charAt(j);\r\n\t}\r\n\treturn stringReplace;\r\n}", "function http_prepare(x) {\n x = x.replace(' ', '%20')\n x = x.replace('!', '%21')\n x = x.replace('\"', '%22')\n x = x.replace('#', '%23')\n x = x.replace('$', '%24')\n x = x.replace('%', '%25')\n x = x.replace('&', '%26')\n x = x.replace(\"'\", '%27')\n x = x.replace('(', '%28')\n x = x.replace(')', '%29')\n x = x.replace('*', '%2A')\n x = x.replace('+', '%2B')\n x = x.replace(',', '%2C')\n x = x.replace('-', '%2D')\n x = x.replace('.', '%2E')\n x = x.replace('/', '%2F')\n return x;\n}", "get DoubleQuote() {}", "function convertPCname(name)\n\t{\n\t\t// Edit\n\t\tname = name.replace(/ /gi, '.');\n\t\tname = name.replace(/[^a-zA-Z0-9\\.]/g, '');\n\t\tname = name.toLowerCase();\n\n\t\treturn name;\n\t}", "function stringHelper (str_inp) {\n let condensed = \"\"\n for (el of str_inp.toLowerCase()) {\n if (el === \" \" || el === \"!\" || el === \".\" || el === \",\" || el === \"/\" || el === \";\" || el === \":\" || el === \"'\" || el === '\"') {\n continue\n }\n condensed += el\n }\n return condensed\n }", "function cleanWord (word) {\n if (!word) return ''\n var cleanWord = word.replace(/[()!,;:.\"]+/, '')\n return cleanWord\n}", "function domainName(url){\n return url.replace(/(https?:\\/\\/)?(www\\.)?/, '').split('.')[0]\n}", "function string_string(str) {\n\n\t//hello_word = \"hello world\", hello-world=>hello-word\n\t//hello--worlf=\n\tconsole.log(str);\n\t\n\nreturn str.replace(/^[-]/,'')\n\t\t\treplace(/--/g,\",\")\n\t\t\t.replace(/_/g,\" \");\n\n \n\n // let result = \"\";\n\n // str.split('--').forEach((each) => {\n\n // if (each.match(/[_]/)) {\n // result += '\"'+ each.replace(/[_]/g, \" \") + '\"';\n // } else {\n // result += \" \"+each;\n // }\n // })\n\n // return result.replace(/[\\s]dot/g, \" . \");\n\n}", "function getURLFromName(name) {\n\tlower = name.toLowerCase();\n\n\t// Replace all whitespace characters and groups thereof with dashes.\n\tnospaces = lower.replace(/\\s+/gim, \"-\");\n\treturn encodeURIComponent(nospaces);\n}", "function urlConvert (string){\n let convertedString ='';\n for(let i = 0; i < string.length; i++){\n let char = string.toLowerCase().charAt(i);\n if(char === \" \") convertedString += \"+\";\n else convertedString += char;\n }\n return convertedString;\n}", "function Unquote() {\r\n}", "function urlStr(str) {\n return str.replace(/ /g,\"+\");\n}", "function replaceSingleQuotes(str){\n\tstr = str.replace(\"'\", \"''\");\n\tconsole.log(str);\n\treturn str;\n}", "function strip(str) {\n if ('\"' == str[0] || \"'\" == str[0]) return str.slice(1, -1);\n return str;\n}", "function clean(input){\n return input.replace('\\'', '');\n \n }", "function stripslashes(value) {\n return value.replace(/\\\\(.)/g, \"$1\");\n}", "function urlSlug(title) {\n return title.trim().toLowerCase().split(/\\s+/).join(\"-\");\n} //trim removes spaces around the string; /\\s+/ means more than 1 white spaces", "function URLify(str) {\n return str\n .trimEnd()\n .split(\" \")\n .join(\"%20\");\n}", "formatText(text) {\n return text.replace(/[^a-z0-9\\.'\"\\/:?=!+]+/gi, ' ');\n }", "function simplifyName(name){\n\t//console.log(\"simplifying: \" + name)\n\n\tvar idName = name;\n\tidName = idName.replace(/ /g,'');\n\tidName = idName.replace(\"'\",'');\n\tidName = idName.replace(/[.,\\/#!$%\\^&\\;:{}=\\-_`~]/g,\"\");\n\n\treturn idName;\n}", "set BackQuote(value) {}", "function prepareWaypointsNote(note) {\n\t\t\t\t\n\t\t\t\tnote = note.replace(/'/g, \"\");\n\t\t\t\tnote = note.replace(/\"/g, \"\");\n\n\t\t\t\treturn note;\n\t\t\t}", "function removeSpaces(element) {\n\t\treturn encodeURIComponent(element);\n\t}", "function urlSlug(title) {\n var arrTitle = [...title];\n var newTitle = '';\n for(let i=0;i<arrTitle.length;i++){\n newTitle = newTitle + (arrTitle[i]);\n }\n \n return newTitle\n .split(/\\W/)\n .filter(obj => {\n return obj !== \"\";\n })\n .join(\"-\")\n .toLowerCase();\n}", "nameDB() {\n let hostname = window.location.host.split('.')\n let response = hostname\n\n //Set capitalize to all words\n hostname.forEach((word, index) => {\n if (index >= 1) {\n hostname[index] = word.charAt(0).toUpperCase() + word.slice(1)\n }\n })\n\n //Remove .com .org....\n if (hostname.length >= 2) response.pop()\n\n return `${response.join('')}DB`//Response\n }", "parseDomain(url) {\n if(url) {\n if (url.indexOf(\"://\") > -1) {\n url = url.split('/')[2];\n } else {\n url = url.split('/')[0];\n }\n }\n\n return url;\n }", "function stripOffQuotes(geneParam) {\n const cleanedWord = geneParam.replace(/\"\\B/, '').replace(/\\B\"/, '').trim()\n return cleanedWord\n}", "function stripSingleQuotes(str) {\n if(str[0] == \"'\" && str[str.length-1] == \"'\") {\n return str.substring(1, str.length-1);\n }\n return str;\n }", "function codify(name) {\n if (!name) return '';\n // return name.toLowerCase().replace(/[\\&\\[\\]\\(\\)\\{\\}\\.\\?\\/# \\-_:'`~\\\\@\"']/g, '');\n return latinise(name).toLowerCase().replace(/[^a-zA-Z0-9]/g, '');\n }", "urlsafe(text) {\n return text.replace(/\\+/g, '-').replace(/\\//g, '_');\n }", "get BackQuote() {}", "function URLifyBetter(url) {\n const urlArray = url.split('');\n\n for (let i = url.length; i > 0; i--) {\n let temp = [];\n if (urlArray[i] === \" \") {\n temp = urlArray.splice(i + 1)\n urlArray.pop(); \n urlArray.push(\"%20\");\n urlArray.push(...temp);\n }\n }\n return urlArray.join('');\n}", "static name(url) {\n return url.toString().replace(/.*\\//,\"\")\n }", "function get_site_name(page_title){\r\n\tif (page_title.indexOf('http://www.')!=-1){\r\n\t\tvar site_start = page_title.indexOf('http://www.')+11;\r\n\t} else {\r\n\t\tvar site_start = page_title.indexOf('http://')+7;\r\n\t}\r\n\tvar site_name= page_title.substring(site_start);\r\n\r\n\treturn site_name;\r\n}", "function getJLinkName(s) {\n console.log(s);\n let jLinkIndex = s.indexOf(\"j/\");\n if (jLinkIndex >= 0) {\n let endOfNameIndex = s.indexOf(\" \", jLinkIndex + 2);\n console.log(endOfNameIndex);\n if (endOfNameIndex == -1) endOfNameIndex = s.length;\n\n return s.slice(jLinkIndex + 2, endOfNameIndex + 1);\n }\n return \"\";\n}", "function removePunctuationFromURL(url){\n return url.replace(/[\\.,-\\/#!$%\\^&\\*;:{}=\\-_`~()]/g, \"\");\n}", "function simplifyName(name){\n\tvar idName = name;\n\tidName = idName.replace(/ /g,'');\n\tidName = idName.replace(\"'\",'');\n\tidName = idName.replace(/[.,\\/#!$%\\^&\\;:{}=\\-_`~]/g,\"\");\n\n\treturn idName;\n}", "function simplifyName(name){\n\tvar idName = name;\n\tidName = idName.replace(/ /g,'');\n\tidName = idName.replace(\"'\",'');\n\tidName = idName.replace(/[.,\\/#!$%\\^&\\;:{}=\\-_`~]/g,\"\");\n\n\treturn idName;\n}", "function quote(s)\n{\n return s.replace(/[\\^\\$\\\\\\.\\*\\+\\?\\(\\)\\[\\]\\{\\}\\|]/g, '\\\\$&');\n}", "function unescape(token) {\n return token.replace(/~1/g, \"/\").replace(/~0/g, \"~\");\n}", "function webStr(strIn) { //把psd文件名转换为web安全的字符\n\tvar ch,\n\t\tidx = 0,\n\t\tlen = strIn.length > 120 ? 120 : strIn.length,\n\t\tstrOut = '';\n\n\tfor (idx; idx < len; idx += 1) {\n\n\t\tch = strIn.charAt(idx).toUpperCase();\n\t\tif (ch >= 'A' && ch <= 'Z') {\n\t\t\tstrOut += strIn.charAt(idx);\n\t\t} else if (ch >= '0' && ch <= '9') {\n\t\t\tstrOut += strIn.charAt(idx);\n\t\t} else if (ch === '_' || ch === '-') {\n\t\t\tstrOut += strIn.charAt(idx);\n\t\t} else {\n\t\t\tif (idx === 0) {\n\t\t\t\tstrOut += 'x';\n\t\t\t} else {\n\t\t\t\tstrOut += '-';\n\t\t\t}\n\t\t}\n\t}\n\treturn strOut;\n}", "slugify(text) {\n return text\n .toString()\n .toLowerCase()\n .replace(/\\s+/g, \"-\")\n .replace(/[^\\w\\-]+/g, \"\")\n .replace(/--+/g, \"-\");\n }" ]
[ "0.62879425", "0.61810935", "0.617759", "0.6057302", "0.60502386", "0.60371584", "0.60248435", "0.60136855", "0.6006507", "0.6000711", "0.5992546", "0.59913296", "0.5936591", "0.5936591", "0.58925027", "0.5844544", "0.5842103", "0.5836293", "0.5782062", "0.5776443", "0.5776065", "0.5739948", "0.5726971", "0.57138276", "0.57070714", "0.57013", "0.57013", "0.57013", "0.57013", "0.57013", "0.57007116", "0.5692749", "0.5688975", "0.5685144", "0.5680928", "0.5679644", "0.5678464", "0.5674243", "0.5670371", "0.5667613", "0.5665454", "0.5663121", "0.56575245", "0.5640203", "0.56188023", "0.5609209", "0.5606862", "0.5601539", "0.5599684", "0.5585444", "0.5576814", "0.5573616", "0.5568429", "0.55620885", "0.5559016", "0.55488807", "0.55487585", "0.5545928", "0.5545318", "0.55385715", "0.5530624", "0.55270493", "0.55229914", "0.5514592", "0.5511489", "0.55034477", "0.5501861", "0.54891056", "0.54852325", "0.5481853", "0.54651076", "0.54635453", "0.54475427", "0.54366237", "0.5434941", "0.5427091", "0.5421839", "0.5420898", "0.5415289", "0.5412347", "0.54108924", "0.5408641", "0.5405017", "0.5403567", "0.54011065", "0.5399757", "0.5391887", "0.53905576", "0.5389508", "0.53879565", "0.5387231", "0.53856677", "0.538249", "0.53817284", "0.5376723", "0.5372591", "0.5372591", "0.5364781", "0.5364562", "0.53640753", "0.536134" ]
0.0
-1
Called when a nonfocused tab is selected. If have CNN in one tab (with blocked elements) and Fox in another, go to Fox tab and back to CNN, you want counter to change back to CNN count. Only one icon in URL across all tabs, have to update it per page.
onTabChange(evt) { const win = evt.target.ownerGlobal; const currentURI = win.gBrowser.currentURI; // Don't show the page action if page is not http or https if (currentURI.scheme !== "http" && currentURI.scheme !== "https") { this.hidePageAction(win.document); return; } const currentWin = Services.wm.getMostRecentWindow("navigator:browser"); // If user changes tabs but stays within current window we want to update // the status of the pageAction, then reshow it if the new page has had any // resources blocked. if (win === currentWin) { this.hidePageAction(win.document); // depending on the treatment branch, we want the count of timeSaved // ("fast") or blockedResources ("private") const counter = this.treatment === "private" ? this.state.blockedResources.get(win.gBrowser.selectedBrowser) : this.state.timeSaved.get(win.gBrowser.selectedBrowser); if (counter) { this.showPageAction(win.document, counter); this.setPageActionCounter(win.document, counter); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onSwitchTab()\n\t{\n\t\tvar idx = jQuery(this).index();\n\t\t_preferences.tab = parseInt(idx, 10);\n\n\t\tClient.loadFile(DB.INTERFACE_PATH + 'basic_interface/tab_itm_0'+ (idx+1) +'.bmp', function(data){\n\t\t\tCashShop.ui.find('.tabs').css('backgroundImage', 'url(' + data + ')');\n\t\t\t//requestFilter();\n\t\t});\n\t}", "function onTabChange(i) {\n\t\tsetCurrentTab(i)\n\t}", "function setTabActive(tab){tabVisited[tab]=true;$(\"#\" + tab).removeClass(\"inactive\")}", "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 opentab(evt, punNum) {\n // Declaring variables \n var i, tabContent, tablink;\n tabContent = document.getElementsByClassName(\"tabContent\");\n for (i = 0; i < tabContent.length; i++) {\n tabContent[i].style.display = \"none\";\n }\n tablink = document.getElementsByClassName(\"tablink\");\n for (i = 0; i < tablink.length; i++) {\n tablink[i].className = tablink[i].className.replace(\"active\", \"\")\n }\n\n document.getElementById(punNum).style.display = \"block\";\n evt.currentTarget.className += \" active\";\n}", "function onTabActivated (data) {\n updateBadge(data.tabId);\n}", "function changeTab(num) {\r\n var index;\r\n if (num) {\r\n index = $(opts.indexWrap).find('li').eq(num - 1);\r\n changeTabStatus(index, true);\r\n }\r\n }", "function on_tab_updated(id, change_info, tab)\n {\n if (tab.active && change_info.url) { update_in_tab(tab); }\n }", "function selectTab(ev, tabName)\n{\n if (prefs.debug)\n console.log(\"URL Link \" + tabName + \" selected\");\n\n // Set all buttons as non-current\n let tabContent = document.getElementsByClassName(\"tab-content\");\n for (let tab = 0; tab < tabContent.length; tab++)\n tabContent[tab].style.display = \"none\";\n\n // Hide all tabs\n let tabLinks = document.getElementsByClassName(\"tab-link\");\n for (let tab = 0; tab < tabLinks.length; tab++) {\n tabLinks[tab].className = tabLinks[tab].className.replace(/ active\\b/g, \"\");\n }\n\n // Show selected tab\n document.getElementById(tabName + \"-tab\").style.display = \"block\";\n\n // Flag active button\n ev.currentTarget.className += \" active\";\n}", "function checkTab() {\n\tchrome.tabs.query({active: true, currentWindow: true}, function(arrayOfTabs) {\n\tvar url = arrayOfTabs[0].url;\n\n\t\tif (url.indexOf(\"netflix.com\") > -1) {\n\t\t\n\t\t\t//show the button if netflix is the current tab\n\t\t\tvar id = arrayOfTabs[0].id;\n\t\t\tchrome.pageAction.show(id);\n\t\t\tif (timerOn == false) {\n\n\t\t\t\t//check if the day has changed\n\t\t\t\tvar d = new Date();\n\t\t\t\tvar n = parseInt(d.getDate());\n\t\t\t\tif (n != current) {\n\t\t\t\t\tchrome.storage.local.set({'remaining': reset, 'current': n}, function(something) {});\n\t\t\t\t}\t\t\t\n\t\t\t\t\n\t\t\t\t//start the timer\n\n\t\t\t\tstart(id);\n\t\t\t}\n\t\t}\n\t\t\n\t\t//if the current tab is not netflix but the timer is on, turn it off\n\t\tif (url.indexOf(\"netflix.com\") == -1 && timerOn == true) {\n\t\t\tvar id = arrayOfTabs[0].id;\n\t\t\tchrome.pageAction.hide(id);\n\t\t\tstop(id);\n\t\t}\n\t});\n}", "function updateTab (tabs) {\n if (tabs[0]) {\n currentTab = tabs[0]\n let currentURL = currentTab.url\n if (!isValidURL(currentURL)) {\n hideIcon()\n } else {\n getOptions()\n .then(updateStatus)\n .then(updateUI)\n }\n }\n}", "function onClickTab(tab) {\n if (d3.select(\"#tab_\"+tab).classed(\"active\")) { return; }\n active_tab = tab;\n // hide all tab_content\n d3.selectAll(\".tab_content\").style(\"display\", \"none\");\n // show selected tab_content\n d3.select(\"#div_\"+tab).style(\"display\", \"unset\");\n // mark tab as selected\n d3.selectAll(\".tab\").classed(\"active\", false);\n d3.select(\"#tab_\"+tab).classed(\"active\", true);\n drawgraphs();\n}", "function handleTabChange(activeRef){\n var locationName = \"\";\n\n if(activeRef == \"#tabOne\"){\n locationName = $(\"#tab-one\").val(); //e.g. \"family1\"\n }else if(activeRef == \"#tabTwo\"){\n locationName = $(\"#tab-two\").val();\n }else if(activeRef == \"#tabThree\"){\n locationName = $(\"#tab-three\").val();\n }else if(activeRef == \"#tabFour\"){\n locationName = $(\"#tab-four\").val();\n }else if(activeRef == \"#tabFive\"){\n locationName = $(\"#tab-five\").val();\n }\n\n //set tab background\n var url = window.common.getLocationByName(locationName).background;\n $(\"#tab-background\").css(\"background-image\", \"url(\"+url+\")\");\n\n //update jsPlumb connections\n refreshConnectionView(locationName);\n}", "function change_tab_content()\n{\n $('.pages-icons').removeClass(\"current\");\n $(this).addClass('current');\n}", "async function on_tab_activated(info)\n {\n update_in_tab(await browser.tabs.get(info.tabId));\n }", "function showChangeTrackingTabCount()\r\n{\r\n $(document).ready(function()\r\n {\r\n \t//Change tracking tab button id\r\n \t//Tracker#: 19238 F2J. CHANGE TRACKING ON COMPETENCIES DOCUMENT\r\n \t//Tracker#: 18917 F4L - CHANGE TRACKING ON CAPACITY DOCUMENT\r\n \tif ($(\"#1237CenterCell\").length > 0 || $(\"#16377CenterCell\").length > 0\r\n \t || $(\"#16352CenterCell\").length > 0 || $(\"#16388CenterCell\").length > 0\r\n \t || $(\"#16389CenterCell\").length > 0 || $(\"#16390CenterCell\").length > 0\r\n \t || $(\"#1441CenterCell\").length > 0 || $(\"#16391CenterCell\").length > 0\r\n \t || $(\"#1304CenterCell\").length > 0 || $(\"#1497CenterCell\").length > 0\r\n\t\t\t || $(\"#16394CenterCell\").length > 0 || $(\"#16395CenterCell\").length > 0\r\n \t || $(\"#16401CenterCell\").length > 0 || $(\"#16404CenterCell\").length > 0\r\n || $(\"#16454CenterCell\").length > 0 || $(\"#2110CenterCell\").length > 0\r\n || $(\"#16555CenterCell\").length > 0 )\r\n \t{\r\n \t\tvar changeAjax = new htmlAjax();\r\n \t\tchangeAjax.setActionURL(\"changetrackviewerplm.do\");\r\n \t\tchangeAjax.setActionMethod(\"numberOfChanges\");\r\n \t\tchangeAjax.setProcessHandler(\"showNumCTChanges\");\r\n \t\tchangeAjax.showProcessingBar(false);\t//Tracker#: 20234 CHANGE TRACKING COUNT PERFORMANCE ON OVERVIEW SCREENS\r\n\r\n \t\tvar parentDocViewId = null;\r\n \t\tif ($(\"#1237CenterCell\").length > 0)\r\n \t\t{\r\n \t\t //TechSpec\r\n parentDocViewId = \"132\";\r\n \t\t}\r\n \t\telse if ($(\"#16377CenterCell\").length > 0)\r\n \t\t{\r\n \t\t //Material Projections\r\n \t\t\tparentDocViewId = \"5800\";\r\n \t\t}\r\n else if ($(\"#16352CenterCell\").length > 0)\r\n {\r\n //Material Quote Overview\r\n parentDocViewId = \"155\";\r\n }\r\n else if ($(\"#16388CenterCell\").length > 0)\r\n {\r\n //Material Library Overview\r\n parentDocViewId = \"3303\";\r\n }\r\n else if ($(\"#16389CenterCell\").length > 0)\r\n {\r\n //Artwork Library Overview\r\n parentDocViewId = \"4200\";\r\n }\r\n else if ($(\"#16390CenterCell\").length > 0)\r\n {\r\n //Color Library Overview\r\n parentDocViewId = \"2900\";\r\n }\r\n else if ($(\"#1441CenterCell\").length > 0)\r\n {\r\n //Color Palette Overview\r\n parentDocViewId = \"3500\";\r\n }\r\n else if ($(\"#16391CenterCell\").length > 0)\r\n {\r\n //Material Palette Overview\r\n parentDocViewId = \"6000\";\r\n }\r\n else if ($(\"#1304CenterCell\").length > 0)\r\n {\r\n //Submits\r\n parentDocViewId = \"3400\";\r\n }\r\n else if ($(\"#1497CenterCell\").length > 0)\r\n {\r\n //Fit Evaluation\r\n parentDocViewId = \"2406\";\r\n }\r\n \t\telse if ($(\"#16394CenterCell\").length > 0)\r\n \t\t{\r\n parentDocViewId = \"6800\";\r\n \t\t}\r\n\r\n \t\telse if ($(\"#16395CenterCell\").length > 0)\r\n \t\t{\r\n parentDocViewId = \"6801\";\r\n \t\t}\r\n \t\t//Tracker#: 19238 F2J. CHANGE TRACKING ON COMPETENCIES DOCUMENT\r\n \t\telse if ($(\"#16401CenterCell\").length > 0)\r\n \t\t{\r\n parentDocViewId = \"7000\";\r\n \t\t}\r\n \t\t//Tracker#: 18917 F4L - CHANGE TRACKING ON CAPACITY DOCUMENT\r\n \t\telse if ($(\"#16404CenterCell\").length > 0)\r\n \t\t{\r\n parentDocViewId = \"7300\";\r\n \t\t}\r\n else if ($(\"#16454CenterCell\").length > 0)\r\n {\r\n parentDocViewId = \"212\";\r\n }\r\n else if ($(\"#2110CenterCell\").length > 0)\r\n {\r\n parentDocViewId = \"321\";\r\n }\r\n else if ($(\"#16555CenterCell\").length > 0)\r\n {\r\n parentDocViewId = \"6304\";\r\n }\r\n changeAjax.parameter().add(\"parentDocViewId\", parentDocViewId);\r\n \t\tchangeAjax.sendRequest();\r\n \t}\r\n });\r\n}", "function onTabClick() {\n\n if(!loading && !new_patient) {\n\n var target = $(this).attr(\"data-target\");\n\n $(tabs).each(function() {\n\n $(this).removeClass(\"selected\");\n });\n\n $(sections).each(function() {\n\n ($(this).attr(\"data-type\") == target) ? $(this).removeClass(\"hide\") : $(this).addClass(\"hide\");\n })\n\n $(this).addClass(\"selected\");\n }\n }", "function tab(tab) {\n\tif ($.inArray(tab, availableTabs) == -1) {\n\t\tconsole.log(\"invalid tab. Please update your available tabs\");\n\t} else {\n\t\tvar arrayLength = availableTabs.length;\n\t\tfor (var i = 0; i < arrayLength; i++) {\n\t\t\t//maybe have problems where tab doesn't exist\n\t\t $(\"#\"+availableTabs[i] + 'Content').hide(); \n\t\t $(\"#\"+availableTabs[i] + 'Content').css({'class': ''});\n\t\t $(\"#\"+availableTabs[i]).css({'background': 'rgb(0, 45, 60)'});\n\t\t}\n\t\t$(\"#\" + tab + 'Content').show();\n\t\t$(\"#\" + tab + 'Content').css({'class': 'active'});\n\t\tactiveTab = tab;\n\t\t$(\"#\" + tab).css({'background': 'rgb(67, 153, 152)'});\n\t\tif ($.inArray(tab, loadedTabs) == -1) {\n\t\t\tloadTab(activeTab);\n\t\t}\n\t\tif (window.mobilecheck()) {\n\t\t\tlayoutMobileMasonry(activeTab + 'Grid');\n\t\t} else {\n\t\t\tlayoutMasonry(activeTab + 'Grid');\n\t\t}\n\t}\n}", "function activeTabChanged(activeInfo) {\n if (activeInfo) {\n var tabId = activeInfo.tabId;\n if (tabId) {\n getCurrentTabUrl();\n }\n }\n}", "function selectTab() {\n var href = tab.href.split('#')[1];\n var panel = layout.content_.querySelector('#' + href);\n layout.resetTabState_(tabs);\n layout.resetPanelState_(panels);\n tab.classList.add(layout.CssClasses_.IS_ACTIVE);\n panel.classList.add(layout.CssClasses_.IS_ACTIVE);\n }", "function selectTab() {\n var href = tab.href.split('#')[1];\n var panel = layout.content_.querySelector('#' + href);\n layout.resetTabState_(tabs);\n layout.resetPanelState_(panels);\n tab.classList.add(layout.CssClasses_.IS_ACTIVE);\n panel.classList.add(layout.CssClasses_.IS_ACTIVE);\n }", "function updateTabs() {\n getCurrentWindowTabs().then((tabs) => {\n tabCountInWindowTitle(tabs);\n for (let tab of tabs) {\n var tabIdtoString = tab.id.toString();\n\n if (tab.favIconUrl !=undefined){\n var favIconUrltoString = tab.favIconUrl.toString(); \n //console.log(favIconUrltoString + \" favIconUrltoString\") \n }else{\n var favIconUrltoString = \"logos/clearfavicon.png\";\n //console.log(favIconUrltoString + \" favIconUrltoString\") \n }\n tab.title = \"&\" + tab.title;\n if(tab.active){tab.title =tab.title + \" ~#~\"; console.log(\"tab active \" + tab.id);}\n\n browser.menus.update(tabIdtoString,{\n \"icons\": {\n \"16\": favIconUrltoString\n },\n title: tab.title\n });\n }\n });\n}", "async function update_in_tab(tab)\n {\n if (bookmarks.is_locked() ||\n (do_limit_to_private_context && !tab.incognito) ||\n tab.url.startsWith(\"about:\") ||\n (await bookmarks.contains_url(tab.url)))\n {\n browser.pageAction.hide(tab.id);\n delete host_tab_ids[tab.id];\n }\n else\n {\n browser.pageAction.show(tab.id);\n host_tab_ids[tab.id] = true;\n }\n }", "function tabClicked(tab) {\n $('#'+currentList).removeClass('defaulttab'); // Remove the defaulttab class from the currentlist\n currentList = $(tab).attr('id'); // Set the currentlist to the new list\n $('#'+currentList).addClass('defaulttab'); // Add the defaulttab class to the new (current) list\n redrawTodosUI(); // Redraw the ToDos, as the list has changed\n }", "function refreshCurrentTab()\n{\n jsobj.swap_tabs(XPCNativeWrapper.unwrap($(\"tabs\")).down(\".tabon\").getAttribute(\"val\"));\n}", "function onClickHandler(info, tab) {\n\tchrome.tabs.sendMessage(tab.id, 'remove-selected-loading-mask');\n}", "function cp_tab_control() {\n\tvar tabs = [];\n\tvar tabContainers = [];\n\tjQuery('ul.tabnavig a').each(function() {\n\t\tif ( window.location.pathname.match(this.pathname) ) {\n\t\t\ttabs.push(this);\n\t\t\ttabContainers.push( jQuery(this.hash).get(0) );\n\t\t}\n\t});\n\n\t//hide all contrainers except execpt for the one from the URL hash or the first container\n\tif ( window.location.hash !== \"\" && window.location.hash.search('block') >= 0 ) {\n\t\tjQuery(tabContainers).hide().filter(window.location.hash).show();\n\t\t//detecting <a> tab using its \"href\" which should always equal the hash\n\t\tjQuery(tabs).filter( function(index) {\n\t\t\treturn ( jQuery(this).attr('href') === window.location.hash );\n\t\t}).addClass('selected');\n\t\tjQuery('html').scrollTop( jQuery(window.location.hash).parent().position().top );\n\t} else {\n\t\tjQuery(tabContainers).hide().filter(':first').show();\n\t\tjQuery(tabs).filter(':first').addClass('selected');\n\t}\n\n\tjQuery(tabs).click(function() {\n\t\t// hide all tabs\n\t\tjQuery(tabContainers).hide().filter(this.hash).fadeIn(100);\n\t\tjQuery(tabs).removeClass('selected');\n\t\tjQuery(this).addClass('selected');\n\t\treturn false;\n\t});\n}", "function updateActiveTab() {\n console.log(\"updateActiveTab ---------------\")\n /* \n function isSupportedProtocol(urlString) {\n var supportedProtocols = [\"https:\", \"http:\", \"ftp:\", \"file:\"];\n var url = document.createElement('a');\n url.href = urlString;\n return supportedProtocols.indexOf(url.protocol) != -1;\n }\n */\n function updateTab(tabs) {\n console.log(\"updateTabs\", tabs)\n if (tabs[0]) {\n currentTab = tabs[0];\n \n browser.bookmarks.getTree().then(bookmarkItems => {\n let bookmarks = [] \n const filter = (node) => { \n if(node.url){ \n helper.isSameBookmarkUrl(currentTab.url, node.url) && bookmarks.push(node)\n } else {\n node.children.forEach(x => filter(x) )\n }\n }\n bookmarkItems.forEach( x=> filter(x) )\n updateBadge(currentTab, bookmarks);\n })\n }\n }\n \n var gettingActiveTab = browser.tabs.query({active: true, currentWindow: true});\n gettingActiveTab.then(updateTab);\n}", "function tabs(evt, tabName) {\n var i, tabcontent, tablinks;\n tabcontent = document.getElementsByClassName(\"tabcontent\");\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n }\n tablinks = document.getElementsByClassName(\"tablinks\");\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].className = tablinks[i].className.replace(\" active\", \"\");\n }\n document.getElementById(tabName).style.display = \"block\";\n evt.currentTarget.className += \" active\";\n document.getElementById(\"defaultOpen\").click();\n}", "function tab_gold_select(i)\n {\n\t document.getElementById(\"tab_1\").className=\" \"; \n\t document.getElementById(\"tab_2\").className=\" \";\n\t document.getElementById(\"tab_\"+i).className=\"cm-act\";\n\t if (document.getElementById(\"div_gold0\"+i)==null)\n\t {\n\t\t return;\n\t }\n\t if (document.getElementById(\"div_gold01\")!=null){\n\t\t document.getElementById(\"div_gold01\").style.display=\"none\";\n\t }\n\t if (document.getElementById(\"div_gold02\")!=null){\n\t\t document.getElementById(\"div_gold02\").style.display=\"none\";\n\t }\n\n\n\t if (document.getElementById(\"div_gold0\"+i)!=null){\n\t\t document.getElementById(\"div_gold0\"+i).style.display=\"\";\n\t }\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 initTabs() {\n $('label').click(function (e) {\n e.preventDefault();\n var forEl = $(this).attr('for');\n $('#' + forEl).trigger('click');\n $('.example__content[data-tab=' + forEl + ']').addClass('is-active').siblings().removeClass('is-active');\n });\n }", "function selectTab() {\n var href = tab.href.split('#')[1];\n var panel = layout._content.querySelector('#' + href);\n layout._resetTabState(tabs);\n layout._resetPanelState(panels);\n addClass(tab, layout._CssClasses.IS_ACTIVE);\n addClass(panel, layout._CssClasses.IS_ACTIVE);\n }", "function fTabSwitchSetInfo(iToTab) {\n // called at initialization and every tab switch\n fLog(\"fTabSwitchSetInfo: \" + iToTab);\n var bTab1 = iToTab <= 0; // tab 1 or initializing\n var bTab2 = iToTab == 1;\n var bTab3 = iToTab == 2;\n\n if (bTab2 || bTab3) {\n var bAnythingSelected = fSetClientSegment(iToTab == 1); // hide/shows all forms called for, including RBCx site\n\n fQkDisplay(oTab2NoneSelected, !bAnythingSelected); // 'Please go back to tab one and select one or more services...\n fQkDisplay(oTab2OnToNext, bTab2 && bAnythingSelected);\n fHide(oTab2Processing);\n fQkDisplay(oTab2Requestor, bTab3 && bAnythingSelected);\n fQkDisplay(oTab2Overview, bTab3 && bAnythingSelected);\n\n if (bAnythingSelected) {\n // one or more forms active\n fCopyGlobalsT1T3();\n }\n\n // other business logic for tabs 2 or 3\n }\n\n if (bTab3) {\n // want to set the 'one' or 'multiple' emails button\n fBuildEMailRouting();\n var iEmails = countEmailsToSend();\n fLog(\"emails to send=\" + iEmails);\n if (iEmails == 0) {\n // Special CEPAS and it's the only form\n oTab3btnSubmit.caption.value.text = msgSendEmail; // msgDisplayEMNotice;\n } else if (iEmails == 1) {\n oTab3btnSubmit.caption.value.text = msgSendEmail;\n } else {\n oTab3btnSubmit.caption.value.text =\n msgSendEmailS1 + iEmails + msgSendEmailS2;\n }\n fFormMakeReadOnly(oTab2Forms);\n } else {\n fFormMakeReadWrite(oTab2Forms);\n }\n}", "function onTabClick(event) {\n let activeTabs = document.querySelectorAll(\".active\");\n\n for (let i = 0; i < activeTabs.length; i++) {\n activeTabs[i].className = activeTabs[i].className.replace(\"active\", \"\");\n }\n\n event.target.parentElement.className += \" active\";\n console.log(\n (document.getElementById(event.target.href.split(\"#\")[1]).className +=\n \" active\")\n );\n}", "function onUpdatedListener(tabId, changeInfo, tab) {\n tabs[tab.id] = tab.incognito;\n}", "function updateActiveTab () {\n function isSupportedProtocol (urlString) {\n const supportedProtocols = ['https:', 'http:', 'ftp:', 'file:']\n const url = document.createElement('a')\n\n url.href = urlString\n\n return supportedProtocols.indexOf(url.protocol) !== -1\n }\n\n function updateTab (tabs) {\n if (tabs[0]) {\n currentTab = tabs[0]\n if (isSupportedProtocol(currentTab.url)) {\n const searching = browser.bookmarks.search({url: currentTab.url})\n\n searching.then((bookmarks) => {\n currentBookmark = bookmarks[0]\n updateIcon()\n })\n } else {\n console.log(`Bookmark it! does not support the '${currentTab.url}' URL.`)\n }\n }\n }\n\n const gettingActiveTab = browser.tabs\n .query({active: true, currentWindow: true})\n\n gettingActiveTab.then(updateTab)\n}", "function tabFn(){\n let tabs = document.querySelectorAll('.tabBox ul li');\n for(let i=0;i<tabs.length;i++){\n \n tabs[i].onclick=function(){\n clearClass(tabs);\n tabs[i].classList.add('current');\n //getData(i);\n renderGoods2(i);\n //goodsList[i].classList.remove(\"hide\");\n }\n }\n}", "function update_tabs() {\n $('.user-subscriptions-tab-pane').each(() => {\n let $tab_pane = $(this);\n let count = $tab_pane.find('.user-subscriptions-list > li').length;\n\n $('.user-subscriptions-tab__badge-' + $tab_pane.data('block-name')).attr('data-count', count);\n $tab_pane.attr('data-count', count);\n });\n }", "function change_tab(clicked_tab){\n\n if (clicked_tab.id === \"tab_1\"){\n currentPage = \"EPG\";\n showEPG();\n } else if (clicked_tab.id === \"tab_2\"){\n // it's the settings tab -> we need to show the user the current resolution\n showResolution();\n }\n else\n {\n currentPage = \"Not EPG page\";\n }\n\n //close all open_tabs and open_panels\n var open_tabs = document.getElementsByClassName('open_tab');\n for(var i = 0; i < open_tabs.length; i++){\n open_tabs[i].className = '';\n }\n\n var open_panels = document.getElementsByClassName('open_panel');\n for(var i = 0; i < open_panels.length; i++){\n open_panels[i].className = 'closed_panel';\n }\n\n //open tab and panel\n document.getElementById(clicked_tab.id).className = 'open_tab';\n var clicked_tab_nr = clicked_tab.id.charAt(clicked_tab.id.length - 1);\n var panel_id_string = \"panel_\" + clicked_tab_nr;\n document.getElementById(panel_id_string).className = \"open_panel\";\n}", "function setTab(i) {\n\t\t\t//vm.activeTab = i;\n\t\t}", "function openTab(evt, pN){\r\n var i, tC, tL;\r\n tC = document.getElementsByClassName(\"tabcontent\");\r\n for (i = 0; i < tC.length; i++) {\r\n tC[i].style.display = \"none\";\r\n }\r\n tL = document.getElementsByClassName(\"tablinks\");\r\n for (i = 0; i < tL.length; i++) {\r\n tL[i].className = tL[i].className.replace(\" active\", \"\");\r\n }\r\n document.getElementById(pN).style.display = \"block\";\r\n evt.currentTarget.className += \" active\";\r\n}", "function contactTabs(evt, onglet) {\n var i, tabcontent, tablinks;\n tabcontent = document.getElementsByClassName(\"tabcontent\");\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n }\n tablinks = document.getElementsByClassName(\"tablinks\");\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].className = tablinks[i].className.replace(\" active\", \"\");\n }\n document.getElementById(onglet).style.display = \"flex\";\n evt.currentTarget.className += \" active\";\n}", "function initRetainNum(){\n\t\n\tif($(\".selection-tab-hdr\").length > 0){\n\t\t\n\t\tvar theTab = $(\".selection-tab-hdr.panel-tab-hdr\").find(\".panel-tab\");\n\t\t\n\t\ttheTab.click(function(){\n\t\t\t\n\t\t\tvar theIndex = theTab.index(this);\n\t\t\t\n\t\t\tshowNumSelection(theIndex);\n\t\t});\n\t\t\n\t\tshowNumSelection(0);\n\t};\n\t\n}", "function ChangeTabs(evt, backSymbol) {\n var i, tabcontent, tablinks;\n tabcontent = document.getElementsByClassName(\"tabcontent\");\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n }\n tablinks = document.getElementsByClassName(\"tablinks\");\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].className = tablinks[i].className.replace(\" active\", \"\");\n }\n document.getElementById(backSymbol).style.display = \"block\";\n evt.currentTarget.className += \" active\";\n}", "function refreshActiveTabs (BN, is_deleted) {\r\n browser.tabs.query({active: true})\r\n .then(\r\n\tfunction (a_tabs) {\r\n\t let len = a_tabs.length;\r\n\t let tab, tabUrl, tabFaviconUrl, is_refreshFav, is_nofavicon, foundBN;\r\n\t for (let i=0 ; i<len ; i++) {\r\n\t\ttab = a_tabs[i];\r\n\t\ttabUrl = tab.url;\r\n\t\tif ((tabUrl != undefined)\r\n\t\t\t&& (!tabUrl.startsWith(\"view-source:\"))\r\n\t\t ) {\r\n\t\t // Handle specific wyciwyg:// case\r\n\t\t if (tabUrl.startsWith(\"wyciwyg://\")) { // Cached URL wyciwyg://x/.... Cf. https://en.wikipedia.org/wiki/WYCIWYG\r\n\t\t\t// Find start of real URL, which is after the first \"/\" after \"wyciwyg://x\"\r\n\t\t\tlet pos = tabUrl.indexOf(\"/\", 10) + 1;\r\n\t\t\ttabUrl = tabUrl.substring(pos);\r\n\t\t }\r\n\t\t tabFaviconUrl = tab.favIconUrl;\r\n\t\t is_refreshFav = !options.disableFavicons\t\t // Ignore if options.disableFavicons is set\r\n/*\t\t\t\t\t\t && !options.pauseFavicons\t // Ignore if options.pauseFavicons is set */\r\n\t\t\t\t\t\t && (!is_deleted || options.trashEnabled) // Ignore if really deleting bookmarks\r\n\t\t\t\t\t\t && (tabFaviconUrl != undefined) // Need a favicon URI\r\n\t\t\t\t\t\t ;\r\n\t\t is_nofavicon = is_notCollectableFaviconFromTab(tabFaviconUrl, tabUrl);\r\n\t\t foundBN = refreshBTNTreeFavicon(BN, tabFaviconUrl, tabUrl, is_refreshFav, is_nofavicon);\r\n\t\t if (foundBN != undefined) {\r\n\t\t\tif (!is_deleted) {\r\n\t\t\t baFoundBN_id[tab.windowId] = foundBN.id;\r\n\t\t\t browser.browserAction.setIcon(\r\n\t\t\t\t{path: \"icons/star2bkmked.png\",\r\n\t\t\t\t tabId: tab.id\r\n\t\t\t\t}\r\n\t\t\t );\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t baFoundBN_id[tab.windowId] = undefined;\r\n\t\t\t browser.browserAction.setIcon(\r\n\t\t\t\t{tabId: tab.id\r\n\t\t\t\t}\r\n\t\t\t );\r\n\t\t\t}\r\n\t\t } // Else do not touch BSP2 icon for that tab\r\n\t\t}\r\n\t }\r\n\t}\r\n );\r\n}", "function currentTabs(tabs) {\n var loc = tbr.localSession_;\n consoleDebugLog('Latest local tabs:\\n' + tabsToString(tabs));\n // Accept the new set of tabs\n loc.tabs = tabs;\n // Proceed with updated tabs in place.\n contFunc();\n }", "function currentTab(){\r\n\tif (byId(\"tUnassigned\").style.display == \"block\") return 1;\r\n\telse return 2;\r\n}", "function activaTab(tab){\n $('.nav-tabs-chart-selector a[href=\"#' + tab + '\"]').tab('show');\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 changeTab(e) {\n setTab(e.target.id);\n}", "function updateBadgeNumber(tabId, count) {\n var ctx = document.createElement('canvas').getContext('2d'),\n image = new Image(32, 32),\n hasAds = count !== -1,\n title = hasAds ? (count + ' sponsored ad' + (count > 1 ? 's' : '') + ' hidden.') : 'No ads.'\n\n image.onload = function() {\n ctx.drawImage(image, 0, 0, 32, 32)\n browser.browserAction.setTitle({tabId: tabId, title: title});\n browser.browserAction.setIcon({tabId: tabId, imageData: ctx.getImageData(0,0,32,32), path: 'images/icon32.png'})\n browser.browserAction.setBadgeText({tabId: tabId, text: hasAds ? count.toString() : ''})\n browser.browserAction.setBadgeBackgroundColor({tabId: tabId, color: '#3D5A98' })\n }\n\n image.src = browser.runtime.getURL('images/icon32.png')\n}", "function goBackToTabs(){\n $(\"#scroll-tab-news-details\").removeClass(\"is-active\");\n $(\"#\"+activeTab).addClass(\"is-active\");\n onNewsPost = \"no\";\n scrolTop();\n}", "function tabSwitch( $tab ) {\n\n var id, content, tab;\n\n // if $tab was not set, get the tab from the query string\n if (typeof($tab) === 'undefined') {\n tab = getQ('tab').length ? getQ('tab') : null;\n if (!tab) return;\n $tab = $('#' + tab);\n }\n\n // get id and content location from the chosen tab\n id = $tab.attr('id');\n content = $tab.data('optcontent');\n\n // hide all tab content areas, show current one\n $('.opt-content').hide();\n $(content).show();\n\n // set the active tab head\n $('.opt-tab').removeClass('nav-tab-active');\n $tab.addClass('nav-tab-active').blur();\n\n if (history.pushState) {\n var stateObject = {dummy: true};;\n var url = window.location.protocol\n + \"//\"\n + window.location.host\n + window.location.pathname\n + '?page=integrity-checker_options&tab=' + id;\n\n history.pushState(stateObject, $(document).find('title').text(), url);\n }\n }", "function changeTab(pageName, tabElement){\n var tabcontent;\n var tablinks;\n\n tabcontent = document.getElementsByClassName(\"tabcontent\");\n tabcontent2 = document.getElementsByClassName(\"tabcontent\").value;\n\n for (var i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n\n }\n\n tablinks = document.getElementsByClassName(\"tablink\");\n\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].style.backgroundColor = \"\";\n\n }\n tabElement.style.backgroundColor = \"AntiqueWhite\";\n document.getElementById(pageName).style.display = \"block\";\n\n\n\n}", "function triigletabcontent() {\n $(\".tab-c\").each(function() {\n $(this).removeClass(\"active\");\n });\n }", "function updateTabIcon(tab, options) {\n let icon;\n let badge;\n let badgeColor = '#555';\n\n try {\n if (options) {\n icon = options.icon;\n badge = options.badge;\n } else {\n var blocked;\n var disabled;\n\n var tabInfo = adguard.frames.getFrameInfo(tab);\n if (tabInfo.adguardDetected) {\n disabled = tabInfo.documentWhiteListed;\n blocked = '';\n } else {\n disabled = tabInfo.applicationFilteringDisabled;\n disabled = disabled || tabInfo.urlFilteringDisabled;\n disabled = disabled || tabInfo.documentWhiteListed;\n\n if (!disabled && adguard.settings.showPageStatistic()) {\n blocked = tabInfo.totalBlockedTab.toString();\n } else {\n blocked = '0';\n }\n }\n\n if (disabled) {\n icon = adguard.prefs.ICONS.ICON_GRAY;\n } else if (tabInfo.adguardDetected) {\n icon = adguard.prefs.ICONS.ICON_BLUE;\n } else {\n icon = adguard.prefs.ICONS.ICON_GREEN;\n }\n\n badge = adguard.utils.workaround.getBlockedCountText(blocked);\n\n // If there's an active notification, indicate it on the badge\n var notification = adguard.notifications.getCurrentNotification();\n if (notification && !tabInfo.adguardDetected) {\n badge = notification.badgeText;\n badgeColor = notification.badgeBgColor;\n }\n }\n\n adguard.browserAction.setBrowserAction(tab, icon, badge, badgeColor, browserActionTitle);\n } catch (ex) {\n adguard.console.error('Error while updating icon for tab {0}: {1}', tab.tabId, new Error(ex));\n }\n }", "function switchGoal(view, tab) {\n var i, tabcontent, tablinks;\n tabcontent = document.getElementsByClassName(\"tabcontent\");\n for (i = 0; i < 4; i++) {\n tabcontent[i].style.display = \"none\";\n }\n tablinks = document.getElementsByClassName(\"tablinks\");\n for (i = 0; i < 4; i++) {\n tablinks[i].className = tablinks[i].className.replace(\" active\", \"\");\n }\n document.getElementById(tab).style.display = \"block\";\n view.currentTarget.className += \" active\";\n}", "function triggletab() {\n $(\".tab\").each(function() {\n $(this).removeClass(\"active\");\n });\n }", "function changeTab(tab) {\n $('#tabGroup').find(\"a[class='active']\").removeClass('active');\n switch (tab) {\n case \"editAccount\":\n $('#editAccountTab').addClass(\"active\");\n break;\n case \"viewAccount\":\n $('#viewAccountTab').addClass(\"active\");\n break;\n case \"viewPurchaseHistory\":\n $('#viewPurchaseHistoryTab').addClass(\"active\");\n break;\n case \"viewCard\":\n $('#viewCardTab').addClass(\"active\");\n break;\n case \"registerCard\":\n $('#registerCardTab').addClass(\"active\");\n break;\n case \"viewAddress\":\n $('#viewAddressTab').addClass(\"active\");\n break;\n case \"registerAddress\":\n $('#registerAddressTab').addClass(\"active\");\n break;\n\n }\n}", "function lemurlog_OnTabSelected_15(event)\n{\n if(lemurlog_g_enable === false)\n {\n return;\n }\n var url = window.content.location.href; \n if(lemurlog_IsRecordableURL(url))\n {\n var time = new Date().getTime();\n url=lemurlogtoolbar_washAndRinse(url, true);\n\tvar id = event.selectedTab.linkedBrowser.parentNode.id;\n lemurlog_DoWriteLogFile(lemurlog_LOG_FILE, \"SelTab\\t\" + time + \"\\t\" + id + \"\\t\" + url + \"\\n\");\n }\n}", "function changeAtiveTab(event,activeClasses,normalClasses){\n event.preventDefault();\n // prepare classes for querySelectorAll and classList.remove/add\n normalClasses = normalClasses.split(\" \").filter(item => item !== \" \" && item !== \"\");\n activeClasses = activeClasses.split(\" \").filter(item => item !== \" \" && item !== \"\");\n let queryActiveClasses = activeClasses.map(item => \".\" + item);\n // get the anchor element with the data-toggle=\"tab\" that has been clicked\n let element = event.currentTarget;\n let elementID = event.currentTarget.getAttribute(\"href\");\n // get it's counterpart tab element\n let tabElement = document.querySelector(elementID);\n // get the unordered list parent (grand-parent actualy)\n let ulElement = element.parentNode.parentNode;\n // get the current active element\n let activeElement = ulElement.querySelector(\"li > a\" + queryActiveClasses);\n let activeElementID = activeElement.getAttribute(\"href\");\n // get the current active tab element\n let activeTabElement = document.querySelector(activeElementID);\n\n normalClasses.forEach((item) => {\n activeElement.classList.add(item);\n element.classList.remove(item);\n });\n activeClasses.forEach((item) => {\n activeElement.classList.remove(item);\n element.classList.add(item);\n });\n\n activeTabElement.classList.add(\"hidden\");\n activeTabElement.classList.remove(\"block\");\n tabElement.classList.remove(\"hidden\");\n tabElement.classList.add(\"block\");\n}", "function activeTab(index) {\n tabContent.forEach((section )=>{\n section.classList.remove('ativo');\n })\n tabContent[index].classList.add('ativo');\n }", "function opentab(num){\n\n\tvar wincur = currentWindow.id;\n\tvar wintab = found[num].windowId;\n\n\tif(wintab != wincur) {\n\n \t// switch tabs in these windows\t \n chrome.extension.getBackgroundPage().switchWindows(wintab,wincur,all,found[num].id);\n \n\n\t}\n\telse {\n\t chrome.tabs.update(Number(found[num].id), {selected: true});\n\t}\n\t\n\tif(localStorage['closechange'] !== undefined && localStorage['closechange'] == 1){\n\t window.close();\n\t}\n}", "function opentab(evt, usertype) {\n var i, tabcontent, tablinks;\n tabcontent = document.getElementsByClassName(\"tabcontent\");\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n }\n tablinks = document.getElementsByClassName(\"tablinks\");\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].className = tablinks[i].className.replace(\" active\", \"\");\n }\n document.getElementById(usertype).style.display = \"block\";\n evt.currentTarget.className += \" active\";\n }", "function lemurlog_OnTabSelected_20(event)\n{\n if(lemurlog_g_enable === false)\n {\n return;\n }\n\n var browser = gBrowser.selectedTab;\n if(!browser)\n {\n return;\n }\n var url = window.content.location.href; \n if(lemurlog_IsRecordableURL(url))\n {\n var time = new Date().getTime();\n\tvar id = browser.linkedBrowser.parentNode.id;\n url=lemurlogtoolbar_washAndRinse(url, true);\n lemurlog_DoWriteLogFile(lemurlog_LOG_FILE, \"SelTab\\t\" + time + \"\\t\" + id + \"\\t\" + url + \"\\n\");\n }\n}", "function switchPrefsTab(tab) {\n\t\t// hide all\n\t\tdocument.getElementById('info').className='tab_hidden';\n\t\tdocument.getElementById('messages').className='tab_hidden';\n\t\tdocument.getElementById('signature').className='tab_hidden';\n\t\tdocument.getElementById('trash').className='tab_hidden';\n\t\tdocument.getElementById('skin').className='tab_hidden';\n\t\tdocument.getElementById('filters').className='tab_hidden';\n\t\t\n\t\tdocument.getElementById('tab_info').className='tab_info_hidden';\n\t\tdocument.getElementById('tab_messages').className='tab_info_hidden';\n\t\tdocument.getElementById('tab_signature').className='tab_info_hidden';\n\t\tdocument.getElementById('tab_trash').className='tab_info_hidden';\n\t\tdocument.getElementById('tab_skin').className='tab_info_hidden';\n\t\tdocument.getElementById('tab_filters').className='tab_info_hidden';\n\t\t\n\t\t// show needed\n\t\tdocument.getElementById('tab_'+tab).className='tab_info_visible';\n\t\tdocument.getElementById(tab).className='tab_visible';\n\t}", "function onTabUpdated() {\n info(\"event: Chrome says that tab was updated\");\n\n // Restrict to non-single-post Google+ pages\n if (!isEnabledOnThisPage())\n return;\n\n // If list mode, make sure the correct last opened entry is unfolded, now\n // that we know that window.location.href is correct\n if (displayMode == 'list')\n unfoldLastOpenInListMode();\n\n // If switching between Streams to Games, we need to inject the content pane buttons.\n // At this time, one of the content panes will be hidden -- we need to pick out the correct\n // subtree\n var $contentPaneDiv = $(_ID_CONTENT_PANE + ' > :not([style*=\"none\"])');\n updateContentPaneButtons($contentPaneDiv);\n}", "function onTick () {\n Object.keys(tabStore).forEach(id => {\n id = parseInt(id, 10); // feels like good old rhino\n let tab = tabStore[id];\n tab.current++;\n if (tab.current >= tab.time) {\n tab.current = 0;\n chrome.tabs.get(id, realTab => {\n if (realTab) {\n tab.reloaded++;\n chrome.tabs.reload(id, { bypassCache: NOCACHE }, () => {\n updateBadge(id); // this will be wiped out at reload end, heck\n });\n } else {\n deregister(id);\n }\n });\n }\n });\n}", "function cb_tabOnUpdated(id, info, tab) {\n\n //Checks if loading is complete\n if (tab.status !== \"complete\"){\n console.log(\"Not loaded\");\n return;\n }\n else\n {\n console.log(\"Loaded\");\n }\n \n if (tab.url.toLowerCase().indexOf(\"facebook.com\") === -1){\n console.log(\"Not Facebook\");\n return;\n }\n\n if(!tempBool){ \n chrome.pageAction.setIcon({tabId: tab.id, path: 'images/icongrey.png'});\n }\n\n if(tempBool){ \n chrome.pageAction.setIcon({tabId: tab.id, path: 'images/icon.png'});\n }\n\n if (tab.url.toLowerCase().indexOf(\"facebook.com/buzzfeed\") !== -1){\n chrome.tabs.update(tab.id, {url: \"http://www.facebook.com/\"});\n }\n\n //Show PageAction\n chrome.pageAction.show(tab.id);\n\n if(tempBool){ \n chrome.pageAction.setIcon({tabId: tab.id, path: 'images/icon.png'});\n chrome.storage.sync.get(\"urlList\", function(data){\n urlList = data.urlList;\n if (typeof urlList === 'undefined') {\n urlList = default_urlList;\n }\n });\n chrome.tabs.executeScript(tab.id, {\"file\": \"js/buzzoff.js\"}, function() {\n chrome.tabs.sendMessage(tab.id, JSON.stringify(urlList));\n });\n }\n}", "onChangeTab(i, value, tab, ev){\r\n this.setState({\r\n currentTab: i\r\n });\r\n }", "function onclickForTab(event)\n{\n //to prevent URL from changing and browse history building up\n event.preventDefault();\n \n //-------tab display logic---\n var lastTab = document.querySelector('li.current a');\n \n //NOP if clicking current tab again\n if(lastTab == this)\n {\n return false;\n }\n \n lastTab.parentNode.className = ''; //undisplay\n \n this.parentNode.className = 'current';\n //---------------------------\n \n //-----content div display logic---\n var lastDiv = document.querySelector('div.current');\n lastDiv.className = ''; //undisplay\n \n var matchingDiv = this.getAttribute('data-div-id');\n \n var thisDiv = document.getElementById(matchingDiv);\n \n thisDiv.className = 'current';\n //-----------\n \n //get tab div id from tab link\n var divId = this.getAttribute('data-div-id');\n \n onclickForNamedTab(divId);\n}", "function jscoverage_selectTab(tab) {\n\t$(tab).tab('show');\n}", "function changeTab (pressedTabIndex) {\n\n var tabsArea \n = document.getElementById(TABS_AREA);\n \n var tabs = tabsArea.getElementsByTagName(DIV_TAG);\n\n for (var tabIndex = 0; tabIndex < tabs.length; ++tabIndex) {\n tabs[tabIndex].className = TAB_CLASS;\n }\n\n tabs[pressedTabIndex].className = TAB_CLASS + ' ' + SELECTED_TAB_CLASS;\n}", "function switchTabs(newTabNum, listItems) {\n if (newTabNum !== curTabNum) {\n switchToTab(newTabNum);\n switchHighlight(newTabNum, listItems);\n\n curTabNum = newTabNum;\n }\n\n // Show new tab, hide old tab\n function switchToTab(newTabNum) {\n var curTab = document.querySelector(\".features-tab\" + curTabNum);\n var newTab = document.querySelector(\".features-tab\" + newTabNum);\n\n // disable current tab and enable selected tab\n\n curTab.style.transition = \"opacity 0.5s\";\n curTab.style.opacity = 0;\n curTab.style.zIndex = 1;\n\n newTab.style.transition = \"opacity 0.2s\";\n newTab.style.opacity = 1;\n newTab.style.zIndex = 2;\n }\n\n // Display new highlight and hide old one in the menu list\n function switchHighlight(newTabNum, listItems) {\n if (newTabNum !== curTabNum) {\n // Get current and new HL objects\n var curListItem = listItems[curTabNum-1];\n var curHL = curListItem.children[0];\n var HLWidth = window.getComputedStyle(curHL).width;\n\n var newListItem = listItems[newTabNum-1];\n var newHL = newListItem.children[0];\n\n // Apply transition effect\n curHL.style.width = 0 + \"px\";\n newHL.style.width = HLWidth;\n }\n }\n}", "function tabchange(tab) {\n\tswitch (tab) {\n\t\tcase \"situations\":\n\t\t\tviewstack = new Moobile.ViewControllerStack;\n\t\t\twindowcontroller.setRootViewController(viewstack).getRootViewController().pushViewController(new ViewController.Situations(), new Moobile.ViewTransition.None);\n\t\t\tbreak;\n\t\tcase \"revivification\":\n\t\t\tviewstack = new Moobile.ViewControllerStack;\n\t\t\twindowcontroller.setRootViewController(viewstack).getRootViewController().pushViewController(new ViewController.Revivification(), new Moobile.ViewTransition.None);\n\t\t\tbreak;\n\t\tcase \"emergency\":\n\t\t\tviewstack = new Moobile.ViewControllerStack;\n\t\t\twindowcontroller.setRootViewController(viewstack).getRootViewController().pushViewController(new ViewController.Emergency(), new Moobile.ViewTransition.None);\n\t\t\tbreak;\n\t\tcase \"more\":\n\t\t\tviewstack = new Moobile.ViewControllerStack;\n\t\t\twindowcontroller.setRootViewController(viewstack).getRootViewController().pushViewController(new ViewController.More(), new Moobile.ViewTransition.None);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t}\n\n}", "function incrementTab(tab) {\n if (!overlayCounter.hasOwnProperty(tab.id)) {\n overlayCounter[tab.id] = 0;\n }\n overlayCounter[tab.id] += 1;\n if (overlayCounter[tab.id] === 1) {\n emit(monitor, \"visible\", tab);\n }\n}", "function browserBackButton(ev){\n url = location.hash; //hash will include the \"#\"\n //update the visible div and the active tab\n for(var i=0; i < numPages; i++){\n if((\"#\" + pages[i].id) == url){\n pages[i].style.display = \"block\";\n }else{\n pages[i].style.display = \"none\";\t\n }\n }\n for(var t=0; t < numLinks; t++){\n links[t].className = \"\";\n if(links[t].href == location.href){\n links[t].className = \"activetab\";\n }\n }\n}", "function openInfo(evt, tabName) {\n\n\t// Get all elements with class=\"tabcontent\" and hide them\n\ttabcontent = document.getElementsByClassName(\"tabcontent\");\n\tfor (i = 0; i < tabcontent.length; i++) {\n\t\ttabcontent[i].style.display = \"none\";\n\t}\n\n\t// Get all elements with class=\"tablinks\" and remove the class \"active\"\n\ttablinks = document.getElementsByClassName(\"tablinks\");\n\tfor (i = 0; i < tablinks.length; i++) {\n\t\ttablinks[i].className = tablinks[i].className.replace(\" active\", \"\");\n\t}\n\n\t// Show the current tab, and add an \"active\" class to the button that opened the tab\n\tdocument.getElementById(tabName).style.display = \"block\";\n\tevt.currentTarget.className += \" active\";\n\n}", "function openInfo(evt, tabName) {\n\n\t// Get all elements with class=\"tabcontent\" and hide them\n\ttabcontent = document.getElementsByClassName(\"tabcontent\");\n\tfor (i = 0; i < tabcontent.length; i++) {\n\t\ttabcontent[i].style.display = \"none\";\n\t}\n\n\t// Get all elements with class=\"tablinks\" and remove the class \"active\"\n\ttablinks = document.getElementsByClassName(\"tablinks\");\n\tfor (i = 0; i < tablinks.length; i++) {\n\t\ttablinks[i].className = tablinks[i].className.replace(\" active\", \"\");\n\t}\n\n\t// Show the current tab, and add an \"active\" class to the button that opened the tab\n\tdocument.getElementById(tabName).style.display = \"block\";\n\tevt.currentTarget.className += \" active\";\n\n}", "function onTabShown(event, tabId) {\n // always show spinner on tab change, to avoid stale destinations list flashing\n showSpinner();\n if (tabId === tabControl.TABS.EXPLORE) {\n UserPreferences.setPreference('method', 'explore');\n setFromUserPreferences();\n $(options.selectors.isochroneSliderContainer).removeClass(options.selectors.hiddenClass);\n clickedExplore();\n } else {\n clearIsochrone();\n mapControl.isochroneControl.clearDestinations();\n $(options.selectors.isochroneSliderContainer).addClass(options.selectors.hiddenClass);\n }\n }", "function hideIcon () {\n currentBookmark = undefined\n browser.pageAction.hide(currentTab.id)\n updateIcon(false)\n}", "function checkCurrentTab() {\n\tchrome.tabs.query({\"active\": true, \"currentWindow\": true, \"windowType\": \"normal\"}, tabs => {\n\t\tvar tab = tabs[0];\n\n\t\t// popup/devTools windows ran result in null tab variable\n\t\tif (!tab) { return; }\n\n\t\t// get current URL\n\t\tvar currentURL = tab.url; \n\t\tconsole.log('Updating state from URL: ' + currentURL);\n\t\tchrome.storage.local.set({'url': currentURL});\n\n\t\t// check if URL matches a refugee need\n\t\tvar match = isMatch(currentURL);\n\t\t// update chrome.storage.local.isMatch\n\t\tchrome.storage.local.set({'isMatch': match});\n\t\t// update notification badge\n\t\tchrome.browserAction.setBadgeText({ text: match ? '1' : ''});\n\t});\n}", "function onPageIconClick(tab) {\n chrome.tabs.sendRequest(tab.id, {\n name: \"toggle\"\n }, function(response) {\n if(response.status)\n enablePageIcon(tab);\n else\n disablePageIcon(tab);\n });\n}", "function show_active_tab()\n{\n $(this).children('img').addClass(\"current\");\n event.stopPropagation();\n show_form();\n}", "updateSelectedCount() {\n WindowService.getCurrentWindow()\n .then(win => TabService.getSelectedTabs(win.id))\n .then(tabs => this.setState({ selectedTabs: tabs.length }));\n }", "registeredTabs() {\n this.updateTabs()\n }", "function switchTab(selectedTab) {\r\n\r\n\ttabNames = new Array (\"pageLayoutTab\", \"resultAppearanceTab\", \"imageUploadTab\");\r\n\tfor (i=0; i<3; i++) {\r\n\t\tif (i == selectedTab) {\r\n\t\t\tdocument.getElementById(tabNames[i]).style.display = \"block\";\r\n\t\t} else {\r\n\t\t\tdocument.getElementById(tabNames[i]).style.display = \"none\";\r\n\t\t}\r\n\t}\r\n\r\n\ttop.selectedSubMenuTab = tabNames[selectedTab];\r\n\t\r\n\t// Check if there were changes in the form\r\n\tif (tabNames[selectedTab] == \"imageUploadTab\") {\r\n\t\r\n\t\tsubmitCustomUiForm(\"imageUploadTab\", \"\", true);\r\n\t\r\n\t\tif (mainFormContentChanged == true) {\r\n\t\t\tsubmitCustomUiForm(\"imageUploadTab\", \"savePreview\");\r\n\t\t}\r\n\t}\r\n}", "function onTabPaneClick(e) {\n e.preventDefault();\n var $target = $(this);\n var idx = $target.index();\n var $parent = $target.parent();\n var $tabs = $parent.find('.js-tab-pane');\n var $slider = $( $parent.data('slider') );\n $tabs.removeClass('js-active');\n $target.addClass('js-active');\n $slider.slick('slickGoTo', idx);\n }", "function openContent1(tab,value){\n\tvar tabcontent = document.getElementsByClassName(\"tab-content\");\n \tfor (i = 0; i < tabcontent.length; i++) {\n \ttabcontent[i].style.display = \"none\";\n \t}\n\n \tvar tablinks = document.getElementsByClassName(\"tabLinks\");\n \tfor (i = 0; i < tablinks.length; i++) {\n \ttablinks[i].className = tablinks[i].className.replace(\" active1\", \"\");\n \t}\n\n \t document.getElementById(value).style.display = \"block\";\n \t $(\"#\"+tab).addClass(\"active1\");\n\n}", "onSubredditTabClick(eventObject) {\n let tabElementClickedByUser = eventObject.target;\n /* Only continue if the user did not click a tab that is already selected. */\n if (!tabElementClickedByUser.classList.contains(\"active\") && tabElementClickedByUser.tagName === \"BUTTON\") {\n let tabContainer = document.getElementById(\"at_tabcontainer\");\n let currentIndexOfNewTab = 0;\n /* Iterate over the tabs to find the currently selected one and remove its selected status */\n for (let i = 0, len = tabContainer.children.length; i < len; i += 1) {\n let tabElement = tabContainer.children[i];\n if (tabElement === tabElementClickedByUser)\n currentIndexOfNewTab = i;\n tabElement.classList.remove(\"active\");\n }\n /* Mark the new tab as selected and start downloading it. */\n tabElementClickedByUser.classList.add(\"active\");\n this.showTab(this.threadCollection[currentIndexOfNewTab]);\n }\n }", "function tabSwitched (activeInfo) {\r\n let tabId = activeInfo.tabId;\r\n let winId = activeInfo.windowId;\r\n/*\r\n trace('-------------------------------------');\r\n trace(\"A tab was switched.\\r\\n\"\r\n\t +\"activeInfo.previousTabId: \"+activeInfo.previousTabId+\"\\r\\n\"\r\n\t +\"activeInfo.tabId: \"+activeInfo.tabId+\"\\r\\n\"\r\n\t +\"activeInfo.windowId: \"+winId+\"\\r\\n\"\r\n\t );\r\n*/\r\n browser.tabs.get(tabId)\r\n .then(\r\n\tfunction (tab) {\r\n\t let tabUrl = tab.url;\r\n\t // Verify this is a searchable url - If not, we get exception:\r\n\t // Type error for parameter query (Value must either: be a string value, or .url must match the format \"url\")\r\n\t if ((tabUrl != undefined)\r\n\t\t && (!tabUrl.startsWith(\"view-source:\"))\r\n\t\t) {\r\n\t\ttry {\r\n\t\t // Handle specific wyciwyg:// case\r\n\t\t if (tabUrl.startsWith(\"wyciwyg://\")) { // Cached URL wyciwyg://x/.... Cf. https://en.wikipedia.org/wiki/WYCIWYG\r\n\t\t\t// Find start of real URL, which is after the first \"/\" after \"wyciwyg://x\"\r\n\t\t\tlet pos = tabUrl.indexOf(\"/\", 10) + 1;\r\n\t\t\ttabUrl = tabUrl.substring(pos);\r\n\t\t }\r\n\t\t // Look for a bookmark matching the url\r\n\t\t // It seems that parameters can make the search API fail and return 0 results sometimes, so strip them out,\r\n\t\t // we will really compare on gotten results.\r\n\t\t let simpleUrl;\r\n\t\t let paramsPos = tabUrl.indexOf(\"?\");\r\n\t\t if (paramsPos >= 0) {\r\n\t\t\tsimpleUrl = tabUrl.slice(0, paramsPos);\r\n\t\t }\r\n\t\t else {\r\n\t\t\tsimpleUrl = tabUrl;\r\n\t\t }\r\n//\t\t browser.bookmarks.search({url: tabUrl})\r\n\t\t browser.bookmarks.search(decodeURI(simpleUrl)) // Search workaround to avoid exceptions on about:, file: ... URLs, cf. https://bugzilla.mozilla.org/show_bug.cgi?id=1352835\r\n\t\t .then(\r\n\t\t\tfunction (a_BTN) { // An array of BookmarkTreeNode\r\n\t\t\t let len = a_BTN.length;\r\n//console.log(\"A tab was switched to 2 - tabUrl: \"+tabUrl);\r\n//console.log(\"Results: \"+len);\r\n\t\t\t if (len > 0) { // This could be a bookmarked tab\r\n\t\t\t\t// If there is a favicon and we are collecting them, refresh all coorresponding BookmarkNodes with it\r\n\t\t\t\tlet tabFaviconUrl = tab.favIconUrl;\r\n\t\t\t\tlet is_refreshFav = !options.disableFavicons\t\t // Ignore if options.disableFavicons is set\r\n/*\t\t\t\t\t\t\t\t\t&& !options.pauseFavicons\t // Ignore if options.pauseFaviconsis set */\r\n\t\t\t\t\t\t\t\t\t&& (tabFaviconUrl != undefined) // Need a favicon URI\r\n\t\t\t\t\t\t\t\t\t&& (tabUrl != \"about:blank\") // Do not refresh about:blank bookmarks\r\n\t\t\t\t\t\t\t\t\t;\r\n\t\t\t\tlet foundBN_id = refreshBTNArrayFavicon(a_BTN, len, tabFaviconUrl, tabUrl, is_refreshFav);\r\n \t\t\t\tbaFoundBN_id[winId] = foundBN_id; // Forget about previous found one\r\n\t\t\t\t// Show a bookmarked BSP2 star for this tab, if we found a corresponding bookmark not in BSP2 trash\r\n\t\t\t\tif (foundBN_id != undefined) {\r\n\t\t\t\t browser.browserAction.setIcon(\r\n\t\t\t\t\t{path: \"icons/star2bkmked.png\",\r\n\t\t\t\t\t tabId: tabId\r\n\t\t\t\t\t}\r\n\t\t\t\t );\r\n\t\t\t\t}\r\n\t\t\t\telse { // Reset to unbookmarked BSP2 icon\r\n\t\t\t\t browser.browserAction.setIcon(\r\n\t\t\t\t\t{tabId: tabId\r\n\t\t\t\t\t}\r\n\t\t\t\t );\r\n\t\t\t\t}\r\n\t\t\t }\r\n\t\t\t else { // Reset to unbookmarked BSP2 icon\r\n\t\t\t\tbaFoundBN_id[winId] = undefined;\r\n\t\t\t\tbrowser.browserAction.setIcon(\r\n\t\t\t\t {tabId: tabId\r\n\t\t\t\t }\r\n\t\t\t\t);\r\n\t\t\t }\r\n\t\t\t}\r\n\t\t );\r\n\t\t} catch (err) {\r\n\t\t // Reset to unbookmarked BSP2 icon\r\n\t\t baFoundBN_id[winId] = undefined;\r\n\t\t browser.browserAction.setIcon(\r\n\t\t\t{tabId: tabId\r\n\t\t\t}\r\n\t\t );\r\n\r\n\t\t let msg = \"Error in searching url \"+tabUrl+\" on tabModified : \"+err;\r\n\t\t console.log(msg);\r\n\t\t if (err != undefined) {\r\n\t\t\tlet fn = err.fileName;\r\n\t\t\tif (fn == undefined) fn = err.filename; // Not constant :-( Some errors have filename, and others have fileName \r\n\t\t\tconsole.log(\"fileName: \"+fn);\r\n\t\t\tconsole.log(\"lineNumber: \"+err.lineNumber);\r\n\t\t }\r\n\t\t}\r\n\t }\r\n\t else { // Reset to unbookmarked BSP2 icon\r\n\t\tbaFoundBN_id[winId] = undefined;\r\n\t\tbrowser.browserAction.setIcon(\r\n\t\t {tabId: tabId\r\n\t\t }\r\n\t\t);\r\n\t }\r\n\t}\r\n );\r\n}", "function updateCurrentActiveIndex() {\n\tchrome.tabs.query({\n\t\thighlighted: true\n\t}, function (tabs) {\n\t\tfor (var index = 0; index < tabs.length; index++) {\n\t\t\tvar tab = tabs[index];\n\t\t\tvar allTabs = user.tabsSortedByWindow[tab.windowId];\n\t\t\tvar previousActiveIndex = user.activeTabIndex[tab.windowId];\n\t\t\tvar timeStamp = getTimeStamp();\n\t\t\tconsole.log(tab)\n\t\t\tif (previousActiveIndex !== tab.index && previousActiveIndex !== null && allTabs[previousActiveIndex]) {\n\t\t\t\tif (user.loggedIn) {\n\t\t\t\t\tdeactivateTimeTab(allTabs[previousActiveIndex].databaseTabID);\n\t\t\t\t}\n\t\t\t\tallTabs[previousActiveIndex].highlighted = false;\n\t\t\t\tallTabs[previousActiveIndex].timeOfDeactivation = timeStamp;\n\t\t\t}\n\t\t\tuser.activeTabIndex[tab.windowId] = tab.index;\n\t\t\tallTabs[tab.index].highlighted = true;\n\t\t}\n\t})\n}", "function refreshCurrentUrl(){\n chrome.tabs.getSelected(null,function(tab) {\n currentUrl = tab.url;\n });\n}", "function changeTabs(){\n $('.cruise-section li a').eq($(this).val()).tab('show');\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 initTabControl() {\r\n var tabs = document.getElementById('tabs');\r\n var i;\r\n var child;\r\n var tabNum = 0;\r\n for (i = 0; i < tabs.childNodes.length; i++) {\r\n child = tabs.childNodes.item(i);\r\n if (child.nodeType === 1) {\r\n if (child.className !== 'disabled') {\r\n child.onclick = tab_click;\r\n }\r\n tabNum++;\r\n }\r\n }\r\n selectTab(0);\r\n}", "function jscoverage_initTabControl() {\n\t$('.tabs a').on('click', function (e) {\n\t\te.preventDefault();\n\t\tjscoverage_tab_click(e);\n\t\t$(this).tab('show');\n\t});\n\n\t// $('.tabs a:not(.disabled):first').trigger('click');\n}", "function triigletabcontent() {\n $(\".tab-c\").each(function() {\n $(this).removeClass(\"active\");\n });\n}", "function showTab(e) {\n console.log(\"inside showTab()\");\n /* element na koji je kliknuto, pa njegov title, moze biti welcome, B, C, CE*/\n /* kliknuti elem moze biti iz navigation ili iz tabs*/\n var selectedTab = e.target.title;\n console.log(selectedTab);\n\n if (selectedTab == \"welcome\") {\n welcomePaneShowing = true;\n console.log(\" welcome tab selected\");\n document.getElementById(\"content\").innerHTML =\n \"<h3>Click a tab to display category desription</h3>\"; /* mixing content with behaviour*/\n } else {\n welcomePaneShowing = false;\n }\n\n// set each tab's CSS class\n var tabs = document.getElementById(\"tabs\").getElementsByTagName(\"a\");\n for (var i=0; i<tabs.length; i++) {\n var currentTab = tabs[i];\n if (currentTab.title == selectedTab) {\n currentTab.className = \"active\";\n } else {\n currentTab.className = \"inactive\";\n }\n }\n\n var request = createRequest();\n if (request==null) {\n alert(\"Unable to create request\");\n return;\n }\n request.onreadystatechange = showCategory;\n request.open(\"GET\", selectedTab + \".html\", true);\n request.send(null);\n}" ]
[ "0.6804875", "0.67060405", "0.662984", "0.6509093", "0.640578", "0.6388963", "0.6351939", "0.6343096", "0.6339086", "0.6297179", "0.6263849", "0.6222256", "0.6215924", "0.62062645", "0.6173672", "0.615899", "0.6154063", "0.613716", "0.61233974", "0.61130035", "0.61130035", "0.6095471", "0.60596526", "0.6053043", "0.60301965", "0.5990216", "0.5984581", "0.597521", "0.5966015", "0.59605783", "0.59494865", "0.5946715", "0.59400475", "0.5936012", "0.5934997", "0.59336895", "0.59320325", "0.59054005", "0.59046847", "0.58940303", "0.58938646", "0.5851801", "0.5835606", "0.583253", "0.5830724", "0.582256", "0.58147883", "0.5814373", "0.5813555", "0.5809223", "0.58083355", "0.58033866", "0.57995933", "0.5799531", "0.57980037", "0.5792921", "0.5792405", "0.578886", "0.5788036", "0.5786866", "0.57812023", "0.5772691", "0.57540065", "0.5750409", "0.57401717", "0.57378185", "0.57337666", "0.5729211", "0.5728041", "0.5725967", "0.5714388", "0.57124126", "0.570656", "0.5695405", "0.5695268", "0.56946063", "0.56941617", "0.5693182", "0.5691992", "0.5691992", "0.56914955", "0.5689868", "0.5687256", "0.5686157", "0.56828904", "0.56783366", "0.56745344", "0.5672007", "0.5658768", "0.565847", "0.56571", "0.56562644", "0.56552607", "0.56546247", "0.565366", "0.56533265", "0.56525826", "0.564247", "0.56381065", "0.56371206" ]
0.66836447
2
[END] Init section ============================================================================== [START] Websocket section =======================================================================
function setWebsocketConnection() { console.log('Opening WS connection to: ' + "ws://" + window.location.host + "/API-ws/"); vm.ws = new WebSocket("ws://" + window.location.host + "/API-ws/"); vm.ws.onmessage = function(e) { receiveWebsocketMessage(e.data); }; vm.ws.onopen = function() { // Request information console.log('Opened WS connection to: ' + "ws://" + window.location.host + "/API-ws/"); //TODO requestGetDetails('content', 'get_details'); }; // Call onopen directly if socket is already open if (vm.ws.readyState == WebSocket.OPEN) {vm.ws.onopen();} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "start() {\n\n /**\n * Initialize the websocket server object\n * @type {TemplatedApp}\n */\n const app = uWS.App().ws('/*', {\n\n // Websocket server options\n compression: uWS.SHARED_COMPRESSOR,\n maxPayloadLength: 16 * 1024 * 1024,\n idleTimeout: 10,\n maxBackpressure: 1024,\n\n /**\n * Event triggered whenever a client connects to the websocket\n * @param ws {WebSocket} The newly connected client\n */\n open: (ws) => {\n\n // send newly connected client initial timestamp\n this.notify(ws, 0)\n },\n\n /**\n * Event triggered whenever the server receives an incoming message from a client\n * @param ws {WebSocket} The client the incoming message is from\n * @param message The incoming message\n * @param isBinary {boolean} Whether the message was sent in binary mode\n */\n message: (ws, message, isBinary) => {\n\n // decode incoming message into an object\n let data = JSON.parse(new Buffer.from(message).toString());\n\n // notify client with event for message with count \"c\"\n this.notify(ws, data.c);\n }\n\n /**\n * Tells the websocket server to start listening for incoming connections\n * on the given port\n */\n }).listen(port, (token) => {\n if (token) {\n console.log('Listening to port ' + port);\n } else {\n console.log('Failed to listen to port ' + port);\n }\n });\n }", "function initWebSocket() {\n\t\t// Create a connection to Server\n\t\tconnect();\n\t}", "function initWebSocket() {\n\t\t// Create a connection to Server\n\t\tconnect();\n\t}", "function initWebSock() {\n\n\n\t// create websocket connection with specified remote IP address\n\t//console.log(\"PilotHostName:\"+PilotHostName);\n\tconsole.log(\"WsUrl = \"+wsurl);\n\twebsocketMain = new WebSocket(wsurl);\n\n\t// for now, does nothing with version, gets CUID and triggers event notifications; available space, partition list\n\twebsocketMain.onopen = function(evt) {\n\t\tdocument.getElementById(\"WebStatus\").innerHTML = \"&nbsp;Connection succeeds.\";\n\t\t$(\"#WebStatus\").effect(\"pulsate\",{times:3},3000);\n\t\tsendVersionNeg(evt);\n\t};\n\n\t// determine what the websocket server has sent us\n\twebsocketMain.onmessage = function(evt) { parseIncomingMessage(evt); };\n\n\t// determine error code sent by websocket server\n\twebsocketMain.onerror = function(evt) { parseError(evt); };\n\n\t// perform any cleanup on socket close\n\twebsocketMain.onclose = function(evt) { sendClientShutdown(evt); };\n\n}", "function initWebsocket() {\n connection.onopen = () => {\n };\n\n connection.onclose = () => {\n getServerUrl().then(result => {\n connection = new WebSocket(result);\n });\n };\n\n connection.onerror = (error) => {\n throw 'Error'\n };\n\n connection.onmessage = (event) => {\n\n var obj = JSON.parse(event.data);\n\n switch(obj.type) {\n case 'MSG_RECV':\n handleChatMessage(obj);\n break;\n case 'MAP_RECV':\n myMap.handleMarker(obj);\n break;\n case 'MAP_DEL':\n myMap.deleteMarker(obj);\n break;\n default:\n throw 'Type not found';\n }\n };\n}", "initWS() {\n this.ws = new WebSocket(this.wsUrl, 'game');\n }", "_webSocketConnect(data) {\n var authUrl = data.wsUrl + '?access_token=' +\n this.settings.wsToken;\n var connection = null;\n // Open a websocket connection for streaming audio\n try {\n // Set up WAMP connection to router\n connection = new autobahn.Connection({\n url: authUrl,\n realm: 'default'\n });\n } catch (e) {\n console.log('WebSocket creation error: ' + e);\n return;\n }\n var self = this;\n connection.onerror = function(e) {\n console.log('WebSocket error: ' + e);\n self.fireEvent('websocketError', [e]);\n };\n connection.onopen = function(session) {\n console.log('WebSocket connection opened');\n self._session = session;\n var _call = self._session.call;\n self._session.call = function(url) {\n console.debug('Calling RPC: ' + url);\n return _call.apply(this, arguments);\n };\n self.fireEvent('websocketOpened');\n };\n connection.onclose = function(e) {\n console.log('WebSocket disconnected');\n self._session = null;\n self.fireEvent('websocketClosed');\n };\n connection.open();\n }", "connect(url) {\n if ( ! url ) {\n url = window.location.href; // http://localhost:8080/console.html\n this.log(\"This href \"+url);\n let start = url.indexOf('/');\n let protocol = url.substring(0,start);\n let webSocketProtocol = 'ws';\n if ( protocol == 'https:' ) {\n webSocketProtocol = 'wss';\n }\n let end = url.indexOf('/', start+2);\n url = webSocketProtocol+':'+url.substring(start,end)+'/vrspace/client'; // ws://localhost:8080/vrspace\n }\n this.log(\"Connecting to \"+url);\n this.ws = new WebSocket(url);\n this.ws.onopen = () => {\n this.connectionListeners.forEach((listener)=>listener(true));\n /*\n this.pingTimerId = setInterval(() => {\n this.sendCommand(\"Ping\");\n }, 20000);\n */\n }\n this.ws.onclose = () => {\n this.connectionListeners.forEach((listener)=>listener(false));\n //clearInterval(this.pingTimerId);\n }\n this.ws.onmessage = (data) => {\n this.receive(data.data);\n this.dataListeners.forEach((listener)=>listener(data.data)); \n }\n this.log(\"Connected!\")\n }", "function setupWebSocket() {\n\tconsole.log('------------------------------------------ Websocket Up ------------------------------------------');\n\twss = new ws.Server({ server: server });\t\t\t\t\t\t// start the websocket now\n\twss.on('connection', function connection(ws) {\n\n\t\t// -- Process all websocket messages -- //\n\t\tws.on('message', function incoming(message) {\n\t\t\tconsole.log(' ');\n\t\t\tconsole.log('-------------------------------- Incoming WS Msg --------------------------------');\n\t\t\tlogger.debug('[ws] received ws msg:', message);\n\t\t\tvar data = null;\n\t\t\ttry {\n\t\t\t\tdata = JSON.parse(message);\t\t\t\t\t\t\t// it better be json\n\t\t\t} catch (e) {\n\t\t\t\tlogger.debug('[ws] message error', message, e.stack);\n\t\t\t}\n\n\t\t\t// --- [5] Process the ws message --- //\n\t\t\tif (data && data.type == 'setup') {\t\t\t\t\t\t// its a setup request, enter the setup code\n\t\t\t\tlogger.debug('[ws] setup message', data);\n\t\t\t\tstartup_lib.setup_ws_steps(data);\t\t\t\t\t// <-- open startup_lib.js to view the rest of the start up code\n\n\t\t\t} else if (data) {\t\t\t\t\t\t\t\t\t\t// its a normal marble request, pass it to the lib for processing\n\t\t\t\tws_server.process_msg(ws, data);\t\t\t\t\t// <-- the interesting \"blockchainy\" code is this way (websocket_server_side.js)\n\t\t\t}\n\t\t});\n\n\t\t// log web socket errors\n\t\tws.on('error', function (e) { logger.debug('[ws] error', e); });\n\n\t\t// log web socket connection disconnects (typically client closed browser)\n\t\tws.on('close', function () { logger.debug('[ws] closed'); });\n\n\t\t// whenever someone connects, tell them our app's state\n\t\tws.send(JSON.stringify(ws_server.build_state_msg()));\t\t\t\t// tell client our app state\n\t});\n\n\t// --- Send a message to all connected clients --- //\n\twss.broadcast = function broadcast(data) {\n\t\tvar i = 0;\n\t\twss.clients.forEach(function each(client) {\t\t\t\t\t\t\t// iter on each connection\n\t\t\ttry {\n\t\t\t\tlogger.debug('[ws] broadcasting to clients. ', (++i), data.msg);\n\t\t\t\tclient.send(JSON.stringify(data));\t\t\t\t\t\t\t// BAM, send the data\n\t\t\t} catch (e) {\n\t\t\t\tlogger.debug('[ws] error broadcast ws', e);\n\t\t\t}\n\t\t});\n\t};\n\n\tws_server.setup(wss, null);\n}", "function initWebSocket() {\n var gateway = `ws://${window.location.hostname}/ws`;\n console.log(gateway)\n websocket = new WebSocket(gateway);\n websocket.onopen = onWebSocketOpen;\n websocket.onclose = onWebSocketClose;\n websocket.onmessage = onWebSocketMessage;\n}", "_wsOnOpen () {\n const { helloCustomDetails, authmethods, authid, authextra, serializer, onError, realm } = this._options;\n const serverProtocol = this._ws.protocol?.split('.')?.[2];\n const hasServerChosenOurPreferredProtocol = serverProtocol === serializer.protocol;\n\n this._log(`Websocket connected. Server has chosen protocol: \"${serverProtocol}\"`);\n\n if (!hasServerChosenOurPreferredProtocol) {\n if (serverProtocol === 'json') {\n this._options.serializer = new JsonSerializer();\n } else {\n const noSerializerAvailableError = new Errors.NoSerializerAvailableError();\n this._fillOpStatusByError(noSerializerAvailableError);\n\n if (this._cache.connectPromise) {\n this._cache.connectPromise.onError(noSerializerAvailableError);\n this._cache.connectPromise = null;\n }\n\n if (onError) {\n onError(noSerializerAvailableError);\n }\n }\n }\n\n if (serializer.isBinary) {\n this._ws.binaryType = 'arraybuffer';\n }\n\n const messageOptions = {\n ...helloCustomDetails,\n ...this._wamp_features,\n ...(authid ? { authid, authmethods, authextra } : {}),\n };\n const encodedMessage = this._encode([WAMP_MSG_SPEC.HELLO, realm, messageOptions]);\n\n if (encodedMessage) {\n // Sending directly 'cause it's a hello message and no sessionId check is needed\n this._ws.send(encodedMessage);\n }\n }", "function setupWebSocket() {\n logger.info('------------------------------------------ Websocket Up ------------------------------------------');\n var wss = new ws.Server({ server: server });\t\t\t\t\t\t\t\t//start the websocket now\n wss.on('connection', function connection(ws) {\n logger.debug('[ws] received ws connect');\n ws.on('message', function incoming(message) {\n console.log(' ');\n console.log('-------------------------------- Incoming WS Msg --------------------------------');\n logger.debug('[ws] received ws msg:', message);\n var data = null;\n try {\n data = JSON.parse(message);\n }\n catch (e) {\n logger.debug('[ws] message error', message, e.stack);\n }\n if (data && data.type == 'setup') {\n logger.debug('[ws] setup message', data);\n\n\n }\n else if (data) {\n logger.debug('[ws] message', data);\n }\n wss.broadcast(build_state_msg())\n\n });\n\n ws.on('error', function (e) { logger.debug('[ws] error', e); });\n ws.on('close', function () { logger.debug('[ws] closed'); });\n ws.send(JSON.stringify(build_state_msg()));\t\t\t\t\t\t\t//tell client our app state\n });\n wss.broadcast = function broadcast(data) {\n var i = 0;\n wss.clients.forEach(function each(client) {\n try {\n logger.debug('[ws] broadcasting to clients. ', (++i), data.msg);\n client.send(JSON.stringify(data));\n }\n catch (e) {\n logger.debug('[ws] error broadcast ws', e);\n }\n });\n };\n\n wss.broadcastMsg = function broadcast(msg,state,payload) {\n var data={\n msg:msg,\n state:state,\n payload:payload\n };\n var i = 0;\n wss.clients.forEach(function each(client) {\n try {\n logger.debug('[ws] broadcasting to clients. ', (++i), data.msg);\n client.send(JSON.stringify(data));\n }\n catch (e) {\n logger.debug('[ws] error broadcast ws', e);\n }\n });\n };\n app.wss=wss;\n\n}", "function startWebsocket() {\n const address = game.settings.get(moduleName,'address');\n \n const url = address.startsWith('wss://') ? address : ('ws://'+address+'/');\n\n ws = new WebSocket(url);\n\n ws.onmessage = function(msg){\n //console.log(msg);\n analyzeWSmessage(msg.data);\n clearInterval(wsInterval);\n wsInterval = setInterval(resetWS, 5000);\n }\n\n ws.onopen = function() {\n messageCount = 0;\n WSconnected = true;\n ui.notifications.info(\"Material Deck \"+game.i18n.localize(\"MaterialDeck.Notifications.Connected\") +\": \"+address);\n wsOpen = true;\n const msg = {\n target: \"server\",\n module: \"MD\"\n }\n ws.send(JSON.stringify(msg));\n const msg2 = {\n target: \"SD\",\n type: \"init\",\n system: game.system.id\n }\n ws.send(JSON.stringify(msg2));\n clearInterval(wsInterval);\n wsInterval = setInterval(resetWS, 5000);\n }\n \n clearInterval(wsInterval);\n wsInterval = setInterval(resetWS, 10000);\n}", "function websocket_setup() {\n // Get the endpoint address from the current page\n var ws_url = 'ws://' + window.document.location.host + '/endpoint';\n ws = new WebSocket(ws_url);\n ws.onopen = function() {\n msg_connect_success();\n on_connect();\n };\n ws.onclose = function() {\n msg_connect_close();\n }\n ws.onmessage = function(msg) {\n callback(msg);\n }\n}", "function initWS() {\n\tws = new WebSocket('wss://' + location.host + '/groupcall');\n\tws.onopen = wsOnOpen;\n\tws.onclose = wsOnClose;\n\tws.onmessage = wsOnMessage;\n}", "createSocket () {\n this.ws = new WebSocket(this.getEndpoint())\n }", "constructor(wss) {\n this.websocketServer = wss;\n }", "function start_websockets() {\n console.log(\"start_websockets\");\n websocket = new WebSocket(\"ws://\" + server_IP + ':' + server_websocket_port);\n websocket.binaryType = \"arraybuffer\"; // We are talking binary\n\n // when we receive a message, execute this function on it\n websocket.onmessage = function(evt) {\n try {\n // Decode the Message\n var msg = Message.decode(evt.data);\n switch (msg.type) {\n case Message.MessageType.SERVER_VERSION:\n console.log(\"Received server version\");\n receive_version(msg.server_version);\n break;\n case Message.MessageType.PRICE:\n console.log(\"Received price message\");\n receive_price(msg.price);\n break;\n case Message.MessageType.FUNDING:\n console.log(\"Received funding\");\n receive_funding(msg.funding);\n break;\n case Message.MessageType.INITIATE:\n console.log(\"Received initiate\");\n receive_initiate(msg.initiate);\n break;\n case Message.MessageType.RETURN_REFUND:\n console.log(\"Received refund signature\");\n receive_refund(msg.return_refund.signature);\n break;\n case Message.MessageType.CHANNEL_OPEN:\n console.log(\"Received channel open\");\n receive_channel_open();\n break;\n case Message.MessageType.PAYMENT_ACK:\n console.log(\"Received payment ack\");\n receive_payment_ack();\n break;\n case Message.MessageType.CLOSE:\n console.log(\"Received close message\");\n receive_close();\n break;\n case Message.MessageType.ERROR:\n console.log(\"Received error message \" + msg.error.code);\n receive_error(msg.error.code);\n break;\n }\n } catch (err) {\n console.log(\"Error: \\n\" + err.stack);\n }\n };\n\n // when we receive an error, execute this function\n websocket.onerror = function(error) {\n console.log(\"Received error \" + error.code);\n //print_object(websocket);\n };\n\n // when we have successfully opened the websocket, execute this\n websocket.onopen = function() {\n console.log(\"Websocket opened\");\n websocket_open = true;\n waiting_to_initiate = true;\n if (open_channel) {\n start_payment_channel();\n }\n };\n\n // when the websocket closes, execute this\n websocket.onclose = function(event) {\n console.log(\"Received close event with code \" + event.code );\n\n // if we closed because the server says there are multiple tabs open\n // notify user\n if (event.code === POLICY_VIOLATION)\n {\n multiple_tabs_open = true;\n set_ui_state(UI_STATES.MULTIPLE_BITMESH_TABS_OPEN);\n }\n // else try to reconnect with exponential backoff\n else\n {\n websocket_open = false;\n var timeout = 1000 * (Math.pow(2, num_connection_retries));\n console.log(\"Websocket closed. Attempting to restart in \" + (timeout / 1000) + \" seconds\");\n console.log(\"=======================================\");\n setTimeout(start_websockets, timeout);\n num_connection_retries++;\n cancel_payments();\n set_channel_state(CHANNEL_STATES.WEBSOCKET_CLOSED);\n }\n };\n}", "function start() {\n\tconst webSocketServer = new WebSocket.Server({ port: 8081 });\n\n\twebSocketServer.on('connection', function connection(ws) {\n\t\tws.on('message', function incoming(message) {\n\t\t\tconsole.log(\"- Received message\", message);\n\n\t\t\tconst clientEvent = JSON.parse(message)\n\n\t\t\thandleClientEvent(ws, clientEvent)\n\t\t});\n\n\t\tws.on('close', function handle() {\n\t\t\tconsole.log(\"CLOSE\")\n\t\t\tdisconnectClient(ws)\n\t\t})\n\t});\n}", "wsConnect() {\n\n\t\tconst socketUrl = 'ws://localhost:8989/ws';\n\t\t// const socketUrl = 'ws://192.168.1.68:8888/ws';\n\t\t// const socketUrl = 'ws://192.168.1.68:8888/ws';\n\n\t\tthis.SPJS.ws = new WebSocket(socketUrl);\n\n\t\tthis.SPJS.ws.onopen = () => this.onSpjsOpen();\n\t\tthis.SPJS.ws.onmessage = evt => this.onSpjsMessage(evt.data);\n\t\tthis.SPJS.ws.onerror = error => this.onSpjsError(error);\n\t\tthis.SPJS.ws.onclose = () => this.onSpjsClose();\n\n\t}", "onConnect() {\n console.log(\"WS Opened\")\n }", "function startWS() {\n let wsocket = new WebSocket(config.item.WS_HOSTPORT, 'echo-protocol');\n wsocket.onmessage = (event) => {\n let json = JSON.parse(event.data);\n page.find('#attendee_numbers').set('text', json.data || 'N/A');\n //console.info('Incoming message: ' + event.data)\n };\n wsocket.onopen = (event) => {\n wsocket.send(JSON.stringify({\n type: 'identifier',\n data: event_data.event_code\n }));\n wsocket.send(JSON.stringify({\n type: 'message',\n toIdentifier: event_data.event_code,\n data: event_data.event_code\n }));\n console.info('Connection opened');\n };\n wsocket.onerror = (event) => {\n console.info('Error: ' + event.data);\n }\n }", "function WebSocketConnection()\n{\nvar self = this;\n\nvar isNodeJs = (typeof window === \"undefined\" ? true : false);\n\nvar lib = null;\nvar SpaceifyError = null;\nvar SpaceifyLogger = null;\n\nif(isNodeJs)\n\t{\n\tlib = \"/var/lib/spaceify/code/\";\n\n\tSpaceifyLogger = require(lib + \"spaceifylogger\");\n\tSpaceifyError = require(lib + \"spaceifyerror\");\n\n\tglobal.fs = require(\"fs\");\n\tglobal.WebSocket = require(\"websocket\").w3cwebsocket;\n\t}\nelse\n\t{\n\tlib = (window.WEBPACK_MAIN_LIBRARY ? window.WEBPACK_MAIN_LIBRARY : window);\n\n\tSpaceifyLogger = lib.SpaceifyLogger;\n\tSpaceifyError = lib.SpaceifyError;\n\t}\n\nvar errorc = new SpaceifyError();\nvar logger = new SpaceifyLogger(\"WebSocketConnection\");\n\nvar url = \"\";\nvar id = null;\nvar port = null;\nvar socket = null;\nvar origin = null;\nvar pipedTo = null;\nvar isOpen = false;\nvar isSecure = false;\nvar remotePort = null;\nvar remoteAddress = null;\nvar eventListener = null;\n\n// For client-side use, in both Node.js and the browser\n\nself.connect = function(opts, callback)\n\t{\n\tid = opts.id || null;\n\tport = opts.port || \"\";\n\tisSecure = opts.isSecure || false;\n\n\tvar caCrt = opts.caCrt || \"\";\n\tvar hostname = opts.hostname || null;\n\tvar protocol = (!isSecure ? \"ws\" : \"wss\");\n\tvar subprotocol = opts.subprotocol || \"json-rpc\";\n\n\ttry\t{\n\t\turl = protocol + \"://\" + hostname + (port ? \":\" + port : \"\") + (id ? \"?id=\" + id : \"\");\n\n\t\tvar cco = (isNodeJs && isSecure ? { tlsOptions: { ca: [fs.readFileSync(caCrt, \"utf8\")] } } : null);\n\n\t\tsocket = new WebSocket(url, \"json-rpc\", null, null, null, cco);\n\n\t\tsocket.binaryType = \"arraybuffer\";\n\n\t\tsocket.onopen = function()\n\t\t\t{\n\t\t\tlogger.log(\"WebSocketConnection::onOpen() \" + url);\n\n\t\t\tisOpen = true;\n\n\t\t\tcallback(null, true);\n\t\t\t};\n\n\t\tsocket.onerror = function(err)\n\t\t\t{\n\t\t\tlogger.error(\"WebSocketConnection::onError() \" + url, true, true, logger.ERROR);\n\n\t\t\tisOpen = false;\n\n\t\t\tcallback(errorc.makeErrorObject(\"wsc\", \"Failed to open WebsocketConnection.\", \"WebSocketConnection::connect\"), null);\n\t\t\t}\n\n\t\tsocket.onclose = function(reasonCode, description)\n\t\t\t{\n\t\t\tonSocketClosed(reasonCode, description, self);\n\t\t\t};\n\n\t\tsocket.onmessage = onMessageEvent;\n\t\t}\n\tcatch(err)\n\t\t{\n\t\tcallback(err, null);\n\t\t}\n\t};\n\n// For server-side Node.js use only\n\nself.setSocket = function(val)\n\t{\n\ttry\t{\n\t\tsocket = val;\n\n\t\tsocket.on(\"message\", onMessage);\n\n\t\tsocket.on(\"close\", function(reasonCode, description)\n\t\t\t{\n\t\t\tonSocketClosed(reasonCode, description, self);\n\t\t\t});\n\n\t\tisOpen = true;\n\t\t}\n\tcatch(err)\n\t\t{\n\t\tlogger.error(err, true, true, logger.ERROR);\n\t\t}\n\t};\n\nself.setId = function(val)\n\t{\n\tid = val;\n\t};\n\nself.setPipedTo = function(targetId)\n\t{\n\tpipedTo = targetId;\n\t};\n\nself.setRemoteAddress = function(val)\n\t{\n\tremoteAddress = val;\n\t};\n\nself.setRemotePort = function(val)\n\t{\n\tremotePort = val;\n\t};\n\nself.setOrigin = function(val)\n\t{\n\torigin = val;\n\t};\n\nself.setIsSecure = function(val)\n\t{\n\tisSecure = val;\n\t}\n\nself.setEventListener = function(listener)\n\t{\n\teventListener = listener;\n\t};\n\nself.getId = function()\n\t{\n\treturn id;\n\t};\n\nself.getRemoteAddress = function()\n\t{\n\treturn remoteAddress;\n\t};\n\nself.getRemotePort = function()\n\t{\n\treturn remotePort;\n\t};\n\nself.getOrigin = function()\n\t{\n\treturn origin;\n\t};\n\nself.getIsSecure = function()\n\t{\n\treturn isSecure;\n\t}\n\nself.getPipedTo = function()\n\t{\n\treturn pipedTo;\n\t}\n\nself.getIsOpen = function()\n\t{\n\treturn isOpen;\n\t}\n\nself.getPort = function()\n\t{\n\treturn port;\n\t}\n\nvar onMessage = function(message)\n\t{\n\ttry\t{\n\t\tif (eventListener)\n\t\t\t{\n\t\t\tif (message.type == \"utf8\")\n\t\t\t\t{\n\t\t\t\t//logger.log(\"WebSocketConnection::onMessage(string): \" + JSON.stringify(message.utf8Data));\n\n\t\t\t\teventListener.onMessage(message.utf8Data, self);\n\t\t\t\t}\n\t\t\tif (message.type == \"binary\")\n\t\t\t\t{\n\t\t\t\t//logger.log(\"WebSocketConnection::onMessage(binary): \" + binaryData.length);\n\n\t\t\t\teventListener.onMessage(message.binaryData, self);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\tcatch(err)\n\t\t{\n\t\tlogger.error(err, true, true, logger.ERROR);\n\t\t}\n\t};\n\nvar onMessageEvent = function(event)\n\t{\n\t//logger.log(\"WebSocketConnection::onMessageEvent() \" + JSON.stringify(event.data));\n\n\ttry\t{\n\t\tif (eventListener)\n\t\t\teventListener.onMessage(event.data, self);\n\t\t}\n\tcatch(err)\n\t\t{\n\t\tlogger.error(err, true, true, logger.ERROR);\n\t\t}\n\t};\n\nvar onSocketClosed = function(reasonCode, description, obj)\n\t{\n\tlogger.log(\"WebSocketConnection::onSocketClosed() \" + url);\n\n\ttry\t{\n\t\tisOpen = false;\n\n\t\tif (eventListener)\n\t\t\teventListener.onDisconnected(obj.getId());\n\t\t}\n\tcatch(err)\n\t\t{\n\t\tlogger.error(err, true, true, logger.ERROR);\n\t\t}\n\t};\n\nself.send = function(message)\n\t{\n\ttry\t{\n\t\tsocket.send(message);\n\t\t}\n\tcatch(err)\n\t\t{\n\t\tlogger.error(err, true, true, logger.ERROR);\n\t\t}\n\t};\n\nself.sendBinary = self.send;\n\nself.close = function()\n\t{\n\ttry\t{\n\t\tsocket.close();\n\t\t}\n\tcatch(err)\n\t\t{\n\t\tlogger.error(err, true, true, logger.ERROR);\n\t\t}\n\t};\n\n}", "function init() {\n //Create and open the socket\n leap = new WebSocket(\"ws://localhost:6437/\");\n\n // On successful connection\n leap.onopen = function (event) {\n $log.info(\"Connected to Leap WebSocket!\");\n };\n\n // On message received\n leap.onmessage = function (event) {\n $rootScope.$broadcast('leapData', $.parseJSON(event.data));\n };\n\n // On socket close\n leap.onclose = function (event) {\n leap = null;\n $log.info(\"WebSocket connection closed\");\n }\n\n //On socket error\n leap.onerror = function (event) {\n alert(\"Received error\");\n };\n }", "function init() {\n // Check if the browser supports websockets\n if (!websocket_check()) {\n msg_unsupported_browser();\n return;\n }\n\n // Setup a websocket connection\n websocket_setup();\n}", "function connectWebsocket() {\n\n //-------------------------------------------\n // Create WebSocket\n //-------------------------------------------\n var socket = new WebSocket(\"ws://127.0.0.1:3337/streamlabs\");\n\n //-------------------------------------------\n // Websocket Event: OnOpen\n //-------------------------------------------\n socket.onopen = function () {\n\n // AnkhBot Authentication Information\n var auth = {\n author: \"EncryptedThoughts\",\n website: \"twitch.tv/encryptedthoughts\",\n api_key: API_Key,\n events: [\n \"EVENT_QUEUE_UPDATE\",\n \"EVENT_QUEUE_STATUS\"\n ]\n };\n\n // Send authentication data to ChatBot ws server\n socket.send(JSON.stringify(auth));\n };\n\n //-------------------------------------------\n // Websocket Event: OnMessage\n //-------------------------------------------\n socket.onmessage = function (message) {\n\n // Parse message\n var socketMessage = JSON.parse(message.data);\n console.log(socketMessage);\n\n //EVENT_QUEUE_DISPLAY\n if (socketMessage.event === \"EVENT_QUEUE_UPDATE\") {\n var queueData = JSON.parse(socketMessage.data);\n var total = Object.keys(queueData).length;\n\n if (total > 0)\n $(\"#current\").html(\"Current: \" + queueData[0].username); \n if (total > 1)\n $(\"#next\").html(\"Next: \" + queueData[1].username);\n \n $(\"#total\").html(\"Total: \" + total); \n }\n\n //EVENT_QUEUE_STATUS\n if (socketMessage.event === \"EVENT_QUEUE_STATUS\") {\n var statusData = JSON.parse(socketMessage.data);\n $(\"#status\").html(\"Queue: \" + statusData.status);\n }\n };\n\n //-------------------------------------------\n // Websocket Event: OnError\n //-------------------------------------------\n socket.onerror = function (error) {\n console.log(\"Error: \" + error);\n };\n\n //-------------------------------------------\n // Websocket Event: OnClose\n //-------------------------------------------\n socket.onclose = function () {\n // Clear socket to avoid multiple ws objects and EventHandlings\n socket = null;\n // Try to reconnect every 5s\n setTimeout(function () { connectWebsocket() }, 5000);\n };\n\n}", "function openWebSocket() {\n websocket = new WebSocket(host);\n\n websocket.onopen = function(evt) {\n //writeToScreen(\"Websocket Connected\");\n websocket.send(\"cam-start\");\n //refreshStream();\n\n };\n\n websocket.onmessage = function(evt) {\n\n\n\n\n var message = JSON.parse(evt.data);\n var data = ab2str(message.data);\n\n console.log(data);\n if (data === \"255\") {\n writeToScreen('<span style = \"color: red;\">Error Incoming Collision Detected!</span>', true);\n } else {\n //writeToScreen('<span style = \"color: blue;\">RECEIVE: ' + data + '</span>');\n }\n\n };\n\n websocket.onerror = function(evt) {\n writeToScreen('<span style=\"color: red;\">ERROR:</span> ' + evt.data);\n };\n\n websocket.onclose = function (p1) {\n websocket.send('cam-stop');\n }\n}", "function openWSConnection(protocol, hostname, port, endpoint) {\n var webSocketURL = null;\n webSocketURL = protocol + \"://\" + hostname + \":\" + port + endpoint;\n console.log(\"openWSConnection::Connecting to: \" + webSocketURL);\n try {\n webSocket = io(webSocketURL);\n console.log('--webSocket--');\n console.dir(webSocket, { depth: null, colors: true });\n\n webSocket.on('new parameters', (parameters) => {\n console.dir(parameters, { depth: null, colors: true });\n let template = document.getElementById('horizontalTemplate').innerHTML;\n if (parameters.orientation !== 0) {\n template = document.getElementById('verticalTemplate').innerHTML;\n }\n else {\n template = document.getElementById('horizontalTemplate').innerHTML;\n }\n renderTemplate(parameters, template);\n });\n\n webSocket.on('connect_failed', (details) => {\n console.log(\"WebSocket CONNECTION FAILED: \" + JSON.stringify(details, null, 4));\n });\n\n webSocket.on('error', (details) => {\n console.log(\"WebSocket ERROR: \" + JSON.stringify(details, null, 4));\n });\n\n webSocket.onopen = function (openEvent) {\n console.log(\"WebSocket OPEN: \" + JSON.stringify(openEvent, null, 4));\n document.getElementById(\"btnSend\").disabled = false;\n document.getElementById(\"btnConnect\").disabled = true;\n document.getElementById(\"btnDisconnect\").disabled = false;\n };\n webSocket.onclose = function (closeEvent) {\n console.log(\"WebSocket CLOSE: \" + JSON.stringify(closeEvent, null, 4));\n document.getElementById(\"btnSend\").disabled = true;\n document.getElementById(\"btnConnect\").disabled = false;\n document.getElementById(\"btnDisconnect\").disabled = true;\n };\n webSocket.onerror = function (errorEvent) {\n console.log(\"WebSocket ERROR: \" + JSON.stringify(errorEvent, null, 4));\n };\n webSocket.onmessage = function (messageEvent) {\n var wsMsg = messageEvent.data;\n console.log(\"WebSocket MESSAGE: \" + wsMsg);\n if (wsMsg.indexOf(\"error\") > 0) {\n document.getElementById(\"incomingMsgOutput\").value += \"error: \" + wsMsg.error + \"\\r\\n\";\n } else {\n document.getElementById(\"incomingMsgOutput\").value += \"message: \" + wsMsg + \"\\r\\n\";\n }\n };\n } catch (exception) {\n console.error(exception);\n webSocket.close();\n }\n}", "function startWebsocketClient() {\n const socketProtocol = (window.location.protocol === 'https:' ? 'wss:' : 'ws:')\n const serverSocketUrl = socketProtocol + \"//\" + window.location.hostname + \":\" + window.location.port + window.location.pathname\n const socket = new WebSocket(serverSocketUrl);\n\n socket.onopen = e => {\n console.log(`connection to ${serverSocketUrl} established.`);\n }\n\n socket.onmessage = (e) => {\n runtimeInfo = JSON.parse(e.data);\n\n updateContainerInfo(runtimeInfo);\n };\n}", "constructor() {\n // call the socket init with the url of my test environment aka local host (WS server)\n socket.init('ws://localhost:3001'); \n //sending and echoing a message\n socket.registerOpenHandler(() => {\n let message = new ChatMessage({ message: 'pow!' });\n socket.sendMessage(message.serialize());\n });\n socket.registerMessageHandler((data) => {\n console.log(data);\n });\n }", "connect() {\n this.ws = new WebSocket(WS_URI, { headers: this.player.headers, rejectUnauthorized: false })\n\n this.ws.on('open', this.handleOpen.bind(this))\n this.ws.on('message', this.handleMessage.bind(this))\n this.ws.on('error', this.handleError.bind(this))\n this.ws.on('close', this.handleClose.bind(this))\n }", "function init() {\n const PORT = process.env.WEBSOCKET_PORT || 3300;\n const wss = new WebSocket.Server({ port: PORT });\n \n wss.on('connection', async (ws, request) => {\n let userID = cookie.parse(request.headers.cookie).user;\n let room = await dbManager.findRoomByUserID(userID);\n if (sockets[room._id] == undefined)\n sockets[room._id] = [];\n sockets[room._id][userID] = ws;\n send(room); //send info to everyone else\n \n ws.on('message', async message => {\n room = await dbManager.findRoomByUserID(userID);\n if (room == null || userID == null || (room.connected > 1 && userID != room.uIDs[0] && userID != room.uIDs[1])) {\n ws.send(\"REDIRECT\");\n return;\n }\n \n let playerNumber = userID == room.uIDs[0] ? 0 : 1;\n \n if (message == null || isNaN(message) || message < 0 || message > 8) {\n ws.send(\"Invalid value\");\n return;\n }\n let position = parseInt(message);\n \n if (playerNumber == room.turn && room.board[position] == null && room.winner == null) {\n room = await dbManager.updateRoom(room._id, playerNumber, position);\n }\n send(room);\n });\n });\n}", "function connectWebsocket() {\n\n //-------------------------------------------\n // Create WebSocket\n //-------------------------------------------\n var socket = new WebSocket(\"ws://127.0.0.1:3337/streamlabs\");\n\n //-------------------------------------------\n // Websocket Event: OnOpen\n //-------------------------------------------\n socket.onopen = function() {\n\n // AnkhBot Authentication Information\n var auth = {\n author: \"SirPhilthyOwl\",\n website: \"twitch.tv/SirPhilthyOwl\",\n api_key: API_Key,\n events: [\n \"EVENT_USERNAME\"\n ]\n };\n\n // Send authentication data to ChatBot ws server\n socket.send(JSON.stringify(auth));\n };\n\n //-------------------------------------------\n // Websocket Event: OnMessage\n //-------------------------------------------\n socket.onmessage = function (message) {\n\n // Parse message\n var socketMessage = JSON.parse(message.data);\n console.log(socketMessage);\n\n // EVENT_USERNAME\n if (socketMessage.event == \"EVENT_USERNAME\") {\n var eventData = JSON.parse(socketMessage.data);\n var outroVar\n Intro(eventData);\n }\n if (eventData.mode == \"NoUsers\") {\n outroVar = setTimeout(outroTransition, 3000);\n }\n else if (eventData.mode == \"Start\") {\n Start(eventData);\n }\n else if (eventData.mode == \"End\") {\n End(eventData);\n }\n else if (eventData.mode == \"Win\") {\n Win(eventData);\n }\n else if (eventData.mode == \"Leaderboard\") {\n Leaderboard(eventData, outroVar);\n }\n }\n\n function Intro(eventData) {\n $(\"#alert\").queue(function() {\n $(this).removeClass(settings.OutTransition + \"Out initialHide\");\n $(\"#alert\").addClass(settings.InTransition + \"In\");\n if (eventData.mode == \"None\") {\n $(\"#encrypt\").html(\"Password Mini-game\");\n }\n $(\"#guess1\").html(eventData.Guess1)\n $(\"#guess2\").html(eventData.Guess2)\n $(\"#guess3\").html(eventData.Guess3)\n $(\"#guess4\").html(eventData.Guess4)\n $(\"#guess5\").html(eventData.Guess5)\n document.getElementById('encrypt').style.color = settings.TextColor\n $(\"#logo\").attr(\"src\", \"LockWhite.png\");\n $(this).dequeue();\n });\n }\n\n function Start(eventData) {\n $(\"#alert\").queue(function() {\n $(\"#encrypt\").stringChange(eventData.Encrypt, \"encrypt\");\n changeGuess(eventData);\n $(this).dequeue();\n });\n }\n\n function End(eventData) {\n $(\"#alert\").queue(function() {\n changeGuess(eventData);\n $(\"#encrypt\").stringChange(\"The lock won't budge, better luck next time!\", \"encrypt\")\n outroVar = setTimeout(outroTransition, 2000);\n $(this).dequeue();\n });\n }\n\n function Win(eventData) {\n $(\"#alert\").queue(function() {\n changeGuess(eventData);\n $(\"#logo\").changePicture(\"LockOpenWhite.png\");\n $(\"#encrypt\").stringChange(\"The password has been cracked!\", \"encrypt\");\n outroVar = setTimeout(outroTransition, 2000);\n $(this).dequeue();\n });\n }\n\n function Leaderboard(eventData, outroVar) {\n $(\"#alert\").queue(function() {\n if (outroVar != null) {\n clearTimeout(outroVar);\n $(\"#encrypt\").fadeOut(function() {\n $(\"#encrypt\").text(\"Leaderboard:\");\n }).fadeIn();\n }\n if ($('#logo').attr('src') == \"LockOpenWhite.png\") {\n $(\"#encrypt\").fadeOut(function() {\n $(\"#encrypt\").text(\"Leaderboard:\");\n }).fadeIn();\n }\n $(\"#encrypt\").html(\"Leaderboard:\");\n changeGuess(eventData);\n outroVar = setTimeout(outroTransition, 9000);\n $(this).dequeue();\n });\n }\n\n function changeGuess(eventData) {\n var obj = {\n \"guess1\": eventData.Guess1,\n \"guess2\": eventData.Guess2,\n \"guess3\": eventData.Guess3,\n \"guess4\": eventData.Guess4,\n \"guess5\": eventData.Guess5\n };\n $.each(obj, function(key, value) {\n $(\"#\" + key).fadeOut(function() {\n $(\"#\" + key).text(value.String);\n }).fadeIn();\n if (value.Color == \"Positional\") {\n document.getElementById(key).style.color = settings.PositionalColor;\n } else {\n document.getElementById(key).style.color = settings.GuessColor;\n }\n });\n }\n\n $.fn.stringChange = function(text, div) {\n document.getElementById(div).style.color = settings.TextColor;\n $(this).fadeOut(function() {\n $(this).text(text);\n }).fadeIn();\n }\n\n $.fn.changePicture = function(picture) {\n $(this).fadeOut(function() {\n $(this).attr(\"src\", picture);\n }).fadeIn();\n }\n\n function outroTransition() {\n var tempVal\n $(\"#guess5\").fadeOut();\n $(\"#guess4\").fadeOut();\n $(\"#guess3\").fadeOut();\n $(\"#guess2\").fadeOut();\n $(\"#guess1\").fadeOut();\n if ($(\"#encrypt\").text() != \"Password Mini-game\") {\n $(\"#encrypt\").stringChange(\"Password Mini-game\", \"encrypt\");\n }\n setTimeout(function() {\n $(\"#alert\").addClass(settings.OutTransition + \"Out\");\n $(\"#alert\").removeClass(settings.InTransition + \"In\");\n },1000);\n }\n\n function stopOutro(outroVar) {\n if (outroVar != False) {\n clearInterval(outroVar);\n }\n }\n\n //-------------------------------------------\n // Websocket Event: OnError\n //-------------------------------------------\n socket.onerror = function(error) {\n console.log(\"Error: \" + error);\n }\n\n //-------------------------------------------\n // Websocket Event: OnClose\n //-------------------------------------------\n socket.onclose = function() {\n // Clear socket to avoid multiple ws objects and EventHandlings\n socket = null;\n // Try to reconnect every 5s\n setTimeout(function(){connectWebsocket()}, 5000);\n }\n\n}", "createSocket() {\n // Create the socket\n this.socket = new WebSocket('ws://localhost:7777');\n\n extendWebSocket(this.socket);\n\n // Listen for connect events and\n // print them to the terminal\n this.socket.onopen = function() {\n this.top.onConnectionWithServer();\n }.bind(this);\n\n // Listen for a variety of messages\n // and define the callbacks for each\n this.socket.register(\n 'presets', (message) => this.handlePresetsMessage(message));\n this.socket.register(\n 'serialPorts', (message) => this.handleSerialPortsMessage(message));\n this.socket.register(\n 'channelDataString',\n (message) => this.handleChannelDataStringMessage(message));\n this.socket.register(\n 'impedanceDataString',\n (message) => this.handleImpedanceDataStringMessage(message));\n this.socket.register(\n 'recordingStarted',\n (message) => this.handleRecordingStartedMessage(message));\n this.socket.register(\n 'recordingStopped',\n (message) => this.handleRecordingStoppedMessage(message));\n this.socket.register(\n 'presetSaved', (message) => this.handlePresetSavedMessage(message));\n this.socket.register(\n 'unableToConnectToChannelDataSocket',\n (message) =>\n this.handleUnableToConnectToChannelDataSocketMessage(message));\n this.socket.register(\n 'channelDataSocketConnected',\n (message) => this.handleChannelDataSocketConnectedMessage(message));\n this.socket.register(\n 'channelDataSocketClosed',\n (message) => this.handleChannelDataSocketClosedMessage(message));\n this.socket.register(\n 'channelDataSocketError',\n (message) => this.handleChannelDataSocketErrorMessage(message));\n this.socket.register(\n 'version', (message) => this.handleVersionMessage(message));\n this.socket.register(\n 'recordingAlreadyExists',\n (message) => this.handleRecordingAlreadyExistsMessage(message));\n this.socket.register(\n 'recordingError',\n (message) => this.handleRecordingErrorMessage(message));\n this.socket.register(\n 'bioampVersion',\n (message) => this.handleBioampVersionMessage(message));\n this.socket.register(\n 'alwaysOnArtifactUpdate',\n (message) => this.handleAlwaysOnArtifactUpdateMessage(message));\n }", "function initWebSocket(webSocketPort)\r\n{\r\n\t//On recupere l'ip du serveur\r\n\tvar ip = location.host;\r\n\tip = ip.split(\":\");\r\n\tip = ip[0];\r\n\t//alert(ip);\r\n\t//Connexion a la websocket\r\n\tvar webSocketAddress = \"ws://\"+ip+\":\"+webSocketPort+\"/\"\r\n\tdoConnect(webSocketAddress);\r\n}", "function init(gameId) {\n var loc = window.location, new_uri;\n if (loc.protocol === \"https:\") {\n new_uri = \"wss:\";\n } else {\n new_uri = \"ws:\";\n }\n new_uri += \"//\" + loc.host;\n new_uri += loc.pathname + gameId;\n ws = new WebSocket(new_uri);\n //ws = new WebSocket(\"ws://echo.websocket.org\");\n ws.addEventListener(\"open\", function () {\n console.log(\"socket opended\");\n pingId = setInterval(ping, pingInterval);\n });\n\n ws.addEventListener(\"message\", handleMessage);\n\n ws.addEventListener(\"close\", function () {\n console.log(\"socket closed\");\n clearInterval(pingId);\n view.init();\n });\n\n ws.addEventListener(\"error\", function () {\n console.err(\"socket error\")\n });\n\n\n }", "function initWebsockets() {\n device.classList.add('hasInited');\n window.addEventListener(\"deviceorientation\", debounceDeviceOrientationEvent);\n }", "function init() {\n // Create and open the socket\n ws = new WebSocket(\"ws://localhost:6437/v6.json\");\n\n // On successful connection\n ws.onopen = function (event) {\n var enableMessage = JSON.stringify({ enableGestures: true });\n ws.send(enableMessage); // Enable gestures\n ws.send(JSON.stringify({ focused: true })); // Claim focus\n\n window.addEventListener('focus', focusListener);\n window.addEventListener('blur', blurListener);\n\n document.getElementById(\"connectionStatus\").classList.remove(\"badge-danger\");\n document.getElementById(\"connectionStatus\").classList.add(\"badge-success\");\n document.getElementById(\"connectionStatus\").innerText = \"Connected\";\n };\n\n // On message received\n ws.onmessage = function (event) {\n if (recording) {\n var obj = JSON.parse(event.data);\n if (obj.id) {\n recordingData.push(obj);\n }\n }\n };\n\n // On socket close\n ws.onclose = function (event) {\n ws = null;\n window.removeEventListener(\"focus\", focusListener);\n window.removeEventListener(\"blur\", blurListener);\n document.getElementById(\"connectionStatus\").classList.remove(\"badge-success\");\n document.getElementById(\"connectionStatus\").classList.add(\"badge-danger\");\n document.getElementById(\"connectionStatus\").innerText = \"Disconnected\";\n }\n\n // On socket error\n ws.onerror = function (event) {\n console.log(\"Socket error.\");\n };\n}", "connectedCallback() {\n this.initSensorWebSocket();\n }", "function WebSocketStart() {\n var port = 8181; // default - should get reset via value of hidden 'web_sock_port' input element\n var str_port = document.getElementById(\"web_sock_port\").value;\n console.log(\"got raw port value \" + port);\n if (!isNaN(str_port))\n port = parseInt(str_port);\n console.log(\"got web socket port \", port);\n\n console.log(location.hostname);\n var socket = new WebSocket(\"ws://\" + location.hostname + \":\" + port + \"/websock\");\n console.log('connected');\n socket.onopen = function () {\n console.log('in onopen');\n return true;\n };\n\n // The only event we really handle thus far is receive connection status.\n // In response we set the leds correspodingly\n socket.onmessage = function (event) {\n console.log('in onmessage');\n var result = JSON.parse(event.data);\n console.log('event data parsed: ', result);\n\n updatesSinceChange++;\n \n // We switch the Arduino connection led either when what has been clicked is in\n // sync with what is reported from the extension plugin or if we have waited for\n // more than 3 status reports and still nothing has changed (which might get caused\n // by a problem SFB has to connect, for instance)\n if (sfbSetStatus == result.isRunning || updatesSinceChange > 3) {\n SetLed(\"onLed\", result.isRunning);\n sfbSetStatus = result.isRunning;\n updatesSinceChange = 0;\n }\n // The telemetry connection led we just set based on the status from the plugin\n SetLed(\"connLed\", result.isActivated);\n };\n\n socket.onerror = function () {\n window.alert('Error');\n return false;\n };\n\n socket.onclose = function () {\n window.alert('Disconnected');\n return false;\n };\n}", "startAugmentaWebsocket() {\n\t\t\n\t\t//Create the WebSocket object\n\t\t//this.#_websocketurl = websocketurl;\n\t\tthis.#_socket = new WebSocket(this.#_websocketurl);\n\n\t\t//Websocket connection opened\n\t\tthis.#_socket.onopen = () => {\n\t\t\tif (this.#_websocketOpened != undefined) {\n\t\t\t\tthis.#_websocketOpened();\n\t\t\t}\n\t\t\t\n\t\t\tclearInterval(this.#_timerId);\n\n\t\t\tthis.#_socket.onclose = () => {\n\t\t\t\tthis.#_websocketClosed();\n\t\t\t\tthis.#_timerId = setInterval(() => {\n\t\t\t\t\tconsole.log(\"trying to connect to \" + this.#_websocketurl);\n\t\t\t\t\tthis.startAugmentaWebsocket();\n\t\t\t\t}, 10000);\n\t\t\t};\n\t\t}\n\n\t\t//Message received\n\t\tthis.#_socket.onmessage = (message) => {\t\n\t\t\t\n\t\t\t//Three types of message : scene, fusion and object\n\n\t\t\tif (message.data.charAt(3) == 's') {\n\n\t\t\t\tif(this.#_augmentaScene !== undefined) {\n\t\t\t\t\tthis.#_augmentaScene.updateAugmentaScene(message);\n\t\t\t\t} else {\n\t\t\t\t\tthis.#_augmentaScene = new AugmentaScene();\n\t\t\t\t\tthis.#_augmentaScene.updateAugmentaScene(message);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//Remove inactive objects in case willLeave message wasn't received\n\t\t\t\tthis.checkAlive();\n\n\t\t\t}\n\n\t\t\tif (message.data.charAt(3) == 'f') {\n\n\t\t\t\tif(this.#_fusion !== undefined) {\n\t\t\t\t\tthis.#_fusion.updateFusion(message);\n\t\t\t\t\tthis.#_fusionUpdated(this.#_fusion);\n\t\t\t\t} else {\n\t\t\t\t\tthis.#_fusion = new Fusion();\n\t\t\t\t\tthis.#_fusion.updateFusion(message);\n\t\t\t\t\tthis.#_fusionUpdated(this.#_fusion);\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif (message.data.charAt(3) == 'o') {\n\n\t\t\t\tlet msg = JSON.parse(message.data);\t\n\n\t\t\t\tif(message.data.charAt(15) == 'e') { //enter\n\n\t\t\t\t\tlet id = msg.object.enter.id;\n\n\t\t\t\t\tthis.#_augmentaObjects[id] = new AugmentaObject();\n\t\t\t\t\tthis.#_augmentaObjects[id].initializeAugmentaObject(message);\n\t\t\t\t\tthis.#_objectEntered(this.#_augmentaObjects[id]);\n\t\t\t\t\tthis.#_augmentaObjects[id].lastSeen = this.#_augmentaScene.frame;\n\t\t\t\t\n\t\t\t\t} else if(message.data.charAt(15) == 'u') { //update\n\n\t\t\t\t\tlet id = msg.object.update.id;\n\n\t\t\t\t\tif(this.#_augmentaObjects[id] !== undefined) {\n\t\t\t\t\t\tthis.#_augmentaObjects[id].updateAugmentaObject(message);\n\t\t\t\t\t\tthis.#_objectUpdated(this.#_augmentaObjects[id]);\n\t\t\t\t\t\tthis.#_augmentaObjects[id].lastSeen = this.#_augmentaScene.frame;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.#_augmentaObjects[id] = new AugmentaObject();\n\t\t\t\t\t\tthis.#_augmentaObjects[id].updateAugmentaObject(message);\n\t\t\t\t\t\tthis.#_objectEntered(this.#_augmentaObjects[id]);\n\t\t\t\t\t\tthis.#_augmentaObjects[id].lastSeen = this.#_augmentaScene.frame;\n\t\t\t\t\t}\n\n\t\t\t\t} else if(message.data.charAt(15) == 'l') { //leave\n\t\t\t\t\t\n\t\t\t\t\tlet id = msg.object.leave.id;\n\n\t\t\t\t\tif(this.#_augmentaObjects[id] !== undefined) {\n\t\t\t\t\t\tthis.#_objectWillLeave(this.#_augmentaObjects[id]);\n\t\t\t\t\t\tdelete this.#_augmentaObjects[id];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\n\t}", "function createWebSocket() {\n var old = gSocket;\n if (old !== null && old.readyState === WebSocket.OPEN) return;\n \n useWebSocket(new WebSocket(\"ws://\" + window.location.host + \"/ws/\"));\n}", "function init () {\n\t\n\t\tvar host = \"ws://localhost\"; //ws://localhost:8787/\n\t\t\n\t\ttry {\n\t\t\t// Firefox accept only MozWebSocket\n\t\t\tsocket = (\"MozWebSocket\" in window ? new MozWebSocket (host) : new WebSocket(host));\n\t\t\t//socket = (\"WebScoket\" in window) ? new WebSocket(host) :\n\t\t\tlog ('WebSocket - status ' + socket.readyState);\n\t\t\t\n\t\t\tsocket.onopen = function (msg) {\n\t\t\t\tlog (\"Welcome - status \" + this.readyState);\n\t\t\t}\n\t\t\t\n\t\t\tsocket.onmessage = function (msg) {\n\t\t\t\tlog (\"Received: \" + msg.data);\n\t\t\t}\n\n\t\t\tsocket.onclose = function (msg) {\n\t\t\t\tlog (\"Disconnected - status \" + this.readyState); \n\t\t\t}\n\t\t}\n\t\tcatch (ex) {\n\t\t\tlog (ex);\n\t\t}\n\t\t$(\"#msg\").focus ();\n\t}", "function establish_websocket(port) {\n if (\"WebSocket\" in window) {\n ws = new WebSocket(\"ws://\" + document.domain + \":\" + port.toString() + \"/updated\");\n\n ws.onstart = function () {\n console.log('onstart I guess...' + ws);\n ws.send('started');\n };\n ws.onmessage = function (msg) {\n load_data();\n };\n\n ws.onclose = function (msg) {\n $(\"#updated\").html('SERVER DISCONNECTEDDDDD');\n $(\"#updated\").css('backgroundColor', '#FFCCFF');\n $(\"#updated\").fadeIn('fast');\n };\n //load the initial data\n console.log('loading default stuff...');\n load_data();\n } else {\n alert(\"WEBSOCKETTT NOT SUPPORTEED\");\n }\n}", "setupWebSocket() {\n\n let self = this;\n let filterImsi = self._nconf.get(\"udpRelayService:filterImsi\");\n self.socket.on('connect', function () {\n console.log(\"Connected to NB-IoT relay service\");\n });\n self.socket.on('message', function (data) {\n data.msgStr = new Buffer(data.data, 'base64').toString(\"ascii\");\n data.msgJSON = safelyParseJSON(data.msgStr) || {};\n\n // if set in the config.jsom the messages are filtered bei an imsi\n if (filterImsi === '' || filterImsi === data.imsi) {\n log.L2(dl, '########################');\n log.L2(dl, 'Received from: ' + data.imsi);\n log.L2(dl, \"Reveiced at: \" + data.timestamp);\n log.L2(dl, \"Direction: \" + data.direction);\n log.L2(dl, \"Message_raw: \" + data.msgStr);\n log.L2(dl, \"Message_json: \" + JSON.stringify(data.msgJSON, null, 4));\n log.L2(dl, '########################\\n\\n\\n');\n\n self.emit('jsonData', data);\n }\n });\n\n self.socket.on('disconnect', function () {\n log.L1(dl,\"Disconnected from NB-IoT relay service\");\n });\n\n self.socket.on('error', (error) => {\n log.Err(dl, error);\n });\n\n }", "function init(){\n wss.on('connection', onConnection);\n}", "function websocketPing(){\n websocketSendEvent(\"message\",\"hello world!\");\n //console.log('Message sent');\n}", "startApp () {\n this.ws = new window.WebSocket('ws://vhost3.lnu.se:20080/socket/')\n document.getElementById(`close${this.count}`).addEventListener('click', this.closeChat.bind(this), { once: true })\n document.getElementById(`minimize${this.count}`).addEventListener('click', this.minimizeChat.bind(this))\n document.getElementById(`userMessage${this.count}`).addEventListener('keydown', this.sendMessage.bind(this))\n document.getElementById(`userMessage${this.count}`).addEventListener('input', this.emojiChecker.bind(this))\n document.getElementById(`channel${this.count}`).addEventListener('keydown', this.createChannel.bind(this))\n document.getElementById(`channels${this.count}`).addEventListener('click', this.changeChannel.bind(this))\n document.getElementById(`channels${this.count}`).addEventListener('dblclick', this.removeChannel.bind(this))\n document.getElementById(`nickName${this.count}`).addEventListener('keydown', this.updateUsername.bind(this))\n this.ws.addEventListener('message', this.listenMessage.bind(this))\n document.getElementById(`userMessage${this.count}`).focus()\n document.getElementById(`userMessage${this.count}`).disabled = true\n document.getElementById(`channel${this.count}`).disabled = true\n\n const sessionStorage = JSON.parse(window.sessionStorage.getItem('data'))\n if (sessionStorage === null) {\n document.getElementById(`defaultChannel${this.count}`).click()\n document.getElementById(`receivedMessages${this.count}`).innerHTML += `<p class=\"receivedMessages\">You will need to enter a username before you can continue</p>`\n document.getElementById(`receivedMessages${this.count}`).innerHTML += `<p class=\"receivedMessages\">The Matrix ${this.getTime()}</p>`\n document.getElementById(`nickName${this.count}`).focus()\n } else {\n this.userName = String(sessionStorage[0])\n document.getElementById(`nickName${this.count}`).value = String(this.userName)\n this.savedMessages = sessionStorage[1]\n this.channels = sessionStorage[2]\n this.channels.forEach(element => { this.addChannel(element) })\n document.getElementById(`userMessage${this.count}`).disabled = false\n document.getElementById(`channel${this.count}`).disabled = false\n document.getElementById(`defaultChannel${this.count}`).click()\n }\n }", "function MinimaWebSocketListener(){\n\tMinima.log(\"Starting WebSocket Listener @ \"+Minima.wshost);\n\t\n\t//Check connected\n\tif(MINIMA_WEBSOCKET !== null){\n\t\tMINIMA_WEBSOCKET.close();\n\t}\n\t\n\t//Open up a websocket to the main MINIMA proxy..\n\tMINIMA_WEBSOCKET = new WebSocket(Minima.wshost);\n\t\n\tMINIMA_WEBSOCKET.onopen = function() {\n\t\t//Connected\n\t\tMinima.log(\"Minima WS Listener Connection opened..\");\t\n\t\t\n\t\t//Now set the MiniDAPPID\n\t\tuid = { \"type\":\"uid\", \"uid\": window.location.href };\n\t\t\n\t\t//Send your name.. set automagically but can be hard set when debugging\n\t\tMINIMA_WEBSOCKET.send(JSON.stringify(uid));\n\t\t\t\n\t //Send a message\n\t MinimaPostMessage(\"connected\", \"success\");\n\t};\n\t\n\tMINIMA_WEBSOCKET.onmessage = function (evt) { \n\t\t//Convert to JSON\t\n\t\tvar jmsg = JSON.parse(evt.data);\n\t\t\n\t\tif(jmsg.event == \"newblock\"){\n\t\t\t//Set the new status\n\t\t\tMinima.block = parseInt(jmsg.txpow.header.block,10);\n\t\t\tMinima.txpow = jmsg.txpow;\n\t\t\t\n\t\t\t//What is the info message\n\t\t\tvar info = { \"txpow\" : jmsg.txpow };\n\t\t\t\n\t\t\t//Post it\n\t\t\tMinimaPostMessage(\"newblock\", info);\n\t\t\t\n\t\t}else if(jmsg.event == \"newtransaction\"){\n\t\t\t//What is the info message\n\t\t\tvar info = { \"txpow\" : jmsg.txpow, \"relevant\" : jmsg.relevant };\n\t\t\t\n\t\t\t//New Transaction\n\t\t\tMinimaPostMessage(\"newtransaction\", info);\n\t\t\n\t\t}else if(jmsg.event == \"newtxpow\"){\n\t\t\t//What is the info message\n\t\t\tvar info = { \"txpow\" : jmsg.txpow };\n\t\t\t\n\t\t\t//New TxPoW\n\t\t\tMinimaPostMessage(\"newtxpow\", info);\n\t\t\t\n\t\t}else if(jmsg.event == \"newbalance\"){\n\t\t\t//Set the New Balance\n\t\t\tMinima.balance = jmsg.balance;\n\t\t\t\n\t\t\t//What is the info message\n\t\t\tvar info = { \"balance\" : jmsg.balance };\n\t\t\t\n\t\t\t//Post it..\n\t\t\tMinimaPostMessage(\"newbalance\", info);\n\t\t\n\t\t}else if(jmsg.event == \"network\"){\n\t\t\t//What type of message is it..\n\t\t\tif( jmsg.details.action == \"server_start\" || \n\t\t\t\tjmsg.details.action == \"server_stop\" || \n\t\t\t\tjmsg.details.action == \"server_error\"){\n\t\t\t\t\t\n\t\t\t\tsendCallback(MINIMA_SERVER_LISTEN, jmsg.details.port, jmsg.details);\n\t\t\t\t\n\t\t\t}else if( jmsg.details.action == \"client_new\" || \n\t\t\t\t\t jmsg.details.action == \"client_shut\" || \n\t\t\t\t\t jmsg.details.action == \"message\"){\n\t\t\t\t\t\t\n\t\t\t\tif(!jmsg.details.outbound){\n\t\t\t\t\tsendCallback(MINIMA_SERVER_LISTEN, jmsg.details.port, jmsg.details);\n\t\t\t\t}else{\n\t\t\t\t\tsendCallback(MINIMA_USER_LISTEN, jmsg.details.hostport, jmsg.details);\n\t\t\t\t}\n\t\t\t}else if( jmsg.details.action == \"post\"){ \n\t\t\t\t//Call the MiniDAPP function..\n\t\t\t\tif(MINIMA_MINIDAPP_CALLBACK){\n\t\t\t\t\tMINIMA_MINIDAPP_CALLBACK(jmsg.details);\t\n\t\t\t\t}else{\n\t\t\t\t\tMinima.minidapps.reply(jmsg.details.replyid, \"ERROR - no minidapp interface found\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\tMinima.log(\"UNKNOWN NETWORK EVENT : \"+evt.data);\n\t\t\t}\n\t\t\t\t\t\t\t\n\t\t}else if(jmsg.event == \"txpowstart\"){\n\t\t\tvar info = { \"transaction\" : jmsg.transaction };\n\t\t\tMinimaPostMessage(\"miningstart\", info);\n\t\t\n\t\t\tif(Minima.showmining){\n\t\t\t\tMinima.notify(\"Mining Transaction Started..\",\"#55DD55\");\t\n\t\t\t}\n\t\t\t\t\n\t\t}else if(jmsg.event == \"txpowend\"){\n\t\t\tvar info = { \"transaction\" : jmsg.transaction };\n\t\t\tMinimaPostMessage(\"miningstop\", info);\n\t\t\n\t\t\tif(Minima.showmining){\n\t\t\t\tMinima.notify(\"Mining Transaction Finished\",\"#DD5555\");\n\t\t\t}\n\t\t}\n\t};\n\t\t\n\tMINIMA_WEBSOCKET.onclose = function() { \n\t\tMinima.log(\"Minima WS Listener closed... reconnect attempt in 10 seconds\");\n\t\n\t\t//Start her up in a minute..\n\t\tsetTimeout(function(){ MinimaWebSocketListener(); }, 10000);\n\t};\n\n\tMINIMA_WEBSOCKET.onerror = function(error) {\n\t\t//var err = JSON.stringify(error);\n\t\tvar err = JSON.stringify(error, [\"message\", \"arguments\", \"type\", \"name\", \"data\"])\n\t\t\n\t\t// websocket is closed.\n\t Minima.log(\"Minima WS Listener Error ... \"+err); \n\t};\n}", "function webSocket_onopen()\n\t{\n\t\tlogger_.log(\"webSocket_onopen\", \"WebSocket Verbindung geoeffnet\");\n\t\treadValueList();\n\t\tstatusChange();\n\t}", "function webSocket_onopen()\n\t{\n\t\tstatusChange();\n\t\tconsole.log(\"[ASNeG_Client] WebSocket Verbindung geoeffnet\");\n\t\treadValueList();\n\t}", "function wsconnect(){\n try {\n console.log(\"opening Websocket\");\n if (\"WebSocket\" in window) {\n console.log(ws_uri);\n var socket = new WebSocket(ws_uri);\n } // end if\n else {\n // Firefox currently prefixes the WebSocket object\n var socket = new MozWebSocket(ws_uri);\n } // end else\n socket.onopen = function() {\n console.log(\"Websocket opened\");\n }\n socket.onmessage = function(e) {\n if (debug === true) {\n console.log(\"Received data: \" + e.data);\n }\n measurement = JSON.parse(e.data);\n console.log(datakey);\n updateData(measurement, datakey);\n } // end function\n socket.onclose = function(){ \n console.log(\"Websocket closed\");\n // automatically reconnect after 1s\n window.setTimeout(wsconnect, 2000);\n }\n } catch(exception) { // end try\n console.log(\"Websocket exception\" + exception); \n } // end catch\n \n } // end function wsconnect", "function onConnection (ws) {\n\n /* Create a websocket stream from the websocket */\n var wstream = websocket(ws);\n\n /* Create our JSON streams */\n var parser = JSONStream.parse([true]);\n var stringify = JSONStream.stringify();\n\n /* Hook up PM2Plotly to emitIO */\n var emitStream = emitIO(pm2plotly);\n var id = hat(8,16);\n pm2plotly.emitStream = emitStream;\n\n /* Pipe the client info the JSON parser */\n wstream.pipe(parser);\n\n /**\n * Listen for events from the parser\n * and trigger them on pm2plotly\n */\n emitIO(parser, pm2plotly);\n\n /**\n * stringify and send events from the\n * server/pm2plotly back to the client\n */\n emitStream.pipe(stringify).pipe(wstream);\n\n /**\n * Here we create our client API listeners.\n * Whenever a client emits one of these, events,\n * we can do what we'd like with it.\n */\n pm2plotly.on('list', pm2plotly.listProcesses.bind(pm2plotly));\n pm2plotly.on('createDashboard', pm2plotly.createDashboard.bind(pm2plotly));\n pm2plotly.on('start', pm2plotly.start.bind(pm2plotly));\n pm2plotly.on('stop', pm2plotly.stop.bind(pm2plotly));\n pm2plotly.on('restart', pm2plotly.restart.bind(pm2plotly));\n pm2plotly.on('delete', pm2plotly.createDashboard.bind(pm2plotly));\n\n /**\n * Here we send the client an event to tell them\n * that all is good to go!\n */\n pm2plotly.emitTo(emitStream, 'auth', id);\n}", "function createWebSocket(listenKey, userStream, OrderAPI, binanceAPI) {\n //console.log(\"createWebSocket\", listenKey, userStream, OrderAPI, binanceAPI);\n const wsstream = new webSocket(`${userStream}${listenKey}`);\n console.log(\"websocket initiated\");\n wsstream.on(\"open\", () => {\n console.log(\"websocket opened\");\n });\n wsstream.on(\"error\", (err) => {\n console.log(err.message);\n });\n keepConnectionAlive(OrderAPI, binanceAPI);\n return wsstream;\n}", "listen () {\n const url = 'ws://' + this._options.hostname + ':' + this._options.port\n this.ws = new WebSocket(url, { family: 4 })\n\n this.ws\n .on('error', (error) => {\n /** Emitted on error.\n * @event WsMonitor#error\n * @param {Error} error - The error.\n */\n this.emit('error', error)\n })\n .on('open', () => {\n /** Emitted when connection to web socket server is opened.\n * @event WsMonitor#listening\n * @param {string} url - The URL of the web socket server.\n */\n this.emit('listening', url)\n })\n .on('message', (data, flags) => {\n try {\n const obj = JSON.parse(data.toString())\n if (!this._options.raw) {\n if (obj.t === 'event') {\n switch (obj.e) {\n case 'changed':\n if (obj.r && obj.id && obj.state) {\n const resource = '/' + obj.r + '/' + obj.id + '/state'\n /** Emitted when a `changed` notification has been received.\n * @event WsMonitor#changed\n * @param {string} resource - The changed resource.<br>\n * This can be a `/lights`, `/groups`, or `/sensors`\n * resource for top-level attributes, or a `state` or\n * `config` sub-resource.\n * @param {object} attributes - The top-level, `state`,\n * `config`, or `capabilities` attributes.\n */\n this.emit('changed', resource, obj.state)\n return\n }\n if (obj.r && obj.id && obj.config) {\n const resource = '/' + obj.r + '/' + obj.id + '/config'\n this.emit('changed', resource, obj.config)\n return\n }\n if (obj.r && obj.id && obj.attr) {\n const resource = '/' + obj.r + '/' + obj.id\n this.emit('changed', resource, obj.attr)\n return\n }\n if (obj.r && obj.id && obj.capabilities) {\n const resource = '/' + obj.r + '/' + obj.id + '/capabilities'\n this.emit('changed', resource, obj.capabilities)\n return\n }\n break\n case 'added':\n if (obj.r && obj.id) {\n const resource = '/' + obj.r + '/' + obj.id\n /** Emitted when an `added` notification has been received.\n * @event WsMonitor#added\n * @param {string} resource - The added resource.\n * @param {object} attributes - The full attributes of the\n * added resource.\n */\n this.emit('added', resource, obj[obj.r.slice(0, -1)])\n return\n }\n break\n case 'scene-called':\n if (obj.gid && obj.scid) {\n const resource = '/groups/' + obj.gid + '/scenes/' + obj.scid\n /** Emitted when an `sceneRecall` notification has been received.\n * @event WsMonitor#sceneRecall\n * @param {string} resource - The scene resource.\n */\n this.emit('sceneRecall', resource)\n return\n }\n break\n default:\n break\n }\n }\n }\n /** Emitted when an unknown notification has been received, or when\n * `params.raw` was specified to the\n * {@link WsMonitor constructor}.\n * @event WsMonitor#notification\n * @param {object} notification - The raw notification.\n */\n this.emit('notification', obj)\n } catch (error) {\n this.emit('error', error)\n }\n })\n .on('close', () => {\n /** Emitted when the connection to the web socket server has been closed.\n * @event WsMonitor#closed\n * @param {string} url - The URL of the web socket server.\n */\n this.emit('closed', url)\n if (this._options.retryTime > 0) {\n setTimeout(this.listen.bind(this), this._options.retryTime * 1000)\n }\n })\n }", "function on_open() {\n add_to_output(\"### Opened WebSocket\");\n const socket_connected_log = document.getElementById(\"socketConnect\");\n socket_connected_log.innerHTML = \"Yes\";\n socket_connected = true;\n}", "function connectWebSocket() {\n let protocol = 'wss://';\n // so it also works in 'http' (useful when testing)\n if (location.protocol === 'http:') {\n protocol = 'ws://';\n }\n SOCKET = new WebSocket(protocol + window.location.host + \"/chat\", \"chat\");\n SOCKET.onopen = socketReady;\n SOCKET.onclose = function () {\n console.log('Socket closed');\n addSystemMessage(textElement(\"Disconnected! (will try to reconnect in 5s)\"));\n reconnectWebSocket();\n };\n SOCKET.onerror = function (event) {\n console.log(event);\n addSystemMessage(textElement(\"Disconnected! (will try to reconnect in 5s)\"));\n reconnectWebSocket();\n };\n SOCKET.onmessage = function (event) {\n var type = event.data[0];\n switch (type) {\n case MessageType.getUsername:\n var username = parseUsernameMessage(event.data);\n associateUsername(username);\n break;\n case MessageType.currentUsersCount:\n let connectedCount = parseUsersCount(event.data);\n addToUsersCount(connectedCount);\n break;\n case MessageType.textMessage:\n var message = parseTextMessage(event.data);\n addUserMessage(message);\n break;\n case MessageType.userJoined:\n var username = parseUsernameMessage(event.data);\n userJoined(username);\n break;\n case MessageType.userLeft:\n var username = parseUsernameMessage(event.data);\n userLeft(username);\n break;\n }\n };\n}", "function create_ws() {\n // Create WebSocket connection.\n socket = new WebSocket(server_adress);\n\n socket.onopen = function(event) {\n console.log(\"OPENED\");\n };\n\n\n socket.onmessage = function(event) {\n let length = event.data.size;\n let offset = exports.buffer_ptr();\n // console.log(event.data)\n event.data.arrayBuffer()\n .then(buffer => {\n // console.log(\"received\")\n // if we define bytes earlier in parent scope then everything blows up(don't know (why) Javascript)\n let bytes = new Uint8Array(memory.buffer, offset, length);\n let data = new Uint8Array(buffer, 0, length)\n for (let i = 0; i < length; i++) {\n bytes[i] = data[i];\n }\n exports.receive_msg(length)\n })\n .catch((error) => {\n // console.log(error)\n // console.log(\"you are looser haha\")\n });\n };\n\n\n socket.onclose = function(event) {\n };\n\n socket.onerror = function(error) {\n alert(`[error] ${error.message}`);\n };\n}", "function initWebSocket() {\n\n\tvar socket = new WebSocket( \"ws://localhost:8081\" );\n\n\tsocket.onopen = openSocket;\n\n\tsocket.onmessage = updateRotation;\n\n\tfunction openSocket() {\n\n\t\tsocket.send( \"WebSocket is opened.\" );\n\n\t}\n\n\tfunction updateRotation( result ) {\n\n\t\tvar data = result.data.replace( /\"/g, \"\" ).split( \" \" );\n\n\t\tif ( data[ 0 ] == \"QC\" ) {\n\n\t\t\tif ( data.length === 5 ) {\n\n\t\t\t\t/* data: QC q[0] q[1] q[2] q[3] */\n\t\t\t\tlistnerQuaternion.set(\n\t\t\t\tNumber( data[ 2 ] ), Number( data[ 3 ] ), Number( data[ 4 ] ), Number( data[ 1 ] ) ).normalize();\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tconsole.log( \"Invarid data!\" );\n\n\t\t}\n\n\t}\n\n}", "Start(wsaddr){\r\n\t\tvar protocol = (window.location.protocol === \"https:\" ? \"wss://\" : \"ws://\")\r\n this.websocket = new WebSocket(protocol+wsaddr);\r\n this.websocket.onmessage = this._recieveMessage.bind(this);\r\n this.websocket.onclose = this._socketClose.bind(this);\r\n\t\tvar websocket = this.websocket;\r\n\t\t//Send sessionid over ws:\r\n\t\tthis.websocket.onopen = function(){\r\n\t\t\tvar sessionID = getCookieValue(\"SessionID\")\r\n\t\t\tconsole.log(\"Session ID: \"+sessionID)\r\n\t\t\twebsocket.send(sessionID+\"\\r\\n\")\r\n\t\t};\r\n\t}", "connect() {\r\n socket = new WebSocket(\"ws://localhost:4567/profesor\");\r\n socket.onopen = this.openWs;\r\n socket.onerror = this.errorWs;\r\n socket.onmessage = this.messageWs;\r\n app.recarga();\r\n }", "function connectWebsocket() {\n\t\n\t//-------------------------------------------\n\t// Create WebSocket\n\t//-------------------------------------------\n\tvar socket = new WebSocket(\"ws://127.0.0.1:3337/streamlabs\");\n\n\t//-------------------------------------------\n\t// Websocket Event: OnOpen\n\t//-------------------------------------------\n\tsocket.onopen = function() {\n\t\t\n\t\t// AnkhBot Authentication Information\n\t\tvar auth = {\n\t\t\tauthor: \"GameTangent\",\n\t\t\twebsite: \"twitch.tv/gametangent\",\n\t\t\tapi_key: API_Key,\n\t\t\tevents: [\n\t\t\t\t\"EVENT_HYPE_LEVEL\"\n\t\t\t]\n\t\t};\n\t\t\n\t\t// Send authentication data to ChatBot ws server\n\t\tsocket.send(JSON.stringify(auth));\n\t};\n\t\n\t// Control Variables\n\tvar lastHypeLevel = 0; // What was the hype as of the last socket message\t\n\t\n\t//-------------------------------------------\n\t// Websocket Event: OnMessage\n\t//-------------------------------------------\n\tsocket.onmessage = function (message) {\t\n\t\t\n\t\t// Parse message\n\t\tvar socketMessage = JSON.parse(message.data);\n\t\t// EVENT_HYPE_LEVEL\n\t\tif (socketMessage.event == \"EVENT_HYPE_LEVEL\") {\n\t\t\tconsole.log(\"LOG DATA: \" + socketMessage.data)\n\t\t\t\n\t\t\t// Parse the hypelevel from the message\n\t\t\tvar eventData = JSON.parse(socketMessage.data);\n\t\t\tvar newHypeLevel = eventData.hype_level;\n\t\t\t//1339px == Full Bottle\n\t\t\t\n\t\t\t// Animate the texts's value from x to y:\n\t\t\t$({hypeValue: lastHypeLevel}).animate({hypeValue: newHypeLevel}, {\n\t\t\t\tduration: 3000,\n\t\t\t\teasing:'swing', // can be anything\n\t\t\t\tstep: function() { // called on every step\n\t\t\t\t document.getElementById(\"spicy-full\").style.height=Math.round(this.hypeValue*13.39) + \"px\";\n\t\t\t\t}\n\t\t\t});\n\t\t\tlastHypeLevel = newHypeLevel;\n\t\t\t\t\n\t\t\tconsole.log(\"CURRENT_HYPE_LEVEL: \" + eventData.hype_level);\n\t\t}\n\t}\n\n\t//-------------------------------------------\n\t// Websocket Event: OnError\n\t//-------------------------------------------\n\tsocket.onerror = function(error) {\t\n\t\tconsole.log(\"Error: \" + error);\n\t}\t\n\t\n\t//-------------------------------------------\n\t// Websocket Event: OnClose\n\t//-------------------------------------------\n\tsocket.onclose = function() {\n\t\t// Clear socket to avoid multiple ws objects and EventHandlings\n\t\tsocket = null;\t\t\n\t\t// Try to reconnect every 5s \n\t\tsetTimeout(function(){connectWebsocket()}, 5000);\t\t\t\t\t\t\n\t} \n\n}", "function start_server(){\n\t\tconsole.log(`Huawei4G NodeJS Websocket Server Started OK. Listening on ws port: ${port}`)\n\n\t\tserver.on('connection', function(socket) {\n\n\t\t\t\t\t socket.on('message', function(message) {\n\t\t\t\t\t\tconsole.log( `Received from client: ${message}` )\n\t\t\t\t\t\tprocess_request(message, socket)\n\t\t\t\t\t });\n\n\t\t\t\t\t socket.on('close', function(msg, disconnect) {\n\t\t\t\t\t\tconsole.log(`A client disconnected.`);\n\t\t\t\t\t });\n\n\t\t});\n}", "function openWebSocket() {\n if (!gWebSocketOpened) {\n gWebSocket = new WebSocket('ws://localhost:12221/webrtc_write');\n }\n\n gWebSocket.onopen = function () {\n console.log('Opened WebSocket connection');\n gWebSocketOpened = true;\n };\n\n gWebSocket.onerror = function (error) {\n console.log('WebSocket Error ' + error);\n };\n\n gWebSocket.onmessage = function (e) {\n console.log('Server says: ' + e.data);\n };\n}", "function connect() {\n add_to_output(\"### Trying to open new WebSocket\");\n if (socket_connected) {\n disconnect();\n }\n const socket_path = document.getElementById(\"socketPath\");\n socket = new WebSocket(socket_path.value);\n init_socket(socket);\n}", "Connect() {\n //\n\n if (!WebApp.SocketAPI.MasterSocket.URL) {\n\n if (document.location.protocol == \"https:\") {\n WebApp.SocketAPI.MasterSocket.URL = 'wss://' + document.location.hostname + \":\" + document.location.port;\n } else {\n WebApp.SocketAPI.MasterSocket.URL = 'ws://' + document.location.hostname + \":\" + document.location.port;\n }\n\n }\n WebApp.SocketAPI.MasterSocket.WebSocketConnection = new WebSocket(WebApp.SocketAPI.MasterSocket.URL);\n\n\n\n\n\n WebApp.SocketAPI.MasterSocket.WebSocketConnection.SendData = function (JSONData, OnResult) {\n if (typeof (JSONData) == \"string\") {\n JSONData = JSON.parse(JSONData);\n }\n if (!JSONData.TID) {\n JSONData.TID = \"Evt-\" + (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);\n }\n\n if (OnResult) {\n //\n WebApp.SocketAPI.MasterSocket.MsgQue.Add(JSONData.TID, OnResult);\n }\n\n WebApp.SocketAPI.MasterSocket.WebSocketConnection.send(JSON.stringify(JSONData));\n\n\n };\n\n\n\n\n\n /*\n Wire up the events...\n */\n WebApp.SocketAPI.MasterSocket.WebSocketConnection.onclose = function (evt) {\n WebApp.SocketAPI.MasterSocket.Events.onclose(evt);\n };\n WebApp.SocketAPI.MasterSocket.WebSocketConnection.onerror = error => {\n WebApp.SocketAPI.MasterSocket.Events.onmessage(error);\n };\n WebApp.SocketAPI.MasterSocket.WebSocketConnection.onmessage = e => {\n /*\n Make sure you use TID to setup the call backs...\n */\n const jsonData = JSON.parse(e.data);\n if (jsonData.TID) {\n\n //Remember the TID...\n const TID = jsonData.TID;\n\n //Delete our Transaction ID so they don't have to deal with it...\n delete jsonData[\"TID\"];\n\n //Make the call back...\n WebApp.SocketAPI.MasterSocket.MsgQue.__AllMsgs[TID](jsonData);\n\n //Delete it from the que since we are done with it...\n delete WebApp.SocketAPI.MasterSocket.MsgQue.__AllMsgs[TID];\n\n } else {\n //No TID then it's not a call back so just process the message...\n WebApp.SocketAPI.MasterSocket.Events.onmessage(jsonData);\n }\n };\n WebApp.SocketAPI.MasterSocket.WebSocketConnection.onopen = () => {\n WebApp.SocketAPI.MasterSocket.Events.onopen();\n };\n\n\n\n }", "Connect() {\r\n this._MistyWebSocket.Connect(function (event) {\r\n //\talert(\"Connected to websockets\");\r\n });\r\n }", "function getWebSocket() {\n\t\n\trequest('https://slack.com/api/rtm.start?token=' + global.token + '&pretty=1', function(error, response, body) {\n\t\tparser.log(response.url);\n\t\tif (!error && response.statusCode === 200) {\n\t\t url = JSON.parse(body).url;\n\t\t parser.log( \"Creating url:\"+url);\n\t\t createWS(url);\n\t\t}\n\t});\n}", "function attach_socket() {\n var wsUri = \"ws://\" + window.location.hostname + \"/controller\";\n update_connection_status(\"Connection to \" + wsUri + \" ...\")\n websocket = new WebSocket(wsUri);\n websocket.onopen = function (evt) { onOpen(evt) };\n websocket.onclose = function (evt) { onClose(evt) };\n websocket.onmessage = function (evt) { onMessage(evt) };\n websocket.onerror = function (evt) { onError(evt) };\n}", "function Socket(){\n // if(window.s){\n // window.s.close()\n // }\n var socket = new WebSocket(\"ws://\" + hook_socket_host +\"/webhook_callback/1755bc91fc44d03f0f4440530ddc8c01\")\n socket.onopen = function(){\n console.log('open');\n socket.send('heihei')\n };\n socket.onmessage = function(e){\n if(e.data != '1'){\n status = JSON.parse(e.data)['status']\n key = JSON.parse(e.data)['key']\n if(status=4){\n document.getElementById(''+JSON.parse(e.data)['key']+'').style.background='green'\n document.getElementById(''+JSON.parse(e.data)['key']+'').textContent='成功'\n var last_hook = strtimetounix(JSON.parse(e.data)['time'])\n var last_hook = timetounicode(last_hook)\n // document style is js , jq is $('#id')\n $(''+'#'+JSON.parse(e.data)['key']+'').parents().prevAll()[0].textContent = last_hook\n }\n }else{\n console.log('no update work')\n }\n };\n // socket.onerror = function(){\n // console.log(\"websocket.error\")\n // }\n}", "function createWebSocket () \n {\n ws = new WebSocket('wss://' + site.ws_url + '/ws/core');\n \n // Websocket sent data to us.\n ws.onmessage = function(e) \n { \n var msg = JSON.parse(e.data);\n \n // Some special cases send \"job\" instead of \"type\"\n if(msg.job)\n {\n msg.type = msg.job;\n msg.data = msg.data.Payload;\n }\n \n // Is this a pong to our ping or some other return.\n if(msg.type == 'pong')\n {\n missed_heartbeats--;\n } else\n {\n $scope.$broadcast(msg.type, { data: msg.data, timestamp: msg.timestamp }); \n }\n };\n \n // On Websocket open\n ws.onopen = function(e) \n {\n $scope.ws_reconnecting = false;\n \n // Setup the connection heartbeat\n if(heartbeat === null) \n {\n missed_heartbeats = 0;\n \n heartbeat = setInterval(function() {\n \n try {\n missed_heartbeats++;\n \n if(missed_heartbeats >= 5)\n {\n throw new Error('Too many missed heartbeats.');\n }\n \n ws.send(JSON.stringify({ type: 'ping' }));\n \n } catch(e) \n {\n $scope.ws_reconnecting = true;\n clearInterval(heartbeat);\n heartbeat = null;\n console.warn(\"Closing connection. Reason: \" + e.message);\n ws.close();\n }\n \n }, 5000);\n } else\n {\n clearInterval(heartbeat);\n }\n \n // We need to get WS API key to do anything fun.\n $http.post('/api/v1/me/get_websocket_key', {}).success(function (json) {\n \n // If failed do nothing.\n if(! json.status)\n {\n return false;\n }\n \n // Send websocket key\n ws.send(JSON.stringify({ type: 'ws-key', data: json.data.key })); \n }); \n \n };\n \n/*\n ws.onerror = function(e) {\n \n // clear heartbeat\n clearInterval(heartbeat);\n heartbeat = null;\n \n $scope.ws_reconnecting = true;\n $scope.$apply();\n }\n*/\n \n // On Close\n ws.onclose = function () \n { \n // Kill Ping heartbeat.\n clearInterval(heartbeat);\n heartbeat = null;\n \n // Try to reconnect\n $scope.ws_reconnecting = true;\n setTimeout(function () { createWebSocket(); }, 3 * 1000);\n $scope.$apply();\n }\n \n }", "function createWebSocket() {\n var ws = new WebSocket(channelUrl+\"?token=\"+self.token + queryParam);\n ws.onopen = function() {\n // reset the tries back to 1 since we have a new connection opened.\n attempts = 1;\n\n self._log('Websocket opened: '+ws.url);\n self._fetchResourceOnReady();\n self._emitMessage('connected');\n\n // setup heartbeat onsleep and beat it once to get timer started\n self.heartbeat.onsleep = function() {\n // treat it like the socket closed because when network drops onclose does not get called right away\n self._log(\"Heartbeat timed out. closing socket\");\n ws.onclose();\n };\n self.heartbeat.beat();\n };\n ws.onmessage = function(response) {\n self.heartbeat.beat();\n\n // Receives a message\n if(response.data.trim().length === 0) {\n // heartbeat received\n return;\n }\n var json;\n try {\n json = JSON.parse(response.data);\n } catch (e) {\n self._log(e);\n self._log('This doesn\\'t look like a valid JSON: ' + response.data, response);\n return;\n }\n var type = json.event_type;\n var payload = json.payload;\n self._emitMessage(type, payload);\n };\n ws.onerror = function(response) {\n self._log(\"Websocket had an error\", response);\n };\n ws.onclose = function(response) {\n self._log(\"Websocket closed\");\n var payload = {'message': 'Websocket disconnected due to lost connectivity'};\n self._emitMessage('disconnected', payload);\n var time = generateInterval(attempts);\n\n // clear the heartbeat onsleep callback\n self.heartbeat.onsleep = function() {};\n\n setTimeout(function () {\n // We've tried to reconnect so increment the attempts by 1\n attempts++;\n\n // Connection has closed so try to reconnect every 10 seconds.\n createWebSocket();\n }, time);\n\n };\n }", "function prepareWebSocket() {\n // アクセスしてきたアドレス 例: hoge.com:12345\n var adress = location.href.match( /\\/\\/[^\\/]+/ )[0].substr(2);\n\n var ws = new WebSocket(\"ws://\" + adress + \"/pop/\" + INDEX); \n ws.binaryType = 'arraybuffer';\n\n ws.onopen = function(){\n console.log(\"open!\");\n };\n\n // 受信したバイナリをbase64にしてsrcに指定する\n ws.onmessage = function(e){\n var src = \"data:image/jpeg;base64,\" + encode(new Uint8Array(e.data));\n $('#liveImg').attr('src', src);\n };\n\n window.onbeforeunload = function(){\n ws.close(1000);\n };\n}", "function start() {\n // TEST - TODO turn off when not testing\n //if(document.domain==\"localhost\"){websock = new WebSocket('ws://10.203.1.197/ws');}\n if (document.domain == \"localhost\"){websock = new WebSocket('ws://10.203.1.23/ws')}\n else { \n websock = new WebSocket('ws://' + window.location.hostname + '/ws'); \n };\n\n websock.onopen = function(evt) { \n console.log('websock open'); \n };\n websock.onclose = function(evt) { \n console.log('websock close'); \n alert(\"This control panel is no longer connected to the device. Please close this window and reopen the control panel.\");\n return 0;\n }; \n websock.onerror = function (evt) { console.log(evt); };\n websock.onmessage = function (evt) {\n\n var payload = evt.data;\n if (payload.indexOf(\"~*~*\") < 0) {\n if (payload.indexOf('{\"fishyDevices\"') == 0) {\n processJSON(payload);\n } else {\n console.log(payload);\n }\n } else {\n dealWithMessagePayload(payload);\n }\n };\n}", "function connectWS() {\n var host;\n if (!(\"WebSocket\" in window)) {\n alert(\"Your browser doesn't support WebSockets, please \" +\n \"use Google Chrome or Mozilla Firefox\");\n return;\n }\n \n try {\n host = \"ws://127.0.0.1:8000/\";\n socket = new WebSocket(host);\n \n socket.onopen = onOpenHandler; \n socket.onerror = onErrorHandler;\n socket.onclose = onCloseHandler;\n socket.onmessage = onMessageHandler;\n } catch (exception) {\n showAlert(\"Exception in WebSocket connection: \" + exception, \"danger\");\n }\n}", "function addInitListener(status,redirect){\n // Create WebSocket connection.\n socket = createQueueSocket()\n socket.addEventListener('open', function (event) {\n socket.send(JSON.stringify({flag: status,url: redirect}))\n socket.close()\n });\n}", "_constructSocketListeners () {\n /* Handles our open event */\n this._ws.addEventListener('open', evt => {\n setInterval(() => {\n this._sendArray([{ m: '+ls' }])\n }, this._roomScanMS)\n this._isConnected = true\n this._sendArray([{ m: 'hi' }])\n this._heartbeatInterval = setInterval(() => {\n this._sendArray([{ m: 't', e: Date.now() }])\n }, this._heartbeatMS)\n this.emit('connected')\n this.setChannel('lobby')\n this._noteFlushInterval = setInterval(() => {\n if (this._noteBufferTime && this._noteBuffer.length > 0) {\n this._sendArray([{ m: 'n', t: this._noteBufferTime + this._serverTimeOffset, n: this._noteBuffer }])\n this._noteBufferTime = 0\n this._noteBuffer = []\n }\n }, this._noteFlushIntervalMS)\n })\n\n /* Handles our close event */\n this._ws.addEventListener('close', evt => {\n clearInterval(this._heartbeatInterval)\n clearInterval(this._noteFlushInterval)\n if (!this.hasErrored) this.emit('disconnected')\n })\n\n /* Handles our errors */\n this._ws.addEventListener('error', error => {\n if (error.message === 'WebSocket was closed before the connection was established') return\n this.emit('error', new Error(error))\n this._ws.close()\n })\n\n /* Handles generic messages */\n this._ws.addEventListener('message', evt => {\n if (typeof evt.data !== 'string') return\n try {\n const transmission = JSON.parse(evt.data)\n for (var i = 0; i < transmission.length; i++) {\n var msg = transmission[i]\n if (msg.m === 'hi') {\n this._recieveServerTime(msg.t, msg.e || undefined)\n }\n if (msg.m === 't') {\n this._recieveServerTime(msg.t, msg.e || undefined)\n }\n if (msg.m === 'a') {\n this.emit('message', {\n content: msg.a,\n user: {\n id: msg.p.id,\n name: msg.p.name,\n color: msg.p.color\n },\n time: msg.t\n })\n }\n if (msg.m === 'ch') {\n this.room.name = msg.ch._id\n this._channelHasJoined = true\n if (this.room.users.length !== 0) return\n msg.ppl.forEach(person => {\n this.room.users.push({\n id: person.id,\n name: person.name,\n color: person.color\n })\n })\n }\n if (msg.m === 'p') {\n const formattedUser = {\n id: msg.id,\n name: msg.name,\n color: msg.color\n }\n this.emit('userJoined', formattedUser)\n this.room.users.push(formattedUser)\n }\n if (msg.m === 'bye') {\n const user = this.room.users.filter(e => e.id === msg.p)[0]\n this.room.users = this.room.users.filter(e => e.id !== msg.p)\n this.emit('userLeave', user)\n }\n if (msg.m === 'ls') {\n this.rooms = []\n msg.u.forEach(room => {\n this.rooms.push({\n name: room._id,\n count: room.count\n })\n })\n this._sendArray([{ m: '-ls' }])\n }\n if (msg.m === 'n') {\n this.emit('notePress', {\n note: msg.n,\n user: msg.p\n })\n }\n }\n } catch (error) {\n this.emit('error', error)\n }\n })\n }", "constructor() {\n // Allow only ws protocol\n this.socket = io('http://localhost:4001', {transports: ['websocket']});\n }", "webSocketConnectAndBind(ws, id) {\n let priorAuth = this;\n let socket = new WebSocket(ws);\n this.setState({\n stompClient: Stomp.over(socket)\n });\n this.state.stompClient.connect({}, function (frame) {\n console.log(\"Connected: \" + frame);\n priorAuth.state.stompClient.subscribe(\n priorAuth.priorAuthService.WS_SUBSCRIBE,\n function (msg) {\n priorAuth.webSocketReceiveMessage(msg.body, id);\n }\n );\n priorAuth.state.stompClient.send(\n priorAuth.priorAuthService.WS_BIND,\n {},\n \"bind: \" + id\n );\n });\n }", "webSocketConnectAndBind(ws, id) {\n let priorAuth = this;\n let socket = new WebSocket(ws);\n this.setState({\n stompClient: Stomp.over(socket)\n });\n this.state.stompClient.connect({}, function(frame) {\n console.log(\"Connected: \" + frame);\n priorAuth.state.stompClient.subscribe(\n priorAuth.props.priorAuthService.WS_SUBSCRIBE,\n function(msg) {\n priorAuth.webSocketReceiveMessage(msg.body, id);\n }\n );\n priorAuth.state.stompClient.send(\n priorAuth.props.priorAuthService.WS_BIND,\n {},\n \"bind: \" + id\n );\n });\n }", "connect() {\n this.ws = new WebSocket(this.host);\n this.ws.on('open', this.onConnect.bind(this));\n this.ws.on('close', this.onDisconnect.bind(this));\n this.ws.on('error', this.onError.bind(this));\n }", "static createGamesWebsocketConnection() {\n socket = new WebSocket('ws://localhost:3000/cable');\n\n socket.onopen = function(event) {\n console.log('WebSocket is connected.');\n\n const msg = {\n command: 'subscribe',\n identifier: JSON.stringify({\n channel: 'GamesChannel',\n }),\n };\n \n socket.send(JSON.stringify(msg));\n };\n \n socket.onclose = function(event) {\n console.log('WebSocket is closed.');\n };\n\n socket.onmessage = function(event) { \n const response = event.data;\n const msg = JSON.parse(response);\n \n \n if (msg.type === \"ping\") {\n return;\n } \n\n console.log(\"FROM RAILS: \", msg);\n\n if (msg.message) {\n\n if (msg.message.game) {\n const gameObject = msg.message.game;\n \n const game = new Game(gameObject.id, gameObject.name, gameObject.status, gameObject.phase);\n gameObject.players.forEach(playerObject => {\n const player = new Player(playerObject.id, playerObject.name);\n game.players.push(player);\n }) \n \n game.renderGameListCard();\n } else if (msg.message.game_player) {\n const gamePlayerObject = msg.message.game_player;\n \n const game = Game.all.find(game => {\n return game.id === gamePlayerObject.game_id\n })\n const player = new Player(gamePlayerObject.id, gamePlayerObject.player_name)\n game.players.push(player);\n\n const playersUl = document.getElementById(`${gamePlayerObject.game_id}-players-list`)\n\n const playerLi = document.createElement('li');\n playerLi.textContent = gamePlayerObject.player_name;\n playerLi.dataset.playerId = gamePlayerObject.player_id;\n playerLi.dataset.gameId = gamePlayerObject.game_id;\n playerLi.id = `game-id-${gamePlayerObject.game_id}-player-id-${gamePlayerObject.player_id}`\n\n playersUl.appendChild(playerLi);\n }\n\n }\n \n \n };\n \n socket.onerror = function(error) {\n console.log('WebSocket Error: ' + error);\n };\n }", "function SocketController(webSocketURL) \r\n{\r\n console.log(\"SocketController: construct\");\r\n this.url = webSocketURL;\r\n console.log(\"SocketController: URL=\"+this.url);\r\n}", "function connect() {\n var socket = new SockJS('/gs-guide-websocket');\n stompClient = Stomp.over(socket);\n stompClient.connect({}, function (frame) {\n console.log('Connected: ' + frame);\n stompClient.subscribe('/receive-update-client/' + $('#httpSessionId').val(), function (message) {\n var gameUpdate = JSON.parse(message.body);\n updateView(gameUpdate);\n });\n login();\n });\n}", "connect () {\n /* Connect our websocket */\n this._ws = new WebSocket(this.uri, {\n origin: 'https://www.multiplayerpiano.com',\n agent: this.proxy ? this.proxy.startsWith('socks') ? new SocksProxyAgent(this.proxy) : new HttpsProxyAgent(this.proxy) : undefined\n })\n\n this._constructSocketListeners()\n\n setTimeout(() => {\n if (!this._isConnected) {\n this.emit('error', new Error('Bot failed to connect to websocket in 10 seconds.'))\n this._ws.close()\n }\n }, this._socketTimeoutMS)\n }", "function connect() {\n var WebSocket = require('faye-websocket'),\n\t//establish web socket connection to the endpoint\n ws = new WebSocket.Client(websocketendpoint, [], {\n\t//proxy is required when on GE server \n proxy: {\n origin: geproxy\n },\n\t// sends a 'ping' message every 30 milliseconds through the socket to client side to keep connection alive\n ping: 30\n });\n var options = {\n debug: true\n };\n //nodejs does not have a WebSocket object like browsers have, you must choose a websocket client and use webstomp.over instead of webstomp.client. \n var webstomp = require('webstomp-client');\n var client = webstomp.over(ws, options);\n //A client instance can and should be created through webstomp.client or webstomp.over\n var headers = {\n login: '',\n passcode: ''\n };\n client.connect('','', function(frames){\n\t\t\n\t//Subscribe based on location id \n\tvar locationone = client.subscribe(fmo, function(message) \t\n\t{\n\t\n\t//parse JSON file ....\n\t//maps data from message to JSON\n quote = JSON.parse(message.body);\n\t//calls parseJson function \n\tparseJson(quote);\t\n\t}\n\t)\n\t\n\tvar locationtwo = client.subscribe(fco, function(message)\n\t{\n\t\n\t//parse JSON file ....\n\t//maps data from message to JSON\n quote = JSON.parse(message.body);\n\t//calls parseJson function \n\tparseJson(quote);\t\n\t}\n\t)\n\t\n\tvar locationthree = client.subscribe(sco, function(message)\n\t{\n\t\n\t//parse JSON file ....\n\t//maps data from message to JSON\n quote = JSON.parse(message.body);\n\t//calls parseJson function \n\tparseJson(quote);\t\n\t}\n\t)\t\n\t\n\tvar locationfour = client.subscribe(facilites, function(message)\n\t{\n\t\n\t//parse JSON file ....\n\t//maps data from message to JSON\n quote = JSON.parse(message.body);\n\t//calls parseJson function \n\tparseJson(quote);\t\n\t}\n\t)\n\t\n\t\n}\n); \n \n}", "function openSocket() {\r\n\t// Ensures only one connection is open at a time\r\n\tif (webSocket !== undefined && webSocket.readyState !== WebSocket.CLOSED) {\r\n\t\treturn;\r\n\t}\r\n\r\n\t// Create a new instance of the websocket\r\n\twebSocket = new WebSocket(\"ws://\" + socket_url + \":\" + port\r\n\t\t\t+ \"/WebMobileGroupChatServer/chat?name=\" + name);\r\n\r\n\t/**\r\n\t * Binds functions to the listeners for the websocket.\r\n\t */\r\n\twebSocket.onopen = function(event) {\r\n\t\t// $('#message_container').fadeIn();\r\n\r\n\t\tif (event.data === undefined)\r\n\t\t\treturn;\r\n\t};\r\n\r\n\twebSocket.onmessage = function(event) {\r\n\r\n\t\t// parsing the json data\r\n\t\tparseMessage(event.data);\r\n\t};\r\n\r\n\twebSocket.onclose = function(event) {\r\n\r\n\t};\r\n}", "onopen(evt) {\n this.webSocket.send(JSON.stringify({\n accessKey: this.accessKey,\n sessionID: this.sessionID\n }));\n }", "init() {\n this.socket.emit('init', 'ooga');\n }", "constructor(ws) {\n super();\n this.ws = ws;\n this._sig = \"ws\";\n this._open = true;\n this.ws.on('message', message => {\n if (this._open) { return this.push(message.binaryData); }\n });\n this.ws.on('close', () => {\n this._open = false;\n return this.emit('close');\n });\n this.ws.on(\"error\", err => this.emit('error', err));\n }", "constructor(ws) {\n super();\n this.ws = ws;\n this._sig = \"ws\";\n this._open = true;\n this.ws.on('message', message => {\n if (this._open) { return this.push(message.binaryData); }\n });\n this.ws.on('close', () => {\n this._open = false;\n return this.emit('close');\n });\n this.ws.on(\"error\", err => this.emit('error', err));\n }", "function connect() {\n $(\".disconnected\").show();\n webSocket = new WebSocket(wsUri + \"/remote\");\n webSocket.onopen = function () { onOpen(); };\n webSocket.onclose = function () { onClose(); };\n webSocket.onmessage = function (evt) { onMessage(evt); };\n webSocket.onerror = function (evt) { onError(evt); };\n}", "function init_primary_websocket(is_from_disconnected_state)\n {\n try {\n \tprimary_sock = new WebSocket(\"ws://\" + location.host + \"/stream?paintroom=\" + paint_room_name);\n console.log(\"Opening a new websocket connection : \" + location.host + \" at client for paintroom \" + paint_room_name); \t\n }\n catch(e) {\n \tconsole.log(\"Failed top open primary websocket connection . Reason : \" + e.message);\n }\n\n /* Websocket event handlers */\n \n // OPEN event handler\n primary_sock.onopen = function () {\n console.log(\"Connected via websocket ..\");\n is_connected = true;\n // Bootstrap the canvas with prior events from the server ..\n if (is_connected) {\n \tif(is_from_disconnected_state = true) {\n console.log(\"Bootstrapping session storage events after offline mode ..\");\n load_localstorage_events(); \n \t}\n\n console.log(\"Bootstrapping prior events for the current session on local client ..\"); \t\n dummy_initial_bootstrap(); \t\n } else {\n console.log(\"Not connected via websocket yet during bootstrapping ..\");\n }\n }\n\n // ONCLOSE event handler\n primary_sock.onclose = function () {\n console.log(\"Websocket disconnected ..\");\n is_connected = false;\n \n // Check if this is a normal client disconnect or preferred server failure\n var is_normal_client_disconnect = checkIfNormalClientDisconnect();\n console.log(\"Normal disconnect ? \" + is_normal_client_disconnect);\n \n /**\n * In case, this is not a normal client disconnect then need to figure out if there are any\n * other worker servers to which this client can be redirected. If yes, redirect to that\n * worker server, else operate in the disconnected mode.\n */\n if(is_normal_client_disconnect == false) {\n \tconsole.log(\"Unregistering the client with paintroom ..\");\n \t\tunregisterClientSession();\n\n \t\tvar is_disconnected_mode = checkIfDisconnectedMode();\n \tconsole.log(\"Is disconnected ? \" + is_disconnected_mode);\n \t// Preferred server is down. Migrate the client to a new worker server\n \tif(is_disconnected_mode == false) {\n \t\tconsole.log(\"Preferred server down. Migrating client to a new worker server ..\");\n \t\thandlePreferredServerDown();\n \t}\n \t// All worker servers are down. Operate in disconnected mode\n \telse {\n \t\tconsole.log(\"All worker servers down. Operating in disconnected mode ..\");\n \t\thandleDisconnectedMode();\n \t}\n }\n else {\n \tconsole.log(\"Client has ended its session ..\");\n \tsessionStorage.clear();\n }\n }\n \n // Handle incoming messages/events from the server via websocket duplex connection\n primary_sock.onmessage = function (msg) {\n // Consume events from server. Specifically, replays all events on client to simulate\n // real-time synchronization between distributed clients\n var data = JSON.parse(msg.data);\n draw(data.start_x, data.start_y, data.end_x, data.end_y);\n } \n }", "handleWebsocketOpened() {\n this.sendHeaders();\n this.flushFrameBuffer();\n }", "function connect() {\n var serverUrl;\n var scheme = \"ws\";\n\n // If this is an HTTPS connection, we have to use a secure WebSocket\n // connection too, so add another \"s\" to the scheme.\n\n if (document.location.protocol === \"https:\") {\n scheme += \"s\";\n }\n serverUrl = scheme + \"://\" + myHostname + \":6503\";\n\n log(`Connecting to server: ${serverUrl}`);\n connection = new WebSocket(serverUrl, \"json\");\n\n connection.onopen = function(evt) {\n document.getElementById(\"text\").disabled = false;\n document.getElementById(\"send\").disabled = false;\n };\n\n connection.onerror = function(evt) {\n console.dir(evt);\n }\n\n connection.onmessage = function(evt) {\n var chatBox = document.querySelector(\".chatbox\");\n var text = \"\";\n var msg = JSON.parse(evt.data);\n log(\"Message received: \");\n console.dir(msg);\n var time = new Date(msg.date);\n var timeStr = time.toLocaleTimeString();\n\n switch(msg.type) {\n case \"id\":\n clientID = msg.id;\n setUsername();\n break;\n\n case \"username\":\n text = \"<b>User <em>\" + msg.name + \"</em> signed in at \" + timeStr + \"</b><br>\";\n break;\n\n case \"message\":\n text = \"(\" + timeStr + \") <b>\" + msg.name + \"</b>: \" + msg.text + \"<br>\";\n break;\n\n case \"rejectusername\":\n myUsername = msg.name;\n text = \"<b>Your username has been set to <em>\" + myUsername +\n \"</em> because the name you chose is in use.</b><br>\";\n break;\n\n case \"userlist\": // Received an updated user list\n handleUserlistMsg(msg);\n break;\n\n // Signaling messages: these messages are used to trade WebRTC\n // signaling information during negotiations leading up to a video\n // call.\n\n case \"video-offer\": // Invitation and offer to chat\n handleVideoOfferMsg(msg);\n break;\n\n case \"video-answer\": // Callee has answered our offer\n handleVideoAnswerMsg(msg);\n break;\n\n case \"new-ice-candidate\": // A new ICE candidate has been received\n handleNewICECandidateMsg(msg);\n break;\n\n case \"hang-up\": // The other peer has hung up the call\n handleHangUpMsg(msg);\n break;\n\n // Unknown message; output to console for debugging.\n\n default:\n log_error(\"Unknown message received:\");\n log_error(msg);\n }\n\n // If there's text to insert into the chat buffer, do so now, then\n // scroll the chat panel so that the new text is visible.\n\n if (text.length) {\n chatBox.innerHTML += text;\n chatBox.scrollTop = chatBox.scrollHeight - chatBox.clientHeight;\n }\n };\n}", "handleOpen() {\n log.info(`[WS] Connected to ${WS_URI}`)\n }", "function connectElgatoStreamDeckSocket(inPort, inPluginUUID, inRegisterEvent, inInfo) {\n // Open the web socket to Stream Deck\n // Use 127.0.0.1 because Windows needs 300ms to resolve localhost\n websocket = new WebSocket('ws://127.0.0.1:' + inPort);\n\n // Web socket is connected\n websocket.onopen = function() {\n // Register plugin to Stream Deck\n registerPluginOrPI(inRegisterEvent, inPluginUUID);\n // Request the global settings of the plugin\n requestGlobalSettings(inPluginUUID);\n }\n\n // Web socked received a message\n websocket.onmessage = function(inEvent) {\n // Parse parameter from string to object\n var jsonObj = JSON.parse(inEvent.data);\n\n // Extract payload information\n var event = jsonObj['event'];\n var action = jsonObj['action'];\n var context = jsonObj['context'];\n var jsonPayload = jsonObj['payload'];\n var settings;\n\n // Key up event\n if(event === 'keyUp') {\n settings = jsonPayload['settings'];\n var coordinates = jsonPayload['coordinates'];\n var userDesiredState = jsonPayload['userDesiredState'];\n var state = jsonPayload['state'];\n Plugin.onKeyUp(context, settings, coordinates, userDesiredState, state);\n }\n else if(event === 'keyDown') {\n settings = jsonPayload['settings'];\n var coordinates = jsonPayload['coordinates'];\n var userDesiredState = jsonPayload['userDesiredState'];\n var state = jsonPayload['state'];\n Plugin.onKeyDown(context, settings, coordinates, userDesiredState, state);\n }\n else if(event === 'willAppear') {\n settings = jsonPayload['settings'];\n Plugin.onWillAppear(context, settings, action);\n }\n else if(event === 'willDisappear') {\n Plugin.onWillDisappear(context);\n }\n else if(event === 'didReceiveGlobalSettings') {\n console.log(\"didReceiveGlobalSettings\");\n // Set global settings\n globalSettings = jsonPayload['settings'];\n \n var host, token;\n if (globalSettings.hasOwnProperty(\"host\"))\n host = globalSettings.host;\n if (globalSettings.hasOwnProperty(\"token\"))\n token = globalSettings.token;\n if (host && token)\n Hass.connect(host, token).then(Plugin.onHassConnected); \n }\n else if(event === 'didReceiveSettings') {\n settings = jsonPayload['settings'];\n Plugin.onDidReceiveSettings(context, settings);\n }\n else if(event === 'systemDidWakeUp') {\n Plugin.onSystemDidWakeUp();\n }\n };\n}", "function WSLobbyConnect(){\n\tconnection = new WebSocket('ws://192.168.10.105:8888','echo');\n\tconnection.onopen = myWSOnOpen;\n\tconnection.onmessage = myWSOnMessage;\n\tconnection.onerror = myWSOnError;\n\n\t//window.setInterval(updateNameListWidget,2000);\n\tdocument.onmousemove=updateMouseEvent;\n}", "listen() {\n //Server() is statically used, as there is no need to create\n // a Websocket instance to call this function\n const server = new Websocket.Server({ port: P2P_PORT });\n\n //Create an event listener, that listens for incoming types of messages\n // The first argument specifies the type of event we are listening\n // out for. By listening to connection events we can fire specific\n // code whenever a new socket connects to this server\n // In order to interact with that socket we are given a callback function\n // whose parameter is the socket object created due to the connection\n server.on('connection', (socket) => this.connectSocket(socket));\n\n //The following function will handle later instances of the application\n // connecting to peers that are specified when they're started\n this.connectToPeers();\n\n console.log(`Listening for P2P connections on: ${P2P_PORT}`);\n }", "constructor(webSocketUrl, handleErrorMessage) {\n this.handleErrorMessage = handleErrorMessage;\n this.accountCallbacks = new Map();\n this.messageCallbacks = new Map();\n this.waiting = new Map();\n this.idNumber = 0; // added to web socket request IDs to ensure unique IDs\n this.socket = new isomorphic_ws_1.default(webSocketUrl);\n this.messageCallbacks.set('response', (data) => {\n const dataStatusResponse = data;\n this.waiting.set(dataStatusResponse.id, data);\n });\n this.messageCallbacks.set('transaction', (data) => this.handleTransaction(data));\n this.socket.addEventListener('message', (event) => {\n const parsedData = JSON.parse(event.data);\n const messageType = parsedData.type;\n const callback = this.messageCallbacks.get(messageType);\n if (callback) {\n callback(parsedData);\n }\n else {\n this.handleErrorMessage(`Received unhandlable message: ${event.data}`);\n }\n });\n this.socket.addEventListener('close', (event) => {\n this.handleErrorMessage(`WebSocket disconnected, ${event.reason}`);\n });\n this.socket.addEventListener('error', (event) => {\n this.handleErrorMessage(`WebSocket error: ${event.message}`);\n });\n }" ]
[ "0.7875458", "0.7656297", "0.7656297", "0.75624424", "0.7470115", "0.74622655", "0.7413259", "0.7399179", "0.7365329", "0.73570615", "0.7317922", "0.72944677", "0.7293981", "0.7284767", "0.72635704", "0.7236498", "0.7235157", "0.7226381", "0.72094995", "0.720764", "0.72030324", "0.7188477", "0.7187809", "0.717305", "0.7167946", "0.7162495", "0.7146135", "0.71233964", "0.70937586", "0.70807153", "0.70751363", "0.70728093", "0.70525146", "0.70299006", "0.7025377", "0.7023423", "0.70189357", "0.70137995", "0.7005061", "0.69879717", "0.69869304", "0.69500554", "0.6937918", "0.6936115", "0.69357514", "0.6927099", "0.6891876", "0.6886727", "0.68832797", "0.6875585", "0.68714386", "0.68487877", "0.6837144", "0.6829423", "0.6803106", "0.6796303", "0.67957824", "0.6794979", "0.6791818", "0.6787774", "0.6770501", "0.67681515", "0.6752872", "0.6741029", "0.67285097", "0.67157114", "0.6711644", "0.67110705", "0.67083144", "0.6696707", "0.6671785", "0.66685873", "0.6665606", "0.66571236", "0.66439533", "0.66401863", "0.6635371", "0.6631777", "0.66298956", "0.662916", "0.66243386", "0.66218024", "0.66182905", "0.6617515", "0.66165745", "0.66161233", "0.6615916", "0.6613942", "0.66138506", "0.6606029", "0.6606029", "0.66048765", "0.6601339", "0.6597143", "0.6584332", "0.65826994", "0.6582387", "0.65811425", "0.6571991", "0.65707034" ]
0.6787456
60
Create an iterator for an iterable object.
function iter(object) { var it; if (typeof object.iter === 'function') { it = object.iter(); } else { it = new ArrayIterator(object); } return it; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static createIteratorFromIterable(iterable){\n //TODO save state for restarting when Flow is being reused\n return iterable;\n }", "function iter(o) {\n // Makes sure that create_iterator is called in the same scope as iter.\n return create_iterator.call(this, o);\n}", "function Iterable() {}", "function Iterator(iterable, start, stop, step) {\n if (!iterable) {\n return Iterator.empty;\n } else if (iterable instanceof Iterator) {\n return iterable;\n } else if (!(this instanceof Iterator)) {\n return new Iterator(iterable, start, stop, step);\n } else if (Array.isArray(iterable) || typeof iterable === \"string\") {\n iterators.set(this, new IndexIterator(iterable, start, stop, step));\n return;\n }\n iterable = Object(iterable);\n if (iterable.next) {\n iterators.set(this, iterable);\n } else if (iterable.iterate) {\n iterators.set(this, iterable.iterate(start, stop, step));\n } else if (Object.prototype.toString.call(iterable) === \"[object Function]\") {\n this.next = iterable;\n } else {\n throw new TypeError(\"Can't iterate \" + iterable);\n }\n}", "function iteratorFor(items) {\n var iterator = {\n next: function next() {\n var value = items.shift();\n return { done: value === undefined, value: value };\n }\n };\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function () {\n return iterator;\n };\n }\n\n return iterator;\n }", "function iteratorFor(items) {\n\t var iterator = {\n\t next: function next() {\n\t var value = items.shift();\n\t return { done: value === undefined, value: value };\n\t }\n\t };\n\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function () {\n\t return iterator;\n\t };\n\t }\n\n\t return iterator;\n\t }", "function iteratorFor(items) {\n\t var iterator = {\n\t next: function next() {\n\t var value = items.shift();\n\t return { done: value === undefined, value: value };\n\t }\n\t };\n\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function () {\n\t return iterator;\n\t };\n\t }\n\n\t return iterator;\n\t }", "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift()\n\t return {done: value === undefined, value: value}\n\t }\n\t }\n\t\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t }\n\t }\n\t\n\t return iterator\n\t }", "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift()\n\t return {done: value === undefined, value: value}\n\t }\n\t }\n\t\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t }\n\t }\n\t\n\t return iterator\n\t }", "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift()\n\t return {done: value === undefined, value: value}\n\t }\n\t }\n\t\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t }\n\t }\n\t\n\t return iterator\n\t }", "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift()\n\t return {done: value === undefined, value: value}\n\t }\n\t }\n\t\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t }\n\t }\n\t\n\t return iterator\n\t }", "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift()\n\t return {done: value === undefined, value: value}\n\t }\n\t }\n\t\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t }\n\t }\n\t\n\t return iterator\n\t }", "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift()\n\t return {done: value === undefined, value: value}\n\t }\n\t }\n\t\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t }\n\t }\n\t\n\t return iterator\n\t }", "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift()\n\t return {done: value === undefined, value: value}\n\t }\n\t }\n\t\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t }\n\t }\n\t\n\t return iterator\n\t }", "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift()\n\t return {done: value === undefined, value: value}\n\t }\n\t }\n\t\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t }\n\t }\n\t\n\t return iterator\n\t }", "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift()\n\t return {done: value === undefined, value: value}\n\t }\n\t }\n\t\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t }\n\t }\n\t\n\t return iterator\n\t }", "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift()\n\t return {done: value === undefined, value: value}\n\t }\n\t }\n\t\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t }\n\t }\n\t\n\t return iterator\n\t }", "function iteratorFor(items) {\n var iterator = {\n next: function next() {\n var value = items.shift();\n return { done: value === undefined, value: value };\n }\n };\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function () {\n return iterator;\n };\n }\n\n return iterator;\n }", "function iteratorFor(items) {\n var iterator = {\n next: function next() {\n var value = items.shift();\n return { done: value === undefined, value: value };\n }\n };\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function () {\n return iterator;\n };\n }\n\n return iterator;\n }", "function _createForOfIteratorHelper(t,o){var e=\"undefined\"!=typeof Symbol&&t[Symbol.iterator]||t[\"@@iterator\"];if(!e){if(Array.isArray(t)||(e=_unsupportedIterableToArray(t))||o&&t&&\"number\"==typeof t.length){e&&(t=e);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}var n,a=!0,s=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return a=t.done,t},e:function(t){s=!0,n=t},f:function(){try{a||null==e.return||e.return()}finally{if(s)throw n}}}}", "function iteratorFor(items) {\n var iterator = {\n next: function next() {\n var value = items.shift();\n return { done: value === undefined, value: value };\n }\n };\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function () {\n return iterator;\n };\n }\n\n return iterator;\n}", "function makeReusableIterable(generatorFn) {\n return {\n [Symbol.iterator]: generatorFn\n };\n}", "function iteratorFor(items) {\n var iterator = {\n next: function next() {\n var value = items.shift();\n return { done: value === undefined, value: value };\n }\n };\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function () {\n return iterator;\n };\n }\n\n return iterator;\n }", "function makeIterable(i) {\n function* fromIterator(i) {\n for (let r = i.next(); !r.done; r = i.next()) {\n yield r.value;\n }\n }\n function* fromIterable(i) {\n yield* i;\n }\n return isIterable(i) ? (isIterableIterator(i) ? i : fromIterable(i)) : fromIterator(i);\n}", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift();\n return {done: value === undefined, value: value}\n }\n };\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n };\n }\n\n return iterator\n }", "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift()\n\t return {done: value === undefined, value: value}\n\t }\n\t }\n\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t }\n\t }\n\n\t return iterator\n\t }", "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift()\n\t return {done: value === undefined, value: value}\n\t }\n\t }\n\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t }\n\t }\n\n\t return iterator\n\t }", "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift()\n\t return {done: value === undefined, value: value}\n\t }\n\t }\n\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t }\n\t }\n\n\t return iterator\n\t }", "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift()\n\t return {done: value === undefined, value: value}\n\t }\n\t }\n\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t }\n\t }\n\n\t return iterator\n\t }", "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift()\n\t return {done: value === undefined, value: value}\n\t }\n\t }\n\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t }\n\t }\n\n\t return iterator\n\t }", "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift()\n\t return {done: value === undefined, value: value}\n\t }\n\t }\n\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t }\n\t }\n\n\t return iterator\n\t }", "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift()\n\t return {done: value === undefined, value: value}\n\t }\n\t }\n\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t }\n\t }\n\n\t return iterator\n\t }", "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift()\n\t return {done: value === undefined, value: value}\n\t }\n\t }\n\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t }\n\t }\n\n\t return iterator\n\t }", "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift()\n\t return {done: value === undefined, value: value}\n\t }\n\t }\n\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t }\n\t }\n\n\t return iterator\n\t }", "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift()\n\t return {done: value === undefined, value: value}\n\t }\n\t }\n\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t }\n\t }\n\n\t return iterator\n\t }", "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift()\n\t return {done: value === undefined, value: value}\n\t }\n\t }\n\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t }\n\t }\n\n\t return iterator\n\t }", "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift();\n\t return {done: value === undefined, value: value}\n\t }\n\t };\n\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t };\n\t }\n\n\t return iterator\n\t }", "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift();\n\t return {done: value === undefined, value: value}\n\t }\n\t };\n\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t };\n\t }\n\n\t return iterator\n\t }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift();\n return { done: value === undefined, value: value };\n }\n };\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator;\n };\n }\n\n return iterator;\n}", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift();\n return {done: value === undefined, value: value}\n }\n };\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n };\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift();\n return {done: value === undefined, value: value}\n }\n };\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n };\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift();\n return {done: value === undefined, value: value}\n }\n };\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n };\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift();\n return {done: value === undefined, value: value}\n }\n };\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n };\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift();\n return {done: value === undefined, value: value}\n }\n };\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n };\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift();\n return {done: value === undefined, value: value}\n }\n };\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n };\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift();\n return {done: value === undefined, value: value}\n }\n };\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n };\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift();\n return {done: value === undefined, value: value}\n }\n };\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n };\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift();\n return {done: value === undefined, value: value}\n }\n };\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n };\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift();\n return {done: value === undefined, value: value}\n }\n };\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n };\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift();\n return {done: value === undefined, value: value}\n }\n };\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n };\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift();\n return {done: value === undefined, value: value}\n }\n };\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n };\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift();\n return {done: value === undefined, value: value}\n }\n };\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n };\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift();\n return {done: value === undefined, value: value}\n }\n };\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n };\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift();\n return {done: value === undefined, value: value}\n }\n };\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n };\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift();\n return {done: value === undefined, value: value}\n }\n };\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n };\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift();\n return {done: value === undefined, value: value}\n }\n };\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n };\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift();\n return { done: value === undefined, value: value };\n }\n };\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator;\n };\n }\n\n return iterator;\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift();\n return {done: value === undefined, value: value}\n }\n };\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n };\n }\n\n return iterator\n}", "function iteratorFor(items) {\n var iterator = {\n next: function () {\n var value = items.shift();\n return { done: value === undefined, value: value };\n },\n };\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function () {\n return iterator;\n };\n }\n\n return iterator;\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n \n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n \n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }", "function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n }" ]
[ "0.7961911", "0.7845444", "0.7678671", "0.74827826", "0.74399346", "0.7403339", "0.7403339", "0.7401556", "0.7401556", "0.7401556", "0.7401556", "0.7401556", "0.7401556", "0.7401556", "0.7401556", "0.7401556", "0.7401556", "0.7398377", "0.7398377", "0.7396775", "0.7384306", "0.737944", "0.7377669", "0.73647213", "0.7336177", "0.73265904", "0.73265904", "0.73265904", "0.73265904", "0.73265904", "0.73265904", "0.73265904", "0.73265904", "0.73265904", "0.73265904", "0.73265904", "0.73245513", "0.73245513", "0.73175514", "0.73053384", "0.73053384", "0.73053384", "0.73053384", "0.73053384", "0.73053384", "0.73053384", "0.73053384", "0.73053384", "0.73053384", "0.73053384", "0.73053384", "0.73053384", "0.73053384", "0.73053384", "0.73053384", "0.73053384", "0.7299054", "0.72972304", "0.7291561", "0.7278123", "0.72634053", "0.72634053", "0.72634053", "0.72634053", "0.72634053", "0.72634053", "0.72634053", "0.72634053", "0.72634053", "0.72634053", "0.72634053", "0.72634053", "0.72634053", "0.72634053", "0.72634053", "0.72634053", "0.72634053", "0.72634053", "0.72634053", "0.72634053", "0.72634053", "0.72634053", "0.72634053", "0.72634053", "0.72634053", "0.72634053", "0.72634053", "0.72634053", "0.72634053", "0.72634053", "0.72634053", "0.72634053", "0.72634053", "0.72634053", "0.72634053", "0.72634053", "0.72634053", "0.72634053", "0.72634053" ]
0.74190605
6
Construct a new array iterator.
function ArrayIterator(source) { this._index = 0; this._source = source; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function CreateArrayIterator(array, kind) {\n var o = ToObject(array);\n var iterator = new ArrayIterator;\n set_internal(iterator, '[[IteratedObject]]', o);\n set_internal(iterator, '[[ArrayIteratorNextIndex]]', 0);\n set_internal(iterator, '[[ArrayIterationKind]]', kind);\n return iterator;\n }", "function ArrayLikeIterator (obj) {\n\t this._o = obj\n\t this._i = 0\n\t}", "function AssocArrayIterator(array) {\n this._index = 0;\n this._array = array;\n }", "function makeIterator(arr) {\n let nextIndex = 0\n return {\n next: () =>\n nextIndex < arr.length\n ? { value: arr[nextIndex++], done: false }\n : { done: true }\n }\n}", "function CreateArrayIterator(obj, kind) {\n var iteratedObject = ToObject(obj);\n var iterator = NewArrayIterator();\n UnsafeSetReservedSlot(iterator, ITERATOR_SLOT_TARGET, iteratedObject);\n UnsafeSetReservedSlot(iterator, ITERATOR_SLOT_NEXT_INDEX, 0);\n UnsafeSetReservedSlot(iterator, ITERATOR_SLOT_ITEM_KIND, kind);\n return iterator;\n}", "function ArrayLikeIterator(obj) {\n this._o = obj\n this._i = 0\n}", "function ArrayLikeIterator(obj) {\n this._o = obj\n this._i = 0\n}", "function ArrayLikeIterator(obj) {\n this._o = obj\n this._i = 0\n}", "function ArrayLikeIterator(obj) {\n this._o = obj\n this._i = 0\n}", "function ArrayLikeIterator(obj) {\n this._o = obj\n this._i = 0\n}", "function arrayIterator (arr) {\n if (!Array.isArray(arr)) throw new Error('Not an array!')\n var pos = 0\n\n function next () {\n if (pos < arr.length) {\n return { done: false, value: arr[pos++] }\n }\n return { done: true }\n }\n\n return function () {\n return { next: next }\n }\n}", "function makeArray(start, end, iter){\n const inputArray = [];\n for(let i = start; i < end + 1; i += iter){\n inputArray.push(i)\n }\n return inputArray;\n}", "function makeArray(start, end, iter){\n const inputArray = [];\n for(let i = start; i < end + 1; i += iter){\n inputArray.push(i)\n }\n return inputArray;\n}", "function Iterator(arr) {\n this.arr = arr;\n this.row = 0;\n this.col = 0;\n this.rowMax = arr.length;\n}", "function makeIterator(array) { //this is how iterators work under the hool\n var nextIndex = 0;\n\n return {\n next: function() { //you can also write `next() {...}`\n return nextIndex < array.length ? //you can write your custom logic also, but return {value, done}\n {value: array[nextIndex++], done: false} :\n {done: true};\n }\n };\n }", "function Iterator() {\n this.arr = [];\n this.index = 0;\n this.current = function() {\n return this.arr[this.index]\n }\n }", "function ArrayIterable(arr){\n this.arr = arr\n}", "function Iterator(arr) {\n\t\n\tthis.length = arr.length;\n\t\n\tthis.each = function(fn) {\n\t\teach(arr, fn);\t\n\t};\n\t\n\tthis.size = function() {\n\t\treturn arr.length;\t\n\t};\t\n}", "[Symbol.iterator]() {\n return this.#array[Symbol.iterator]();\n }", "items() {\n return new algorithm_1.ArrayIterator(this._items);\n }", "function iteratorFromItems(items) {\n return new ArrayIterator(items);\n}", "function iterator() {\n let iterator = []\n for (i = 0; i < 80; i++) {\n iterator.push(i);\n }\n return iterator;\n }", "[Symbol.iterator]() {\n return new ArrayIterator(this.employees);\n }", "function GeneratorFromArr(arr){\n\tthis.arr = arr\n}", "function Iterator(array){\n let nextIndex = 0;\n \n // the Iterator function will return an object containing a next function\n return {\n next: function(){\n\n // if the array isn't exhausted \n if (nextIndex < array.length){\n // return an object with the next item and done: false\n return {\n value: array[nextIndex++],\n done: false\n }\n }\n\n else{\n // return an object with done: true\n return {\n done: true\n }\n }\n }\n }\n}", "function Array() {}", "function returnIterator(arr) {\n var i = 0;\n\n return function () {\n var elem = arr[i];\n i++;\n\n return elem;\n }\n}", "function arrayFactory(numberOfElements,multiplier,offset) {\n\tvar array = new Array(numberOfElements);\n\tfor (var i=0; i<numberOfElements; i++)\n\t\tarray[i] = i * multiplier + offset;\n\treturn array;\n}", "function arrayEnumerator() {\n var obj = this;\n return (function() {\n return {\n __enumeratorIndex: -1,\n Current: null,\n get_Current: function () { return this.Current; },\n current: function() { return this.Current; },\n dispose: function() { },\n moveNext: function() {\n if (this.__enumeratorIndex >= obj.length) {\n return false;\n }\n\n this.__enumeratorIndex++;\n this.Current = obj[this.__enumeratorIndex];\n return this.__enumeratorIndex < obj.length;\n },\n };\n })({});\n }", "function ArrayFrom(items, mapfn = undefined, thisArg = undefined) {\n // Step 1.\n var C = this;\n\n // Steps 2-3.\n var mapping = mapfn !== undefined;\n if (mapping && !IsCallable(mapfn))\n ThrowTypeError(JSMSG_NOT_FUNCTION, DecompileArg(1, mapfn));\n var T = thisArg;\n\n // Step 4.\n // Inlined: GetMethod, steps 1-2.\n var usingIterator = items[std_iterator];\n\n // Step 5.\n // Inlined: GetMethod, step 3.\n if (usingIterator !== undefined && usingIterator !== null) {\n // Inlined: GetMethod, step 4.\n if (!IsCallable(usingIterator))\n ThrowTypeError(JSMSG_NOT_ITERABLE, DecompileArg(0, items));\n\n // Steps 5.a-b.\n var A = IsConstructor(C) ? new C() : [];\n\n // Step 5.c.\n var iterator = MakeIteratorWrapper(items, usingIterator);\n\n // Step 5.d.\n var k = 0;\n\n // Step 5.e\n for (var nextValue of allowContentIter(iterator)) {\n // Step 5.e.i.\n // Disabled for performance reason. We won't hit this case on\n // normal array, since _DefineDataProperty will throw before it.\n // We could hit this when |A| is a proxy and it ignores\n // |_DefineDataProperty|, but it happens only after too long loop.\n /*\n if (k >= 0x1fffffffffffff)\n ThrowTypeError(JSMSG_TOO_LONG_ARRAY);\n */\n\n // Steps 5.e.vi-vii.\n var mappedValue = mapping ? callContentFunction(mapfn, T, nextValue, k) : nextValue;\n\n // Steps 5.e.ii (reordered), 5.e.viii.\n _DefineDataProperty(A, k++, mappedValue);\n }\n\n // Step 5.e.iv.\n A.length = k;\n return A;\n }\n\n // Step 7 is an assertion: items is not an Iterator. Testing this is\n // literally the very last thing we did, so we don't assert here.\n\n // Steps 8-9.\n var arrayLike = ToObject(items);\n\n // Steps 10-11.\n var len = ToLength(arrayLike.length);\n\n // Steps 12-14.\n var A = IsConstructor(C) ? new C(len) : std_Array(len);\n\n // Steps 15-16.\n for (var k = 0; k < len; k++) {\n // Steps 16.a-c.\n var kValue = items[k];\n\n // Steps 16.d-e.\n var mappedValue = mapping ? callContentFunction(mapfn, T, kValue, k) : kValue;\n\n // Steps 16.f-g.\n _DefineDataProperty(A, k, mappedValue);\n }\n\n // Steps 17-18.\n A.length = len;\n\n // Step 19.\n return A;\n}", "function getArray() {\n var a = new Array(10);\n\n for (var i = 0; i < a.length; i++) {\n a[i] = i;\n }\n\n return a;\n}", "function create$7() {\n let out = new ARRAY_TYPE(2);\n out[0] = 0;\n out[1] = 0;\n return out;\n}", "function Iterator(arr) {\n this.length = arr.length;\n this.each = function(fn) {$.each(arr, fn);};\n this.size = function() {return arr.length;};\n}", "function array(items) {\n if(!(this instanceof array)) return new array(items)\n \n var self = this\n this.items = []\n this.count = o_O(0)\n this.length = 0\n this.count.change(function(count) {\n self.length = count \n })\n if(items) {\n for(var i=0; i< items.length; i++)\n this.push(items[i])\n }\n this.initialize()\n}", "_makeIterator() {\n return this.fn.apply(this.context, this.args);\n }", "[Symbol.iterator] () {\n return this\n }", "function Generator(arr) {\n this._value = arr;\n this._indice = 0;\n}", "function makeArray(n) {\nthis.length = n\nreturn this\n}", "function a(c){(0,b.default)(this,a),(0,d.default)(this,\"arr\",void 0),(0,d.default)(this,\"arrIterator\",void 0),this.arr=c,this.arrIterator=c[Symbol.iterator]()}", "constructor() {\n //starts array as empty\n this.length = 0;\n //capacity will be value for length of items in array + any empty spaces\n this._capacity = 0;\n //allocates the space for the length of new array, as long as there is room in memory\n this.ptr = newMem.allocate(this.length);\n }", "function ofArray(data) {\n var ret = create();\n for (var _i = 0, data_1 = data; _i < data_1.length; _i++) {\n var xs = data_1[_i];\n ret.set(xs[0], xs[1]);\n }\n return ret;\n }", "static _createArray(length) {\n\t\tlet lengthAsInteger = parseInt(length, 10);\n\t\tlet arr = new Array(lengthAsInteger || 0);\n\t\tlet i = lengthAsInteger;\n\n\t\tif (arguments.length > 1) {\n\t\t\tlet args = Array.prototype.slice.call(arguments, 1);\n\t\t\twhile (i--) arr[lengthAsInteger - 1 - i] = GeneratorUtil._createArray.apply(this, args);\n\t\t}\n\n\t\treturn arr;\n\t}", "function arr(arg) {\n return new ndarray_1.NDArray(arg);\n}", "function RetroArrayIterator(source) {\n this._source = source;\n this._index = source.length - 1;\n }", "constructor (N) {\n this.arr = new Array(N)\n\n for (var i = 0; i < N; i++) {\n this.arr.push(i)\n }\n }", "function create$6() {\n let out = new ARRAY_TYPE(4);\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n}", "createIterator (results) {\n return {\n next () {\n return results.shift() || { done: true };\n }\n };\n }", "function CreateArray(n) {\n\tthis.length = n;\n\tfor (var i = 1; i <= n; i++) {\n\t\tthis[i] = 0;\n\t\t}\n\treturn this;\n\t}", "function RetroArrayIterator(source) {\r\n this._source = source;\r\n this._index = source.length - 1;\r\n }", "function makeArray(size) \n{\n\tthis.size = size;\n\treturn this;\n}", "function iterifyArr(arr) {\r\n var cur = 0;\r\n arr.next = (function () { return (++cur >= this.length) ? false : this[cur]; });\r\n arr.prev = (function () { return (--cur < 0) ? false : this[cur]; });\r\n return arr;\r\n}", "function ofArray(xs) {\n var ret = create();\n for (var i = 0, l = xs.length; i < l; i++) {\n ret.add(xs[i]);\n }\n return ret;\n }", "function makeArray() {\n this[0] = makeArray.arguments.length;\n for (i = 0; i<makeArray.arguments.length; i++)\n this[i+1] = makeArray.arguments[i];\n}", "function getArray(ctor, ptr) {\n var elementSize = ctor.BYTES_PER_ELEMENT;\n if (!elementSize) throw Error(\"not a typed array\");\n checkMem();\n var buf = U32[ ptr >>> 2];\n var byteOffset = U32[(ptr + 4) >>> 2];\n var byteLength = U32[(ptr + 8) >>> 2];\n return new ctor(buffer, buf + 8 + byteOffset, (byteLength - byteOffset) / elementSize);\n }", "function ArraySeq2(array, offset) {\n this.array = array;\n this.offset = offset;\n}", "function createArray(){\n\tvar array = [];\n\tfor(var i = 0; i < 20; i++){\n\tarray[i] = i*5;\n\t}\n\treturn(array);\n}", "function DynamicArray() {\n this.arr = new Array(1);\n this.size = 1;\n this.length = 0;\n this.start = 0;\n}", "function iteratorToArray(it) {\n var res = [];\n while (true) {\n var r = it.next();\n if (r.done) break;\n res.push(r.value);\n }\n return res;\n}", "function create(array, length, optStartIndex) {\n // Example:\n // arrayProjection.create([1,2,3,4,5,6,7,8,9], 4, 1)\n // // => { array: [/*...*/], from: 1, to: 5 }\n var startIndex = optStartIndex || 0;\n if (startIndex + length > array.length) startIndex -= startIndex + length - array.length;\n return { array: array, from: startIndex, to: startIndex + length };\n}", "__makeSequence() {\n return makeIndexedSequence(this);\n }", "static from(iter)\n {\n let group = new Group;\n\n for (let element of iter)\n group.add(element);\n\n return group;\n }", "getIterator()\r\n {\r\n return new NullIterator();\r\n }", "function makeReusableIterable(generatorFn) {\n return {\n [Symbol.iterator]: generatorFn\n };\n}", "function array(n) {\r\n for (i = 0; i < n; i++) {\r\n this[i] = 0;\r\n }\r\n this.length = n;\r\n}", "function makeArray(length) {\n return Array.apply(null, Array(length));\n}", "async toArrayForTest() {\n if (this.size === Infinity) {\n throw new Error('Can not convert infinite data stream to array.');\n }\n return (await this.iterator()).toArrayForTest();\n }", "sessions() {\n return new algorithm_1.ArrayIterator(this._sessions);\n }", "function getFilterIterable(arr, filter) {\n let index = 0;\n return {\n [Symbol.iterator]() {\n return {\n next() {\n while (true) {\n if (index === arr.length) return {done: true};\n let value = arr[index++];\n if (filter(value)) return {value};\n }\n }\n };\n }\n };\n}", "ToArray() {\n\n }", "function create$5() {\n let out = new ARRAY_TYPE(4);\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n return out;\n}", "static fromArray(arr) {\n return Matrix.map(new Matrix(arr.length, 1), (_, i) => arr[i]);\n }", "[Symbol.iterator]() { return this; }", "[Symbol.iterator]() { return this; }", "[Symbol.iterator]() { return this; }", "[Symbol.iterator]() { return this; }", "[Symbol.iterator]() { return this; }", "extendTypedArray (array, deltaSize) {\n const ta = new array.constructor(array.length + deltaSize) // make new array\n ta.set(array) // fill it with old array\n return ta\n }", "*[Symbol.iterator]() {\n const length = this.length;\n for (let i = 0 ; i < length ; i++) {\n yield this.get(i);\n }\n }", "[Symbol.iterator]() {\n return {\n next: () => {\n let done = !this.hasNext();\n let val = this.next();\n return {\n done: done,\n value: val\n };\n }\n };\n }", "[Symbol.iterator]() {\n return {\n next: () => {\n let done = !this.hasNext();\n let val = this.next();\n return {\n done: done,\n value: val\n };\n }\n };\n }", "static createIteratorFromGenerator(gen){\n return (function(_gen){\n let gen = _gen;\n let iterator = gen();\n let elem;\n\n return {\n next: function(){\n try {\n elem = iterator.next();\n return elem;\n }\n finally{\n //create a new iterator for reuse. Note that this may not always replicate the initial\n //state based on how the data is retrieved. It is the responsibility of the programmer\n //to make this happen if reuse is required.\n if( elem.done )\n iterator = gen();\n }\n }\n };\n })(gen);\n }", "function BaseArray() {\n for (var i=0; i < arguments.length; i++) {\n this[i] = arguments[i];\n };\n this.length = arguments.length;\n }", "*[Symbol.iterator]() {\n let i = 0\n while (i < this.size()) {\n yield this.get(i)\n i++\n }\n }", "function makeTypedArray(elementSize, pack, unpack) {\n // Each TypedArray type requires a distinct constructor instance with\n // identical logic, which this produces.\n var TypedArray = function() {\n Object.defineProperty(this, 'constructor', {value: TypedArray});\n $TypedArray$.apply(this, arguments);\n makeArrayAccessors(this);\n };\n if ('__proto__' in TypedArray) {\n TypedArray.__proto__ = $TypedArray$;\n } else {\n TypedArray.from = $TypedArray$.from;\n TypedArray.of = $TypedArray$.of;\n }\n TypedArray.BYTES_PER_ELEMENT = elementSize;\n var TypedArrayPrototype = function() {};\n TypedArrayPrototype.prototype = $TypedArrayPrototype$;\n TypedArray.prototype = new TypedArrayPrototype();\n Object.defineProperty(TypedArray.prototype, 'BYTES_PER_ELEMENT', {value: elementSize});\n Object.defineProperty(TypedArray.prototype, '_pack', {value: pack});\n Object.defineProperty(TypedArray.prototype, '_unpack', {value: unpack});\n return TypedArray;\n }", "function makeTypedArray(elementSize, pack, unpack) {\n // Each TypedArray type requires a distinct constructor instance with\n // identical logic, which this produces.\n var TypedArray = function() {\n Object.defineProperty(this, 'constructor', {value: TypedArray});\n $TypedArray$.apply(this, arguments);\n makeArrayAccessors(this);\n };\n if ('__proto__' in TypedArray) {\n TypedArray.__proto__ = $TypedArray$;\n } else {\n TypedArray.from = $TypedArray$.from;\n TypedArray.of = $TypedArray$.of;\n }\n TypedArray.BYTES_PER_ELEMENT = elementSize;\n var TypedArrayPrototype = function() {};\n TypedArrayPrototype.prototype = $TypedArrayPrototype$;\n TypedArray.prototype = new TypedArrayPrototype();\n Object.defineProperty(TypedArray.prototype, 'BYTES_PER_ELEMENT', {value: elementSize});\n Object.defineProperty(TypedArray.prototype, '_pack', {value: pack});\n Object.defineProperty(TypedArray.prototype, '_unpack', {value: unpack});\n return TypedArray;\n }", "function makeTypedArray(elementSize, pack, unpack) {\n // Each TypedArray type requires a distinct constructor instance with\n // identical logic, which this produces.\n var TypedArray = function() {\n Object.defineProperty(this, 'constructor', {value: TypedArray});\n $TypedArray$.apply(this, arguments);\n makeArrayAccessors(this);\n };\n if ('__proto__' in TypedArray) {\n TypedArray.__proto__ = $TypedArray$;\n } else {\n TypedArray.from = $TypedArray$.from;\n TypedArray.of = $TypedArray$.of;\n }\n TypedArray.BYTES_PER_ELEMENT = elementSize;\n var TypedArrayPrototype = function() {};\n TypedArrayPrototype.prototype = $TypedArrayPrototype$;\n TypedArray.prototype = new TypedArrayPrototype();\n Object.defineProperty(TypedArray.prototype, 'BYTES_PER_ELEMENT', {value: elementSize});\n Object.defineProperty(TypedArray.prototype, '_pack', {value: pack});\n Object.defineProperty(TypedArray.prototype, '_unpack', {value: unpack});\n return TypedArray;\n }", "constructor (arraySpecs, initSize = 100, deltaSize = 100) {\n // arraySpec details: Three forms are used.\n //\n // The \"key\" is the name of the array. The values are brackets specifying\n // formats for the Object's arrays.\n // * key: [value, 0] - name is a constant value, not an array of values.\n // * key: [arrayType, 1] - key is a simple array of given type.\n // A shortcut is key: arrayType .. w/o the brackets.\n // * key: [arrayType, num] - name is an Array of TypedArrays of num elements\n // arrayType has to be a typed array. If Array is to contain arrays,\n // they should be array objects of size num, not num elements from array.\n\n this.length = 0\n this.size = 0\n this.specs = {}\n this.arrayNames = [] // experiment, may not need\n this.defaultNames = []\n // convert arraySpecs arrays to {Type, elements} objects\n for (const key in arraySpecs) {\n let val = arraySpecs[key]\n if (util.typeOf(val) === 'function') val = [val, 1]\n const [Type, elements] = val\n this.specs[key] = {Type, elements}\n\n if (elements === 0) // experiment, may not need\n this.defaultNames.push(key)\n else\n this.arrayNames.push(key)\n }\n this.initSize = initSize\n this.deltaSize = deltaSize\n this.arrays = {}\n this.initArrays(this.specs)\n this.sharedGetterSetter = this.createGetterSetter()\n }", "function defaultIterator() {\n var self = this;\n return {\n length: function(){ return self.length },\n get: function(i){ return self[i] }\n }\n}", "function makeArray(n) {\r\n//*** BUG: If I put this line in, I get two error messages:\r\n//(1) Window.length can't be set by assignment\r\n//(2) daysInMonth has no property indexed by 4\r\n//If I leave it out, the code works fine.\r\n// this.length = n;\r\n for (var i = 1; i <= n; i++) {\r\n this[i] = 0\r\n }\r\n return this\r\n}", "function copyArray() {\n return new Array(...array);\n}", "function buildCustomArray(len, f) {\n\tvar a = [];\n\tfor (var i=0; i<len; i++) {\n\t\ta[i] = f(i);\n\t}\n\treturn a;\n}", "function MakeArray(n)\n{\n\tfor (var i = 0; i <= n-1; i++)\n\t{\n\t\tthis[i] = 0;\n\t}\n\treturn this\n}", "function r$2(s,r){return new s(new ArrayBuffer(r*s.ElementCount*e$6(s.ElementType)))}", "function makeTypedArray(elementSize, pack, unpack) {\n // Each TypedArray type requires a distinct constructor instance with\n // identical logic, which this produces.\n var TypedArray = function () {\n Object.defineProperty(this, 'constructor', {value: TypedArray});\n $TypedArray$.apply(this, arguments);\n makeArrayAccessors(this);\n };\n if ('__proto__' in TypedArray) {\n TypedArray.__proto__ = $TypedArray$;\n } else {\n TypedArray.from = $TypedArray$.from;\n TypedArray.of = $TypedArray$.of;\n }\n\n TypedArray.BYTES_PER_ELEMENT = elementSize;\n\n var TypedArrayPrototype = function () {\n };\n TypedArrayPrototype.prototype = $TypedArrayPrototype$;\n\n TypedArray.prototype = new TypedArrayPrototype();\n\n Object.defineProperty(TypedArray.prototype, 'BYTES_PER_ELEMENT', {value: elementSize});\n Object.defineProperty(TypedArray.prototype, '_pack', {value: pack});\n Object.defineProperty(TypedArray.prototype, '_unpack', {value: unpack});\n\n return TypedArray;\n }", "function makeTypedArray(elementSize, pack, unpack) {\n // Each TypedArray type requires a distinct constructor instance with\n // identical logic, which this produces.\n var TypedArray = function () {\n Object.defineProperty(this, 'constructor', {value: TypedArray});\n $TypedArray$.apply(this, arguments);\n makeArrayAccessors(this);\n };\n if ('__proto__' in TypedArray) {\n TypedArray.__proto__ = $TypedArray$;\n } else {\n TypedArray.from = $TypedArray$.from;\n TypedArray.of = $TypedArray$.of;\n }\n\n TypedArray.BYTES_PER_ELEMENT = elementSize;\n\n var TypedArrayPrototype = function () {\n };\n TypedArrayPrototype.prototype = $TypedArrayPrototype$;\n\n TypedArray.prototype = new TypedArrayPrototype();\n\n Object.defineProperty(TypedArray.prototype, 'BYTES_PER_ELEMENT', {value: elementSize});\n Object.defineProperty(TypedArray.prototype, '_pack', {value: pack});\n Object.defineProperty(TypedArray.prototype, '_unpack', {value: unpack});\n\n return TypedArray;\n }", "function makeTypedArray(elementSize, pack, unpack) {\n // Each TypedArray type requires a distinct constructor instance with\n // identical logic, which this produces.\n var TypedArray = function() {\n Object.defineProperty(this, 'constructor', {value: TypedArray});\n $TypedArray$.apply(this, arguments);\n makeArrayAccessors(this);\n };\n if ('__proto__' in TypedArray) {\n TypedArray.__proto__ = $TypedArray$;\n } else {\n TypedArray.from = $TypedArray$.from;\n TypedArray.of = $TypedArray$.of;\n }\n\n TypedArray.BYTES_PER_ELEMENT = elementSize;\n\n var TypedArrayPrototype = function() {};\n TypedArrayPrototype.prototype = $TypedArrayPrototype$;\n\n TypedArray.prototype = new TypedArrayPrototype();\n\n Object.defineProperty(TypedArray.prototype, 'BYTES_PER_ELEMENT', {value: elementSize});\n Object.defineProperty(TypedArray.prototype, '_pack', {value: pack});\n Object.defineProperty(TypedArray.prototype, '_unpack', {value: unpack});\n\n return TypedArray;\n }", "function makeTypedArray(elementSize, pack, unpack) {\n // Each TypedArray type requires a distinct constructor instance with\n // identical logic, which this produces.\n var TypedArray = function() {\n Object.defineProperty(this, 'constructor', {value: TypedArray});\n $TypedArray$.apply(this, arguments);\n makeArrayAccessors(this);\n };\n if ('__proto__' in TypedArray) {\n TypedArray.__proto__ = $TypedArray$;\n } else {\n TypedArray.from = $TypedArray$.from;\n TypedArray.of = $TypedArray$.of;\n }\n\n TypedArray.BYTES_PER_ELEMENT = elementSize;\n\n var TypedArrayPrototype = function() {};\n TypedArrayPrototype.prototype = $TypedArrayPrototype$;\n\n TypedArray.prototype = new TypedArrayPrototype();\n\n Object.defineProperty(TypedArray.prototype, 'BYTES_PER_ELEMENT', {value: elementSize});\n Object.defineProperty(TypedArray.prototype, '_pack', {value: pack});\n Object.defineProperty(TypedArray.prototype, '_unpack', {value: unpack});\n\n return TypedArray;\n }", "function makeTypedArray(elementSize, pack, unpack) {\n // Each TypedArray type requires a distinct constructor instance with\n // identical logic, which this produces.\n var TypedArray = function() {\n Object.defineProperty(this, 'constructor', {value: TypedArray});\n $TypedArray$.apply(this, arguments);\n makeArrayAccessors(this);\n };\n if ('__proto__' in TypedArray) {\n TypedArray.__proto__ = $TypedArray$;\n } else {\n TypedArray.from = $TypedArray$.from;\n TypedArray.of = $TypedArray$.of;\n }\n\n TypedArray.BYTES_PER_ELEMENT = elementSize;\n\n var TypedArrayPrototype = function() {};\n TypedArrayPrototype.prototype = $TypedArrayPrototype$;\n\n TypedArray.prototype = new TypedArrayPrototype();\n\n Object.defineProperty(TypedArray.prototype, 'BYTES_PER_ELEMENT', {value: elementSize});\n Object.defineProperty(TypedArray.prototype, '_pack', {value: pack});\n Object.defineProperty(TypedArray.prototype, '_unpack', {value: unpack});\n\n return TypedArray;\n }", "function array(typeSpec) { return new TArray(parseSpec(typeSpec)); }" ]
[ "0.7158582", "0.6462191", "0.64544094", "0.6399269", "0.63200223", "0.6319811", "0.6319811", "0.6319811", "0.6319811", "0.6319811", "0.6286498", "0.6193526", "0.6193526", "0.61046344", "0.6049771", "0.6003641", "0.59335035", "0.59039986", "0.58515316", "0.5800976", "0.57931566", "0.57799864", "0.5746871", "0.5741482", "0.5702059", "0.56827533", "0.56745803", "0.5671669", "0.56446046", "0.5596117", "0.5563169", "0.55415183", "0.5540129", "0.5533815", "0.5533629", "0.5530459", "0.55210567", "0.5510052", "0.5507421", "0.55013764", "0.5493971", "0.5490897", "0.54762006", "0.5458568", "0.54537636", "0.5447123", "0.5431064", "0.5411713", "0.54077834", "0.53988403", "0.535906", "0.53364444", "0.53326774", "0.5329532", "0.5316062", "0.5306405", "0.5284422", "0.52840424", "0.52815646", "0.527882", "0.5277138", "0.52708393", "0.5249213", "0.5231664", "0.5182213", "0.5162694", "0.5150258", "0.5149489", "0.5143577", "0.51421386", "0.5137762", "0.5132072", "0.5132072", "0.5132072", "0.5132072", "0.5132072", "0.51306087", "0.5121258", "0.51191366", "0.51191366", "0.51156086", "0.5115362", "0.5112649", "0.5109003", "0.5109003", "0.5109003", "0.5108376", "0.51029176", "0.509993", "0.509593", "0.5092808", "0.5088243", "0.508367", "0.50797355", "0.50797355", "0.5079338", "0.5079338", "0.5079338", "0.5075554" ]
0.6902262
2
validates data, returns false if it's ok or an error message else
validateFormData(data){ if (data.s_id == "-1") return 'Вы должны выбрать школу'; if (data.p_name == '') return 'Вы должны выбрать проект'; if (data.start == '') return 'Вы должны указать дату начала'; if (data.finish == '') return 'Вы должны указать дату конца'; if (Date.parse(data.finish) <= Date.parse(data.start)) return 'Дата конца не может быть раньше даты начала'; return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validate(data) {\n\tif (\n\t\tvalidateName(data[\"name\"]) == \"\" &&\n\t\tvalidateStandard(data[\"standard\"]) == \"\" &&\n\t\tvalidateRollNo(data[\"rollNo\"]) == \"\" &&\n\t\tvalidateDate(data[\"DOB\"]) == \"\" &&\n\t\tvalidateEmpty(data[\"rollNo\"]) == \"\" &&\n\t\tvalidateEmpty(data[\"name\"]) == \"\" &&\n\t\tvalidateEmpty(data[\"gender\"]) == \"\" &&\n\t\tvalidateEmpty(data[\"standard\"]) == \"\" &&\n\t\tvalidateEmpty(data[\"DOB\"]) == \"\"\n\t)\n\t\treturn true;\n\telse return false;\n}", "function validateData(data) {\n if (data) {\n let conflicts = conflictService.inputs.checkForConflicts(data, $scope.step, $scope.comparators, $scope.flexiblityComparators);\n conflictService.alerts.createConflictAlert(conflicts.conflicts);\n if (conflicts.exist) {\n return false;\n } else {\n return true;\n }\n }\n\n // return false;\n\n }", "function checkErrors(data) {\n\t\tif (data['error'] !== false) {\n\t\t\tif (data['noCash'] == true){\n\t\t\t\talert(\"You did not have enough money to cover your bet, the race was aborted.\");\n\t\t\t}\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function validateData(){\r\n\t var nmflag=validatename();\r\n\t var passflag=validatepassword();\r\n\t var hbflag=validatehobbies();\r\n\t if(nmflag && passflag && hbflag){\r\n\t\t displayData();\r\n\t }\r\n\t return false;\r\n }", "validateData(){\n this.setState({errorMessage: ''});\n ////////////////Empty Input validation\n if(this.state.title == '' || this.state.firstName == '' ||\n this.state.lastName == '' || this.state.day == '' ||\n this.state.month == '' || this.state.year == '' ||\n this.state.stdNum == ''){\n this.setState({errorMessage: 'Empty Input'});\n return false;\n }\n return true;\n }", "function validateData(logger, data) {\n var error = '';\n if(!data.bt) error = 'no bt supplied';\n else if (data.bt === null) error = 'bt cannot be null';\n else if (!data.e) error = 'no e supplied';\n\n if(error.length > 0) return error;\n else return true;\n}", "function verifyData(){\n\n \tvar inDate = $(\"#enterDate\").val();\n \tvar outDate = $(\"#departDate\").val();\n \tvar numPersons = $(\"#numPersons\").val();\n \tvar numKids = $(\"#numRooms\").val();\n \tvar numKids = $(\"#numKids\").val();\n\n \tif(!inDate){\n \t\treturn false;\n \t}\n \tif(!outDate){\n \t\treturn false;\n \t}\n \tif(!numPersons){\n \t\treturn false;\n \t}\n \tif(!numRooms){\n \t\treturn false;\n \t}\n \tif(!numKids){\n \t\treturn false;\n \t}\n\n\n \treturn true;\n }", "function verifyFormData(data) {\n // check required fields\n // check variable type or specific field rule\n if (!data.get(\"name\")) {\n alert(`Please, fill [Name] field`);\n return false;\n }\n if (!data.get(\"contact1\")) {\n alert(`Please, fill [Contact] field`);\n return false;\n }\n if (!data.get(\"contact2\")) {\n alert(`Please, fill [Contact] field`);\n return false;\n }\n if (!data.get(\"contact3\")) {\n alert(`Please, fill [Contact] field`);\n return false;\n }\n if (!data.get(\"address1\")) {\n alert(`Please, fill [Address] field`);\n return false;\n }\n if (!data.get(\"address2\")) {\n alert(`Please, fill [Address] field`);\n return false;\n }\n if (!data.get(\"zipCode\")) {\n alert(`Please, fill [Zip Code] field`);\n return false;\n }\n if (!data.get(\"gender\")) {\n alert(`Please, fill [Gender] field`);\n return false;\n }\n if (!data.get(\"birthYear\")) {\n alert(`Please, fill [Birthday] field`);\n return false;\n }\n if (!data.get(\"birthMonth\")) {\n alert(`Please, fill [Birthday] field`);\n return false;\n }\n if (!data.get(\"birthDay\")) {\n alert(`Please, fill [Birthday] field`);\n return false;\n }\n if (!data.get(\"married\")) {\n alert(`Please, fill [Marital Status] field`);\n return false;\n }\n if (!data.get(\"faithState\")) {\n alert(`Please, fill [Faith State] field`);\n return false;\n }\n if (!data.get(\"joinYear\")) {\n alert(`Please, fill [Join Date] field`);\n return false;\n }\n if (!data.get(\"joinMonth\")) {\n alert(`Please, fill [Join Date] field`);\n return false;\n }\n return true;\n}", "function CheckPatientInputData(){\t\n\t\t\t\n\t\t\t//alert(\"(DEBUG)CheckPatientInputData() - starting\" );\n\t\t\t\n\t\t\tif(CheckInputField(PatientData.Forename_FieldValue,\"text\")==false){\n\t\t\t\t//alert(\"ERROR - Entrada invalida en Nombre\");\n\t\t\t\treturn false;\n\t\t\t}else if(CheckInputField(PatientData.FirstSurname_FieldValue,\"text\")==false){\n\t\t\t\t//alert(\"ERROR - Entrada invalida en Primer Apellido\");\n\t\t\t\treturn false;\n\t\t\t}else if(CheckInputField(PatientData.SecondSurname_FieldValue,\"text\")==false){\n\t\t\t\t//alert(\"ERROR - Entrada invalida en Segundo Apellido\");\n\t\t\t\treturn false;\n\t\t\t}else if(CheckInputField(PatientData.PatientEmail_FieldValue,\"email\")==false){\n\t\t\t\t//alert(\"ERROR - Entrada invalida en Email\");\n\t\t\t\treturn false;\n\t\t\t}else if(1==10){\n\t\t\t//\t//alert(\"ERROR - Entrada invalida en telefono\");\n\t\t\t//FIXME: script failing when checking the phone number\t\n\t\t\t\treturn false;\n\t\t\t}else{\n\t\t\t\t//alert(\"(DEBUG)CheckPatientInputData() - ending. Return TRUE\" );\n\t\t\t\treturn true;\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}", "function isValidData(field) {\n // validation result\n var res = true;\n // Email validation\n var regex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]{2,}$/;\n\n\n // Clear global error message\n vm.messages.error = null;\n\n // Validate Name\n if ((field && field === 'name') || !field) {\n if ((typeof vm.credentials.name !== 'undefined') && (vm.credentials.name.trim() !== '')) {\n res &= true;\n vm.messages.name = null;\n } else {\n res &= false;\n vm.messages.name = 'Please insert your name';\n }\n }\n\n // Validate Email\n if ((field && field === 'email') || !field) {\n if (regex.exec(vm.credentials.email) !== null) {\n res &= true;\n vm.messages.email = null;\n } else {\n res &= false;\n vm.messages.email = 'Please insert a valid email address';\n }\n }\n\n // Validate Password\n if ((field && field === 'password') || !field) {\n if ((typeof vm.credentials.password !== 'undefined') &&\n (vm.credentials.password.trim() !== '')) {\n res &= true;\n vm.messages.password = null;\n } else {\n res &= false;\n vm.messages.password = 'Please insert your account password';\n }\n }\n\n return res;\n }", "function testData(){\n let result = false;\n for(name in data) {\n if(blankField(data[name])){\n result = true;\n }else{\n result = false;\n }\n }\n if(password.value === \"\" || (password.value !== \"\" && !numExp.test(password.value))){\n password.classList.add(\"invalid\");\n password.insertAdjacentHTML('afterend', \"<p class = 'message'>Password must contain one number, one letter, one capital letter and be at least 8 characters long</p>\");\n result = false;\n }\n \n if(telephone.value === \"\" || (telephone.value !== \"\" && !tele.test(telephone.value))){\n telephone.classList.add(\"invalid\");\n telephone.insertAdjacentHTML('afterend', \"<p class = 'message'>Telephone number format must be for eg 876-555-7896</p>\");\n result = false;\n }\n \n return result;\n }", "function validate(data){\r\n\t\tlet errors = {}\r\n\t\t// console.log(\"******\")\r\n\t\t// console.log(data)\r\n\t\tif(data.email === \"\") errors.email=\"Email Can't Be Empty\"\r\n\r\n\t\tif(/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test(data.email) === false) errors.email=\"School Email Should Be Valid\"\r\n\r\n\t\tif(data.name === \"\") errors.name=\"School Name Can't Be Empty\"\r\n\r\n\t\tif(data.password ===\"\") errors.password=\"Password Can't Be Empty\"\r\n\t\tif(data.password.length<6) errors.password=\"Password Length Shouldn't Be Less Than 6\"\r\n\r\n\t\tif(data.cpassword ===\"\") errors.cpassword=\"Confirm Password Can't Be Empty\"\r\n\t\tif(data.cpassword !== data.password) errors.cpassword=\"Password and Confirm Password Should Match\"\t\r\n\r\n\t\t// this.setState({ errors })\r\n\t\tconsole.log(errors)\r\n\t\tconst isValid = Object.keys(errors).length===0\r\n\r\n\t\treturn {errors, isValid}\r\n}", "function validateData(tapi, data, cb) {\n var result = true,\n uriFields = getUriFields(tapi.url);\n\n uriFields.forEach((field) => {\n if (typeof data[field] === 'undefined') {\n cb(new Error('Missing required field \"' + field + '\" in data'));\n result = false;\n }\n });\n tapi.params.forEach((param) => {\n if (param.Required === 'Required') {\n if (typeof data[param] === 'undefined') {\n cb(new Error('Missing required field \"' + param + '\" in data'));\n result = false;\n }\n }\n });\n\n return result;\n }", "function _validateData() {\n const { identifier, password, ip } = user;\n var success = false;\n var error_name, error_code;\n\n if (\n identifier.length < 6 ||\n identifier.length > 254 ||\n identifier === \"undefined\"\n ) {\n error_name = \"username or email\";\n error_code = \"0003\";\n } else if (\n password.length < 8 ||\n password.length > 254 ||\n password === \"undefined\"\n ) {\n error_name = \"password\";\n error_code = \"0004\";\n } else if (!ipValidator(ip) || ip === \"undefined\") {\n error_name = \"ip\";\n error_code = \"0004\";\n } else {\n success = true;\n }\n //respuesta 409 - error del cliente\n switch (success) {\n case false:\n res.cookie(\"refreshToken\", null, {\n maxAge: 0,\n });\n res.status(400).send({\n error_code: `ERROR_SIGN_IN_${error_code}`,\n message: `Invalid ${error_name}.`,\n success: false,\n });\n return false;\n default:\n return true;\n }\n }", "function validate() {\n\t\t\tvar allOk = true;\n\t\t\tvar ok = $userFullName.val().match(/[\\w -]{3,}/) !== null;\n\t\t\ttooltip.set($userFullName, !ok);\n\t\t\tallOk = allOk && ok;\n\n\t\t\tok = $userEmail.val().match(/^[\\w\\.\\-_]{1,}@([\\w\\-_]+.){1,}\\w{3,5}$/) !== null;\n\t\t\ttooltip.set($userEmail, !ok);\n\t\t\tallOk = allOk && ok;\n\n\t\t\tok = $userPhone.val().match(/^[\\d+\\s\\-]{5,}$/) !== null;\n\t\t\ttooltip.set($userPhone, !ok);\n\t\t\tallOk = allOk && ok;\n\n\t\t\tok = $userCitizenship.val().match(/^[\\w\\s]{2,}$/) !== null;\n\t\t\ttooltip.set($userCitizenship, !ok);\n\t\t\tallOk = allOk && ok;\n\n\t\t\tok = datepicker.isValid();\n\t\t\tallOk = allOk && ok;\n\n\t\t\ttooltip.set($submitBookingButton, !allOk);\n\t\t\treturn allOk;\n\t\t}", "function validateInput(data)\n{\n var errors = {};\n\n if (isEmpty(data.email) || validator.isEmpty(data.email))\n {\n errors.id = 'missing id';\n }\n\n return {\n errors,\n isValid: isEmpty(errors)\n };\n}", "function checkIsValidForm(data) {\n\t\n\tvar stat = true;\n\t\n\tif(data == undefined)\n\t\tstat = false;\n\n//checks if any data is empty\n\tif(\tdata.name != undefined && \n\t\tdata.game != undefined && \n\t\tdata.requirements != undefined)\n\t{\n\t\tif(data.members.length == 0)\n\t\t\tstat = false;\n\t\t\n\t\tdata.members.forEach( function(element) {\n\t\t\tif(!global.allUsers.some(e => e.id == element)) {\n\t\t\t\tstat = false;\n\t\t\t}\n\t\t});\n\t}\n\treturn stat;\n}", "validateDatasetForm() {\n if(this.nameValidationState != undefined && this.descValidationState != undefined && this.attribValidationState != undefined) {\n if(this.nameValidationState == 'error' || this.descValidationState == 'error' || this.attribValidationState == 'error') {\n return true;\n } else {\n return false;\n }\n } else {\n return true;\n }\n }", "function checkIsValidForm(data) {\n\n\tvar stat = true;\n\n\tif(data == undefined)\n\t\tstat = false;\n\n//checks if any data is empty\n\tif(\tdata.name != undefined &&\n\t\tdata.team != undefined &&\n\t\tdata.location != undefined &&\n\t\tdata.requirements != undefined)\n\t{\n\t\tif(data.members.length == 0)\n\t\t\tstat = false;\n\n\t\tdata.members.forEach( function(element) {\n\t\t\tif(!global.allUsers.some(e => e.id == element)) {\n\t\t\t\tstat = false;\n\t\t\t}\n\t\t});\n\t}\n\treturn stat;\n}", "isValidData(temp) {\n const { data } = this.state;\n\n let errorList = [];\n\n // Check ten\n if (data.Name == \"\") {\n this.refs['txtName'].setValid(false);\n\n errorList.push({\n name: 'Name',\n msg: strings('dl.contract_list.noti.err.name')\n });\n } else {\n this.refs['txtName'].setValid(true);\n }\n\n // Check phone\n if (data.Phone == \"\") {\n this.refs['txtPhone'].setValid(false);\n\n errorList.push({\n name: 'Phone',\n msg: strings('dl.contract_list.noti.err.phone')\n });\n } else {\n this.refs['txtPhone'].setValid(true);\n }\n\n // Check phone\n if (data.ReasonId == null) {\n this.refs['optChoice'].setValid(false);\n\n errorList.push({\n name: 'Reason',\n msg: strings('dl.contract_list.noti.err.reason')\n });\n } else {\n this.refs['optChoice'].setValid(true);\n }\n\n if (errorList.length == 0) {\n return true;\n }\n\n this.refs['popup'].getWrappedInstance().show(errorList[0].msg);\n return false;\n }", "function isValidData() {\n const validHostName = !!hostName && hostName.length >= 2\n const validGameName = !!gameName && gameName.length >= 2\n return validHostName && validGameName\n }", "function validate() {\n if (!$scope.id.length || !$scope.pass.length || !$scope.name.length || !$scope.group.length ||\n !$scope.email.length || !$scope.phone.length || !$scope.workplace.length || !($scope.informed.email.length || \n $scope.informed.facebook.length || $scope.informed.webSite.length || $scope.informed.colleague.length || \n $scope.informed.other.length) || !($scope.population.elementary.length || \n $scope.population.highSchool.length || $scope.population.higherEducation.length || $scope.population.other.length)) {\n $scope.emptyData = true;\n } else { // Habilita\n $scope.emptyData = false;\n }\n }", "validateData() {\n if(_.isEmpty(this.refs.email.getValue()) || _.isEmpty(this.refs.pass.getValue()) || _.isEmpty(this.refs.username.getValue())) {\n return true;\n }\n }", "function validate() \n{\n var result = validateMemberID() + validateScore() + validateEventID();\n alert(\"result = \" + result); // should be nothing if fields validate\n if ( result == \"\" )\n { \n \talert(\"Data Added successfully\"); \n \treturn true; \n }\n else \n {\n alert(\"Errors in entering the Data\");\n return false;\n }\n \n}", "check() {\n if (this.state.data && this.state.radio && this.state.data !== \"\"\n && this.state.currentMetricAreaCalculations.size >= 1\n && this.state.selectedMetricAreaCalculations) {\n return true\n }\n let errors = {} // Object to hold errors\n\n if (!this.state.data) {\n errors[\"invalidData\"] = \"A value must be entered\"\n }\n if (!this.state.radio) {\n errors[\"invalidRadio\"] = \"An actual or target must be selected\"\n }\n if (this.state.currentMetricAreaCalculations.size < 1) {\n errors[\"invalidMetricArea\"] = \"A metric area must be selected\"\n }\n if (!this.state.selectedMetricAreaCalculations) {\n errors[\"invalidMetricCalc\"] = \"A metric calculation must be selected\"\n }\n errors[\"errorMsg\"] = \"Not all required fields have been answered/selected. Check above for more detail.\"\n\n this.setState(errors)\n return false\n }", "validateData() {\n const title = this.titleRef.current.value;\n let description = this.descriptionRef.current.state.value;\n\n let hasPhoto = this.state.photos.length;\n let hasTitle = true;\n let hasDescription = true;\n\n // Validate photos\n if (!hasPhoto) {\n this.showError('You must upload at least 1 photo');\n }\n\n // Validate title\n if (title == null || title.trim() === '') {\n hasTitle = false;\n this.showError('Title can not empty');\n }\n\n description = !!description ? description : ''\n // Remove all html tag\n const descriptionContent = description.replace(/<\\/?(?!(img)\\b)\\w+[^>]*>/gm, '');\n if (descriptionContent === '') {\n hasDescription = false;\n this.showError('Description can not empty');\n }\n\n return hasPhoto && hasTitle && hasDescription;\n }", "validate() {\n\t\t\n\t\tconst valid = (\n\t\t\tvalidatePatientID(\n\t\t\t\t'patientID', \n\t\t\t\tthis.props.patientID, \n\t\t\t\tthis.setError\n\t\t\t)\n\t\t);\n\t\t\n\t\treturn valid;\n\t}", "function valid(){return validated}", "function validateData(data, callback) {\n\tvar errMsg;\n\tif (data.distance) {\n\t\ttry {\n\t\t\tvar dist_int = parseInt(data.distance);\n\t\t\tdata.distance = dist_int;\n\t\t} catch(err) {\n\t\t\terrMsg = \"Distance is not valid, needs to be integer.\";\n\t\t}\n\t}\n\tif (data.duration) {\n\t\ttry {\n\t\t\tvar duration_int = parseInt(data.duration);\n\t\t\tdata.duration = duration_int;\n\t\t} catch(err) {\n\t\t\terrMsg = \"Duration is not valid, needs to be integer.\";\n\t\t}\n\t\tif (data.time1 && data.time2) {\n\t\t\t// Check that duration is less than end time - start time, converted to minutes\n\t\t\tvar timeDiff = (data.time2 - data.time1) / 60000;\n\t\t\tif (data.duration > timeDiff) {\n\t\t\t\terrMsg = \"Duration is greater than difference between Start Time and End Time\";\n\t\t\t}\n\t\t}\n\t}\n\tif (data.lownumparticipants) {\n\t\ttry {\n\t\t\tvar lownumparticipants_int = parseInt(data.lownumparticipants);\n\t\t\tdata.lownumparticipants = lownumparticipants_int;\n\t\t} catch(err) {\n\t\t\terrMsg = \"Number of Participants is not valid, needs to be integer.\";\n\t\t}\n\t}\n\tif (data.highnumparticipants) {\n\t\ttry {\n\t\t\tvar highnumparticipants_int = parseInt(data.highnumparticipants);\n\t\t\tdata.highnumparticipants = highnumparticipants_int;\n\t\t} catch(err) {\n\t\t\terrMsg = \"Number of Participants is not valid, needs to be integer.\";\n\t\t}\n\t}\n\tif (data.low_price) {\n\t\ttry {\n\t\t\tvar lowprice_int = parseInt(data.lowprice);\n\t\t\tdata.lowprice = lowprice_int;\n\t\t} catch(err) {\n\t\t\terrMsg = \"Price Range is not valid, needs to be integer.\";\n\t\t}\n\t}\n\tif (data.highprice) {\n\t\ttry {\n\t\t\tvar highprice_int = parseInt(data.highprice);\n\t\t\tdata.highprice = highprice_int;\n\t\t} catch(err) {\n\t\t\terrMsg = \"Price Range is not valid, needs to be integer.\";\n\t\t}\n\t}\n\tdata.errMsg = errMsg;\n\tcallback(data);\n}", "validateResponse (data) {\n\t\tthis.validateDisposition(data);\n\t\tthis.validateVersionInfo(data);\n\t\tthis.validateAgentInfo(data);\n\t\tthis.validateAssetUrl(data);\n\t}", "function checkOk(data){\n if (data[0] != OK) {\n console.log(\"{\\\"error\\\": \\\"cannot establish comms with Testalator\\\"}\")\n return false;\n }\n return true;\n}", "function validateInputs(data) {\n // console.log(\"1111111111111\")\n // console.log(data)\n // console.log(\"1111111111111\")\n let inputIndex = 0;\n for (let key in data) {\n if (data[key]) \n inputIndex++;\n }\n if (inputIndex === 0) {\n return \"empty\";\n } else {\n return (inputIndex === requiredFields.length) ? \"valid\" : \"empty\";\n }\n}", "function validate(){\n \n if(name===null){\n alert(\"Enter the name please\")\n return false\n }\n if(className===null){\n alert(\"Enter class name please\")\n return false\n }\n if(location===null){\n alert(\"Enter location please\")\n return false\n }\n if(edu===null){\n alert(\"Enter the Education Buddy please\")\n return false\n }\n if(pd===null){\n alert(\"Enter the personal development buddy\")\n return false\n }\n if(gitHub===null){\n alert(\"Enter github id please\")\n return false\n }\n \n return true;\n }", "function checkInputs() {\n const nameValue = name.value.trim();\n const emailValue = email.value.trim();\n const ageValue = age.value.trim();\n const messageValue = message.value.trim();\n\n let isSuccessful = true;\n if(isNameValid(nameValue)) {\n setSuccessFor(name);\n } else {\n isSuccessful = false;\n setErrorFor(name, 'Name cannot be less that 2 charachters');\n }\n\n if(isEmailValid(emailValue)) {\n setSuccessFor(email);\n } else {\n isSuccessful = false;\n setErrorFor(email, 'Email is not valid');\n }\n\n if(isAgeValid(ageValue)) {\n setSuccessFor(age);\n } else {\n isSuccessful = false;\n setErrorFor(age, 'You must be 18 or over to send this contact form');\n }\n\n if(isMessageValid(messageValue)) {\n setSuccessFor(message);\n } else {\n isSuccessful = false;\n setErrorFor(message, 'Message must be between 10 and 200 characters');\n }\n\n return isSuccessful;\n}", "function validationErrors(data){\n const errors = {};\n if(data.rating == \"\" || data.review == null){\n errors.rating = \"Rating is required\";\n }else if(parseInt(data.rating) < 1 || parseInt(data.rating) > 5){\n errors.rating = \"Rating must be a number between 1 and 5\";\n }\n if(!data.review || data.review == \"\" || data.review == null){\n errors.review = \"Review is required\"\n }\n if(Object.entries(errors).length == 0){\n return false;\n }\n return errors;\n }", "validate() {\n // Als NIET (!) valide, dan error weergeven\n if (!this.isValid()) {\n this.showError();\n console.log(\"niet valide\");\n }\n else\n this.hideError();\n }", "function data_valid() {\n\t\tif (validName === true && validTime === true && validDuration === true && validTestpaper === true && validGroup === true) {\n\t\t\tsubmit.style.backgroundColor = '#4CCABD';\n\t\t\tsubmit.disabled = false;\n\t\t} else {\n\t\t\tsubmit.style.backgroundColor = 'grey';\n\t\t\tsubmit.disabled = true;\n\t\t}\n\t\tdocument.getElementById('time_invalid').innerHTML = validName + ',' + validTime + validDuration + validTestpaper + validGroup;\n\t}", "function checkData() {\n\t\t\t\tif (document.form1.threeChar.value.length == 3) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\talert(\"Enter exactly 3 characters. \" +\n\t\t\t\t\t\tdocument.form1.threeChar.value + \" is not valid.\");\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}", "function validateInput() {\n\t\tif (!name) {\n\t\t\talert('Please input a name');\n\t\t\treturn false;\n\t\t}\n\t\tif (!description) {\n\t\t\talert('Please give a small description');\n\t\t\treturn false;\n\t\t}\n\t\tif (!value) {\n\t\t\talert('Please describe the sentimental value');\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "isvalidated() {\n return isEmpty(this.state.fname_err) &&\n isEmpty(this.state.lname_err) &&\n isEmpty(this.state.username_err) &&\n isEmpty(this.state.year_err) &&\n isEmpty(this.state.month_err) &&\n isEmpty(this.state.day_err) &&\n isEmpty(this.state.email_err) &&\n isEmpty(this.state.password_err) &&\n isEmpty(this.state.confirmPassword_err);\n }", "function validateNotEmpty(data){\n if (data == ''){\n return true;\n }else{\n return false;\n }\n}", "function validateData(data) {\n\tvar invalid = \"invalid-data\";\n\t\n\t// check null case for fresh installation validation\n\tif(null == data) {\n\t\treturn invalid;\n\t}\n\t\n\tvar count = 0;\n\tfor(var config in data) {\n\t\tcount++;\n\t\tif(typeof data[config] == 'undefined') {\n\t\t\treturn invalid;\n\t\t}\n\t}\n\t\n\t// adding extra checks for fresh install case\n\t// user settings will be restored and we want to validate if everything is looking good\n\tif(0 == count || !data.vLoc) {\n\t\treturn invalid;\n\t}\n\t\n\t// if everything is good then return the data object\n\treturn data;\n}", "function validate_user_data(data){\n\t\n\tconst user = {\n\t\tvalid:true,\n\t\tusername:\"\",\n\t\tpassword:\"12345678\", //disabled for testing\n\t\temail:\"\",\n\t\tadmin:false,\n\t\terror:[]\n\t};\n\t\n\t//username\n\tif(data.username && validator.isLength(data.username, {min:2, max:255})){\n\t\tuser.username = validator.stripLow(data.username);\n\t\tuser.username = validator.escape(user.username);\n\t\tuser.username = validator.trim(user.username);\n\t}else{\n\t\tuser.valid = false;\n\t\tuser.error.push({username:\"Unsername length is not within allowed range (2-255)\"});\n\t}\n\t\n\t//email\n\tif(data.email && validator.isLength(data.email, {min:6, max:100}) && validator.isEmail(data.email)){\n\t\tuser.email = validator.stripLow(data.email);\n\t\tuser.email = validator.escape(user.email);\n\t\tuser.email = validator.trim(user.email);\n\t}else{\n\t\tuser.valid = false;\n\t\tuser.error.push({email:\"Email is not valid / not withing allowed range (6-100)\"});\n\t}\n\t\n\t//password\n\t/*if(data.password && validator.isLength(data.password,{min:8,max:255})){\n\t user.password = data.password;\n\t }else{\n\t user.valid = false;\n\t user.error.push({password:\"Password length is not within allowed range (8-255)\"});\n\t }*/\n\t\n\tif(validator.isBoolean(data.admin)){\n\t\tuser.admin = validator.toBoolean(data.admin);\n\t}else{\n\t\tuser.valid = false;\n\t\tuser.error.push({admin:\"Admin value is an invalid boolean\"});\n\t}\n\t\n\treturn user;\n}", "function validate (input) {\n \t//ver dps..\n \treturn true;\n }", "function validate(){\n\n\t\t//TODO: make this work\n\n\n\t}", "function validate(){\n validateAirtimeAmount();\n \n if(isError){\n setState({\n ...state,\n ...errors\n })\n } return isError;\n }", "validateResponse (data) {\n\t\t// validate that we got back \"ourselves\", and that there are no attributes a client shouldn't see\n\t\tthis.validateMatchingObject(this.currentUser.user.id, data.user, 'user');\n\t\tthis.validateSanitized(data.user, UserTestConstants.UNSANITIZED_ATTRIBUTES_FOR_ME);\n\t}", "validateLocalData(data) {\n return true;\n }", "function validation_ok() {\n\n return check_username_sync() && check_password();\n}", "function validation() {\n if (!data.length) {\n return setValid(\"\")\n }\n else {\n const prevReading = data[0].meterReading;\n const currentReading = meterReading.current.value;\n if (currentReading <= prevReading) {\n return setValid(\"false\")\n }\n else {\n return setValid(\"true\")\n }\n }\n }", "function validateData(krs) {\n let message = [];\n\n if (!krs) {\n message.push('No object is provided');\n }\n\n if (!krs.nim) {\n message.push('Nim is empty');\n }\n\n if (!krs.kode_mata_kuliah) {\n message.push('Kode Mata Kuliah is empty');\n }\n\n if (message.length) {\n let error = new Error(message.join());\n error.statusCode = 400;\n\n throw error;\n }\n}", "checkIsValid() {\n if (!this.isValid) {\n this.errors.push({\n field: this.fieldName,\n message: this.message,\n valueRecieved: this.fieldValue,\n });\n }\n }", "function isOkEmail() {\n\n //The program looks there is the right format.\n let indexOfAt = emailUser.value.indexOf('@');\n let textBeforeAt = emailUser.value.slice(0, indexOfAt);\n let textAfterAt = emailUser.value.slice(indexOfAt+1, emailUser.value.length);\n let indexOfDot = textAfterAt.indexOf('.');\n let textBeforeDot = textAfterAt.slice(0, indexOfDot);\n let textAfterDot = textAfterAt.slice(indexOfDot+1, emailUser.value.length);\n\n //fThe program that there are all the elements and later the right format\n if (emailUser.value === \"\") {\n clearAllEmailErrors();\n errorIndication(emailUser, 'email_mailEmpty_EM');\n okEmail = false;\n } else if (!emailUser.value.includes('@')) {\n clearAllEmailErrors();\n errorIndication(emailUser, 'email_no_At_EM');\n return false;\n } else if(textAfterAt.length == 0 || (textAfterAt.length == 1 && indexOfDot == 0)) {\n clearAllEmailErrors();\n errorIndication(emailUser, 'email_no_domain_EM');\n return false;\n } else if (!emailUser.value.includes('.')) {\n clearAllEmailErrors();\n errorIndication(emailUser, 'email_no_dot_EM');\n return false;\n } else if (emailUser.value.includes(' ')) {\n clearAllEmailErrors();\n errorIndication(emailUser, 'email_blank_Space_EM');\n return false;\n } else if (textBeforeAt.length === 0) {\n clearAllEmailErrors();\n errorIndication(emailUser, 'email_bad_Format_EM');\n return false;\n } else if (textBeforeDot.length === 0) {\n clearAllEmailErrors();\n errorIndication(emailUser, 'email_bad_Format_EM');\n return false;\n } else if (textAfterDot.length === 0) {\n clearAllEmailErrors();\n errorIndication(emailUser, 'email_bad_Format_EM');\n return false;\n } else {\n clearAllEmailErrors();\n return true;\n }\n }", "function validate() {\n validateName();\n validatePassword();\n validateEmail();\n validatePhoneNumber();\n \n \n if(isError){\n setState({\n ...state,\n ...errors})\n }\n return isError;\n }", "function validate(){\n\tvar firstName = wordCheck('#firstName','#error_firstname');\n\tvar lastName = wordCheck('#lastName','#error_lastname');\n\tvar email = emailCheck('#email','#error_email');\n\tvar phoneNumber = numberCheck('#contactNumber','#error_contactnumber');\n\tif ($('#subject').length != 0){\n\t\tvar sub = wordCheck('#subject','#error_subject');\n\t}\n\tif (firstName && lastName && email && phoneNumber){\n\t\tif ($('#subject').length != 0){\n\t\t\tif (sub)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\telse{\n\t\t\treturn true;\n\t\t}\n\t}\n\telse\n\t\treturn false;\n}", "function SBUpdateRecord_checkData()\n{\n var isValid = true;\n \n // Clear out the error message.\n \n this.setErrorMessage(\"\");\n\n isValid = this.checkConnectionName(false) && isValid;\n\n if (isValid)\n {\n // Get all form elements for the chosen form so we can check that mapped columns\n // are mapped to an existing form element.\n \n var formNode = this.getFormTag();\n var formElements = (formNode) ? formNode.elements : new Array();\n var mappedColumn = false;\n var mappedPrimary = false;\n\n\tformElements = formElements.concat(FormFieldsMenuASPNet.getWebFormControls(formNode));\n\n\tif (formElements != null)\n\t{\n var columns = this.getColumnList();\n \n for (var i = 0; columns && i < columns.length; i++)\n {\n // Check that user has mapped some columns to values. Also, make sure the columns are\n // mapped to existing form elements.\n \n var columnValue = columns[i].getVariableName();\n\t\n \t if (columnValue)\n { \n\t \t if (dwscripts.findInArray(formElements, columnValue, findFormElement) == (-1))\n {\n isValid = false;\n this.appendErrorMessage(dwscripts.sprintf(MM.MSG_MapColumnToExistingElement, \n\t\t\t\t\t\t\t\t\t\t\t\t\t columns[i].getColumnName()));\n }\n else if (columns[i].getIsPrimaryKey())\n\t\t {\n\t\t mappedPrimary = true;\n\t\t }\n\t\t else\n\t\t {\n mappedColumn = true;\n\t\t }\n }\n }\n }\n\n if (!mappedColumn)\n {\n this.appendErrorMessage(MM.MSG_NoMappedColumns);\n isValid = false;\n }\n\n if (!mappedPrimary)\n {\n this.appendErrorMessage(MM.MSG_NoMappedKey);\n isValid = false;\n }\n }\n\n return isValid;\n}", "function dataValid (data = {}) {\n console.log(\"::: data valid :::\")\n document.getElementById('error').classList.add(\"pseudo\");\n document.getElementById('error').innerHTML = \"\";\n document.getElementById('daysleft').innerHTML = data.daysleft;\n \n // weather summary\n document.getElementById('weathersummary').innerHTML = data.summary;\n document.getElementById('weathersummary').className = '';\n /* eslint-disable-next-line */\n document.getElementById('weathersummary').classList.add(Client.getIconClass(data.icon));\n document.getElementById('destinationimage').src = data.imagelink;\n }", "function verifyData(){\n\tif ( ! $(\"#inputTime\").val()) {\n\t\treturn false;\n\t}\n\treturn true;\n}", "function CheckCompanyInputData(){\t\n\t\t\t\n\t\t\t//alert(\"(DEBUG)CheckPatientInputData() - starting\" );\n\t\t\t\n\t\t\tif(CheckInputField(CompanyData.CompanyID2_FieldValue,\"text\")==false){\n\t\t\t\t//alert(\"ERROR - Entrada invalida en ID Empresa\");\n\t\t\t\treturn false;\n\t\t\t}else if(CheckInputField(CompanyData.CompanyEmail_FieldValue,\"email\")==false){\n\t\t\t\t//alert(\"ERROR - Entrada invalida en Nombre de Empresa\");\n\t\t\t\treturn false;\n\t\t\t}else if(1==10){\n\t\t\t\t//alert(\"ERROR - Entrada invalida en Telefono\");\n\t\t\t\t//FIXME: the company phone check is causing the script to crash. No idea why. Patient phone do works.\n\t\t\t\treturn false;\n\t\t\t}else{\n\t\t\t\t//alert(\"(DEBUG)CheckCompanyInputData() - ending. Return TRUE\" );\n\t\t\t\treturn true;\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}", "function SBRecordsetPHP_checkData(bIsForTest)\r\n{\r\n // Set default value for argument if not present.\r\n if (arguments.length == 0)\r\n {\r\n var bIsForTest = false;\r\n }\r\n \r\n var isValid = true;\r\n \r\n // Clear out the error messages\r\n this.setErrorMessage(\"\");\r\n \r\n // Begin checking the recordset\r\n isValid = this.checkRecordsetName(bIsForTest) && isValid;\r\n isValid = this.checkConnectionName(bIsForTest) && isValid;\r\n \r\n // If recordset or connection aren't valid, just quit there so our error message\r\n // doesn't balloon too much. (Note - this is especially important for simple\r\n // recordsets. If the connection name is bad, we won't get a sql statement.\r\n // We don't want to popup a 'Bad SQL' error in the simple dialog because users\r\n // can't enter SQL there. So bail.)\r\n if (isValid)\r\n {\r\n isValid = this.checkDatabaseCall(bIsForTest) && isValid;\r\n isValid = this.checkPlatformSpecific(bIsForTest) && isValid;\r\n\r\n var sqlParams = new Array();\r\n var theSQL = this.getDatabaseCall(sqlParams);\r\n \r\n // when doing a test - setDatabase call messes up params\r\n if ( bIsForTest == false )\r\n {\r\n this.setDatabaseCall( theSQL, sqlParams ); \r\n }\r\n }\r\n\r\n return isValid;\r\n}", "function validateNotEmpty(data) {\n if (data == '') {\n return true;\n } else {\n return false;\n }\n}", "validate() { }", "function validate() {\n var errorFound = false;\n\n}", "function validateData(form_data) {\n var errors = [];\n return errors;\n }", "function isInputError(title, date, content) {\n if (title.length == 0) {\n alert(\"Empty title!\");\n }\n // check for empty fields\n else if (date.length == 0) {\n alert(\"No date!\");\n }\n // no error\n else { \n \treturn false;\n }\n return true;\n}", "validateCodeError (data) {\n\t\t// verify we got back an code error with the attributes we specified\n\t\tconst codeError = data.codeError;\n\t\tconst expectedOrigin = this.expectedOrigin || '';\n\t\tconst expectedStackTraces = this.test.expectedStackTraces || this.inputCodeError.stackTraces;\n\t\tconst expectedTeamId = this.test.codeErrorInDifferentTeam ? this.test.codeErrorInDifferentTeam.teamId : this.test.team.id;\n\t\tconst expectedStreamId = this.test.codeErrorInDifferentTeam ? this.test.codeErrorInDifferentTeam.streamId : (this.inputCodeError.streamId || '');\n\t\tlet errors = [];\n\t\tlet result = (\n\t\t\t((codeError.id === codeError._id) || errors.push('id not set to _id')) && \t// DEPRECATE ME\n\t\t\t((codeError.teamId === expectedTeamId) || errors.push('teamId does not match the team')) &&\n\t\t\t((codeError.streamId === expectedStreamId) || errors.push('streamId does not match the stream')) &&\n\t\t\t((codeError.postId === (this.inputCodeError.postId || '')) || errors.push('postId does not match the post')) &&\n\t\t\t((codeError.deactivated === false) || errors.push('deactivated not false')) &&\n\t\t\t((typeof codeError.createdAt === 'number') || errors.push('createdAt not number')) &&\n\t\t\t((codeError.lastActivityAt === codeError.createdAt) || errors.push('lastActivityAt should be set to createdAt')) &&\n\t\t\t((codeError.modifiedAt >= codeError.createdAt) || errors.push('modifiedAt not greater than or equal to createdAt')) &&\n\t\t\t((codeError.creatorId === this.test.currentUser.user.id) || errors.push('creatorId not equal to current user id')) &&\n\t\t\t((codeError.numReplies === 0) || errors.push('codeError should have 0 replies')) &&\n\t\t\t((codeError.origin === expectedOrigin) || errors.push('origin not equal to expected origin')) &&\n\t\t\t(DeepEqual(codeError.stackTraces, expectedStackTraces) || errors.push('stackTraces does not match')) &&\n\t\t\t((codeError.providerUrl === this.inputCodeError.providerUrl) || errors.push('providerUrl does not match'))\n\t\t);\n\t\tAssert(result === true && errors.length === 0, 'response not valid: ' + errors.join(', '));\n\n\t\t// verify the code error in the response has no attributes that should not go to clients\n\t\tthis.test.validateSanitized(codeError, CodeErrorTestConstants.UNSANITIZED_ATTRIBUTES);\n\n\t\t// validate the code error's permalink\n\t\tthis.validatePermalink(codeError.permalink);\n\t}", "validateResponse (data) {\n\t\tAssert(data.codeError.modifiedAt >= this.modifiedAfter, 'modifiedAt is not greater than before the code error was updated');\n\t\tthis.expectedCodeError.modifiedAt = data.codeError.modifiedAt;\n\t\t// verify what we fetch is what we got back in the response\n\t\tAssert.deepEqual(data.codeError, this.expectedCodeError, 'fetched code error does not match');\n\t}", "function errorCheckEditProfileForm(){\n\t\tvar errorString =\"\";\n\t\tvar isError = false;\n\t\tvar obj = {\n\t\t\tFirstName: $(\"#firstName\").val(),\n\t\t\tLastName: $(\"#lastName\").val(),\n\t\t\tEmail: $(\"#email\").val(),\n\t\t\tCountry: $(\"#country\").val(),\n\t\t\tCity: $(\"#city\").val(),\n\t\t\tBirthday: $(\"#birthday\").val()\n\t\t}\n\n\t\tif(!ErrorChecking.isOkName(obj.FirstName)){\n\t\t\tisError = true;\n\t\t\terrorString = errorString+\"The first name you entered in not valid\\n\";\n\t\t}\n\t\tif(!ErrorChecking.isOkName(obj.LastName)){\n\t\t\tisError = true;\n\t\t\terrorString = errorString+\"The last name you entered in not valid\\n\";\n\t\t}\n\t\tif(!ErrorChecking.isOkEmail(obj.Email)){\n\t\t\tisError = true;\n\t\t\terrorString = errorString+\"The email you entered in not valid\\n\";\n\t\t}\n\t\tif(!ErrorChecking.isOkCountry(obj.City)){\n\t\t\tisError = true;\n\t\t\terrorString = errorString+\"The city you entered in not valid\\n\";\n\t\t}\n\t\tif(!ErrorChecking.isOkCountry(obj.Country)){\n\t\t\tisError = true;\n\t\t\terrorString = errorString+\"The country you entered in not valid\\n\";\n\t\t}\n\t\tif(!ErrorChecking.isOkDate(obj.Birthday)){\n\t\t\tisError = true;\n\t\t\terrorString = errorString+\"The birthday you entered in not valid\\n\";\n\t\t}\n\t\tif(isError)\n\t\t\talert(errorString);\n\t\treturn isError;\n\t}", "validateData(){\n this.hasSavedValues = false\n\n this.publicoAlvoSim > 0 ? this.hasSavedValues = true : null\n this.publicoAlvoALVA > 0 ? this.hasSavedValues = true : null\n this.publicoAlvoALVA > 0 ? this.hasSavedValues = true : null\n\n this.XER > 0 ? this.hasSavedValues = true : null\n this.COP > 0 ? this.hasSavedValues = true : null\n\n this.listaPrefixos.length > 0 ? this.hasSavedValues = true : null\n\n this.operacaoNaoVinculada > 0 ? this.hasSavedValues = true : null\n this.operacaoVinculada > 0 ? this.hasSavedValues = true : null\n this.operacaoVinculadaEmOutroNPJ > 0 ? this.hasSavedValues = true : null\n\n this.acordoRegPortalSim > 0 ? this.hasSavedValues = true : null\n this.acordoRegPortalNao > 0 ? this.hasSavedValues = true : null\n //this.acordoRegPortalDuplicados > 0 ? this.hasSavedValues = true : null\n\n this.estoqueNumber > 0 ? this.hasSavedValues = true : null\n this.fluxoNumber > 0 ? this.hasSavedValues = true : null\n \n this.duplicadoSimNao > 0 ? this.hasSavedValues = true : null\n this.analisadoSimNao > 0 ? this.hasSavedValues = true : null\n }", "function alamatValidation (alamat) {\r\n if (alamat == \"\") {\r\n return false;\r\n } else return true;\r\n}", "function validate(data) {\n const schema = joi.object({\n exchange: joi.string().required(),\n pair: joi.string().required(),\n sign: joi.string().required(),\n price: joi.number().required(),\n email: joi.string().email().required()\n })\n\n return schema.validate(data)\n}", "get isValid() {\n return this.errors.length === 0;\n }", "function validateNewUserData() {\n !newUser.username || !newUser.password || !newUser.confirmPassword || !newUser.name || !newUser.email ?\n alert('All fields are required. Please fill out accordingly.') :\n newUser.password !== newUser.confirmPassword ? alert('Your passwords don\\'t match!') : postNewUserData();\n }", "isAllValid() {\n return this.state.movieTitle_error || this.state.diractor_error || this.state.year_error || this.state.runtime_error || this.state.genre_error;\n }", "function formValidation(){\n var errorString = \"\";\n\n var u = usernameValidation();\n var p = passwordValidation();\n var e = emailValidation();\n var d = dateOfBirthValidation();\n\n if(!u) errorString += 'username validation: ' + u + \"\\n\";\n if(!p) errorString += \"password validation: \" + p + \"\\n\";\n if(!e) errorString += \"email validation: \" + e + \"\\n\";\n if(!d) errorString += \"dob validation: \" + d + \"\\n\";\n\n\n if(errorString != \"\") alert(errorString);\n return u && p && e && d;\n}", "validate() {}", "function validateRideInput(data){\n\treturn true; // currently everything is supported\n}", "function verifyErrors() {\n\t\tlet foundError = false;\n\t\n \n for(let error in field.validity) {\n \t\t// se nao for customErorr\n \t\t//entao verifica se tem erro\n \t\tif( field.validity[error] && !field.validity.valid) {\n\n \t\t\tfoundError = error\n \t\t}\n }\n return foundError;\n\n }", "function birthdateData(data) {\n var valid = false;\n const regex_date = RegExp(/^\\d{4}\\-(0?[1-9]|1[012])\\-(0?[1-9]|[12][0-9]|3[01])$/);\n const regex_is = regex_date.test(data);\n var error = ('<span id=\"error4\" class=\"msg_error\">Vous devez entrer votre date de naissance valide.</span>');\n var errorData = document.getElementById(\"error4\");\n\n if (regex_is) {\n valid = true;\n formData[3].style.border = \"2px solid #33FF36\";\n }\n else {\n valid = false\n formData[3].style.border = \"2px solid red\";\n formData[3].insertAdjacentHTML(\"afterend\", error);\n } try {\n errorData.remove();\n } catch {}\n return valid;\n}", "async validate() {\n return true\n }", "static checkSomeFields(data) {\n const modelValidationErrors = {\n modelHasErrors: false\n };\n Object.entries(data).forEach(([fieldName, value]) => {\n const field = this[fieldName];\n const valueInData = data[fieldName];\n if (field instanceof fields_1.Field) {\n const fieldValidationErrors = field.getValidationErrors(valueInData);\n if (fieldValidationErrors.fieldHasErrors) {\n modelValidationErrors.modelHasErrors = true;\n }\n modelValidationErrors[fieldName] = fieldValidationErrors;\n }\n });\n return modelValidationErrors;\n }", "function checkData(data, status, errorMessage, successMessage) {\n\tif (data == 'error') {\n\t\tif (errorMessage && status != 'cached')\n\t\t\tshowAlert(errorMessage);\n\t\treturn false;\n\t}\n\tif (data == 'login') {\n\t\tif (status != 'cached') {\n\t\t\t// Checking whether user's session timed out or the user hadn't logged in in the first place.\n\t\t\tvar message = currentUserId ? \"Session timed out.\" : \"Please login first.\"\n\t\t\tshowAlert(message, logoutAndRedirect);\n\t\t\tsetTimeout(logoutAndRedirect, 30000);\n\t\t}\n\t\treturn false;\n\t}\n\tif (data == 'access denied') {\n\t\tlocation.href = '/accessDenied';\n\t\treturn false;\n\t}\n\tif (data == 'success') {\n\t\tif (successMessage && status != 'cached')\n\t\t\tshowAlert(successMessage);\n\t\treturn true;\n\t}\n\tif (data == 'refresh') {\n\t\tshowAlert(\"Server timeout, refreshing page.\")\n\t\trefreshPage();\n\t\treturn false;\n\t}\n\tif (typeof(data) == 'string') {\n\t\tif (status != 'cached' && data != \"\") {\n\t\t\tshowAlert(data);\n\t\t}\n\t\treturn false;\n\t}\n\treturn true;\n}", "function validate(){\n\n\t\tvar isValid = true;\n\n\t \t$('.inputData').each(function() {\n\t \tif ( $(this).val() === '' )\n\t isValid = false;\n\t\t});\n\n\t \treturn isValid;\n\t}", "function validate(){\n\n\t\tvar isValid = true;\n\n\t \t$('.inputData').each(function() {\n\t \tif ( $(this).val() === '' )\n\t isValid = false;\n\t\t});\n\n\t \treturn isValid;\n\t}", "static validate(request, response) {\n let isValid = true;\n const errors = {};\n\n if (!request.body.title) {\n errors.title = 'Add a title';\n isValid = false;\n }\n\n if (!request.body.description) {\n errors.description = 'Add a description';\n isValid = false;\n }\n\n if (!request.body.price) {\n errors.price = 'Add a price';\n isValid = false;\n }\n\n if (request.body.price && Number.isNaN(request.body.price)) {\n errors.price = 'Price is not a number';\n isValid = false;\n }\n\n if (isValid) {\n return isValid;\n }\n\n return response.status(500).json(errors);\n }", "function validateInput() {\n inputIssues = \"\"\n var result = true;\n if (Switching_Method) {\n if (SndRecArray.length != 0) {\n //Inputs that are used for both\n if ((isNaN(TransDelay))) {\n result = false;\n inputIssues += inputIssues + \"Transfer Delay is Invalid, \"\n }\n if ((isNaN(MsgLength))) {\n result = false;\n inputIssues += \"Message Length is Invalid, \"\n }\n if ((isNaN(TransRate))) {\n result = false;\n inputIssues += \"Transmission Rate is Invalid, \"\n }\n\n //Inputs for circuit switching\n if (Switching_Method == \"Circuit\") {\n if ((isNaN(CircSetupTime))) {\n result = false;\n inputIssues += \"Circuit Setup Time is Invalid, \"\n }\n }\n //Inputs for packet switching\n else {\n\n if ((isNaN(PktSize))) {\n result = false;\n inputIssues += \"Packet Size is Invalid, \"\n }\n if ((isNaN(HeaderSize)) || (HeaderSize > PktSize)) {\n result = false;\n inputIssues += \"Header Size is Invalid, \"\n }\n if ((isNaN(PktRoutingDelay))) {\n result = false;\n inputIssues += \"Packet Routing Delay is Invalid, \"\n }\n }\n return result;\n }\n else {\n inputIssues += \"No sender reciver pairs found, \"\n return false;\n }\n }\n\n else {\n inputIssues += \"No method chosen, \"\n return false;\n }\n }", "isValid() {\n if (!PayslipHelper.isNumberValid(this.id)) {\n return false;\n }\n if (!PayslipHelper.isStringValid(this.firstName)) {\n return false;\n }\n if (!PayslipHelper.isStringValid(this.lastName)) {\n return false;\n }\n if (!PayslipHelper.isNumberValid(this.annualSalary)) {\n return false;\n }\n if (!PayslipHelper.isSuperRateValid(this.superRate)) {\n return false;\n }\n if (!PayslipHelper.isStringValid(this.paymentStartDate)) {\n return false;\n }\n\n return true;\n }", "function App() {\n\n function validateData(col, data) {\n let regExp\n\n switch (col) {\n case 0:\n regExp = /^[a-zA-Z ]+$/\n if (!data) {\n createErrorMsg()\n throw new Error('File format is not correct!')\n } else if (!regExp.test(data)) {\n return false\n } else {\n return true\n }\n case 1:\n regExp = /^\\+(?:[1] ?)[0-9\\s]{13}$/\n if (!data) {\n createErrorMsg()\n throw new Error('File format is not correct!')\n } else if (!regExp.test(data)) {\n return false\n } else {\n return true\n }\n case 2:\n regExp = /^(([^<>()[\\]\\\\.,;:\\s@\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/\n if (!data) {\n createErrorMsg()\n throw new Error('File format is not correct!')\n } else if (!regExp.test(data?.toLowerCase())) {\n return false\n } else {\n return true\n }\n case 3:\n if (Number.isInteger(+data) && +data >= 21) {\n return true\n } else {\n return false\n }\n case 4:\n if (Number.isInteger(+data) && +data >= 0 && +data <= 21) {\n return true\n } else {\n return false\n }\n case 5:\n if (+data <= 1000000 && data.split('.')[1]?.length === 2) {\n return true\n } else {\n return false\n }\n case 6:\n if (data === 'TRUE' || data === 'FALSE') {\n return true\n } else if (data === '') {\n data = false\n return true\n } else {\n return false\n }\n case 7:\n regExp = /^[A-Z]{2}$/\n if (!regExp.test(data)) {\n return false\n } else {\n return true\n }\n case 8:\n if (data.split('/')[0]?.length === 4) {\n regExp = /^\\d{4}[/](0?[1-9]|1[012])[/](0?[1-9]|[12][0-9]|3[01])$/\n if (!regExp.test(data)) {\n return false\n } else {\n return true\n }\n } else {\n regExp = /^((0?[1-9]|1[012])[- /.](0?[1-9]|[12][0-9]|3[01])[- /.](19|20)?[0-9]{2})*$/\n if (!regExp.test(data)) {\n return false\n } else {\n return true\n }\n }\n case 9:\n regExp = /^[\\d]{1}[a-z]{2}[\\d]{3}$/\n if (!regExp.test(data)) {\n return false\n } else {\n return true\n }\n default:\n break\n }\n }\n\n function createErrorMsg() {\n if (!document.querySelector('.error')) {\n const errorBlock = document.createElement('div')\n errorBlock.classList.add('error')\n errorBlock.innerText = 'File format is not correct!'\n document.querySelector('.App').append(errorBlock)\n }\n }\n\n const getUsers = async () => {\n \n try {\n const response = await fetch(file)\n if (!file.split('.')[2] === 'csv') {\n createErrorMsg()\n }\n const Data = (await response.text()).trim()\n makeTable(Data)\n } catch (error) {\n console.log(error)\n }\n\n }\n\n function makeTable(csv) {\n const rows = csv.split('\\n')\n const table = document.createElement('table')\n const phones = []\n const emails = []\n let tr = null,\n td = null,\n tds = null\n\n for (let i = 0; i < rows.length; i++) {\n if (i === 0) {\n tr = document.createElement('tr')\n tr.classList.add('tHead')\n tds = rows[i].split(',')\n for (let j = 0; j < tds.length; j++) {\n if (j === 0) {\n td = document.createElement('td')\n td.classList.add(`tCol${i}-Id`)\n td.innerHTML = 'ID'\n tr.appendChild(td)\n td = document.createElement('td')\n td.classList.add(`tCol${i}-${j}`)\n td.innerHTML = tds[j].trim()\n tr.appendChild(td)\n } else if (j === tds.length - 1) {\n td = document.createElement('td')\n td.classList.add(`tCol${i}-${j}`)\n td.innerHTML = tds[j].trim()\n tr.appendChild(td)\n td = document.createElement('td')\n td.classList.add(`tCol${i}-${j + 1}`)\n td.innerHTML = 'Duplicate with'\n tr.appendChild(td)\n } else {\n td = document.createElement('td')\n td.classList.add(`tCol${i}-${j}`)\n td.innerHTML = tds[j].trim()\n tr.appendChild(td)\n }\n }\n table.appendChild(tr)\n } else {\n tr = document.createElement('tr')\n tds = rows[i].split(',')\n for (let j = 0; j < tds.length; j++) {\n if (j === 0) {\n td = document.createElement('td')\n td.classList.add(`tCol${i}-Id`)\n td.innerHTML = i\n tr.appendChild(td)\n td = document.createElement('td')\n td.classList.add(`tCol${i}-${j}`)\n if (!validateData(j, tds[j].trim())) {\n td.classList.add(`err`)\n }\n td.innerHTML = tds[j].trim()\n tr.appendChild(td)\n } else if (j === tds.length - 1) {\n td = document.createElement('td')\n td.classList.add(`tCol${i}-${j}`)\n if (!validateData(j, tds[j].trim())) {\n td.classList.add(`err`)\n }\n td.innerHTML = tds[j].trim()\n tr.appendChild(td)\n td = document.createElement('td')\n td.classList.add(`tCol${i}-${j + 1}`)\n // td.innerHTML = 'X'\n tr.appendChild(td)\n } else {\n td = document.createElement('td')\n td.classList.add(`tCol${i}-${j}`)\n if (!validateData(j, tds[j].trim())) {\n td.classList.add(`err`)\n }\n if (j === 1) {\n phones.push(tds[j].trim())\n }\n if (j === 2) {\n emails.push(tds[j].trim())\n }\n td.innerHTML = tds[j].trim()\n tr.appendChild(td)\n }\n }\n table.appendChild(tr)\n }\n }\n\n document.querySelector('.App').append(table)\n findDuplicate(phones, emails)\n\n }\n\n function findDuplicate(phones, emails) {\n\n for (let i = 0; i < phones.length; i++) {\n const element = phones[i]\n for (let j = 0; j < phones.length; j++) {\n if (i !== j) {\n if (element === phones[j]) {\n document.querySelector(`.tCol${i + 1}-10`).innerHTML = `${j + 1}`\n }\n }\n }\n }\n\n for (let i = 0; i < emails.length; i++) {\n const element = emails[i]\n for (let j = 0; j < emails.length; j++) {\n if (i !== j) {\n if (element === emails[j]) {\n document.querySelector(`.tCol${i + 1}-10`).innerHTML = `${j + 1}`\n }\n }\n }\n }\n\n }\n\n return (\n <div className=\"App\">\n <button className=\"btn\" onClick={getUsers}>\n Import users\n </button>\n </div>\n )\n}", "function layerverified(){\n var isvalid = true; \n var errorstr = \"\"; \n if($(\"#inLayerName\").val().trim() == \"\" || $(\"#inLayerType\").val().trim() == \"\" || $(\"#tbDetails\").val().trim() == \"\"){\n alert(\"Please ensure the name, description, and type for the form have been entered\");\n isvalid = false;\n } \n if($(\"#hfCoords\").val().trim() == \"\"){\n isvalid = false;\n alert(\"You have to draw a layer in order to save it\");\n } \n return isvalid; \n }", "function inputValidation() {\r\n\tvar portalPacketTitle = document.getElementById(\"portalPacketTitle\");\r\n\tvar portalPacketContent = document.getElementById(\"portalPacketContent\");\r\n\tvar portalPacketFooter = document.getElementById(\"portalPacketFooter\");\r\n\tvar error = \"\";\r\n\tif (portalPacketTitle.value.length == 0) {\r\n\t\terror += \"标题不能为空\\n\";\r\n\t}\r\n\tif (portalPacketContent.value.length == 0) {\r\n\t\terror += \"描述文字不能为空\\n\";\r\n\t}\r\n\tif (portalPacketFooter.value.length == 0) {\r\n\t\terror += \"页脚不能为空\\n\";\r\n\t}\r\n\tif (error.length != 0) {\r\n\t\twindow.alert(error);\r\n\t\treturn false;\r\n\t} else\r\n\t\treturn true;\r\n}", "validateResponse (data) {\n\t\t// we fetched the user's \"user\" object, we should see their lastReads attribute\n\t\t// for the created stream set to the last post of the first batch we created,\n\t\t// which we marked as read for the current user\n\t\tconst firstPosts = this.postData.map(postData => postData.post);\n\t\tconst lastReadPost = firstPosts[firstPosts.length - 1];\n\t\tAssert(data.user.lastReads[this.teamStream.id] === lastReadPost.seqNum, 'lastReads for stream is not equal to the seqNum of the last post read');\n\t}", "checkErrors() {\n if (this.state.valid_state_new && this.state.valid_state_current) {\n if (this.state.valid_state_new === 'success' && this.state.valid_state_current === 'success') {\n return false;\n }\n }\n return true;\n }", "function isValidStep() {\n if ($scope.inputs.enterpriseLabel === '' || !$scope.inputs.enterpriseLabel) {\n trackClientLabelFail('Missing Enterprise Name');\n $scope.setFormError('Please enter organization name.');\n return false;\n }\n if ($scope.inputs.enterpriseLabel.indexOf('.') !== -1) {\n trackClientLabelFail('Invalid Organization Name');\n $scope.setFormError('Organization names cannot contain periods.');\n return false;\n }\n if ($scope.inputs.enterpriseLabel.length > 50) {\n trackClientLabelFail('Invalid Organization Name Length');\n $scope.setFormError('Organization names cannot be longer than 50 characters.');\n return false;\n }\n return true;\n }", "function validateNewBuyerData(bData) {\n // required buyer data fields\n try {\n const {\n buyerName,\n buyerEmail,\n } = bData;\n\n const dataToValidate = [\n buyerName,\n buyerEmail,\n ];\n return dataToValidate.every((item) => item);\n } catch (err) {\n console.log(err);\n }\n}", "static isValid(accountData) {\n var ret = typeof accountData.name == \"string\" &&\n typeof accountData.type == \"string\" &&\n typeof rootForType(accountData.type) == \"string\";\n if (!ret) {\n console.log(\"Invalid account: \", accountData);\n }\n return ret;\n }", "function isInputError(name, tel, email) {\n if (name.length == 0) {\n alert(\"Empty name!\");\n }\n // check for empty fields\n else if (tel.length == 0 && email.length == 0) {\n alert(\"Provide tel or email!\");\n }\n // check for valid tel no\n else if (tel.length > 0 && !isValidTel(tel)) {\n alert(\"Invalid telephone number!\");\n }\n // check for valid email\n else if (email.length > 0 && !isValidEmail(email)) {\n alert(\"Invalid email address!\");\n }\n // no error\n else { \n \treturn false;\n }\n return true;\n}", "function validateRequired(data, requiredCols) {\n var isValid = true;\n var failString = '<br>The following required columns are missing values:<br>'\n for (var reqCol of requiredCols) {\n if (missingColumnData(data[reqCol])) {\n isValid = false;\n failString += ' -' + reqCol + '<br>';\n } else if (data[reqCol].length != data[reqCol].filter(x => x != '' && x != null).length) {\n isValid = false;\n failString += ' -' + reqCol + '<br>';\n }\n }\n failString += '<br>Please check your spreadsheet and make sure the columns match the template exactly.<br>'\n return { 'valid': isValid, 'failString': failString };\n }", "validate() {\n const errors = [];\n if (!this.gtin) {\n errors.push('gtin is required.');\n }\n if (!this.quantity) {\n errors.push('quantity is required.');\n } else if (this.quantity < 0) { // TODO accept zero quantity ?\n errors.push('quantity cannot be negative.');\n }\n if (!this.requesterId) {\n errors.push('requesterId is required.');\n }\n if (!this.senderId) {\n errors.push('senderId is required.');\n }\n\n return errors.length === 0 ? undefined : errors;\n }", "function isOK(data) {\n // todo\n return true;\n}", "should_indicate_invalid()\n\t{\n\t\tconst { indicateInvalid, error } = this.props\n\t\treturn indicateInvalid && error\n\t}" ]
[ "0.77531505", "0.7391569", "0.72468317", "0.719642", "0.7034853", "0.70219046", "0.7018224", "0.699882", "0.69641054", "0.69521403", "0.69462174", "0.6935079", "0.69181216", "0.69050217", "0.6879", "0.6865814", "0.6849471", "0.68477464", "0.6826225", "0.6814217", "0.6780389", "0.6778226", "0.67423713", "0.67289925", "0.66995615", "0.6686703", "0.6647843", "0.66279763", "0.66123134", "0.66022426", "0.6590674", "0.65722984", "0.6560984", "0.65439355", "0.6536162", "0.6517779", "0.64899087", "0.64851844", "0.6474488", "0.647352", "0.64708775", "0.6458241", "0.64580643", "0.645493", "0.6451327", "0.6441864", "0.6438457", "0.6426877", "0.64173466", "0.64171433", "0.6414708", "0.64138466", "0.6409998", "0.6399035", "0.6395684", "0.6394881", "0.63747466", "0.63712424", "0.636647", "0.6364399", "0.63614506", "0.6360334", "0.6355204", "0.6353833", "0.63498664", "0.6347827", "0.63335127", "0.6328054", "0.62726617", "0.627059", "0.6268721", "0.6262656", "0.6256256", "0.62504613", "0.6247282", "0.6244542", "0.6228456", "0.6219615", "0.6215836", "0.6211597", "0.6208854", "0.62026703", "0.61995286", "0.61995286", "0.6198779", "0.6194898", "0.6191833", "0.6191788", "0.61903137", "0.6184987", "0.61848927", "0.61830205", "0.6181102", "0.6178939", "0.61714417", "0.61634386", "0.6157374", "0.61492974", "0.614722", "0.6137134" ]
0.69787955
8
This handler function recieves data from other ipfscoord peers.
rpcHandler (inData) { try { console.log('Data recieved by rpcHandler: ', inData) const jsonData = JSON.parse(inData) console.log('jsonData: ', jsonData) // _this.eventEmitter.emit('rpcData', jsonData) } catch (err) { console.error('Error in rpcHandler()') // Do not throw an error. This is a top-level function. } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "send_data_to_partner(data_received){\n\t\tclients[data_received['person_b']].socket.emit('data_received',{'type' : 'partner_data', 'content': data_received['content']});\n\t}", "function gotData(data) {\n var sender = data.val();\n\n /********************* GET ADDRESS ******************/\n //Geolocation function\n function lat(callback) {\n navigator.geolocation.getCurrentPosition(function(position) {\n {\n enableHighAccuracy: true;\n }\n var lat = position.coords.latitude;\n var lon = position.coords.longitude;\n callback.call(null, lat, lon);\n }, function(error) {\n alert(\"Please check your location settings and try again.\")\n console.log(\"Something went wrong: \", error);\n });\n }\n\n\n function locateme() {\n lat(function(latitude, longitude) {\n var lat = latitude.toString();\n var lon = longitude.toString();\n var address = (lat + ', ' + lon);\n socket.emit('sender', {\n name: sender.name,\n number: sender.number,\n address: address\n });\n\n console.log(sender);\n });\n }\n locateme();\n\n }", "static both_clients_accepted(data_received){\n\t\tclients[data_received['person_a']].socket.emit('data_received',{'type':'both_accepted'});\n\t\tclients[data_received['person_b']].socket.emit('data_received',{'type':'both_accepted'});\n\t}", "processData(socket, data) {\n\n rideProcess.listen(socket, data);\n\n\n }", "function onrecieveData(data)\n{\n\t for (myConnection in connections) \n\t { // iterate over the array of connections\n\t\tconnections[myConnection].send(data); // send the data to each connection\n\t }\n\tconsole.log(\"Received data: \" + data);\n}", "function emitBoth(data) {\n //Prevent the dreaded infinite loop\n if (data.flags && data.flags !== {} && data.flags.toCinna) return\n var resolved = (data.msg === 'kipsupervisor') ? false : true\n if (data.msg && (data.msg.trim() === 'kipsupervisor') && data.thread && data.thread.ticket) {\n data.thread.ticket.isOpen = true\n } else if (data.msg && (data.msg.trim() === 'kipsupervisor') && !data.thread.ticket) {\n data.thread.ticket = {}\n data.thread.ticket.id = shortid.generate();\n data.thread.ticket.isOpen = true\n }\n ioClient.emit('new channel', {\n name: data.source.channel,\n id: data.source.id,\n resolved: resolved\n })\n var action = data.action ? data.action : '';\n var flags = (data.flags && data.flags !== {}) ? data.flags : {toSupervisor: true};\n\n ioClient.emit('new message', {\n id: null,\n incoming: true,\n msg: (data.msg ? data.msg : ''),\n tokens: ((data.msg && typeof data.msg == 'string') ? data.msg.split() : []),\n bucket: data.bucket,\n action: action,\n amazon: [],\n source: {\n //chnge to data.source.origin\n origin: data.source.origin,\n channel: data.source.channel,\n org: data.source.id.split('_')[0],\n id: data.source.id\n },\n client_res: [],\n ts: Date.now,\n thread: data.thread,\n urlShorten:data.urlShorten,\n thread: data.thread,\n flags: flags\n })\n}", "_signalOtherPeeer() {\n console.log('Signal other peer');\n const propseId = shortid.generate();\n this.setRemotePeerId(propseId);\n SocketService.getInstance().send({\n\t\t\ttype: SOCKET_MESSAGE_TYPES.PEER_SIGNAL,\n\t\t\tpeerData: {\n\t\t\t\tsignal: this._rawLocalDescription,\n toUser: this._user,\n fileModel: this._fileModel,\n remotePeerId: this._id,\n propseId\n\t\t\t}\n\t\t}, SOCKET_EVENTS.MESSAGE);\n\t}", "receivePiece(data) {\n\t\tthis.piece.receiveServerUpdate(data);\n\t}", "onDiffieIPFS({gB, ipfsRef}) {\n // console.log('onDiffieIPFS');\n this.setOtherGX(gB)\n\n this.peer = new Peer({initiator: false});\n this.handlePeerEvent()\n this.handleInfo(ipfsRef)\n }", "onMessageReceived(msg, msgInfo) {\n if (msgInfo.address === ip.address()) {\n // if the source address is the own ip address return\n return;\n } else {\n // else forward the message the the app\n this.mainWindow.webContents.send(\"receivedMessage\", msg.toString());\n }\n }", "function onExchange(msg){\n var self = this;\n // #1 get a sample of neighbors from our partial view\n this.partialView.increment();\n var sample = this.partialView.getSample(msg.inview, false);\n // #A remove the chosen neighbor from our partialview\n var i = 0;\n while (i<sample.length){\n var e = sample[i];\n var removed = self.neighborhoods.disconnect(e.id);\n if (!removed){ // the partial view is late\n // #a inform the partial view of the departure of the peer\n onPeerDown.call(this, e.id);\n // #b clear the sample from references to this id\n var j = 0;\n while (j<sample.length){\n if (sample[j].id === e.id){\n sample.splice(j, 1);\n } else {\n ++j;\n }; \n };\n } else {\n // normal behavior\n self.partialView.removePeer(e.id, e.age);\n ++i;\n };\n };\n // #B from initiator to chosen neigbhor\n sample.forEach(function(e){\n self.neighborhoods.connect(msg.outview, (e.id !== msg.inview) && e.id);\n });\n}", "function onRecieve(buf) {\n if(!isActive) {\n return;\n }\n var msgType = buf.readUint8();\n // world state update\n if (msgType === 1) {\n main.world.update(buf, main.scene)\n }\n // respond to a ping request\n if (msgType === 2) {\n server.send(server.newMessage(2));\n }\n }", "function readLocator () {\r\n orb.readLocator(function (err, data) {\r\n if (err) {\r\n console.error(\"error: \", err);\r\n readLocator();\r\n } else {\r\n console.log(data.xpos);\r\n console.log(data.ypos);\r\n var dist = Math.sqrt(Math.pow((data.xpos - x), 2) + Math.pow((data.ypos - y), 2));\r\n x = data.xpos;\r\n y = data.ypos;\r\n socket.emit('newDistanceSphero', {dist: dist});\r\n }\r\n });\r\n}", "handleLocalData(data) {\n const count = data[data.length - 3];\n const blockId = this.executeCheckList[count];\n if (blockId) {\n const socketData = this.handler.encode();\n socketData.blockId = blockId;\n this.setSocketData({\n data,\n socketData,\n });\n this.socket.send(socketData);\n }\n }", "onDiffieOnly({from, gA}) {\n // console.log('onDiffieOnly');\n this\n .setOtherGX(gA)\n .setOtherAddress(from);\n\n this.peer = new Peer({initiator: true});\n this.handlePeerEvent();\n }", "function peerListener( caller_rtc_id, data )\n{\n\t// trace(\"peerListener( \" + caller_rtc_id + \" ) : \" );\n\tdata = JSON.parse( data );\n\ttrace_object( data );\n\t\n\tif ( data.action == 'chat' ) {\n\t\tvideo_chat_message_recv( caller_rtc_id, data );\n\t}\n\telse if ( data.action == 'whiteboard' ) {\n\t\twhiteboard_canvas_draw_from_server( data );\n\t}\n\telse if ( data.action == 'command' ) {\n\t\tvideo_chat_command( caller_rtc_id, data );\n\t}\n}", "function handleReceiveData(data) {\r\n\t\tif (\"orden\" in data) {\r\n\t\t\tif (data.orden == \"takeoff\") {\r\n\t\t\t\tarDrone.takeoff();\r\n\t\t\t} else if (data.orden == \"land\") {\r\n\t\t\t\tarDrone.land();\r\n\t\t\t} else {\r\n\t\t\t\tconsole.log(\"Orden no valida. \");\r\n\t\t\t}\r\n\t\t} else if (\"x\" in data) {\r\n\t\t\tarDrone.setXYValues(data.x, data.y);\r\n\t\t} else if (\"alt\" in data) {\r\n\t\t\tarDrone.setAltYaw(data.alt, data.yaw);\r\n\t\t} else {\r\n\t\t\tconsole.log(\"Dato invalido. \");\r\n\t\t}\t\t\r\n\t}", "function readData(binarystring, timestamp, host, portConnect, senderid, socket) {\n let senderidstring = \"\";\n\n //parsing the header \n v = parseInt(binarystring.substring(0, 3), 2);\n msgtype = parseInt(binarystring.substring(3, 11), 2);\n numpeers = parseInt(binarystring.substring(11, 24), 2);\n senderidlength = parseInt(binarystring.substring(24, 32), 2);\n\n //looping through data to decode the sender id\n for (j = 32; j < 32 + (senderidlength * 8); j = j + 8) {\n let charb = binarystring.substring(j, j + 8)\n senderidstring = senderidstring + String.fromCharCode(parseInt(charb, 2));\n }\n\n //getting the payload information\n let newstart = 32 + (senderidlength * 8);\n for (i = 0; i < numpeers; i++) {\n let peeraddressstring = \"\";\n peeraddress = parseInt(binarystring.substring(newstart, newstart + 32), 2);\n peerportnum = parseInt(binarystring.substring(newstart + 32, newstart + 48), 2);\n let peeradd1 = parseInt(binarystring.substring(newstart, newstart + 8), 2);\n let peeradd2 = parseInt(binarystring.substring(newstart + 8, newstart + 16), 2);\n let peeradd3 = parseInt(binarystring.substring(newstart + 16, newstart + 24), 2);\n let peeradd4 = parseInt(binarystring.substring(newstart + 24, newstart + 32), 2);\n peeraddressstring = peeradd1.toString() + \".\" + peeradd2.toString() + \".\" + peeradd3.toString() + \".\" + peeradd4.toString();\n\n\n //adding to stack\n if (!peeringdeclined.includes(newPortConnect)) {\n queue.push({\"HOST\":peeraddressstring,\"PORT\":peerportnum});\n }\n\n peered = peered + \"[\" + peeraddressstring + \":\" + peerportnum + '] ';\n newstart = newstart + 48;\n }\n\n if (v != 7) { //ignore if v does not equal 7\n return 0;\n }\n\n else if (msgtype == 2) { //if the packet is redirect\n console.log('\\nReceived ack from ', senderidstring, ':', portConnect);\n if (peered.length > 0) { //if peered with others print peer table\n console.log('\\tWhich is peered with', peered)\n }\n console.log('\\n')\n console.log('The join has been declined; The auto join process is being performed... ');\n\n // destroying the peer\n peered = \"\";\n peer.destroy();\n }\n\n //if the packet is welcome\n else {\n //add peer to peer table\n if (newPortConnect > 0) {\n //add the host and port to the peer table\n singleton.addPeerTable(host, newPortConnect, socket)\n //print connection information\n console.log('\\n')\n console.log('Connected to peer ', senderidstring, ':', newPortConnect, 'at timestamp: ', timestamp);\n console.log('This peer address is', host, ':', portLocal, 'located at', senderid);\n console.log('Received ack from ', senderidstring, ':', newPortConnect);\n if (peered.length > 0) { //if peered with others print peer table\n console.log('\\tWhich is peered with', peered)\n }\n } else {\n //add the host and port to the peer table\n singleton.addPeerTable(host, portConnect, socket)\n console.log('\\n')\n //print connection information\n console.log('Connected to peer ', senderidstring, ':', portConnect, 'at timestamp: ', timestamp);\n console.log('This peer address is', host, ':', portLocal, 'located at', senderid);\n console.log('Received ack from ', senderidstring, ':', portConnect);\n if (peered.length > 0) { //if peered with others print peer table\n console.log('\\t Which is peered with', peered)\n }\n }\n }\n}", "function getAllPassenger () {\n\t// console.log('getAllPassenger'); \n\t// $.ajax({\n\t// url : \"/service/getPassenger/all\",\n\t// type: \"GET\",\n\t// success: function(data){\n\t// console.log(data);\n\t// addPoiJson(data.geoJson);\n\t// }\n\t// });\n\tsocket.emit('get all passenger',{msg:'request get all passenger'});\n\tsocket.on('show all passenger',function(data){\n\t//alert('her its html show all passenger !!');\n\t// console.log(data);\n\taddPoi(data);\n\t});\n}", "function pushDataToClient() {\n twitchSocket.emit('update client', twitchData);\n }", "handlePositionChangeEvent(data) {\n console.log('in handlePositionChangeEvent method '+ JSON.stringify(data));\n let dataObj = data.data;\n this.calculateNewCoinDataSet(dataObj.playerType, dataObj.positionFrom,\n dataObj.positionTo, dataObj.coinId);\n this.changePlayerTurnToNextPlayer();\n }", "function getData(socket) {\n getTemp()\n getLight()\n getWindowState()\n getHeaterState()\n getArtificialLightIntensity()\n getHumidity()\n\n socket.emit(\"newMeasurements\", readData)\n}", "function send_data(){\n\tfor (i = 0; i < 8; i++) { \n\t\tuint8[i] = tic80_gpio[i];\n\t}\n if(state==\"host\"){peer1.send(uint8);}\n else if(state==\"client\"){peer2.send(uint8);}\n}", "function broadcast(_ref2) {\n var type = _ref2.type,\n data = _ref2.data;\n\n if (star === null) {\n return;\n }\n\n var message = { type: type, data: data };\n _.forEach(star.peers, function (peer) {\n return peer.send(JSON.stringify(message));\n });\n }", "function peerinfo(cb){\n\t\t\tgetJson('http://192.168.0.160:8334/api/getpeerinfo', function(err, response) {\n\t\t if (err) return console.log(err);\n\t\t burstData['peers'] = response;\n\t\t cb();\n\t\t });\n\t\t}", "function partnerWithInterests(interests, socketId, allSockets, filter, userCountry, callback){\n\t// search for each socket\n switch (filter){\n case 'nearby':\n nearby(socketId.latitude, socketId.longtitude, socketId.userCountry,function(err, partner){\n callback(null, partner);\n });\n break;\n case 'country':\n country(filter, userCountry, function(err, partner){\n callback(null, partner);\n });\n break;\n case 'world':\n world(filter, function(err, partner){\n callback(null, partner);\n })\n break;\n }\n var arrayInt = [];\n // find nearby partner\n function nearby(userLatitude, userLongtitude, userCountry, callback){\n var matchedNearbySockets = [];\n if(filter === 'nearby'){\n for( var i = 0; i < allSockets.length; i++){\n if(socketId.id === allSockets[i].id){\n // if both same do nothing\n }\n else{\n // make array of interests\n interestsCtrl.makeArray(allSockets[i].interest, function(err, array){\n // search in each socket\n for (var j = 0; j < interests.length; j++){\n // if any filter matches and has same filter -- add socket to array\n if(in_array(interests[j],array) === true && allSockets[i].filter === filter){\n var partnerLatitude = allSockets[i].latitude,\n partnerLongtitude = allSockets[i].longtitude;\n var distance = geolib.getDistance(\n {latitude: userLatitude, longitude: userLongtitude }, \n {latitude: partnerLatitude, longitude: partnerLongtitude}\n ); \n if(distance <= 100){\n matchedNearbySockets.push(allSockets[i]);\n }\n }\n }\n })\n }\n }\n var msg = 'You matched on ';\n if(matchedNearbySockets.length === 0){\n socketId.emit('no nearby','No user found nearby, searching in your country...');\n country('country',userCountry, function(err, partner){\n callback(null, partner);\n });\n }\n \n // if only one user found\n else if(matchedNearbySockets.length === 1){\n // make array of interests\n interestsCtrl.makeArray(matchedNearbySockets[0].interest, function(err, array){\n // search in each socket\n for (var j = 0; j < interests.length; j++){\n // if any filter matches and has same filter -- add socket to array\n if(in_array(interests[j],arrayInt) === true ){\n msg = ' '+msg+'#'+interests[j]+' ';\n }\n }\n });\n socketId.emit('matchedInterests',{msg:msg});\n matchedNearbySockets[0].emit('matchedInterests',{msg:msg});\n var result = {};\n result.partner = matchedNearbySockets[0];\n result.msg = 'You are now connected to a random person nearby. Happy Chatting!';\n callback(null, result);\n }\n // if there are multiple users\n else if(matchedNearbySockets.length >= 2){\n var pIndex = Math.round(Math.random()*matchedNearbySockets.length) - 1;\n if(pIndex == -1){pIndex = 0;}\n // make array of interests\n interestsCtrl.makeArray(matchedNearbySockets[pIndex].interest, function(err, array){\n // search in each socket\n for (var j = 0; j < interests.length; j++){\n // if any filter matches and has same filter -- add socket to array\n if(in_array(interests[j],arrayInt) === true ){\n msg = msg+'#'+interests[j]\n }\n }\n });\n socketId.emit('matchedInterests',{msg:msg});\n matchedNearbySockets[pIndex].emit('matchedInterests',{msg:msg});\n var result = {};\n result.partner = matchedNearbySockets[pIndex];\n result.msg = 'You are now connected to a random person nearby. Happy Chatting!'; \n callback(null,result);\n }\n\n }\n }\n\n // find country parnter\n function country(filter,userCountry,callback){\n var matchedCountrySockets = [];\n if(filter === 'country'){\n for( var i = 0; i < allSockets.length; i++){\n if(socketId.id === allSockets[i].id){\n // if both same do nothing\n }\n else{\n // make array of interests\n interestsCtrl.makeArray(allSockets[i].interest, function(err, array){\n // search in each socket\n for (var j = 0; j < interests.length; j++){\n // if any filter matches and has same filter -- add socket to array\n if(in_array(interests[j],array) === true && allSockets[i].filter === filter && userCountry === allSockets[i].country){\n matchedCountrySockets.push(allSockets[i]);\n }\n }\n })\n }\n }\n var msg = 'You matched on ';\n // for loop end\n if(matchedCountrySockets.length === 0){\n socketId.emit('no country','No user found in country, searching in world...');\n world('world',function(err, partner){\n callback(null,partner);\n });\n }\n \n // if only one user found\n else if(matchedCountrySockets.length === 1){\n // make array of interests\n interestsCtrl.makeArray(matchedCountrySockets[0].interest, function(err, array){\n // search in each socket\n for (var j = 0; j < interests.length; j++){\n // if any filter matches and has same filter -- add socket to array\n if(in_array(interests[j],arrayInt) === true ){\n msg = msg+'#'+interests[j]\n }\n }\n });\n socketId.emit('matchedInterests',{msg:msg});\n matchedCountrySockets[0].emit('matchedInterests',{msg:msg});\n var result = {};\n result.partner = matchedCountrySockets[0];\n result.msg = 'You are now connected to a random person from '+userCountry+'. Happy Chatting!';\n callback(null,result);\n }\n // if there are multiple users\n else if(matchedCountrySockets.length >= 2){\n var pIndex = Math.round(Math.random()*matchedCountrySockets.length) - 1;\n if(pIndex == -1){pIndex = 0;}\n // make array of interests\n interestsCtrl.makeArray(matchedCountrySockets[pIndex].interest, function(err, array){\n // search in each socket\n for (var j = 0; j < interests.length; j++){\n // if any filter matches and has same filter -- add socket to array\n if(in_array(interests[j],arrayInt) === true ){\n msg = msg+'#'+interests[j]\n }\n }\n });\n socketId.emit('matchedInterests',{msg:msg});\n matchedCountrySockets[pIndex].emit('matchedInterests',{msg:msg});\n var result = {};\n result.partner = matchedCountrySockets[pIndex];\n result.msg = 'You are now connected to a random person from '+userCountry+'. Happy Chatting!';\n callback(null,matchedCountrySockets[pIndex]);\n }\n\n }\n }\n\n\n // find world partner\n function world(filter, callback){\n\n var matchedWorldSockets = [];\n if(filter === 'world'){\n for( var i = 0; i < allSockets.length; i++){\n if(socketId.id === allSockets[i].id){\n // if both same do nothing\n }\n else{\n // make array of interests\n interestsCtrl.makeArray(allSockets[i].interest, function(err, array){\n arrayInt = array;\n // search in each socket\n for (var j = 0; j < interests.length; j++){\n // if any filter matches and has same filter -- add socket to array\n if(in_array(interests[j],array) === true && allSockets[i].filter === filter){\n matchedWorldSockets.push(allSockets[i]);\n }\n }\n })\n }\n }\n var msg = 'You matched on ';\n // for loop end\n if(matchedWorldSockets.length === 0){\n callback(null,'no partner found');\n }\n \n // if only one user found\n else if(matchedWorldSockets.length === 1){\n // make array of interests\n interestsCtrl.makeArray(matchedWorldSockets[0].interest, function(err, array){\n // search in each socket\n for (var j = 0; j < interests.length; j++){\n // if any filter matches and has same filter -- add socket to array\n if(in_array(interests[j],arrayInt) === true ){\n msg = msg+'#'+interests[j];\n }\n }\n });\n socketId.emit('matchedInterests',{msg:msg});\n matchedWorldSockets[0].emit('matchedInterests',{msg:msg});\n var result = {};\n result.partner = matchedWorldSockets[0];\n result.msg = 'You are now connected to a random person. Happy Chatting!';\n callback(null,result);\n }\n // if there are multiple users\n else if(matchedWorldSockets.length >= 2){\n var pIndex = Math.round(Math.random()*matchedWorldSockets.length) - 1;\n if(pIndex == -1){pIndex = 0;}\n // make array of interests\n interestsCtrl.makeArray(matchedWorldSockets[pIndex].interest, function(err, array){\n // search in each socket\n for (var j = 0; j < interests.length; j++){\n // if any filter matches and has same filter -- add socket to array\n if(in_array(interests[j],arrayInt) === true ){\n msg = msg+'#'+interests[j]\n }\n }\n });\n socketId.emit('matchedInterests',{msg:msg});\n matchedWorldSockets[pIndex].emit('matchedInterests',{msg:msg});\n var result = {};\n result.partner = matchedWorldSockets[pIndex];\n result.msg = 'You are now connected to a random person. Happy Chatting!';\n callback(null,result);\n }\n }\n } \n //create results\n\n\n}", "async handlePeerEvent() {\n try {\n this\n .peer\n .on('signal', (data) => this.onSignal(data))\n .on('connect', () => this.emit('connect', this.peer))\n .on('data', (data) => this.emit(data.type, data))\n .on('error', (error) => {\n this.peer.error = true\n\n this.emit('error', error)\n })\n\n // .on('data', (data) => this.emit('data', data))\n // .on('stream', (stream) => this.emit('stream', stream))\n } catch (error) {\n this.emit('error', error)\n }\n }", "function receivingData(socketId) {\r\n\tsocketUdp.recvFrom(socketId, function(readInfo) {\r\n\t\tif (readInfo.message <= 0) {\r\n\t\t\tconsole.log(\"Error Reading \" + readInfo.message);\r\n\t\t} else {\r\n\t\t\tvar newString = ab2str(readInfo.data);\r\n\t\t\tconsole.log(\"ReceivingData Continuos.\");\r\n\t\t\t\r\n\t\t\tvar messageData = newString.split(\";\");\r\n\t\t\tif(messageData[0] != \"\"){\r\n\t\t\t\tif (messageData[0] == INICIO) {\r\n\t\t\t\t\tconsole.log(\"ReceivingData INICIO # \" + MAIN_SERVER_UDP_PORT);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(messageData[1] == OK) {\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tparseSalas(messageData[2]);\t\t\t\t\t\r\n\t\t\t\t\t} else if(messageData[1] == ERROR_NO_SALAS) {\r\n\t\t\t\t\t\tvar jsonAux = '';\t\t\t\t\t\t\r\n\t\t\t\t\t\tparseSalas(jsonAux);\t\t\t\t\t\t\r\n\t\t\t\t\t} else if(messageData[1] == ERROR_SALA_REP) {\r\n\t\t\t\t\t\t$('#nameSala').val(\"\");\r\n\t\t\t\t\t\t$('#nuevaSala').attr('disabled', '');\r\n\t\t\t\t\t\t$('#labelMen').html(\"Error. Room name repeated.\");\r\n\t\t\t\t\t} else if(messageData[1] == ERROR_NO_APP) {\r\n\t\t\t\t\t\t$('#nameSala').val(\"\");\r\n\t\t\t\t\t\t$('#nuevaSala').attr('disabled', '');\r\n\t\t\t\t\t\t$('#labelMen').html(\"Error. Application does not exist or maximum bad players.\");\r\n\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tcallInicioSocket();\r\n\t\t\t\t} else if (messageData[0] == BEGIN_SESSION) {\r\n\t\t\t\t\tconsole.log(\"ReceivingData BEGIN_SESSION # \" + MAIN_SERVER_UDP_PORT + \" # \" + messageData[1]);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (messageData[1] == OK) {\r\n\t\t\t\t\t\t//console.log(\"ROOM: \" + messageData[2]);\t\t\t\t\t\r\n\t\t\t\t\t\tROOM_ID = messageData[2];\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//console.log(\"PLAYER ID: \" + messageData[3]);\r\n\t\t\t\t\t\tUSER_ID = messageData[3];\r\n\t\t\t\t\t\tplayersLatencies = new Object();\r\n\t\t\t\t\t\tplayersLatencies[USER_ID] = currentLatency;\r\n\t\t\t\t\t\tplayerReference = USER_ID;\r\n\t\r\n\t\t\t\t\t\t//console.log(\"PORT: \" + messageData[4]);\r\n\t\t\t\t\t\tGAME_PORT = parseInt(messageData[4]);\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//console.log(\"User number: \" + messageData[5]);\r\n\t\t\t\t\t\tUSER_NUMBER = messageData[5];\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tROOM_NAME = messageData[6];\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tMAX_PLAYER = messageData[7];\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$('#opciones').css(\"display\", \"none\");\r\n\t\t\t\t\t\tmostrarDiv(document.getElementById(\"juegoCanvas\"));\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\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t//Llamamos al init despues de que llegue el begin con toda la informacion y le pasamos el jugador que es\r\n\t\t\t\t\t\tpreInit(ROOM_NAME, USER_NUMBER, MAX_PLAYER);\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tstopSocket();\r\n\t\t\t\t\t\tstarGametSocket();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//Creamos el socket nuevo del juego para esa sala\r\n\t\t\t\t\t\tgameSocketStart();\r\n\t\t\t\t\t} else if (messageData[1] == ERROR_NO_SALA) {\t\t\t\t\t\t\r\n\t\t\t\t\t\tcontrolEntrarSala = false;\r\n\t\t\t\t\t\t$('#labelMen').html(\"No room. ERROR.\");\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if (messageData[0] == NEW_SALA) {\r\n\t\t\t\t\tconsole.log(\"ReceivingData NEW_SALA # \" + MAIN_SERVER_UDP_PORT + \" # \" + messageData[1]);\r\n\t\t\t\t\tif (messageData[1] == OK) {\r\n\t\t\t\t\t\t//console.log(\"ROOM: \" + messageData[2]);\t\t\t\t\t\t\r\n\t\t\t\t\t\tROOM_ID = messageData[2];\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//console.log(\"PLAYER ID: \" + messageData[3]);\r\n\t\t\t\t\t\tUSER_ID = messageData[3];\r\n\t\t\t\t\t\tplayersLatencies = new Object();\r\n\t\t\t\t\t\tplayersLatencies[USER_ID] = currentLatency;\r\n\t\t\t\t\t\tplayerReference = USER_ID;\r\n\r\n\t\t\t\t\t\t//console.log(\"PORT: \" + messageData[4]);\r\n\t\t\t\t\t\tGAME_PORT = parseInt(messageData[4]);\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//console.log(\"User number: \" + messageData[5]);\r\n\t\t\t\t\t\tUSER_NUMBER = messageData[5];\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tROOM_NAME = messageData[6];\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tMAX_PLAYER = messageData[7];\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$('#opciones').css(\"display\", \"none\");\r\n\t\t\t\t\t\tmostrarDiv(document.getElementById(\"juegoCanvas\"));\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\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t//Llamamos al init despues de que llegue el begin con toda la informacion y le pasamos el jugador que es\r\n\t\t\t\t\t\tpreInit(ROOM_NAME, USER_NUMBER, MAX_PLAYER);\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tstopSocket();\r\n\t\t\t\t\t\tstarGametSocket();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//Creamos el socket nuevo del juego para esa sala\r\n\t\t\t\t\t\tgameSocketStart();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\t\t\t\r\n\t\t}\r\n\t});\r\n\tif(!stopSocketInicial){\r\n\t\tt = setTimeout(function() {\r\n\t\t\treceivingData(socks.socketId);\r\n\t\t}, limitLatencyToInicio);\t\r\n\t}\r\n}", "try_to_match_local(data_received){\n\t\tlet data = {'type':'try_to_match', 'id': this.guid, 'latitude': this.latitude, 'longitude': this.longitude}\n\t\tsend_msg(data)\n\t}", "function pass_data(d) {\n var data = chrome.socket.read(d.socketId);\n console.log('Received data: ', data);\n port.postMessage({data: data});\n }", "function gotMessageFromServer(message) {\n console.log(\"Got message\", message.data); \n var data = JSON.parse(message.data); \n \n switch(data.type) { \n case \"login\": \n handleLogin(data.success,data.allUsers); \n break;\n case \"joined\":\n catchAllAvailableUsers(data.allUsers);\n break;\n case \"statusChange\":\n refreshAllAvailableUsers(data.user_status);\n break;\n case \"snap\":\n console.log('got imgUrl')\n gotRemoteSnapImg(data.snapUrl);\n break;\n //when somebody wants to call us \n case \"offer\": \n console.log('inside offer')\n document.getElementById('callFrom').innerHTML = '來自 ' + name;\n handleOffer(data.offer, data.name);\n alert(\"Receive a call from \" + data.name);\n break; \n case \"answer\": \n console.log('inside answer')\n handleAnswer(data.answer); \n break; \n //when a remote peer sends an ice candidate to us \n case \"candidate\": \n console.log('inside handle candidate')\n handleCandidate(data.candidate); \n break;\n case \"decline\":\n window.clearTimeout(callTimeout);\n handleLeave();\n alert(\"No response from remote\");\n break;\n case \"timeout\":\n handleLeave();\n alert(\"You didn't resopnse a call from \" + data.name);\n break;\n case \"leave\": \n handleLeave();\n alert(\"Remote has disconnected !\");\n break;\n case \"close\":\n if(data.reqFrom == connectedUser) {\n handleLeave();\n alert(\"Remote has disconnected !\");\n }\n refreshAllAvailableUsers(data.user_status);\n break;\n\n default: \n break; \n } \n\n serverConnection.onerror = function (err) { \n console.log(\"Got error\", err); \n };\n\n}", "function addEventListener(socket) {\n socket.on('message', function (data, rinfo){\n var jsonData = BSON.parse(data);\n if (utils.hasFileIndex(jsonData)) {\n var blockID = jsonData[\"index\"];\n var readStream = fs.createReadStream(\n source_file, {\n start: blockID * BLOCK_SIZE,\n end: blockID * BLOCK_SIZE + BLOCK_SIZE - 1,\n autoClose: true\n }\n );\n readStream.on('data', function(data) {\n console.log('transfer data....', blockID);\n var toSend = BSON.serialize({\n header: \"media\",\n index: blockID,\n content: data,\n checksum: utils.get_checksum(data)\n });\n socket.send(toSend, 0, toSend.length, rinfo.port, rinfo.address);\n });\n\n readStream.on('end', function () {\n// console.log('transfer data end....');\n });\n }\n else{\n console.log(\"Waning: BSON is not a file content...\");\n }\n });\n socket.on('close', function(){\n console.log('close....');\n });\n socket.on('error', function(){\n console.log('\\033[96m error occur. \\033[39m');\n });\n}", "function onInputFired (data) {\r\n\tvar movePlayer = find_playerid(this.id, this.room); \r\n\t\r\n\t\r\n\tif (!movePlayer) {\r\n\t\treturn;\r\n\t\tconsole.log('no player'); \r\n\t}\r\n\r\n\t//when sendData is true, we send the data back to client. \r\n\tif (!movePlayer.sendData) {\r\n\t\treturn;\r\n\t}\r\n\t\r\n\t//every 50ms, we send the data. \r\n\tsetTimeout(function() {movePlayer.sendData = true}, 50);\r\n\t//we set sendData to false when we send the data. \r\n\tmovePlayer.sendData = false;\r\n\t\r\n\t//Make a new pointer with the new inputs from the client. \r\n\t//contains player positions in server\r\n\tvar serverPointer = {\r\n\t\tx: data.pointer_x,\r\n\t\ty: data.pointer_y,\r\n\t\tworldX: data.pointer_worldx, \t\t\r\n\t\tworldY: data.pointer_worldy\r\n\t}\r\n\t\r\n //moving the player to the new inputs from the player\r\n\tif (physics.distanceToPointer(movePlayer, serverPointer) <= 30) {\r\n\t\tmovePlayer.body.angle = physics.movetoPointer(movePlayer, 0, serverPointer, 1000);\r\n\t} else {\r\n\t\tmovePlayer.body.angle = physics.movetoPointer(movePlayer, movePlayer.speed, serverPointer);\t\r\n\t}\r\n\t\r\n\t//new player position to be sent back to client. \r\n\tvar info = {\r\n\t\tx: movePlayer.body.position[0],\r\n\t\ty: movePlayer.body.position[1],\r\n\t\tangle: movePlayer.body.angle\r\n\t}\r\n\r\n\t//send to sender (not to every clients). \r\n\tthis.emit('input_recieved', info);\r\n\t\r\n\t//data to be sent back to everyone except sender \r\n\tvar moveplayerData = {\r\n\t\tid: movePlayer.id, \r\n\t\tx: movePlayer.body.position[0],\r\n\t\ty: movePlayer.body.position[1],\r\n\t\tangle: movePlayer.body.angle,\r\n\t}\r\n\t\r\n\t//send to everyone except sender \r\n\tthis.broadcast.emit('enemy_move', moveplayerData);\r\n}", "function sendPos() {\n io.emit('servos', {\n tilt: {\n pos: tiltPos,\n min: tiltMin,\n max: tiltMax\n },\n pan: {\n pos: panPos,\n min: panMin,\n max: panMax\n },\n eye: {\n\twidth: captureWidth,\n\theight: captureHeight\n }\n });\n}", "function _notifyConnectedClientsTwoParts(type, data, data2) {\n let message = {\n type, data, data2\n };\n console.log(JSON.stringify(message));\n connection.invoke(\"SendMessageToAllAsync\", JSON.stringify(message))\n .catch(function (err) {\n return console.error(err.toString());\n });\n }", "function updateEndPointData(callback) {\n getDeviceData.getEndpointsData(function (dataFromMbed, endpoint) {\n if (dataFromMbed) {\n callback(null, dataFromMbed, endpoint);\n };\n });\n}", "function invokeNextConnectingPeers(){\n/*setTimeout( function(){\n\tif(whoAmI !=pcArr.length )\t{\n\t\tvar wheretowhere = whoAmI+1+' '+pcArr.length ;\n\t\tsocket.emit('connectingPeers', wheretowhere);\n\t}\n\t},1000);*/\n}", "function emitShipPositionUpdates(){\n var positions = ships.getAllPos();\n var out = {};\n\n // Only add to the output json that has changed since last send\n for (var id in positions){\n if (lastData[id] != positions[id].str) {\n lastData[id] = positions[id].str;\n out[id] = positions[id].pos;\n out[id].vel = positions[id].vel;\n\n }\n }\n\n // Only *if* there's useful data to be sent, send only that pos data to all clients\n if (Object.keys(out).length) {\n io.sockets.emit('pos', out);\n }\n}", "function processWebSocketData(msg) {\n var command, i = 0, mesh = null, meshid = null, nodeid = null, meshlinks = null, change = 0;\n try { command = JSON.parse(msg.toString('utf8')); } catch (e) { return; }\n if (common.validateString(command.action, 3, 32) == false) return; // Action must be a string between 3 and 32 chars\n\n switch (command.action) {\n case 'ping': { try { ws.send(JSON.stringify({ action: 'pong' })); } catch (ex) { } break; }\n case 'start': {\n // Get the list of disk images\n var domainx = 'domain' + ((domain.id == '') ? '' : ('-' + domain.id));\n var useridx = user._id.split('/')[2];\n var userPath = parent.parent.path.join(parent.parent.filespath, domainx, 'user-' + useridx);\n\n // Look for a list of disk images for the user to select.\n if (fs.existsSync(userPath)) {\n // Do something\n readFsRec(userPath, function (err, results) {\n var floppyImages = [], cdromImages = [];\n for (var i in results) {\n if (results[i].toLowerCase().endsWith('.img')) { floppyImages.push(results[i].substring(userPath.length + 1)); }\n else if (results[i].toLowerCase().endsWith('.iso')) { cdromImages.push(results[i].substring(userPath.length + 1)); }\n }\n var xx, sel = true, html = \"<div style='margin:10px 5px 10px 5px'>Select disk images & start type.</div>\";\n\n // Floppy image selection\n xx = \"<select style=width:240px id=xxFloppyImagesSelect><option value=''>None</option>\";\n for (var i in floppyImages) { xx += \"<option value='\" + encodeURIComponent(floppyImages[i]) + \"'\" + (sel?\" selected\":\"\") + \">\" + floppyImages[i] + \"</option>\"; sel = false; }\n xx += \"</select>\";\n html += \"<div style=margin:5px>\" + addHtmlValue(\"Floppy Image\", xx) + \"</div>\";\n\n // CDROM image selection\n sel = true;\n xx = \"<select style=width:240px id=xxCdromImagesSelect><option value=''>None</option>\";\n for (var i in cdromImages) { xx += \"<option value='\" + encodeURIComponent(cdromImages[i]) + \"'\" + (sel ? \" selected\" : \"\") + \">\" + cdromImages[i] + \"</option>\"; sel = false; }\n xx += \"</select>\";\n html += \"<div style=margin:5px>\" + addHtmlValue(\"CDROM Image\", xx) + \"</div>\";\n\n // Start type\n xx = \"<select style=width:240px id=xxIderStartType><option value=0>On next boot<option value=1>Graceful<option value=2>Immediate</select>\";\n html += \"<div style=margin:5px>\" + addHtmlValue(\"Session Start\", xx) + \"</div>\";\n\n var js = \"function iderServerCall() { return { ider: 1, floppyPath: Q('xxFloppyImagesSelect').value, cdromPath: Q('xxCdromImagesSelect').value, iderStart: Q('xxIderStartType').value }; }\";\n\n try { ws.send(JSON.stringify({ action: 'dialog', args: { html: html, js: js }, buttons: 3 })); } catch (ex) { }\n });\n } else {\n // No user folder\n try { ws.send(JSON.stringify({ action: 'dialog', args: { html: 'No disk images found on remote server. Upload .img and .iso files to server \"My Files\" folder to enable this feature.' }, buttons: 2 })); } catch (ex) { }\n }\n\n break;\n }\n case 'dialogResponse': {\n if (command.args.ider == 1) { // Start IDER Session\n // Decode and validate file paths\n if ((command.args.floppyPath != null) && (typeof command.args.floppyPath != 'string')) { command.args.floppyPath = null; } else { command.args.floppyPath = decodeURIComponent(command.args.floppyPath); }\n if ((command.args.cdromPath != null) && (typeof command.args.cdromPath != 'string')) { command.args.cdromPath = null; } else { command.args.cdromPath = decodeURIComponent(command.args.cdromPath); }\n // TODO: Double check that \".\" or \"..\" are not used.\n if ((command.args.floppyPath != null) && (command.args.floppyPath.indexOf('..') >= 0)) { delete command.args.floppyPath; }\n if ((command.args.cdromPath != null) && (command.args.cdromPath.indexOf('..') >= 0)) { delete command.args.cdromPath; }\n\n // Get the disk image paths\n var domainx = 'domain' + ((domain.id == '') ? '' : ('-' + domain.id));\n var useridx = user._id.split('/')[2];\n var floppyPath = null, cdromPath = null;\n if (command.args.floppyPath) { floppyPath = parent.parent.path.join(parent.parent.filespath, domainx, 'user-' + useridx, command.args.floppyPath); }\n if (command.args.cdromPath) { cdromPath = parent.parent.path.join(parent.parent.filespath, domainx, 'user-' + useridx, command.args.cdromPath); }\n\n // Setup the IDER session\n obj.ider = amtMeshRedirModule.CreateAmtRedirect(amtMeshIderModule.CreateAmtRemoteIder(parent, parent.parent), domain, user, parent, parent.parent);\n obj.ider.onStateChanged = onIderStateChange;\n obj.ider.m.iderStart = command.args.iderStart;\n obj.ider.m.sectorStats = iderSectorStats;\n obj.ider.tlsv1only = req.query.tlsv1only;\n\n // Setup disk images\n var iderError = obj.ider.m.diskSetup(floppyPath, cdromPath);\n\n // Error with the disk images, unable to start IDER\n if (iderError != 0) { try { ws.send(JSON.stringify({ action: 'error', code: iderError })); } catch (ex) { } break; }\n\n // Start the IDER session\n obj.ider.Start(req.query.host, req.query.port, req.query.tls);\n }\n\n break;\n }\n default: {\n // Unknown user action\n console.log('Unknown IDER action from user ' + user.name + ': ' + command.action + '.');\n break;\n }\n }\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 }", "function combinecallback(coords, data, weight) {\n return [coords[0], coords[1], coords[2]];\n }", "function handleIce(data){\n console.log(\"send candidate\");\n socket.emit(\"ice\", data.candidate, roomName);\n}", "function connect(peer_name,other_component_description)\n\t{\n\t if(!(component_description.name in other_component_description.inputs))\n\t\t{\n\t\t console.log(new Error(\"bitstamp_announcer_start - trying to connect wrong components. \"+other_component_description.name+' doesnt have in inputs '+component_description.name+'.').stack,\" to \",\"other_component_description=\",other_component_description,\" from \" ,'component_description=',component_description)\n\t\t return\n\t\t}\n\t\t\t\n\t\t//if(isconnected(other_component_description))\n\t\t//{\n\t\t// console.log(new Error(\"bitstamp_announcer_start - already connected components. \"+other_component_description.name+' doesnt have in inputs '+component_description.name+'.').stack,\" to \",\"other_component_description=\",other_component_description,\" from \" ,'component_description=',component_description)\n\t\t// return\n\t\t//}\n\t\t\n\t\tvar endpoint=other_component_description.inputs[component_description.name];\n\t\t\n\t\tvar port=endpoint.zmqport;\n\t\tvar myexternalip=zmq_getExternalIp();\n\t\tport=port.replace(/127.0.0.1|0.0.0.0|\\*/,myexternalip==endpoint.externalip?'127.0.0.1':endpoint.externalip);\n\t\tvar zmq1 = zmqconnect(port,component_description.name+' to '+other_component_description.name);\n\t\tif(!clients[other_component_description.name]){clients[other_component_description.name]=[];}\n\t\tclients[other_component_description.name].push(zmq1);\n\t\tif(!clients_bypeer[peer_name]){clients_bypeer[peer_name]=[];}\n\t\tclients_bypeer[peer_name].push(zmq1);\n\t\tclients_all.push(zmq1);\n\t\t//zmq.on('message', function on_zmq_client_message(zmq_client,message)\n\t\t//{\n\t\t// console.log('on_zmq_client_message(zmq_client,message) '+message.toString());\n\t\t//})\n\t}", "function processDataGram(peerid, info) {\n if ((peerid == null) || (peerid === \"\") || (\"undefined\" === typeof peerid)) {\n console.log(\"[PROCESS DATAGRAM] EMPTY PEER ID\");\n return\n }\n if (peerid === socket.id) {\n console.log(\"[PROCESS DATAGRAM] SAME SOCKET DGQ\");\n return\n }\n var position = info['position'];\n var rotation = info['rotation'];\n\n // All the components that compose an \"avatar\"\n // \"Templates\" of the non-primitives must exist as top level leaves in `a-scene`\n var peerBox;\n var peerHat;\n var peerChat;\n var peerSombro;\n var peerLight;\n\n if (document.getElementById('hat' + peerid)) {\n peerBox = document.getElementById('box' + peerid);\n peerHat = document.getElementById('hat' + peerid);\n peerChat = document.getElementById('speech' + peerid);\n peerSombro = document.getElementById('sombro' + peerid);\n } else {\n peerBox = document.createElement('a-box');\n peerHat = document.createElement('a-cone');\n peerChat = document.createElement('a-entity');\n peerSombro = document.getElementById('starterbrero').cloneNode(true);\n peerBox.id = 'box' + peerid;\n peerHat.id = 'hat' + peerid;\n peerChat.id = 'speech' + peerid;\n peerSombro.id = 'sombro' + peerid;\n peerBox.setAttribute('lerp', {\"duration\":200});\n peerBox.appendChild(peerSombro);\n peerHat.setAttribute('scale', \"0.4 0.4 0.4\");\n peerSombro.setAttribute('position', {\"x\": 0, \"y\": 0.35, \"z\":0});\n peerSombro.setAttribute('rotation', {\"x\": 0, \"y\": 0, \"z\":0});\n document.querySelector('a-scene').appendChild(peerBox);\n document.querySelector('a-scene').appendChild(peerHat);\n document.querySelector('a-scene').appendChild(peerChat);\n\n var imageBuffer = \"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAcFBQYFBAcGBQYIBwcIChELCgkJChUPEAwRGBUaGRgVGBcbHichGx0lHRcYIi4iJSgpKywrGiAvMy8qMicqKyr/2wBDAQcICAoJChQLCxQqHBgcKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKir/wAARCABcAEwDASIAAhEBAxEB/8QAGwAAAgMBAQEAAAAAAAAAAAAABgcDBAUIAQL/xABAEAACAQMDAQUEBQkHBQAAAAABAgMEBREABiESBxMxQVEUImFxIzKBodIWQlJTYpKiwdEVNFRjcnWxgpGzwvD/xAAaAQADAQEBAQAAAAAAAAAAAAADBAUCBgAB/8QAJBEAAgICAgIDAAMBAAAAAAAAAQIAAwQREiETMSJBUSMyYXH/2gAMAwEAAhEDEQA/APN7w3i1XOlqLdfbskUmVkhWvmK8DORljjQkd17gQ9RvdyaRvL2uTpT4Yz461N+bl67sy05yEXC48/joToEepgaZ1LDJ/wC+pdVthTsy/kVVCz4gTRfd24VGFvlyLY/xknH36gXeO4mbAv8Ac/ifbJPu51WaIGDg+8/gB/zqrFTd2nR9YjzGjB2/Yr41/Jbn3luQFgL3dz8RXSDH36xK3e26Vb3NzXpflcJfxat1kXdxhXOXby9NYNdT93hTgs3poiWNv3BvWuvUlbfW7Q3G6b1j/cZfxanpt/7qjnVzua8OvgyvXyn/ANtDzQsGIYY51EylW40zske4txAPqMxd4bidQy7gumCM/wB9k/Fp3dnF4rqzYtHLWVMtRMWkBlmcuze+2Mk8nXNdsnzbEZuSODroXsuYP2fUTDwLy/8AkbXzFDCw7/JjL4Gocf2KmShW41tTPJLkd4cZ8hqOnmSaGWmpcFQPEfpE8/yGh253hyHgpX6VVsDH53x1pUtwprZbHjQ5lwrE+ZJ1P4nUrFgTNSpgCKWQe6igD01Pa7LUVVLLVd23dRjrLYwuBjVexV1XdGM01G01JG2HfoYqD5LkeHGt+7bpvVyov7ItFppqWiBAlnip2Zsep9B8tDPL0JtVH3BieBJ2Kohd2bGBySdFdj7Jqi4wx1d4UxIy9Sw+B+3TF7OtjbeoLdHcBVi51xHMjIVEZ9Ap5Hz0bzpEI2C48NBstI6WeQrvRE5d3b2c1NrkkNMiSw/pEcjQBdLd7C4jPV1AZPV566wvIpJ45A08OVH1S40j91WuGsv0qlV+oTx6caLjZD7003lY6a2sobBtNHcbY71MTM6ORgthSNPjZdNFSbYhgpkCRq74UeWWyfv0lNkSx0dC8MkiqFlbBJAyNO3Z8iy7didDlS74Przroata2JzWQCBOeZbIjWuKeMYfB6ifMg41m2az124b9T2yhXrkmbpBzwPUn5DW9bbp7TbaSjqqF5ZBMzKysV6gwx0n/qxphdmezXsu6HqZsd7DEocEg9LuATggnyI+/UOyzxqSZfrr8hGoy7JsOitO06a10rOoRQZZEPSZG8zxod3VsC3V14oqqNDSR04xKkJZjMfXqJyNNShUGiPr5apy0SVEv0gyM+GklLIvIfc+rYpbVnoTI2rafYrbGskrP7n5xyQPnoO3RcLldbm9ronEFL3nds/VhmPz8hpkygU8L93wFXA0t5Yi9ynkjZgwkLDpODoOwDsx2hTcWaAG47K23L3LRTWeWfuow71IlfpYHzB8CNBt6qVppC1Ipj64sAZzjnT8udtS6W9TN09IGTleTpC78RU3WtLDx7gyq/PT9LrY2gIC6l6k2TuDtrubU7yNIhbnI5xrozstq3ruz6iqJEEbPJL7oPAxIw/lrnc0DxOeqJs+GOnXQ3ZSvT2dUIKlT1y8EYx9I2rlJ+pzmV6iQkejajEtT7UZs/RrDwremmd2HS10qXZbmZDJ3iOneNkgHP8ATWYdtUsaTU88QkqackjqXOAOCoXwA0TdnL263XYUtNEqT1sbHIlY56OeEyVAwf2T8DqVmJ/EdStjP8xHHRnEYB8NfUpYZZfADy1Ak0cFOZJnVEUZZm8Boeqt4Om4IoIApoACHYDLO3HIOcYGfn8PPUlXAXuGWp7HPETV9op6mlmAnbKkq3WhXn7dA1KY2rKjupFlCt+awONGtynpa2lMbmN42HiPLQjS+zUJZFRVy3OB46w/crYQKqSZBeLoLfbZZJW6EVSxJ1zjVXOa7bonuQj6gT1KufLy05O0eo9os80CMUR8K7AZIHnpex0sFqcU9HFGisAe9K9bNkcHJ8Ps1Qw1CgsfcWzi1hCL6mRT10dXIEjbpcnLhhzp/dmo6di0gGT9JL4n9s6RNztKVTCZAIZ1AIdE6c+ucaePZWJV7O6EVBzIJJeogf5jat47Anqc1mVMi7MC71VdVpmuFTVgS910IsBOT5ZJIHOMaz9hrUwdqtoEVFULH0MHlKN9Uxnk/DJHOnld9tWmy2MLFboIHmZUQKMlQOeWOSTx66C9sCpuG5rjdaammlClI0Krn3e8XP8ADnSLWclYf5HkADAiNDoElNJG/VgqQek4P2HS3tVvqT38NTQVLWxpDErMhJBOcvk84OfHw0yI5MTD0xg6vNCssfgCNREXcfW40tvXuLKe3CnozTCtlSnQdKgS4bH/ADnUVFAe6maYMUz9EGOSB66NbjTU0WWMKfMrrBkCHjpyzHhR/wDeGssx3K1Th06EDL/QCrpnSTwbQNUUd/t1KatLJKbWoKiqWLrAAPLA+PGn7admCsn9tvKYpxjuqbzf4t8PhoyNBSrTiGpCosg6FjAHSBjwxqljVuR3I2ZfXy0hnIcVRc5qru4H72PBIl4xjTn7Puv8jabvJBK3XJll8/eOhXtK2bV7XqJDaqZUtzuZyIWbKHn48L6gaIey5y/Z/RMW6syS8+v0jaqYq8bD/wAknMblUO/uMq71feUjNFb5q6WPkdacITx4DOqyWq7JHHBRh41l5kYyAKmfH3dU5t31tFO8NPS0aoG/Qbn+LUSb4uSZxDSkscklG/Fr3gmPP+CassL0p6W5ZODqKGtmLMgGF1iz7praiRnkip8t6K39dRLf6pTkRQ/un+uotmK4c8TKaZKFPkO5vvRSVzAM2FHJ41o0G16eKrWply3TyEPmfU/00Lw7srYXDLBTMR4Blb8WrX5eXP8AUUn7jfi05jYQ/u/Zi92c+uCHQh0sWGLE59B6aqdxKJuuqKsSfEeGPIaEPy8uf6ik/cb8WvDvq5MMGnpCP9Dfi1R8cQFujuEt6tq3Whkpp1QkjMLkfVb0PwOgu204pYJIFgSn7uQgxovSAcDPHxOT9urbb1uLr0mGlxjH1G4/i19wTtceurqABJKw6ungcKB/LRKVIeYvcFNT/9k=\";\n peerBox.setAttribute('material', 'src', 'url(' + imageBuffer + ')');\n }\n\n\n var lastIcos = peerBox;\n var hatPos = position;\n\n peerBox.setAttribute('position', position);\n peerBox.setAttribute('rotation', rotation);\n\n hatPos.y += 2;\n peerHat.setAttribute('position', hatPos);\n peerHat.setAttribute('color', getRandomColor());\n\n hatPos.y -=2.5;\n peerChat.setAttribute('position', hatPos);\n peerChat.setAttribute('rotation', rotation);\n }", "function combinecallback(coords, data, weight) {\n // console.log('combine callback');\n return [coords[0], coords[1], coords[2]];\n }", "_initEmmiter(){\n const self = this\n\n emitter.on('makeblock', function(block){\n if(config.p2pRole == 'server' && self.connected != 0){\n self.p2psocket.emit('makeblockTo', block)\n self.p2psocket.broadcast.emit('makeblockTo', block)\n }\n })\n\n //data { tx : transaction , socketId : socketId}\n emitter.on('validate', function(data){\n console.log('[blockserver][p2p][validate agreement] validate event start')\n self.eventCount++\n\n\n if(data.tx.result == actionType.allow ){\n self.posCount++;\n }else if(data.tx.result == actionType.deny){\n\n }\n\n //call end\n if(self.eventCount == self.connected || self.connected == 0){\n console.log('[blockserver][validate agreement] start: evnetCount : ' + self.eventCount + ' connected : ' + self.connected + ' posCount : ' + self.posCount)\n\n if(self.connected == 0 || self.posCount >= (self.connected+1)/2) {\n console.log('[blockserver][p2p][validate agreement] allow')\n data.tx.result = 1\n }else{\n console.log('[blockserver][validate agreement] deny')\n data.tx.result = 2\n }\n\n\n var targ_socket = _.find(self.socket_ids , function(sok){\n return sok == data.socketId\n })\n\n if(targ_socket !== undefined){\n console.log('[blockserver][validate agreement] server side : ' + JSON.stringify(data.tx))\n io.to(data.socketId).emit('validateClient', data.tx)\n }else if(self.connected != 0){\n console.log('[blockserver][validate agreement] send to client :' + JSON.stringify(data.tx) + \" socketId : \" + data.socketId)\n self.p2psocket.emit('validateComplete', {result : data.tx , socketId : data.socketId})\n }\n //init\n self.posCount = 0\n self.eventCount = 0\n }\n })\n\n console.log('[blockserver] initEmitter compelete')\n }", "function sendOfferToCallee() {\n sendToServer({\n type: 'offer',\n offer: caller_peer_connect.localDescription\n });\n // console.log('reciveCallerOffer();');\n // console.log(JSON.stringify(caller_peer_connect.localDescription));\n // reciveCallerOffer(caller_peer_connect.localDescription);\n}", "emit_wrapper(message, message_data) {\n message_data.doc_id = this.doc_id;\n //message_data.user\n this.socketio.emit(message, message_data)\n }", "function onReceiveImportantData(data) {\n console.log(\"Important data: \" + data);\n}", "function appC_processIncoming(data) {\n var dataIdx = 0;\n while (dataIdx < data.length) {\n var rx_pkt_len = data[dataIdx + PKT_HEADER_LEN_FIELD] + (data[dataIdx + PKT_HEADER_LEN_FIELD + 1] << 8) + PKT_HEADER_SIZE;\n var ByteBuffer = require(\"bytebuffer\");\n var rx_pkt_buf = new ByteBuffer(rx_pkt_len, ByteBuffer.LITTLE_ENDIAN);\n rx_pkt_buf.append(data.slice(dataIdx, dataIdx + rx_pkt_len), \"hex\", 0);\n dataIdx = dataIdx + rx_pkt_len;\n var rx_cmd_id = rx_pkt_buf.readUint8(PKT_HEADER_CMDID_FIELD);\n switch (rx_cmd_id) {\n case timac_pb.appsrv_CmdId.APPSRV_GET_NWK_INFO_CNF:\n var networkInfoCnf = timac_pb.appsrv_getNwkInfoCnf.decode(rx_pkt_buf.copy(PKT_HEADER_SIZE, rx_pkt_len).buffer);\n appC_processGetNwkInfoCnf(JSON.stringify(networkInfoCnf));\n break;\n case timac_pb.appsrv_CmdId.APPSRV_GET_DEVICE_ARRAY_CNF:\n var devArray = timac_pb.appsrv_getDeviceArrayCnf.decode(rx_pkt_buf.copy(PKT_HEADER_SIZE, rx_pkt_len).buffer);\n appC_processGetDevArrayCnf(JSON.stringify(devArray));\n break;\n case timac_pb.appsrv_CmdId.APPSRV_NWK_INFO_IND:\n var networkInfoInd = timac_pb.appsrv_nwkInfoUpdateInd.decode(rx_pkt_buf.copy(PKT_HEADER_SIZE, rx_pkt_len).buffer);\n appC_processNetworkUpdateIndMsg(JSON.stringify(networkInfoInd));\n break;\n case timac_pb.appsrv_CmdId.APPSRV_DEVICE_JOINED_IND:\n var newDeviceInfo = timac_pb.appsrv_deviceUpdateInd.decode(rx_pkt_buf.copy(PKT_HEADER_SIZE, rx_pkt_len).buffer);\n appC_processDeviceJoinedIndMsg(JSON.stringify(newDeviceInfo));\n break;\n case timac_pb.appsrv_CmdId.APPSRV_DEVICE_NOTACTIVE_UPDATE_IND:\n var inactiveDevInfo = timac_pb.appsrv_deviceNotActiveUpdateInd.decode(rx_pkt_buf.copy(PKT_HEADER_SIZE, rx_pkt_len).buffer);\n appC_processDeviceNotActiveIndMsg(JSON.stringify(inactiveDevInfo));\n break;\n case timac_pb.appsrv_CmdId.APPSRV_DEVICE_DATA_RX_IND:\n var devData = timac_pb.appsrv_deviceDataRxInd.decode(rx_pkt_buf.copy(PKT_HEADER_SIZE, rx_pkt_len).buffer);\n appC_processDeviceDataRxIndMsg(JSON.stringify(devData));\n break;\n case timac_pb.appsrv_CmdId.APPSRV_COLLECTOR_STATE_CNG_IND:\n var coordState = timac_pb.appsrv_collectorStateCngUpdateInd.decode(rx_pkt_buf.copy(PKT_HEADER_SIZE, rx_pkt_len).buffer);\n appC_processStateChangeUpdate(JSON.stringify(coordState));\n break;\n case timac_pb.appsrv_CmdId.APPSRV_SET_JOIN_PERMIT_CNF:\n var permitJoinCnf = timac_pb.appsrv_setJoinPermitCnf.decode(rx_pkt_buf.copy(PKT_HEADER_SIZE, rx_pkt_len).buffer);\n appC_processSetJoinPermitCnf(JSON.stringify(permitJoinCnf));\n break;\n case timac_pb.appsrv_CmdId.APPSRV_TX_DATA_CNF:\n /* Add Applciation specific handling here*/\n break;\n default:\n console.log(\"ERROR: appClient: CmdId not processed: \", rx_cmd_id);\n }\n }\n }", "updateSpoofaxData(newData)\r\n {\r\n //console.log(\"\\nUpdating Spoofax data: \" + JSON.stringify(newData));\r\n this.spoofaxData = newData;\r\n this.io.emit('spoofax-data', this.spoofaxData);\r\n }", "function receivedMessage(data) {\n\tconsole.log('Received:', data);\n\tshowNewMessage(\"other\", data)\n}", "function syncWithOther(socket, data) {\r\n var syncData = \"\";\r\n \r\n for (var i=0; i<onlineList.length; i++) {\r\n for (var j=0; j<onlineList[i].length; j++) {\r\n if (onlineList[i][j].id == socket.id && onlineList[i].length > 1) { \r\n for (var k=0; k<onlineList[i].length; k++) {\r\n if (k != j) {\r\n syncData = JSON.stringify({\"type\":\"sync\", \"match\":i, \"data\":data});\r\n onlineList[i][k].send(syncData); \r\n }\r\n }\r\n return;\r\n }\r\n }\r\n }\r\n}", "function sendPosition(x, y) {\n socket.emit('clientPosition', player);\n // console.log(player)\n}", "function onConnect(socket, socketio) {\n\n\n // SENDS THE AVAILABLE COURIERS TO CLIENT DEPENDING ON THEIR LOCATION\n socket.on('getAvailableCouriers', function(userData) {\n\n\n //GET DISTANCE AND TIMES\n unirest.get('http://maps.googleapis.com/maps/api/distancematrix/json?origins='+userData.latitude+','+userData.longitude+'&destinations=' + finalLink + '&mode=driving&language=tr-TR&sensor=false')\n\n .header('Accept', 'application/json')\n .end(function(response) {\n //console.log(response.raw_body);\n if (availableCouriersUnsortedArray != null) {\n for (var i = 0; i < JSON.parse(response.raw_body).rows[0].elements.length; i++) {\n\n // ASSIGN EACH DISTANCE VALUE TO ITS CORRESPONDING OBJECT\n availableCouriersUnsortedArray[i].distance = JSON.parse(response.raw_body).rows[0].elements[i];\n }\n console.log(availableCouriersUnsortedArray)\n //SEND THE UNSORTED COURIER ARRAY TO THE CLIENT\n socket.emit('sortedCouriersList', availableCouriersUnsortedArray);\n }\n\n });\n\n\n\n console.info('[%s] %s', socket.address, JSON.stringify(userData, null, 2));\n\n });\n\n\n\n //HANDLE ORDERS AND BROADCASTS TO ALL THE COURIERS, TO DETECT FOR WHICH ONE IS IT MEANT TO\n socket.on('newOrder', function(order) {\n\n console.log(\"New Order Received, Waiting For Courier To Respond\")\n console.log(order)\n // socket.to().emit(\"offerFromUser\", order);\n socketio.emit('offerFromUser', order);\n\n });\n\n\n //COURIER ACCEPTED THE JOB, HE IS NO MORE AVAILABLE\n socket.on('acceptedByCourier', function(data) {\n console.log(\"ORDER ACCEPTED BY COURIER\")\n dataModule.postOrder(data) // Write it into Database in ORDER Model\n\n //REMOVE THAT COURIER TEMPORARILY WHO HAS JUST GOT THE JOB\n\n\n console.log(availableCouriersUnsortedArray)\n\n availableCouriersUnsortedArray = _.remove(availableCouriersUnsortedArray, function(currentObject) {\n return currentObject._id === data.courierId;\n });\n console.log(availableCouriersUnsortedArray)\n\n })\n\n //THIS MESSAGE COMES FROM USER TO RELEASE THE COURIER, TO MAKE HIM AVAILABLE\n socket.on('JobAccomplished', function(courierid) {\n //GERI AL REMOVELADIGIN KURYEYI\n console.log(\"JOB ACCOMPLISHED\")\n dataModule.getCourier(courierid).then(function(courier) {\n availableCouriersUnsortedArray.push(courier)\n })\n console.log(availableCouriersUnsortedArray)\n })\n\n\n\n //A COURIER IS LOGGING IN\n socket.on('courierLogin', function(data) {\n console.log(\"COURIER LOGGED IN\");\n dataModule.getCourier(data.courierId).then(function(courier) {\n socket.id = data.courierId; //give socket the same name with data's courierId\n\n availableCouriersUnsortedArray.push(courier);\n console.log(\"-----AVAILABLE COURIERS-----\");\n console.log(availableCouriersUnsortedArray)\n\n\n })\n });\n\n //REALTIME UPDATE THE CURRENT LOCATION OF COURIER\n socket.on('courierLocation', function(data) {\n console.log(\"courierLocation:::\")\n var idx = -1;\n _.find(availableCouriersUnsortedArray, function(courier, courierIndex) {\n if (courier._id == data.courierId) {\n idx = courierIndex;\n return true;\n };\n });\n if (idx > -1) {\n availableCouriersUnsortedArray[idx].latitude = data.latitude\n availableCouriersUnsortedArray[idx].longitude = data.longitude\n }\n\n\n console.log(availableCouriersUnsortedArray)\n\n });\n\n\n //A COURIER IS REGISTERING TO THE SYSTEM\n socket.on('registerCourier', function(data) {\n\n availableCouriersUnsortedArray.push(data);\n socket.broadcast.emit('new courierAvailable', data);\n });\n socket.on('UnRegisterCourier', function(data) {\n console.log(data)\n socket.broadcast.emit('courierRemoved', data);\n availableCouriersUnsortedArray.splice(availableCouriersUnsortedArray.indexOf(data), 1);\n });\n\n\n // Insert sockets below\n require('../api/address/address.socket').register(socket);\n require('../api/category/category.socket').register(socket);\n require('../api/order/order.socket').register(socket);\n require('../api/user/user.socket').register(socket);\n require('../api/courier/courier.socket').register(socket);\n require('../api/thing/thing.socket').register(socket);\n}", "updatePointsOnGlobe() {\n const globeseries = [['peers', []]];\n let geoiplookup = '';\n\n if (process.env.NODE_ENV === 'development') {\n geoiplookup = maxmind.openSync(\n path.join(__dirname, 'GeoLite2-City', 'GeoLite2-City.mmdb')\n );\n } else {\n geoiplookup = maxmind.openSync(\n path.join(\n configuration.GetAppResourceDir(),\n 'GeoLite2-City',\n 'GeoLite2-City.mmdb'\n )\n );\n }\n\n RPC.PROMISE('getpeerinfo', []).then(payload => {\n var tmp = {};\n var ip = {};\n let maxnodestoadd = payload.length;\n if (maxnodestoadd > 20) {\n maxnodestoadd = 20;\n }\n for (var i = 0; i < maxnodestoadd; i++) {\n ip = payload[i].addr;\n ip = ip.split(':')[0];\n var tmp = geoiplookup.get(ip);\n globeseries[0][1].push(tmp.location.latitude);\n globeseries[0][1].push(tmp.location.longitude);\n globeseries[0][1].push(0.1); //temporary magnitude.\n }\n\n globeseries[0][1].push(myIP[0]);\n globeseries[0][1].push(myIP[1]);\n globeseries[0][1].push(0.1); //temporary magnitude.\n // console.log(myIP);\n if (myIP[1]) {\n glb.removePoints();\n glb.addData(globeseries[0][1], {\n format: 'magnitude',\n name: globeseries[0][0],\n });\n glb.createPoints();\n }\n });\n }", "function broadcast(event,data,from,roomname,to){\n var username = _.findWhere(peoples,{socket:from});\n\n debug('peoples send is '+from+'\\n to '+roomname,username);\n //TODO broadcast to all client\n var keyList = (to == undefined)?keys:to;\n\n for(var index in keyList){\n var dataEncrypt = encrypt(data,index);\n\n if(username == null){\n io.sockets.connected[index].emit(event,dataEncrypt);\n }else{\n var usernames = encrypt(username,index);\n var roomEncrypt = encrypt(roomname,index);\n io.sockets.connected[index].emit(event,dataEncrypt,usernames,roomEncrypt);\n }\n }\n\n\n\n}", "function dataChannelReceive(id, data) {\n if (id === ourID) return;\n\n let message;\n try {\n message = JSON.parse(data);\n } catch (e) {\n receiveFile(id, data); // If it is not a JSON then it is a file Blob\n return;\n }\n\n if (message.type == \"pos\") { // It is 3D positional data\n ThreeD.changeUserPosition(id, message.x, message.y, message.z); // Change position of user\n } else if (message.type == \"file\") { // It is a list of advertised files\n clearFileList(id); // Remove previous file options\n for (let i in message.files) {\n updateFileList(id, message.files[i]); // Add each advertised file to the drop-down menu\n }\n } else if (message.type == \"request\") { // It is a file request\n sendFile(id, message.option);\n } else if (message.type == \"chat\") { // It is a chat message\n addChat(connections[id].name, message.message, message.whisper);\n } else if (message.type == \"share\") { // Someone is sharing their screen\n if (message.sharing) { // If the person has started sharing\n if (shareButton) // This is done in order to make unit testing work\n shareButton.hidden = true; // Hide the share screen button\n sharing.id = id; // Save the ID of the sharing user\n sharing.width = message.width;\n sharing.height = message.height;\n } else { // If they have stopped sharing\n sharing.id = null;\n sharing.width = 0;\n sharing.height = 0;\n\n shareButton.hidden = false; // Unhide the share screen button\n screenShare.srcObject = null;\n ThreeD.updateShareScreen(null, sharing, null); // Re-add the 3D walls without the video texture\n }\n }\n}", "_sendData() {\n\n }", "peerConnectHandler(peer){\n var connectingID = peer.metadata;\n this.addNodeConnection(connectingID,peer);\n console.log(`Peer OnConnect! - ${connectingID}`);\n if(this.nodeToCallbacks[connectingID]) {\n this.nodeToCallbacks[connectingID].forEach((callback) => {\n callback();\n });\n }\n delete this.nodeToCallbacks[connectingID];\n\n var peerErrorHandler = function(err) {\n console.log('error', err);\n };\n\n var peerDataHandler = function (wrappedBuffer) {\n var wrappedPacket = JSON.parse(wrappedBuffer.toString());\n var packetType = utils.getPacketType(wrappedPacket);\n if (packetType == 'message') {\n var buffer = Buffer.from(utils.getPacketData(wrappedPacket));\n this.writableStream.push(buffer);\n }\n else if (packetType == 'signal') {\n this.networkCoupler.keepOrPass(wrappedPacket, this.nodeList);\n }\n this.updateNodeConnectionList(connectingID);\n };\n\n var peerCloseHandler = function() {\n var connectingID = peer.metadata;\n this.removeNodeConnection(connectingID);\n };\n\n peer.on('error', peerErrorHandler);\n\n peer.on('data', peerDataHandler.bind(this));\n\n peer.on('close', peerCloseHandler.bind(this));\n }", "onData(data) {\n const callback = packet => {\n // if its the first message we consider the transport open\n if (\"opening\" === this.readyState && packet.type === \"open\") {\n this.onOpen();\n }\n // if its a close packet, we close the ongoing requests\n if (\"close\" === packet.type) {\n this.onClose({ description: \"transport closed by the server\" });\n return false;\n }\n // otherwise bypass onData and handle the message\n this.onPacket(packet);\n };\n // decode payload\n decodePayload(data, this.socket.binaryType).forEach(callback);\n // if an event did not trigger closing\n if (\"closed\" !== this.readyState) {\n // if we got data we're not polling\n this.polling = false;\n this.emitReserved(\"pollComplete\");\n if (\"open\" === this.readyState) {\n this.poll();\n }\n }\n }", "function sendMessageToThird(message) {\n\tconsole.log('Client sending message to third peer: ', message);\n\tsocket.emit('messagetothird', message, isInitiator);\n}", "function combineCallback(coords, data, weight) {\n return coords;\n }", "function onMovePlayer (data) {\r\n\tvar movePlayer = find_playerid(this.id); \r\n\tmovePlayer.x = data.x;\r\n\tmovePlayer.y = data.y;\r\n\tmovePlayer.angle = data.angle; \r\n\t\r\n\tvar moveplayerData = {\r\n\t\tid: movePlayer.id,\r\n\t\tx: movePlayer.x,\r\n\t\ty: movePlayer.y, \r\n\t\tangle: movePlayer.angle\r\n\t}\r\n\t\r\n\t//send message to every connected client except the sender\r\n\tthis.broadcast.emit('enemy_move', moveplayerData);\r\n}", "function handleMessage(event){\n var data = JSON.parse(event.data);\n log(\"Received:\" +\" Latitude: \"+ data.lat +\n \" Longitude: \" + data.lon);\n}", "onAnswer(data) {\n console.log(\"onAnswer\")\n var self = this;\n var peer = self._peers[data.trackingNumber];\n // If there's no peer for this, return because you can't answer without offer\n if (!peer) {\n return;\n }\n // Update id. If this peer didn't already have an id, give it metadata\n if(peer.id) {\n peer.id = data.id\n } else {\n peer.id = data.id;\n peer.metadata = data.metadata;\n self.emit('peer', peer);\n }\n\n peer.signal(data.signal);\n }", "receiveServerUpdate(data) {\n\t\t/* Keep a copy of the numerical values. */\n\t\tthis.score = data.score;\n\t\tthis.high = data.high;\n\t\tthis.level = data.level;\n\t\tthis.lines = data.lines;\n\n\t\t/* Upate the text boxes. */\n\t\tthis._updateLevelLinesBox();\n\t\tthis._updateScoreBox();\n\n\t\t/* Update the grid and the statistics. */\n\t\tthis.grid.receiveServerUpdate(data.grid);\n\t\tthis.statBox.receiveServerUpdate(data.stats);\n\n\t\t/* Update the piece and the next piece. */\n\t\tthis.piece.receiveServerUpdate(data.piece);\n\t\tthis.nextPiece = new Piece(data.nextPiece);\n\t\tthis.nextPieceBox.updatePiece(this.nextPiece);\n\t}", "function fromOtherServer_NewConnection(obj){\n\tconsole.log(\"Received new connection message from other server. That server's IP is \"+\n\t\tobj.ip+\" and its port is \"+obj.port);\n\t\n\t// connect to everything it is connected to (including myself - TOB algorithm calls for broadcasts that include self)\n\tobj.allServerConnections.forEach( function(c) {\n\t\tconnectAsClientToServer(c.ip, c.port);\n\t});\n}", "function newConnection(socket) {\n var thisID;\n console.log('new connection: ' + socket.id);\n //store all user IDs here paired with their socket ID\n allSocketID[IDindex] = socket.id;\n\n socket.on(\"newDrawing\", sendNewDrawings);\n socket.on(\"newMouseClick\", sendNewMouseClick);\n socket.on(\"newUser\", sendNewUserID);\n socket.on(\"requestCanvases\", sendCanvases);\n socket.on(\"requestImageOfCanvas\", sendCanvasImage);\n socket.on(\"newPath\", sendNewPath);\n socket.on(\"newCircle\", sendNewCircle);\n socket.on(\"reset\", Reset);\n\n function sendNewDrawings(data) {\n //console.log(\"Got Here\");\n //console.log(data.drawing);\n canvasImages[data.id] = data.image;\n socket.broadcast.emit(\"newDrawingData\", data);\n }\n\n function sendNewMouseClick(data) {\n socket.broadcast.emit(\"newMouseClickData\", data);\n }\n\n function sendNewUserID() {\n //console.log(allSocketID[IDindex]);\n socket.emit(\"newUserID\", IDindex);\n IDindex += 1;\n }\n\n function sendCanvases() {\n data = {\n canvases: canvases\n }\n socket.emit(\"receivedCanvases\", data);\n }\n\n //send image of specific canvas\n function sendCanvasImage(id) {\n requestedCanvas = {\n image: canvasImages[id],\n id: id\n }\n socket.emit(\"receiveCanvasImage\", requestedCanvas);\n }\n\n function sendNewPath(data) {\n socket.broadcast.emit(\"receiveNewPath\", data);\n }\n\n function sendNewCircle(data) {\n socket.broadcast.emit(\"receiveNewCircle\", data);\n }\n\n function Reset() {\n canvasImages = {};\n socket.broadcast.emit(\"receiveReset\");\n }\n}", "onOffer(data) {\n console.log(\"onOffer\");\n var self = this;\n\n // Check if request already exists for this tracking number\n if (self._requests[data.trackingNumber]) {\n // Check if peer exists for this tracking number\n if (self._peers[data.trackingNumber]) {\n self._peers[data.trackingNumber].signal(data.signal);\n } // There's no peer for this tracking number but the request exists\n else {\n // Add signalling data to record for this request\n self._requests[data.trackingNumber].push(data.signal);\n }\n return\n }\n\n // No request in progress for this tracking number, start recording signalling data\n self._requests[data.trackingNumber] = [data.signal];\n // Emit the request\n // Create 'request' event handler that will create the peer for the tracking number\n self.emit('request', {\n id: data.id,\n metadata: data.metadata || {},\n accept: function(opts, metadata) {\n opts = opts || {};\n metadata = metadata || {};\n opts.initator = false;\n var peer = new SimplePeer(opts);\n\n peer.id = data.id;\n peer.metadata = data.metadata || {};\n self._peers[data.trackingNumber] = peer;\n self.emit('peer', peer); //Peer created!\n\n peer.on('signal', function(signal) {\n self.socket.emit('answer', {\n signal: signal,\n trackingNumber: data.trackingNumber,\n target: data.id,\n metadata: metadata\n });\n });\n\n // Resolve all the signals recorded for this request's tracking number\n self._requests[data.trackingNumber].forEach(function(request) {\n peer.signal(request);\n });\n self._requests[data.trackingNumber] = [];\n }\n });\n }", "processData() {\n // If we have enough data to process the next step in the SOCKS handshake, proceed.\n if (this._receiveBuffer.length >= this._nextRequiredPacketBufferSize) {\n // Sent initial handshake, waiting for response.\n if (this.state === constants_1.SocksClientState.SentInitialHandshake) {\n if (this._options.proxy.type === 4) {\n // Socks v4 only has one handshake response.\n this.handleSocks4FinalHandshakeResponse();\n }\n else {\n // Socks v5 has two handshakes, handle initial one here.\n this.handleInitialSocks5HandshakeResponse();\n }\n // Sent auth request for Socks v5, waiting for response.\n }\n else if (this.state === constants_1.SocksClientState.SentAuthentication) {\n this.handleInitialSocks5AuthenticationHandshakeResponse();\n // Sent final Socks v5 handshake, waiting for final response.\n }\n else if (this.state === constants_1.SocksClientState.SentFinalHandshake) {\n this.handleSocks5FinalHandshakeResponse();\n // Socks BIND established. Waiting for remote connection via proxy.\n }\n else if (this.state === constants_1.SocksClientState.BoundWaitingForConnection) {\n if (this._options.proxy.type === 4) {\n this.handleSocks4IncomingConnectionResponse();\n }\n else {\n this.handleSocks5IncomingConnectionResponse();\n }\n }\n else if (this.state === constants_1.SocksClientState.Established) {\n // do nothing (prevents closing of the socket)\n }\n else {\n this._closeSocket(constants_1.ERRORS.InternalError);\n }\n }\n }", "function webSocketMessageHandler(data) {\n switch (data.type) {\n case \"COORDINATE\":\n clX = data.x * canvasWidth;\n clY = data.y * canvasHeight;\n console.log(\"X:\", clX, \", Y:\", clY);\n break;\n case \"GESTURE\":\n break;\n }\n}", "networkQueryOffersCollected() {\n this.socket.emit('networkQueryOffersCollected');\n }", "function toggleView() {\n\tif (view === \"overview\") {\n\t\toverviewContainer.style.display = \"none\";\n\t\tdetailViewContainer.style.display = \"grid\";\n\n\t\tif (radarChartContainer.children.length === 0) {\n\t\t\tsocket.on('UserID', function (data) {\n\t\t\t\tconsole.log(\"something recieved\");\n\t\t\t\tlet x_id = data.x_id,\n\t\t\t\t\ty_id = data.y_id;\n\t\t\t\tconsole.log(\"x_id: \", x_id);\n\t\t\t\tconsole.log(\"y_id: \", y_id);\n\t\t\t\tlet user1 = y_id;\n\t\t\t\tlet user2 = x_id;\n\t\t\t\tdrawRC(radarChartContainer, user1, user2);\n\t\t\t});\n\n\t\t\tsocket.on('single_y_UserID', function (data) {\n\t\t\t\tconsole.log(\"something recieved for y\");\n\t\t\t\tlet y_id = data.y_id;\n\t\t\t\tlet user1 = y_id;\n\t\t\t\tdrawRC(radarChartContainer, user1, user2);\n\t\t\t});\n\n\t\t\tsocket.on('single_x_UserID', function (data) {\n\t\t\t\tconsole.log(\"something recieved for x\");\n\t\t\t\tlet x_id = data.x_id;\n\t\t\t\tlet user2 = x_id;\n\t\t\t\tdrawRC(radarChartContainer, user1, user2);\n\t\t\t});\n\t\t\tdrawRC(radarChartContainer, user1, user2);\n\t\t}\n\n\t\tsocket.on('UserID', function (data) {\n\t\t\tconsole.log(\"something recieved\");\n\t\t\tlet x_id = data.x_id,\n\t\t\t\ty_id = data.y_id;\n\t\t\tconsole.log(\"x_id: \", x_id);\n\t\t\tconsole.log(\"y_id: \", y_id);\n\t\t\tlet user1 = y_id;\n\t\t\tlet user2 = x_id;\n\n\t\t\tdrawVP(violinPlotContainer, user1, user2, violinPlotSelect.value);\n\t\t});\n\n\t\tsocket.on('single_y_UserID', function (data) {\n\t\t\tconsole.log(\"something recieved for y\");\n\t\t\tlet y_id = data.y_id;\n\t\t\tlet user1 = y_id;\n\t\t\tdrawVP(violinPlotContainer, user1, user2, violinPlotSelect.value);\n\t\t});\n\n\t\tsocket.on('single_x_UserID', function (data) {\n\t\t\tconsole.log(\"something recieved for x\");\n\t\t\tlet x_id = data.x_id;\n\t\t\tlet user2 = x_id;\n\t\t\tdrawVP(violinPlotContainer, user1, user2, violinPlotSelect.value);\n\t\t});\n\n\t\tdrawVP(violinPlotContainer, user1, user2, violinPlotSelect.value);\n\n\t\tif (dotMatrix1Container.children.length === 0) {\n\t\t\tsocket.on('UserID', function (data) {\n\t\t\t\tconsole.log(\"something recieved\");\n\t\t\t\tlet x_id = data.x_id,\n\t\t\t\t\ty_id = data.y_id;\n\t\t\t\tconsole.log(\"x_id: \", x_id);\n\t\t\t\tconsole.log(\"y_id: \", y_id);\n\t\t\t\tlet user1 = y_id;\n\t\t\t\tlet user2 = x_id;\n\n\t\t\t\tdrawDM(dotMatrix1Container, user1);\n\t\t\t});\n\n\t\t\tsocket.on('single_y_UserID', function (data) {\n\t\t\t\tconsole.log(\"something recieved for y\");\n\t\t\t\tlet y_id = data.y_id;\n\t\t\t\tlet user1 = y_id;\n\t\t\t\tdrawDM(dotMatrix1Container, user1);\n\t\t\t});\n\n\n\t\t\tdrawDM(dotMatrix1Container, user1);\n\t\t}\n\n\t\tif (dotMatrix2Container.children.length === 0) {\n\t\t\tsocket.on('UserID', function (data) {\n\t\t\t\tconsole.log(\"something recieved\");\n\t\t\t\tlet x_id = data.x_id,\n\t\t\t\t\ty_id = data.y_id;\n\t\t\t\tconsole.log(\"x_id: \", x_id);\n\t\t\t\tconsole.log(\"y_id: \", y_id);\n\t\t\t\tlet user1 = y_id;\n\t\t\t\tlet user2 = x_id;\n\n\t\t\t\tdrawDM(dotMatrix2Container, user2);\n\t\t\t});\n\n\t\t\tsocket.on('single_x_UserID', function (data) {\n\t\t\t\tconsole.log(\"something recieved for x\");\n\t\t\t\tlet x_id = data.x_id;\n\t\t\t\tlet user2 = x_id;\n\t\t\t\tdrawDM(dotMatrix2Container, user2);\n\t\t\t});\n\n\t\t\tdrawDM(dotMatrix2Container, user2);\n\t\t}\n\t\tview = \"detail\";\n\t} else if (view === \"detail\") {\n\t\tdetailViewContainer.style.display = \"none\";\n\t\toverviewContainer.style.display = \"block\";\n\t\tview = \"overview\";\n\t}\n}", "function messageReceivedExternal(e){\n //try to convert data back into an object if needbe:\n var data = unstringify(e.data);\n\n //block messages from an iframe we didnt make:\n if(e.source != otherWindow) return;\n\n //check that data is in the correct format:\n if(typeof data != \"object\" || data === null) return;\n if(typeof data.action != \"string\") return;\n\n //data is OK, let's use it:\n messageReceived(data);\n }", "function processDataChunk(data) {\n var lines = data.split('\\n');\n lines.sort(compareEventIds).forEach(function(message) {\n var parts = message.split('|');\n\n // switch on type\n switch(parts[1]) {\n case \"F\":\n // add 'from' client to 'to' client list\n Clients.addFollower(parts[3], parts[2], message);\n break;\n case \"U\": \n // no notification\n // remove 'from' client from 'to' client list\n Clients.removeFollower(parts[3], parts[2])\n break;\n case \"B\":\n Clients.broadcast(message);\n break;\n case \"P\":\n Clients.privateMessage(parts[3], message);\n break;\n case \"S\":\n // notify followers of 'from' client\n Clients.notifyStatus(parts[2], message);\n break;\n default: \n break;\n }\n\n });\n }", "function receiveData(socket, data) {\n\n\tif(data.toString().match(/\\-/)) {\n // annouce new connection to channel.\n servers[socket.remoteAddress] = socket.remoteAddress;\n io.sockets.emit('updateservers', servers);\n\n\t\t// Get the fields from the header, this way we provide SOME id of what we deal with.\n\t\tvar header = data.toString().split(\"\\n\");\n\t\tfields = header[1].replace(/\\|/g, \" \");\n\t\tfields = fields.replace(/\\s+/g, \" \");\n\t\tfields = fields.replace(/\\s+/, \"\");\n\t\tfields = fields.split(\" \");\n\t\treturn; // stop processing here.\n\t}\t\n\n\tvar cleanData = cleanInput(data);\n\n\tvar record = {};\n\n\t// First element of the array will be the HOST ip.\n\trecord['server_addr'] = socket.remoteAddress;\n\n\tfor(var i=0;i<cleanData.length;i++) {\n\t\tif(cleanData[i]) {\n\t\t\t// dont assign empty vars to items.\n\t\t\trecord[fields[i]] = cleanData[i];\n\t\t}\n\t}\n\n\t// turn array into json.\n\tvar msgHealth;\n\n\tmsgHealth = JSON.stringify(record);\n\n\t//console.log(\"\\n\");\n io.sockets.emit('updatelog', socket.remoteAddress, msgHealth);\n\t//console.log(msgHealth);\n\n}", "function handleTransmission(data)\n{\n var numMessages = data[0]\n var len = data.length\n var currentIndex = 0\n var currentTransmission = 0\n\n for (var index = 1; index < len; index++)\n {\n var dataItem = data[index]\n if (currentIndex == 0)\n {\n //address\n }\n\n else if (currentIndex == 1)\n {\n //data len\n\n }\n\n else\n {\n //data\n }\n\n }\n\n\n}", "receiveMessage (sender, buffer, skipAuth) {\n const y = this.y;\n const userID = y.userID;\n skipAuth = skipAuth || false;\n if (!(buffer instanceof ArrayBuffer || buffer instanceof Uint8Array)) {\n return Promise.reject(new Error('Expected Message to be an ArrayBuffer or Uint8Array!'))\n }\n if (sender === userID) {\n return Promise.resolve()\n }\n let decoder = new BinaryDecoder(buffer);\n let encoder = new BinaryEncoder();\n let roomname = decoder.readVarString(); // read room name\n encoder.writeVarString(roomname);\n let messageType = decoder.readVarString();\n let senderConn = this.connections.get(sender);\n this.log('User%s from User%s: Receive \\'%s\\'', userID, sender, messageType);\n this.logMessage('User%s from User%s: Receive %Y', userID, sender, [y, buffer]);\n if (senderConn == null && !skipAuth) {\n throw new Error('Received message from unknown peer!')\n }\n if (messageType === 'sync step 1' || messageType === 'sync step 2') {\n let auth = decoder.readVarUint();\n if (senderConn.auth == null) {\n senderConn.processAfterAuth.push([messageType, senderConn, decoder, encoder, sender]);\n // check auth\n return this.checkAuth(auth, y, sender).then(authPermissions => {\n if (senderConn.auth == null) {\n senderConn.auth = authPermissions;\n y.emit('userAuthenticated', {\n user: senderConn.uid,\n auth: authPermissions\n });\n }\n let messages = senderConn.processAfterAuth;\n senderConn.processAfterAuth = [];\n\n messages.forEach(m =>\n this.computeMessage(m[0], m[1], m[2], m[3], m[4])\n );\n })\n }\n }\n if ((skipAuth || senderConn.auth != null) && (messageType !== 'update' || senderConn.isSynced)) {\n this.computeMessage(messageType, senderConn, decoder, encoder, sender, skipAuth);\n } else {\n senderConn.processAfterSync.push([messageType, senderConn, decoder, encoder, sender, false]);\n }\n }", "function emit(data, newmessage) {\n if (!ioClient.connected) {\n ioClient.on('connect', function() {\n if (newmessage) {\n emitBoth(data)\n } else {\n emitMsg(data)\n }\n })\n } else {\n if (newmessage) {\n emitBoth(data) \n } else {\n emitMsg(data)\n }\n }\n}", "relayClientState(uid, data) {\n const serialized = JSON.stringify({ uid, data });\n this.dealerSocket.send([this.areaId, '', serialized]);\n }", "function notifyUpdate(){\n var update = {}\n //get the opponent's id\n for(var i = 0;i<connections.length;++i){\n /**\n * Look for the player opposite that of the one\n * sending the ID.\n */\n\n if(connections[i].id !== connections[index].id){\n console.log(\"Opposite found\");\n console.log(\"This id :\" + connections[i].id);\n console.log(\"other id:\" + connections[index].id);\n\n update[\"id\"] = connections[index].id;\n update[\"event\"] = \"opponentupdate\";\n update[\"data\"] = connections[i];\n }\n }\n console.log(\"Notifying opponent of \" + JSON.stringify(update));\n ws.send(JSON.stringify(update));\n }", "newLiveCell (updateData){\n\n let self = this;\n\n return new Promise((resolve, reject) => {\n self.socket.emit('newLiveCell',updateData, (error) => {\n\n if(error){\n reject (error);\n return;\n } else {\n resolve();\n }\n });\n });\n }", "function receivedData(objs) {\n // if the received data is not of the last request: do nothing with it\n if (id == this._dataRequestID) {\n this._processData(objs,callback);\n }\n }", "function returnWeatherData(data) {\n if (messaging.peerSocket.readyState === messaging.peerSocket.OPEN) {\n // Send a command to the device\n messaging.peerSocket.send({topic: 'weather', data});\n } else {\n console.log(\"Error: Connection is not open\");\n }\n}", "handleDataRecieved(data){\n\t\tvar parsedData = JSON.parse(data.data);\n\n\t\tswitch(parsedData.dataType){\n\t\t\tcase \"0\"://parsedData.dataType.PLAYER\"\":\n\t\t\t\tthis.updateOtherPlayers(parsedData);\n\t\t\t\tbreak;\n\t\t\tcase \"1\":\n\t\t\t\tthis.updateServerEnemies(parsedData);\n\t\t\t\tbreak;\n\t\t\tcase \"2\":\n\t\t\t\tthis.updateOtherPlayerShots(parsedData);\n\t\t\t\tbreak;\n\t\t\tcase \"3\":\n\t\t\t\tthis.updateDropsInfo(parsedData);\n\t\t\t\tbreak;\n\t\t\tcase \"4\":\n\t\t\t\tthis.updateBrainInfo(parsedData);\n\t\t\t\tbreak;\n\t\t\tcase \"5\":\n\t\t\t\tthis.createNewEnemies(parsedData);\n\t\t\t\tbreak;\n\t\t\tcase \"6\":\n\t\t\t\tthis.checkIfResurrected(parsedData);\n\t\t\t\tbreak;\n\t\t\tcase \"11\":\n\t\t\t\tthis.updateRoundInfo(parsedData);\n\t\t\t\tbreak;\n\n\t\t}\n\n\t}", "function onNewplayer (data) {\r\n\tconsole.log(data);\r\n\t//new player instance\r\n\tvar newPlayer = new Player(data.x, data.y, data.angle);\r\n\t\r\n\t//create an instance of player body \r\n\tnewPlayer.body = new p2.Body ({\r\n\t\tmass: 0,\r\n\t\tposition: [0,0],\r\n\t\tfixedRotation: true\r\n\t});\r\n\tworld.addBody(newPlayer.body);\r\n\t\r\n\tconsole.log(\"created new player with id \" + this.id);\r\n\tnewPlayer.id = this.id; \t\r\n\t//information to be sent to all clients except sender\r\n\tvar current_info = {\r\n\t\tid: newPlayer.id, \r\n\t\tx: newPlayer.x,\r\n\t\ty: newPlayer.y,\r\n\t\tangle: newPlayer.angle,\r\n\t}; \r\n\t\r\n\t//send to the new player about everyone who is already connected. \t\r\n\tfor (i = 0; i < player_lst.length; i++) {\r\n\t\texistingPlayer = player_lst[i];\r\n\t\tvar player_info = {\r\n\t\t\tid: existingPlayer.id,\r\n\t\t\tx: existingPlayer.x,\r\n\t\t\ty: existingPlayer.y, \r\n\t\t\tangle: existingPlayer.angle,\t\t\t\r\n\t\t};\r\n\t\tconsole.log(\"pushing player\");\r\n\t\t//send message to the sender-client only\r\n\t\tthis.emit(\"new_enemyPlayer\", player_info);\r\n\t}\r\n\t\r\n\t//send message to every connected client except the sender\r\n\tthis.broadcast.emit('new_enemyPlayer', current_info);\r\n\t\r\n\r\n\tplayer_lst.push(newPlayer); \r\n}", "function exchange(){\n var self = this, oldest = null, sent = false;\n this.partialView.increment();\n // #1 get the oldest neighbor reachable\n while (!oldest && !sent && this.partialView.length()>0){\n oldest = this.partialView.getOldest();\n sent = this.send(oldest.id, MExchange(this.neighborhoods.i.ID,\n this.neighborhoods.o.ID,\n this.protocol), 0);\n };\n if (this.partialView.length()===0){return;}; // ugly return\n // #2 get a sample from our partial view\n var sample = this.partialView.getSample(oldest, true); \n // #3 establish connections oldest -> sample\n // #A remove the chosen arcs\n var i = 0;\n while (i<sample.length){\n var e = sample[i];\n var removed = self.neighborhoods.disconnect(e.id);\n if (!removed){ // the partial view is late\n // #a inform the partial view of the departure of the peer\n onPeerDown.call(this, e.id);\n // #b clear the sample from references to this id\n var j = 0;\n while (j<sample.length){\n if (sample[j].id === e.id){\n sample.splice(j, 1);\n } else {\n ++j;\n }; \n };\n } else {\n // normal behavior\n self.partialView.removePeer(e.id, e.age);\n ++i;\n };\n };\n // #B from oldest to chosen neighbor\n sample.forEach(function(e){\n self.neighborhoods.connect(oldest.id, (e.id !== oldest.id) && e.id);\n });\n}", "function gotMessageFromServer(message) {\r\n var n, data, dest, answer;\r\n var msg = JSON.parse(message.data);\r\n // Ignore messages from ourself\r\n if (msg.id === id) {\r\n console.log(\"me to me: discard!\");\r\n return;\r\n }\r\n console.log(\"gotMessageFromServer:\");\r\n console.log(\"|msg.id/id: '\" + msg.id + \"' / '\" + id + \"'\\n|msg.type: \" + msg.type);//+\"\\n|msg: \"+JSON.stringify(msg));\r\n\r\n switch (msg.type) {\r\n case \"newNode\":\r\n id = msg.newid;\r\n console.log(\"id: \" + id);\r\n idtxt.textContent = id;\r\n newSucc(msg.succ);\r\n //envia join ao sucessor\r\n if (msg.succ !== id) {\r\n serverConnection.send(JSON.stringify({'type': \"join\", 'id': id, 'dest': msg.succ}));\r\n connectTo(0);\r\n }\r\n\r\n break;\r\n\r\n case \"join\":\r\n console.log(\"join: \" + msg.id);\r\n if (pred.id !== msg.id) {\r\n if (pred.id != null)\r\n serverConnection.send(JSON.stringify({\r\n 'type': \"notify\",\r\n 'id': id,\r\n 'dest': pred.id,\r\n 'newsucc': msg.id\r\n }));\r\n pred.id = msg.id;\r\n predtxt.textContent = msg.id;\r\n\r\n }\r\n break;\r\n\r\n case \"notify\":\r\n console.log(\"notify: \" + msg.newsucc);\r\n newSucc(msg.newsucc);\r\n connectTo(0);\r\n break;\r\n\r\n case \"sdp\":\r\n // Only create answers in response to offers\r\n n = checkTables(msg.id, true);\r\n console.log(\"sdp!\");\r\n //console.log(\"msg.data: \"+JSON.stringify(msg.data));\r\n console.log(\"n: \" + JSON.stringify(n));\r\n if (n.t === \"FT\") {\r\n if (!fingerTable[n.n].sdpStatus || msg.data.type == 'answer') {\r\n\r\n console.log(\"sdp ft\");\r\n //dest = fingerTable[n.n].id;\r\n dest = msg.id;\r\n /*data = JSON.parse(msg.data);*/\r\n console.log(n.n + \".signalingState: \" + fingerTable[n.n].pc.signalingState);\r\n console.log(\"ldesc / remdesc -> \" + fingerTable[n.n].pc.localDescription + \" / \" + fingerTable[n.n].pc.remoteDescription);\r\n\r\n fingerTable[n.n].pc.setRemoteDescription(new RTCSessionDescription(msg.data)).then(function () {\r\n fingerTable[n.n].sdpStatus = true;\r\n console.log(\"sdp type: \" + msg.data.type);\r\n if (msg.data.type == 'offer') {\r\n fingerTable[n.n].pc.createAnswer().then(createdDescription).then(function (sdp) {\r\n fingerTable[n.n].pc.setLocalDescription(sdp).then(function () {\r\n console.log(\"(ft)sdp answer: \" + sdp);\r\n serverConnection.send(sendThroughServer(fingerTable[n.n].pc.localDescription, dest, \"sdp\"));\r\n }).catch(errorHandler);\r\n }).catch(errorHandler);\r\n }\r\n }).catch(errorHandler);\r\n }\r\n }\r\n //console.log(\"msg.data.sdp: \\n\"+msg.data.sdp);\r\n else if (n.t === \"TP\") {\r\n if (!tempPeers[n.n].sdpStatus || msg.data.type == 'answer') {\r\n console.log(\"sdp tp\");\r\n dest = tempPeers[n.n].id;\r\n tempPeers[n.n].pc.setRemoteDescription(new RTCSessionDescription(msg.data)).then(function () {\r\n fingerTable[n.n].sdpStatus = true;\r\n if (msg.data.type === 'offer') {\r\n answer = tempPeers[n.n].pc.createAnswer().then(createdDescription).catch(errorHandler);\r\n console.log(\"(tp)sdp answer: \" + answer);\r\n tempPeers[n.n].pc.setLocalDescription(answer);\r\n }\r\n }).catch(errorHandler);\r\n }\r\n } else\r\n console.log(\"sdp already set!\");\r\n break;\r\n\r\n case \"ice\":\r\n n = checkTables(msg.id, false);\r\n console.log(\"n, n.n : \" + JSON.stringify(n) + \", \" + n.n);\r\n if (n.n === undefined) {\r\n n = checkTables(msg.id, true);\r\n connectTo(n.n);\r\n }\r\n console.log(\"ice! /sdptatus:\" + fingerTable[n.n].sdpStatus);\r\n if (n.t === \"FT\") {\r\n if (fingerTable[n.n].sdpStatus && n !== null) {\r\n // dest = fingerTable[n.n].id;\r\n fingerTable[n.n].pc.addIceCandidate(new RTCIceCandidate(msg.ice)).catch(errorHandler);\r\n console.log(\"ft.signalingState(\" + n.n + \"): \" + fingerTable[n.n].pc.signalingState);\r\n console.log(\"ldesc / remdesc -> \" + fingerTable[n.n].pc.localDescription + \" / \" + fingerTable[n.n].pc.remoteDescription);\r\n } else if (n !== null) {\r\n fingerTable[n.n].pendingICE.push(msg.ice);\r\n console.log(\"ice push (\" + n.n + \")\");\r\n }\r\n }\r\n if (n.t === \"TP\") {\r\n if (tempPeers[n.n].sdpStatus && n !== null) {\r\n // dest = tempPeers[n.n].id;\r\n tempPeers[n.n].pc.addIceCandidate(new RTCIceCandidate(msg.ice)).catch(errorHandler);\r\n } else if (n !== null) {\r\n fingerTable[n.n].pendingICE.push(msg.ice);\r\n console.log(\"ice push (\" + n.n + \")\");\r\n }\r\n }\r\n\r\n break;\r\n\r\n case \"fileID\":\r\n console.log(\"got fileID! ::\" + JSON.stringify(msg));\r\n pendingFiles.forEach(function (value, index) {\r\n // console.log(value.name+ \" /// \"+ msg.name);\r\n if (value.name === msg.name) {\r\n // console.log(\"aoefoenv:!:!\");\r\n if (!fileList.includes(msg.fileid)) {\r\n fileList.push(msg.fileid);\r\n }\r\n localStorage.setItem(msg.fileid, JSON.stringify({name: value.name, raw: value.raw}));\r\n }\r\n pendingFiles.splice(index, 1);\r\n });\r\n break;\r\n }\r\n}", "static listenSocketEvents() {\n Socket.shared.on(\"wallet:updated\", (data) => {\n let logger = Logger.create(\"wallet:updated\");\n logger.info(\"enter\", data);\n\n Redux.dispatch(Wallet.actions.walletUpdatedEvent(data));\n });\n }", "senddata(e, Data) {\n return socket.emit('req', { event: e, data: Data });\n }", "function sendCandidateToCallee(candidate) {\n sendToServer({\n type: 'candidate-to-callee',\n candidate: candidate\n });\n\n // to server \n // reciveCallerCandidate(candidate);\n}", "updatePosition(mainCamera) {\n const pos = this.calcChunkPos(mainCamera.position);\n if (this._currentChunk.equals(pos)) {\n return;\n }\n this._currentChunk = pos;\n if (this._current && this._current.server.isWithin(pos)) {\n return;\n }\n if (this._current) {\n this._current.disconnect();\n }\n this._current = null;\n this._connections.forEach(x => {\n if (x.server.isWithin(this._currentChunk)) {\n this._current = x;\n if (this._current.scene.camera) {\n this._current.scene.camera.copy(mainCamera);\n }\n this._current.connect().then(\n (() => {\n this._current.onId(\n (x => {\n console.log(x);\n this._node.addConnection(x);\n }).bind(this)\n );\n this._current.sendId(this._node.peer.id);\n }).bind(this)\n );\n }\n });\n }", "onMessage(verto, dialog, message, data) {\n console.log(\"[onMessage]\", verto, dialog, message, data)\n switch (message) {\n case $.verto.enum.message.pvtEvent:\n if (data.pvtData) {\n switch (data.pvtData.action) {\n // This client has joined the live array for the conference.\n case \"conference-liveArray-join\":\n // With the initial live array data from the server, you can\n // configure/subscribe to the live array.\n this.initLiveArray(verto, dialog, data);\n break;\n // This client has left the live array for the conference.\n case \"conference-liveArray-part\":\n // Some kind of client-side wrapup...\n break;\n }\n }\n break;\n }\n }", "handleInboundMessage(syncData) {\n\n let syncEvents = this.networkTransmitter.deserializePayload(syncData).events;\n let syncHeader = syncEvents.find((e) => e.eventName === 'syncHeader');\n\n // emit that a snapshot has been received\n if (!this.gameEngine.highestServerStep || syncHeader.stepCount > this.gameEngine.highestServerStep)\n this.gameEngine.highestServerStep = syncHeader.stepCount;\n this.gameEngine.emit('client__syncReceived', {\n syncEvents: syncEvents,\n stepCount: syncHeader.stepCount,\n fullUpdate: syncHeader.fullUpdate\n });\n\n this.gameEngine.trace.info(() => `========== inbound world update ${syncHeader.stepCount} ==========`);\n\n // finally update the stepCount\n if (syncHeader.stepCount > this.gameEngine.world.stepCount + this.synchronizer.syncStrategy.STEP_DRIFT_THRESHOLDS.clientReset) {\n this.gameEngine.trace.info(() => `========== world step count updated from ${this.gameEngine.world.stepCount} to ${syncHeader.stepCount} ==========`);\n this.gameEngine.emit('client__stepReset', { oldStep: this.gameEngine.world.stepCount, newStep: syncHeader.stepCount });\n this.gameEngine.world.stepCount = syncHeader.stepCount;\n }\n }", "async processIncomingMessage(msg, neighborId) {\n let rumorId = (msg.hasOwnProperty('id')) ? msg.id : msg;\n let content = (msg.hasOwnProperty('content')) ? msg.content : msg;\n\n\n let alreadyKnown = this.isKnown(rumorId);\n this.currentRumorId = rumorId;\n this.addRumor(rumorId, neighborId);\n\n if (!alreadyKnown) {\n let distribute = true;\n if (this.onNewIncomingRumor) {\n distribute = this.onNewIncomingRumor(content, rumorId);\n }\n if (distribute) {\n await this.distributeRumor(\n content,\n (id) => {\n return !this.toldMe(rumorId, id);\n },\n rumorId\n );\n }\n }\n\n if (this.onMessageProcessed) {\n this.onMessageProcessed(rumorId);\n }\n }", "dataMessage () {\n\t if (this._fin) {\n\t const messageLength = this._messageLength;\n\t const fragments = this._fragments;\n\n\t this._totalPayloadLength = 0;\n\t this._messageLength = 0;\n\t this._fragmented = 0;\n\t this._fragments = [];\n\n\t if (this._opcode === 2) {\n\t var data;\n\n\t if (this._binaryType === 'nodebuffer') {\n\t data = toBuffer(fragments, messageLength);\n\t } else if (this._binaryType === 'arraybuffer') {\n\t data = toArrayBuffer(toBuffer(fragments, messageLength));\n\t } else {\n\t data = fragments;\n\t }\n\n\t this.onmessage(data);\n\t } else {\n\t const buf = toBuffer(fragments, messageLength);\n\n\t if (!isValidUTF8(buf)) {\n\t this.error(new Error('invalid utf8 sequence'), 1007);\n\t return;\n\t }\n\n\t this.onmessage(buf.toString());\n\t }\n\t }\n\n\t this._state = GET_INFO;\n\t }", "handleOutboundInput() {\n for (var x = 0; x < this.outboundMessages.length; x++) {\n this.socket.emit(this.outboundMessages[x].command, this.outboundMessages[x].data);\n }\n this.outboundMessages = [];\n }", "updateScorePlayer1(){\n this.game.updateScorePlayer1();\n this.socket.emit('pointPlayer2');\n }", "function partnerWithoutInterests(socketId, allSockets, filter, userCountry, int, callback){\n // search each socket\n switch (filter){\n case 'nearby':\n nearby(socketId.latitude, socketId.longtitude, socketId.userCountry,function(err, partner){\n callback(null, partner);\n });\n break;\n case 'country':\n country(filter, userCountry, function(err, partner){\n callback(null, partner);\n });\n break;\n case 'world':\n world(filter, function(err, partner){\n callback(null, partner);\n })\n break;\n }\n\n // find nearby partner\n function nearby(userLatitude, userLongtitude, userCountry, callback){\n var matchedNearbySockets = [];\n if(filter === 'nearby'){\n for( var i = 0; i < allSockets.length; i++){\n if(socketId.id === allSockets[i].id){\n // if both same do nothing\n }\n else{\n if(filter === allSockets[i].filter){\n var partnerLatitude = allSockets[i].latitude,\n partnerLongtitude = allSockets[i].longtitude;\n var distance = geolib.getDistance(\n {latitude: userLatitude, longitude: userLongtitude }, \n {latitude: partnerLatitude, longitude: partnerLongtitude}\n ); \n if(distance <= 100){\n matchedNearbySockets.push(allSockets[i]);\n }\n }\n }\n }\n if(matchedNearbySockets.length === 0){\n setTimeout(function(){\n socketId.emit('no nearby','No user found nearby, searching in your country...');\n country('country',userCountry, function(err, partner){\n callback(null, partner);\n });\n },7000);\n }\n // if only one user found\n else if(matchedNearbySockets.length === 1){\n var result = {};\n result.partner = matchedNearbySockets[0];\n result.msg = 'You are now connected to a random person nearby. Happy Chatting!';\n callback(null, result);\n }\n // if there are multiple users\n else if(matchedNearbySockets.length >= 2){\n var pIndex = Math.round(Math.random()*matchedNearbySockets.length) - 1;\n if(pIndex == -1){pIndex = 0;}\n var result = {};\n result.partner = matchedNearbySockets[pIndex];\n result.msg = 'You are now connected to a random person nearby. Happy Chatting!';\n \n callback(null,result);\n }\n\n }\n }\n\n // find country parnter\n function country(filter,userCountry,callback){\n var matchedCountrySockets = [];\n if(filter === 'country'){\n for( var i = 0; i < allSockets.length; i++){\n if(socketId.id === allSockets[i].id){\n // if both same do nothing\n }\n else{\n if(filter === allSockets[i].filter && userCountry === allSockets[i].country){\n matchedCountrySockets.push(allSockets[i]);\n }\n }\n }\n // for loop end\n if(matchedCountrySockets.length === 0){ \n setTimeout(function(){\n socketId.emit('no country','No user found in country, searching in world...');\n world('world',function(err, partner){\n callback(null,partner);\n });\n },7000);\n }\n // if only one user found\n else if(matchedCountrySockets.length === 1){\n var result = {};\n result.partner = matchedCountrySockets[0];\n result.msg = 'You are now connected to a random person from '+userCountry+'. Happy Chatting!';\n callback(null,result);\n }\n // if there are multiple users\n else if(matchedCountrySockets.length >= 2){\n var pIndex = Math.round(Math.random()*matchedCountrySockets.length) - 1;\n if(pIndex == -1){pIndex = 0;}\n var result = {};\n result.partner = matchedCountrySockets[pIndex];\n result.msg = 'You are now connected to a random person from '+userCountry+'. Happy Chatting!';\n callback(null,matchedCountrySockets[pIndex]);\n }\n\n }\n }\n\n\n // find world partner\n function world(filter, callback){\n var matchedWorldSockets = [];\n if(filter === 'world'){\n for( var i = 0; i < allSockets.length; i++){\n if(socketId.id === allSockets[i].id){\n // if both same do nothing\n }\n else{\n if(filter === allSockets[i].filter){\n matchedWorldSockets.push(allSockets[i]);\n }\n }\n }\n // for loop end\n if(matchedWorldSockets.length === 0){\n setTimeout(function(){\n callback(null,'no partner found');\n },7000);\n }\n // if only one user found\n else if(matchedWorldSockets.length === 1){\n var result = {};\n result.partner = matchedWorldSockets[0];\n if(int){\n setTimeout(function(){\n socketId.emit('matchedInterests',{msg:'Sorry, we could not find a match and connected you to a random person. Try adding more interests or change chat filter settings.'});\n },2000);\n }\n result.msg = 'You are now connected to a random person. Happy chatting!';\n callback(null,result);\n }\n // if there are multiple users\n else if(matchedWorldSockets.length >= 2){\n var pIndex = Math.round(Math.random()*matchedWorldSockets.length) - 1;\n if(pIndex == -1){pIndex = 0;}\n var result = {};\n result.partner = matchedWorldSockets[pIndex];\n if(int){\n setTimeout(function(){\n socketId.emit('matchedInterests',{msg:'Sorry, we could not find a match and connected you to a random person. Try adding more interests or change chat filter settings.'});\n },2000);\n }\n result.msg = 'You are now connected to a random person. Happy Chatting!';\n callback(null,result);\n }\n }\n } \n}", "function emitMsg(data) {\n // console.log('\\n\\n\\nEmitting message\\n\\n\\n')\n ioClient.emit('new message', data)\n}" ]
[ "0.6314063", "0.60349506", "0.60322356", "0.58554256", "0.58441746", "0.56437814", "0.5621773", "0.5512736", "0.5439217", "0.5390139", "0.5339901", "0.5338641", "0.53247094", "0.532297", "0.5307712", "0.52739733", "0.5268061", "0.5229465", "0.52286667", "0.5208887", "0.5201638", "0.5200727", "0.51975435", "0.5193523", "0.51854295", "0.5179305", "0.51779747", "0.51750255", "0.5164516", "0.5161993", "0.5160226", "0.51477855", "0.51370054", "0.5136825", "0.5135206", "0.5123777", "0.5118258", "0.5116136", "0.5113468", "0.51078516", "0.51061386", "0.5099615", "0.50850797", "0.5074203", "0.50685483", "0.50387174", "0.50354755", "0.5031085", "0.50272375", "0.50222045", "0.5018444", "0.5016515", "0.5014633", "0.5014389", "0.50060666", "0.4989762", "0.49861002", "0.498416", "0.49837616", "0.49773782", "0.49704266", "0.496525", "0.4964736", "0.49647334", "0.4956472", "0.49512053", "0.4943398", "0.49421665", "0.49254298", "0.49197832", "0.4919501", "0.49153408", "0.4914322", "0.4906425", "0.4905993", "0.49009106", "0.49007484", "0.48989093", "0.4898551", "0.4896052", "0.48949835", "0.4893812", "0.48934865", "0.48893723", "0.4888755", "0.48873693", "0.48854893", "0.48846856", "0.4883371", "0.48807773", "0.487817", "0.48717725", "0.48631078", "0.486066", "0.48570174", "0.48563847", "0.48558354", "0.48541188", "0.48438329", "0.48400626", "0.48396182" ]
0.0
-1
temperature units C (default) or F
function addChartHT(title, subtitle, y_axis_left_title, y_axis_right_title) { // specify the chart options var chartOptions = { chart: { renderTo: 'chart-container', defaultSeriesType: 'line', backgroundColor: '#ffffff', zoomType: 'x', resetZoomButton: { relativeTo: 'chart' }, panning: true, panKey: 'shift', events: { redraw: function() { chartRedrawEvent(this); } } }, time: { useUTC: false }, title: { text: title }, subtitle: { text: subtitle }, plotOptions: { series: { marker: { radius: 2 }, animation: true, step: false, borderWidth: 0, turboThreshold: 0, lineWidth: 1 } }, xAxis: { type: 'datetime', title: { text: 'Date' }, minRange: 60*60*1000 // one hour }, yAxis: [{ showEmpty: false, title: { text: y_axis_left_title } }, { opposite: true, showEmpty: false, title: { text: y_axis_right_title } }], navigation: { buttonOptions: { verticalAlign: 'bottom', y: -10 } }, exporting: { menuItemDefinitions: { // Custom definition units: { onclick: function () { // toggle temperature units sessionStorage.setItem('fahrenheit',(!useFahrenheit).toString()); location.reload(); }, text: useFahrenheit?'Celsius':'Fahrenheit' } }, buttons: { contextButton: { menuItems: ['downloadPNG','units'] } } }, legend: { enabled: true }, credits: { text: 'casportpony.com', href: '' // 'https://casportpony.com/' does not work on google sites } }; // draw the chart return new Highcharts.Chart(chartOptions); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get temperature() {\n // convertimos los grados F a C\n this.temperature_F = 5 / 9 * (this.temperature_F - 32)\n return this.temperature_F;\n }", "function FtoC(temperature) {\n let celcius = Math.floor(((temperature - 32) * 5) / 9);\n return celcius;\n}", "function CtoF(temperature) {\r\n return (temperature * 9) / 5 + 32;\r\n}", "function getTemperature() {\n local supplyVoltage = hardware.voltage();\n local voltage = supplyVoltage * Temperature.read() / 65535.0;\n local c = (voltage - 0.5) * 100 ;\n local celsius = format(\"%.01f\", c);\n return(celsius);\n}", "temp(celsius, fahrenheit)\n\n {\n const cTemp = celsius;\n const cToFahr = cTemp * 9 / 5 + 32;\n console.log(\"Celsius to Fahrenheit:\" + celsius + \"to\" + cToFahr); // (°C × 9/5) + 32 = °F\n const fTemp = fahrenheit;\n const fToCel = (fTemp - 32) * 5 / 9;\n console.log(\"Fahrenheit to Celsius:\" + fahrenheit + \"to\" + celsius);\n\n\n }", "function temp_converter(celsius_value){\n let F = celsius_value + 32/1.8\n console.log(celsius_value+\"C\"+ \" = \"+ F+\"F\")\n}", "function Celsius(celsius){\n this.celsius = celsius\n this.getFahrenheitTemp = function(){\n return 1.8 * this.celsius + 32\n }\n this.getKelvinTemp = function(){\n return this.celsius + 273\n }\n}", "function celsiusTOFahrenheit(temperature) {\n return (temperature * 9 / 5) + 32;\n}", "function fahrenheitTocelsius(temp){\n var tempInFahrenheit = temp;\n var tempInCelsius = (tempInFahrenheit - 32) * 5/9;\n return tempInFahrenheit + \"°F is \" + tempInCelsius+ \"°C\";\n }", "function celsiusToFahrenheit(temperature){\n return (temperature*9/5)+32;\n}", "function celsiusToFahrenheit(temperature){\n return (temperature * 9/5) + 32;\n}", "function celsiusToFahrenheit(temperature)\n{\n return (temperature *9/5) +32;\n\n}", "function celsiusToFahrenheit(temperature){\n return(temperature *9/5) + 32;\n}", "calCelsius(temperature) {\n let celsius = Math.floor(temperature - 273.15)\n return celsius;\n }", "function celsiusToFahrenheit(temperature){\n return(temperature * 9/5)+32;\n}", "function Celsius(celsius){\n\tthis.celsius = celsius;\n\tthis.getFahrenheitTemp = function(){\n\t\treturn 1.8 * this.celsius + 32; \n\t}\n\tthis.getKelvinTemp = function(){\n\t\treturn 273 + this.celsius;;\n\t}\n\n\tthis.isBelowFreezing = function(){\n\t\treturn this.celsius < 32;\n\t}\n}", "function Celcius(F) {\n console.log((F - 32) * 5 / 9 + 'C');\n}", "get temperature() {\n return (5 / 9) * (this.fahrenheit - 32);\n }", "function celsiusToFahrenheit(temperature){\n\treturn (temperature * 9/5) + 32;\n}", "function celciusToFarenhite(temperature){\n return (temperature*9/5)+32;\n \n}", "function temperatureCtoF(tempC) {\n return round((tempC * 1.8) + 32, 2);\n }", "function celsiusToFahrenheit(temperature) {\n return (temperature * 9) / 5 + 32;\n}", "function celsiusToFahrenheit(temperature) {\n return (temperature * 9 / 5) + 32;\n}", "function convertTemperature (temp) {\n if ($(\".celsius\").is(\":checked\")) {\n return ((temp - 32) * (5/9)).toFixed(0) + \"°C\";\n } else {\n return (temp.toFixed(0) + \"F\");\n }\n }", "function c2f(celsius) {\n return celsius * 1.8 + 32;\n}", "function convertTemperature(elem, unit){\n\t\tif(unit == \"fahrenheit\"){\n\t\t\t$.each($('.temp-low, .temp-high, .temp-now'), function(){\n\t\t\t\tvar tempSpan = $(this).find('span:first-child');\n\t\t\t\tvar temp = tempSpan.text();\n\t\t\t\t// Fahrenheit = Celsius * 1.8 + 32\n\t\t\t\tvar convertedTemp = Math.round(parseInt(temp, 10) * 1.8 + 32);\n\t\t\t\ttempSpan.text(convertedTemp);\n\t\t\t\ttempSpan.next('span').html(\"&deg;F\");\n\t\t\t});\n\t\t}\n\t\telse if(unit == \"celsius\"){\n\t\t\t$.each($('.temp-low, .temp-high, .temp-now'), function(){\n\t\t\t\tvar tempSpan = $(this).find('span:first-child');\n\t\t\t\tvar temp = tempSpan.text();\n\t\t\t\t// Celsius = (Fahrenheit - 32) / 1.8\n\t\t\t\tvar convertedTemp = Math.round((parseInt(temp, 10) - 32) / 1.8);\n\t\t\t\ttempSpan.text(convertedTemp);\n\t\t\t\ttempSpan.next('span').html(\"&deg;C\");\n\t\t\t});\n\t\t}\n\n\t\t$('.unit').removeClass('active');\n\t\telem.addClass('active');\n\t}", "function changeTempUnits(unit, temp){\n // We know the temp comes in Kelvin so\n // all the conversions will be done assuming thus\n if (unit === \"F\"){\n temp = 1.8 * (temp - 273) + 32;\n }\n\n if (unit === \"C\"){\n temp = temp - 273.15;\n }\n\n if (unit === \"K\"){\n return temp;\n }\n\n return temp;\n\n\n}", "function farenheitCelsius(temp) {\n return temp - 32 * 5 / 9\n }", "function CTempToF(val)\r\n{\r\n var CeltoFaren = val * 9 / 5 + 32;\r\n return CeltoFaren; \r\n}", "function celsiusToFah(temp_c) {\n\tvar temp_f = (9 * temp_c / 5) + 32;\n\treturn temp_f\n}", "function changeToC() {\n\t\t// get numbers from temperature div\n\t\tvar currTempF = $('#temperature').text().match(/\\d+/),\n\t\t\ttempC = (currTempF - 32) / 1.8,\n\t\t\tupdateTemp = document.getElementById('temperature');\n\n\t\t//console.log(tempC);\n\t\t// Round temperature to 0 decimal places\n\t\ttempC = Number(tempC).toFixed(0);\n\t\t// Print temp in Celsius\n\t\tupdateTemp.innerHTML = '<p>' + tempC + '&#176;C</p>';\n\t}", "function tempConvert(){\n\nlet celciusTemp = document.querySelector('input').value;\nlet C = parseInt(celciusTemp);\nlet F= (1.8 * C) + 32;\nalert(\"Temperature in Farenheit is \" + (F));\n}", "function celsiusToFahrenheit (c) {\n var fahrenheit = ( c * ( 9 / 5) ) + 32;\n return fahrenheit;\n }", "function convertTemp(temp, units) {\n if (units === \"celcius\") return Math.round(temp);\n\n return Math.round((temp * 9) / 5 + 32);\n}", "function changeUnitsF(event) {\n let fahrenheit = document.querySelector(\".currentTemp\");\n fahrenheit.innerHTML = `${Math.round(temperature * 9) / 5 + 32}˚F`;\n}", "function celsiusFarenheit(temp) {\n return temp * 9 / 5 + 32\n }", "function toCelsius(temperature) {\n temperature = Math.round((temperature - 32) / 1.8);\n return temperature;\n}", "function celsiusToFahrenheit(temp){\n var tempInCelsius = temp;\n var tempInFahrenheit = (tempInCelsius * 9/5 + 32);\n return tempInCelsius + \"°C is \" + tempInFahrenheit+ \"°F\";\n }", "function celcius(fvalue)\n{\n //Kelvin to Celcius\n var cvalue_unrounded = fvalue - 273.15;\n //shows 2 decimal places only\n cvalue = cvalue_unrounded.toFixed(2);\n //Returns results as \"cvalue\" outside of this function\n return cvalue;\n}", "gTempStr(units) {\r\n\t\tvar temp;\r\n\t\tif (units === \"c\"){\r\n\t\t\ttemp = (this.temp - 32)/1.8\r\n\t\t} else {\r\n\t\t\ttemp = this.temp\r\n\t\t}\r\n\t\treturn temp + \"°\" + units.toUpperCase();\r\n\t}", "function celciusToFarenheit(C){\n return 1.8*C + 32;\n \n}", "function convertCtoF(cTemp)\n{\n var fTemp = cTemp * 1.8 + 32;\n return fTemp;\n}", "function cToF(celsius) \n{\n var cTemp = celsius;\n var cToFahr = cTemp * 9 / 5 + 32;\n //var message = cTemp+'\\xB0C is ' + cToFahr + ' \\xB0F.';\n return cToFahr.toFixed(2);\n}", "function toCelsius(f){\n\treturn (f-32) * (5/9);\n}", "function FtoC(temp){\n return Math.round(((temp-32)*5)/9);\n}", "function celsiusToFahrenheit(celsiusTemp) {\n return (celsiusTemp * 9 / 5) + 32;\n }", "function convertTemperature(temp, convertTo){\n if(convertTo === \"C\"){\n return Math.round(temp - 273.15);\n }\n else if(convertTo === \"f\"){\n return Math.round((temp*2.25)-459.67);\n }\n}", "function convertTemp (celsius, decimalPlaces = 1) { // Here we are giving default value as 1 , if decimalPlaces is not defined\n const fahrenhite = celsius * 1.8 + 32;\n return Number(fahrenhite.toFixed(decimalPlaces));\n}", "function fToC(fTemp) {\n return (fTemp - 32) * 5 / 9;\n}", "function celsiusToFahrenheit(c) {\n var f = c * 9 / 5 + 32;\n console.log(c + \"°C is \" + f + \"°F.\");\n}", "function fahrenheitToCelsius(f) {\n var celsius = ( f - 32 ) * ( 9 / 5) ;\n return celsius;\n }", "function Celsius(celsius){\n this.celsius = celsius;\n}", "function toCelsius(f) {\n let celsius = ((f-32)/9)*5;\n console.log(celsius);\n}", "function celsiusToFahrenheit(temp){\n return ((9/5) * temp) + 32;\n}", "function calcTempC(tempK) {\n return Math.round(tempK - 273.15);\n }", "function celsiusToFahrenheit(celsius) {\n var ctof = (celsius * 9)/5 + 32;\n console.log(\"\" + celsius + \"°C is \" + ctof + \"°F.\");\n}", "function getTemp(celsius, bool){\n var temp;\n if(bool == true){\n temp = celsius*1.8 + 32;\n }else{\n temp = celsius;\n }\n return temp.toFixed(1);\n }", "function Celsius(celsius) {\n this.celsius = celsius;\n}", "function Celsius(celsius) {\n this.celsius = celsius;\n}", "function convertToFahrenheit(tempC) {\n const tempF = tempC * 1.8 + 32;\n return `${Math.round(tempF)} °F`;\n}", "function handleCelsiusChange (e) {\n //debugger\n setScale('c')\n return setTemperature(e.target.value)\n }", "function toCelsius(temp) {\n let temperature = (((temp - 32) * 5) / 9).toFixed(0);\n\n return temperature;\n}", "function celsiusToFarenheit(c) {\n var farenheit = Math.round((c * 1.8) + 32);\n return (c + \" grados ceslsius son en farenheit \"+ farenheit);\n}", "function stuffTemperature(temp, units) {\n // console.log(\"stuffTemperature:\", temp, units);\n $('#temperature').html(temp.toString() + '&#176; ');\n var unitString = units == 'metric'\n ? 'C'\n : 'F';\n $(\"#units\").html(unitString);\n}", "celsiusToFehrenheit(celsius){\n var f = (celsius * 9/5)+32;\n return f;\n }", "get tempF (){\n console.log('calculating temp in F');\n return this.tempC * (9/5) + 32;\n }", "function convertCelsius(temperature) {\n temperature = Math.round(((temperature - 32) * 5) / 9);\n return temperature;\n}", "parseTemp(temp, str) {\n if (str === \"C\") {\n return `${Math.round(temp - 273.15)}°C`;\n }\n if (str === \"F\") {\n return `${Math.round((temp - 273.15) * 1.8 + 32)}°F`;\n }\n }", "function cToF(celsius)\n {\n var cTemp = celsius;\n var cToFahr = cTemp * 9 / 5 + 32;\n var message = cTemp+'\\xB0C is ' + cToFahr + ' \\xB0F.';//for testing only\n console.log(message);//for testing only\n\n return cToFahr;\n }", "function convertCelsius(fahrTemp) {\n return ((5/9) * (fahrTemp - 32)).toFixed(2);\n} // end convertCelsius()", "function celsiusToFahr(temperature) {\n return (temperature * 9 / 5) + 32\n\n }", "function getC(name,un_name) //get capcitor value in F, (name, name-unit)\n{\n\tvar x=getVar(name);\n\tvar unit=getVtext(un_name);\n\tif(\"pF\"==unit) return x/=1e12;\n\tif(\"nF\"==unit) return x/=1e9;\n\tif(\"uF\"==unit) return x/=1e6;\n\treturn x;\n}", "function farenheitToCelsius(f) {\n var celsius = Math.round((f - 32) / 1.8);\n return (f + \" grados Farenheit son \" + celsius +\" en Celsius\");\n}", "function Celsius(celsius) {\n this.celsius = celsius;\n this.getFahrenheitTemp = function() {\n let temperature = 1.8 * this.celsius + 32;\n console.log(celsius);\n return temperature;\n };\n this.getKelvinTemp = function() {\n let temperature = this.celsius + 273;\n console.log(celsius);\n return temperature;\n };\n}", "function tempKtoF(temp){\n//convert Kelvin to Fahrenheit by using this equation (K − 273.15) × 9/5 + 32 = F\nlet fahrenheit = (temp - 273.15) * 9/5 + 32;\n//assigns fahrenheit to go to 2 decimal places\nfahrenheit = fahrenheit.toFixed(2);\n//returns temperature in Fahrenheit\nreturn fahrenheit;\n}", "function fahrenheitToCelsius(fahrenheitTemp) {\n return (fahrenheitTemp - 32) * 5 / 9;\n }", "function convertToF(celsius) { //1\n let fahrenheit = celsius * 9/5 + 32; //2\n\n return fahrenheit; //3\n}", "static fromKelvinToCelsius(temperature) {\n return Math.trunc(Number(temperature) - 273.15) + '°';\n }", "function fahrenheit(){\n var tempfar=(celsius*9/5)+32\n console.log('La temperatura en grados fahrenheit es: ')\n console.log(tempfar +' °F')\n}", "function farenheitCelsius() {\n const fah = 10;\n const cel = ((fah - 32) * (5/9));\n console.log(cel);\n }", "formatTemp(temp) {\n return `${(temp - 273.15).toFixed(0)} °C`;\n }", "function farenheitToCelcius(){\n if (tempUnits == \"celsius\"){\n tempUnits = \"farenheit\";\n document.getElementById(\"buttonFC\").innerHTML = \"Temperature in Celcius\";\n }\n else if (tempUnits == \"farenheit\"){\n tempUnits = \"celsius\";\n document.getElementById(\"buttonFC\").innerHTML = \"Temperature in Farenheit\";\n }\n getTemperature(tempUnits);\n }", "function CtoF(temp) {\n return (temp * 9/5) + 32;\n}", "function convertTemp() {\n //Calculate the temperature here\n const Ftemp = finput.value;\n const Ctemp = Math.round((Ftemp - 32 )/9*5)\n //Send the calculated temperature to HTML\n document.getElementById(\"c-output\").innerHTML=Ctemp\n}", "function temperature(params) {\n var temperature = params[0];\n return Math.floor(temperature) + \"°\";\n }", "function toCelcius(fahrenheit) {\n\treturn (fahrenheit - 32) * 5 /9;\n}", "function convertToCelsius(temperature) {\n return parseInt(temperature - 273.15);\n}", "convertKelvinToCelciusTemp(kelvinTemp) {\n if (kelvinTemp != 'undefined')\n return (kelvinTemp - 273.15).toFixed(2) + ' C';\n }", "function fToC(fahrenheit) \n{\n var fTemp = fahrenheit;\n var fToCel = (fTemp - 32) * 5 / 9;\n //var message = fTemp+'\\xB0F is ' + fToCel + '\\xB0C.';\n return fToCel.toFixed(2);\n}", "function getTemperature(tempUnits){\n $.getJSON(api, function(data){\n if (tempUnits ==\"celsius\"){\n var tempSulfix = \"C\";\n var temp = (data.current.temp_c);\n var feelslike = (data.current.feelslike_c);\n }\n else if (tempUnits == \"farenheit\"){\n var tempSulfix = \"F\";\n var temp = (data.current.temp_f);\n var feelslike = (data.current.feelslike_f);\n }\n document.getElementById(\"pTemp\").innerHTML = temp + \"&deg\" + tempSulfix;\n document.getElementById(\"pFeel\").innerHTML = feelslike + \"&deg\" + tempSulfix;\n });\n }", "function celsiusToFahrenheit(celsius){\n let fahrenheit = (celsius * (9/5)) + 32;\n return celsius + \" degrees Celsius is \" + fahrenheit + \" degrees Fahrenheit\";\n}", "function toCelsius (fahrenheit) {\r\n var convertedTemp = (fahrenheit - 32) * .5556;\r\n return convertedTemp;\r\n}", "function toCelsius(fahrenheit) {\n return (fahrenheit - 32) * 5 / 9;\n}", "function toCelsius(fahrenheit) {\n return (fahrenheit - 32) * 5 / 9;\n}", "function FahrenheitToCelsius(fDegree){\n var celsius = (fDegree - 32)*5 / 9;\n console.log(celsius);\n }", "function convertFahrenheiTtoCelsius(F) {\n\treturn (F - 32) / 1.8;\n}", "function convertCtoF(celsius) {\n return (celsius * 9/5) + 32;\n}", "function toCelsius(fahrenheit) {\n\n var c = (5 / 9) * (fahrenheit - 32);\n\n gs.info(c);\n}", "function celsToFahr(celsTemp) {\n // your code here\n return celsTemp * 9/5 + 32;\n}", "function convertToFahrenheit(temp){\n let fahr = temp *9/5 +32;\n console.log(`${temp} degrees in C is ${fahr} degrees in F`);\n}", "function celciusToFahreneit(celcius){\n const temperatureInFahreneit = celcius * (9/5) + 32; // in Fahreneit\n console.log(\"Temperature in Fahreneit:\", temperatureInFahreneit);\n\n}" ]
[ "0.77452135", "0.7725546", "0.76010853", "0.74930245", "0.7398444", "0.7391513", "0.7308329", "0.72347814", "0.72189057", "0.72105247", "0.71854264", "0.71824884", "0.71745837", "0.7166796", "0.7133198", "0.7127945", "0.7110141", "0.71008384", "0.7095202", "0.70890886", "0.7070334", "0.70350695", "0.7028963", "0.7020322", "0.7004642", "0.6991899", "0.6968151", "0.69380534", "0.69360846", "0.6933864", "0.68938047", "0.68846184", "0.6852329", "0.68406767", "0.6839695", "0.6834329", "0.6828191", "0.6824959", "0.6811392", "0.68042976", "0.67927116", "0.67923987", "0.67919564", "0.6783251", "0.67702276", "0.67699313", "0.67674786", "0.67655647", "0.67567295", "0.675202", "0.6749987", "0.67412364", "0.6737037", "0.67333645", "0.67204434", "0.67192143", "0.6716375", "0.67039865", "0.67039865", "0.67001843", "0.66994673", "0.6689317", "0.66509724", "0.6644641", "0.663019", "0.6626394", "0.66049397", "0.66035277", "0.6578534", "0.65584224", "0.6544901", "0.6544201", "0.6543489", "0.6532766", "0.6531851", "0.6526043", "0.6524255", "0.65220356", "0.6521304", "0.65130216", "0.6509003", "0.6502117", "0.6499302", "0.64815134", "0.6475977", "0.6473821", "0.6459138", "0.6458277", "0.64568585", "0.6456594", "0.64532554", "0.6445175", "0.6440424", "0.6440424", "0.6424121", "0.64183855", "0.6416588", "0.6402871", "0.64001197", "0.6399827", "0.63898176" ]
0.0
-1
add a series to the chart
function addSeries(chart, name, channel_id, field_number, api_key, results, color, yaxis, conversion_function) { yaxis = yaxis || 0; conversion_function = conversion_function || function(x) {return x}; // get the data with a webservice call $.getJSON('https://api.thingspeak.com/channels/' + channel_id + '/fields/' + field_number + '.json?offset=0&round=2&results=' + results + '&api_key=' + api_key, function(data) { var chart_data = []; var gap_count = 0; var field_name = 'field' + field_number; var prev_time = Date.parse(data.feeds[0].created_at); // iterate through each feed $.each(data.feeds, function() { // get value and time var value = conversion_function(parseFloat(this[field_name])); var time = Date.parse(this.created_at); // skip nulls in data (data with a time but no measurement) if (isNaN(value) && ++gap_count) return; gap_count=0; // deliberately add gap if no measurements for several minutes if (time-prev_time > 5*60*1000) chart_data.push([time-1,null]); prev_time=time; // add to chart data chart_data.push([time, value]); }); // add the chart data (if valid) if (chart_data.length) chart.addSeries({ data: chart_data, name: name, color: color, yAxis: yaxis }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addSeries() {\n storeData = data;\n colorArray.push(colorSpectrum[series%colorSpectrum.length]);\n series = storeData[0].length;\n labelArray.push(origLabels[1] + series);\n doCalc();\n}", "function add(series, metric_name, values) {\n\t\tseries.meta.columns.push(metric_name);\n\t\tseries.data.push(values);\t\n\t\n\t\treturn true;\n\t}", "function addSeries(title, days, hours, minutes) {\r\n\r\n let addNewSeries = { title, days, hours, minutes };\r\n\r\n seriesDurations.push(addNewSeries);\r\n\r\n}", "function addSeriesCB(){\n\t\t\tstx.createDataSet();\n\t\t\tstx.draw();\n\t\t}", "function addData(response) {\n var timestamp = (new Date()).getTime();\n series.push([timestamp, response]);\n plotSeries();\n while (series.length > MAX_POINTS) {\n series.shift();\n }\n}", "add_stdev_series(chart, vol) {\n vol /= 100;\n\n const stdev_up_series = chart.ref.addLineSeries(this.line_settings);\n const stdev_down_series = chart.ref.addLineSeries(this.line_settings);\n const stdev_up_data = [];\n const stdev_down_data = [];\n const start_date = Date.parse(chart.start_date);\n const start_price = chart.start_price;\n\n for (var i = 1; i < this.look_ahead; i++) {\n const next = new Date(start_date);\n next.setDate(next.getDate() + i);\n const next_str = next.toISOString();\n const next_price_up = start_price * Math.exp(vol * Math.sqrt(i / 365));\n const next_price_down = start_price * Math.exp(-vol * Math.sqrt(i / 365));\n stdev_up_data.push({ time: next_str, value: next_price_up });\n stdev_down_data.push({ time: next_str, value: next_price_down });\n }\n\n stdev_up_series.setData(stdev_up_data);\n stdev_down_series.setData(stdev_down_data);\n chart.stdev_up_series = stdev_up_series;\n chart.stdev_down_series = stdev_down_series;\n }", "function insertSkills(data)\n{\n\tdata=JSON.parse(data);\n\t$('#skills').find('#skillData').highcharts({\n chart: {\n type: 'column',\n height:'500'\n },\n title: {\n text: 'Skillset'\n },\n xAxis: {\n type: 'category',\n labels: {\n rotation: -45,\n style: {\n fontSize: '13px',\n fontFamily: 'Verdana, sans-serif'\n }\n }\n },\n\t plotOptions: {\n\t pie: {\n\t size:'100%',\n\t dataLabels: {\n\t enabled: false\n\t }\n\t }\n\t },\n yAxis: {\n min: 0,\n\t\t\tmax:100,\n title: {\n text: 'Percentage'\n }\n },\n legend: {\n enabled: false\n },\n tooltip: {\n pointFormat: '<b>{point.y:.1f} %</b>'\n },\n series: [{\n name: 'Skill',\n data: data,\n dataLabels: {\n enabled: true,\n color: '#000000',\n x: 0,\n y: 0,\n style: {\n fontSize: '8px',\n fontFamily: 'Verdana, sans-serif'\n }\n }\n }]\n });\n}", "function addData(data) {\n var dps = data.item;\n for (var i = 0; i < dps.length; i++) {\n //Memasukan value get kedalam array dataPoints\n dataPoints.push({\n x: new Date(dps[i][0]),\n y: dps[i][1],\n label : direction(dps[i][1])\n });\n }\n chart.render();\n }", "function updateChart(points) {\n var firstSeriesIndex = 0;\n var firstSeries = window.realTimeHighChart.series[firstSeriesIndex];\n var shiftSeries = firstSeries.data.length > 20; // shift if the series is longer than 20\n\n for (var index = 0; index < points.length; index++) {\n var point = points[index];\n\n // add the point\n window.realTimeHighChart.series[index].addPoint(point, true, shiftSeries);\n }\n }", "function graph_line_generate(category,text,data,dom,title,subtitle,color)\n{\n $('#' + dom).highcharts({\n title: {\n text: title\n },\n subtitle: {\n text: subtitle\n },\n xAxis: {\n categories: category,\n crosshair: true\n },\n yAxis: {\n min: 0,\n title: {\n text: text\n }\n },\n legend: {\n layout: 'vertical',\n align: 'right',\n verticalAlign: 'middle',\n borderWidth: 0\n },\n colors: color,\n series: [data]\n });\n}", "function addData(chart, label) {\n chart.data.labels.push(label);\n chart.update();\n\n }", "function setSeriesByChart(chart_id, serie, serie_name, serie_type){\n\tvar highcharts = getChartById(chart_id);\n\tif(highcharts != null){\n\t\tvar series = highcharts.series;\n\t\tvar exist_serie = false;\n\t\tfor(var i = 0; i < series.length; i++){\n\t\t\tif(series[i].name == serie_name){\n\t\t\t\tif(series[i].type != serie_type){\n\t\t\t\t\tseries[i].update({\n\t\t type: serie_type,\n \t\tdrilldown: true\n\t\t });\n\t\t\t\t}\n\t\t\t\tseries[i].setData(serie);\n\t\t\t\texist_serie = true;\n\t\t\t}\n\t\t}\n\t\tif(!exist_serie){\n\t\t\thighcharts.addSeries({\n\t\t\t\ttype: serie_type,\n\t\t\t\tname: serie_name,\n\t\t\t\tdata: serie\n\t\t\t});\n\t\t}\n\t}\n}", "function addTimelineChart(point) {\n // update aoi (clicked point) layer\n Map.layers().forEach(function (layer) {\n if (layer.getName() === 'aoi') {\n Map.layers().remove(layer);\n\n }\n });\n\n let pointLayer = ui.Map.Layer(point, {color: 'red', opacity: 0.6}, 'aoi');\n Map.layers().add(pointLayer);\n\n // update chart and controls\n Map.widgets().reset();\n\n // create a label on the map.\n let label = ui.Label('... loading chart');\n Map.add(label);\n\n // update chart series options, this should be easier, but the ui.Chart is currently very limited, no evens like onDataLoad\n let features = ee.FeatureCollection(videoFrames.map(function (i) {\n let props = ee.Dictionary(i.reduceRegion(ee.Reducer.first(), point, 10));\n props = props.set('system:time_start', i.get('system:time_start'));\n\n return ee.Feature(null, props)\n }));\n\n // find unique property names, use to update series options\n features.toList(5000).map(function (f) {\n return ee.Feature(f).propertyNames().remove('system:id').remove('system:time_start').remove('system:index')\n }).flatten().sort().getInfo(function (bandNames) {\n let seriesCount = distinct(bandNames).length;\n\n // add chart\n let chart = ui.Chart.feature.byFeature(features, 'system:time_start');\n\n chart.setChartType('ScatterChart');\n\n let chartOptions = {\n title: null,\n chartArea: {width: '95%'},\n vAxis: {\n viewWindow: {\n max: 800,\n min: 0\n }\n , textStyle: {fontSize: 12}\n },\n hAxis: {format: 'yyyy-MM-dd', gridlines: {count: 20}, textStyle: {fontSize: 12}},\n lineWidth: 1,\n //curveType: 'function',\n pointSize: 4,\n series: {}\n };\n\n // update series type for RGB bands\n chartOptions.series[seriesCount - 1] = {pointSize: 0, color: '#de2d26'};\n chartOptions.series[seriesCount - 2] = {pointSize: 0, color: '#31a354'};\n chartOptions.series[seriesCount - 3] = {pointSize: 0, color: '#2b8cbe'};\n\n chart.setOptions(chartOptions);\n\n chart.style().set({\n position: 'bottom-left',\n width: '98%',\n height: '250px',\n });\n\n Map.add(chart);\n\n // when the chart is clicked, update the map and label.\n chart.onClick(function (xValue, yValue, seriesName) {\n if (!seriesName || seriesName.indexOf('vis-') !== -1) {\n print('Please select one of the sensor series');\n return\n }\n\n if (!xValue) {\n return; // Selection was cleared.\n }\n\n // Show the image for the clicked date.\n let equalDate = ee.Filter.equals('system:time_start', xValue);\n let equalBand = ee.Filter.equals('short_name', seriesName);\n let image = ee.Image(videoFrames.filter(ee.Filter.and(equalDate, equalBand)).first());\n\n // Show a label with the date on the map.\n ee.String(ee.String(new Date(xValue).toUTCString()).cat(' ').cat(image.get('system:id'))).getInfo(function (str) {\n label.setValue(str);\n\n let layer = ui.Map.Layer(addDate(image), {}, 'chart');\n addImageAsChartLayer(layer);\n image.get('system:id').getInfo(function (id) {\n layer.setName(layer.getName() + ' ' + id)\n })\n })\n });\n\n // update label once chart is added\n label.setValue('Click a point on the chart to show the image for that date.')\n })\n }", "function addDataPoint() {\n // add a new data point to the dataset\n // var now = vis.moment();\n // dataset.add({\n // x: now,\n // y: y(now / 1000)\n // });\n\n // remove all data points which are no longer visible\n //var range = graph2d.getWindow();\n //var interval = range.end - range.start;\n // var oldIds = dataset.getIds({\n // filter: function (item) {\n // return item.x < range.start - interval;\n // }\n // });\n //dataset.remove(oldIds);\n\n //setTimeout(addDataPoint, DELAY);\n}", "function plotEscala(faixa){\n $(\"#chart\").css('display','block');\n Highcharts.chart('chart', {\n chart:{\n type:'line'\n },\n title: {\n text: 'Magnitude calculada x Escala Richter'\n },\n xAxis: {\n plotBands:[{\n color:'#FCFFC5',\n from:magnitudeTable[faixa].de,\n to:magnitudeTable[faixa].ate\n }]\n },\n yAxis: {\n title: {\n text: 'Faixa de magnitude calculada'\n }\n },\n series:[{\n name: 'Escala Richter',\n data:[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\n }]\n }); \n }", "function addData() {\n chart.data.datasets[0].data = yys;\n chart.update();\n}", "function createSeries(field, name, stacked) {\n var series = chart.series.push(new am4charts.ColumnSeries());\n series.dataFields.valueY = field;\n series.dataFields.categoryX = \"year\";\n series.name = name;\n series.columns.template.tooltipText = \"{name}: [bold]{valueY}[/]\";\n series.stacked = stacked;\n series.columns.template.width = am4core.percent(95);\n }", "function push(chart) {\n charts.push(chart);\n }", "function draw_tendance_chart(response, id, texte) {\n var sums = getsum(response);\n var lesdonnees = highchart_data_tendance(sums[0]);\n var sta_chart = Highcharts.chart(id, {\n chart: {\n type: 'column'\n },\n credits: {\n text : \"Unicef Burundi\",\n href: \"http://cmam.unicefburundi.org\"\n },\n title: {\n text: texte\n },\n xAxis: {\n categories: lesdonnees[1],\n crosshair: true\n },\n plotOptions: {\n column: {\n dataLabels: {\n enabled: true\n },\n enableMouseTracking: false\n },\n },\n yAxis: {\n title: {\n text: 'Number of patients'\n }\n },\n series: lesdonnees[0]\n });\n}", "function draw_taux_chart(response, id, texte) {\n var sums = getsum2(response);\n var lesdonnees = highchart_data_taux(sums[0]);\n var sta_chart = Highcharts.chart(id, {\n chart: {\n type: 'spline'\n },\n credits: {\n text : \"Unicef Burundi\",\n href: \"http://cmam.unicefburundi.org\"\n },\n title: {\n text: texte\n },\n xAxis: {\n categories: lesdonnees[1]\n },\n plotOptions: {\n spline: {\n dataLabels: {\n enabled: true\n },\n enableMouseTracking: false\n },\n },\n yAxis: {\n title: {\n text: '%'\n }\n },\n series: lesdonnees[0]\n });\n}", "function insertRandomDatapoints() {\n\t let tmpData = {\n\t one: Math.floor(Math.random() * 35) + 10\n\t };\n\n\t chart1.series.addData(tmpData);\n\t chart1.render();\n\t}", "function addDataToPlot(data){\r\n var sig_iter;\r\n var samp_iter;\r\n var samp_time;\r\n var samp_val;\r\n var newest_timestamp = 0;\r\n \r\n if(data.daq_id == \"main\") {\r\n //Iterate over all samples in all signals received\r\n for(sig_iter = 0; sig_iter < data.signals.length; sig_iter++){\r\n var signal = data.signals[sig_iter];\r\n var chartIdx = signal_name_to_plot_idx[signal.id];\r\n\r\n for(samp_iter = 0; samp_iter < signal.samples.length; samp_iter++){\r\n \r\n //Parse each sample time&value\r\n samp_time = parseFloat(signal.samples[samp_iter].time)/1000.0;\r\n samp_val = parseFloat(signal.samples[samp_iter].val);\r\n\r\n //Should be a one-time thing per run - check if we need to update the initial sample time\r\n // This makes all charts start at 0.0 sec\r\n if(first_sample_time < 0.0){\r\n first_sample_time = samp_time;\r\n }\r\n samp_time = samp_time - first_sample_time;\r\n \r\n //Keep track of the most recent sample of all the data\r\n if(samp_time > newest_timestamp){\r\n newest_timestamp = samp_time;\r\n }\r\n \r\n //Add the sample to the plot\r\n global_chart.series[chartIdx].addPoint([samp_time,samp_val],false,false,true);\r\n }\r\n }\r\n\r\n global_chart.xAxis[0].setExtremes(newest_timestamp - time_range_sec,newest_timestamp,false)\r\n //Force a chart update to display the table\r\n global_chart.redraw();\r\n }\r\n \r\n}", "function createFeatureSeries(name) {\r\n var series = featureChart.series.push(new am4charts.LineSeries());\r\n series.dataFields.valueY = name;\r\n series.dataFields.dateX = \"Date\";\r\n series.name = name;\r\n series.strokeWidth = 1.5;\r\n series.tooltipText = \"[bold]{name}[/]: {valueY.formatNumber('#.##')}\";\r\n\r\n var segment = series.segments.template;\r\n segment.interactionsEnabled = true;\r\n\r\n var hoverState = segment.states.create(\"hover\");\r\n hoverState.properties.strokeWidth = 3;\r\n\r\n var dimmed = segment.states.create(\"dimmed\");\r\n dimmed.properties.stroke = am4core.color(\"#dadada\");\r\n\r\n //Define hover-over events\r\n segment.events.on(\"over\", function(event) {\r\n processOver(event.target.parent.parent.parent);\r\n });\r\n segment.events.on(\"out\", function(event) {\r\n processOut(event.target.parent.parent.parent);\r\n });\r\n return series;\r\n }", "function addDataSet(chart, label, data) {\n chart.data.datasets.push({\n label: label,\n data: data\n });\n\n chart.update();\n }", "function plotSeries() {\n if (series.length < 2)\n return;\n var placeholder = $(\"#placeholder\");\n var p = $.plot(placeholder, [series], options);\n}", "addPoint(point) {\n this.dataset.push(point);\n this.draw();\n }", "loadDailyChart(){\n this.chart = new Highcharts.Chart({\n chart : {\n backgroundColor: '#484849',\n renderTo : 'charts',\n type : 'line',\n },\n title: {\n text: '',\n },\n tooltip: {\n valueDecimals: 2,\n valueSuffix: ' %',\n shared:true\n },\n xAxis: {\n gridLineWidth: 1,\n // tickInterval: 8 * 60 * 60 * 1000, \n type: 'datetime',\n tickLength: 0,\n gridLineColor: '#848484',\n lineColor: '#484849',\n lineWidth: 1,\n dateTimeLabelFormats: {\n day:\"%H:%M\"\n },\n labels:{\n style:{\n color: '#808080',\n fontSize : '10px'\n }\n }\n },\n yAxis:{\n title : '',\n gridLineWidth: 0,\n opposite : true,\n labels: {\n formatter: function() {\n return this.value + ' %';\n },\n style:{\n color: '#808080',\n fontSize : '10px'\n }\n }\n },\n marker: {\n enabled: false\n },\n legend:{\n enabled: false\n },\n credits: {\n enabled: false\n },\n \n });\n // Đệ quy\n var arr = this.sharesChart.slice();\n let index = 0;\n var getShareData = (arr,index) => {\n if (arr.length > 0 ){\n let share = arr[0]; // get first element \n arr = arr.slice(1); // Erase first element\n if (share.isOwnShare){ // if this element have attr isOwnShare\n this.chartCtrl.getLastDailyData(share.instrumentID,true).then(data=>{\n if (data.length > 0 ){ // If recentDay have data.\n // Assign value recentTime\n this.recentTime[0].recentDay = data[0][0];\n this.recentTime[0].instrumentID = share.instrumentID;\n // Add series \n this.addSeries(share.instrumentID,share.shareName,data,this.colors[0].color);\n // this.chart.addSeries({ \n // id : share.instrumentID, \n // name: share.shareName, \n // data: data,\n // color: this.colors[0].color\n // }, true);\n this.sharesChart[index].color = this.colors[0].color;\n this.colors[0].isSelected = true;\n // Add another share with recentDay parameter\n for (let i = 0 ; i < this.sharesChart.length ; i++){ \n if (this.sharesChart[i].instrumentID !== share.instrumentID){ \n this.chartCtrl.getDailyData(this.sharesChart[i].instrumentID,this.recentTime[0].recentDay,true).then(data=>{\n let color = this.getColor(); \n if (data.length > 0 ){ // If this share have data.\n this.addSeries(share.instrumentID,share.shareName,data,color);\n // this.chart.addSeries({ \n // id : this.sharesChart[i].instrumentID, \n // name: this.sharesChart[i].shareName, \n // data: data,\n // color: color\n // }, true);\n }\n this.sharesChart[i].color = color;\n });\n } \n }\n }\n else { // If not satified, continue seek.\n if ( index + 1 < this.sharesChart.length ){\n index++;\n getShareData(arr,index);\n }\n }\n });\n }\n else { // If not satified, continue seek.\n if ( index + 1 < this.sharesChart.length ){\n index++;\n getShareData(arr,index);\n }\n }\n }\n };\n getShareData(arr,index);\n }", "function addData(chart, label, data) {\n chart.data.labels.push(label);\n chart.data.datasets.forEach((dataset) => {\n dataset.data.push(data);\n });\n chart.update();\n}", "function drawChart(highchartdiv){\n $.getJSON('/api/historical_data/?format=json', function (data) {\n\n // Create the chart\n var months = data.months;\n var datacount= data.monthly_counts;\n\n var options={\n chart: {\n renderTo: highchartdiv,\n type: 'column'\n },\n title: {\n text:'Dashboard: Last Five Months'\n },\n xAxis:{\n categories: months,\n title: {\n // text: 'Metrics'\n }\n },\n yAxis: {\n min: 0,\n title: {\n text: 'Values'\n }\n }, \n series:datacount\n };\n\n var chart = new Highcharts.Chart(options);\n\n\n });\n\n}", "function addDataPoint() {\n // add a new data point to the dataset\n let now = vis.moment();\n datasetGraph.add({\n x: now,\n y: y(now / 1000,function (data) {\n return data;\n }),\n group:0\n });\n // datasetGraph.add({\n // x: now,\n // y: y(now / 500),\n // group:1\n // });\n // datasetGraph.add({\n // x: now,\n // y: y(now / 750),\n // group:2\n // });\n // datasetGraph.add({\n // x: now,\n // y: y(now / 123),\n // group:3\n // });\n // // remove all data points which are no longer visible\n // var range = graph2d.getWindow();\n // var interval = range.end - range.start;\n // var oldIds = datasetGraph.getIds({\n // filter: function (item) {\n // return item.x < range.start - interval;\n // }\n // });\n // datasetGraph.remove(oldIds);\n\n setTimeout(addDataPoint, DELAY);\n}", "function drawChart(categories,series,title,subtitle){\r\n\r\n\t\tconsole.log('Draw chart');\r\n\t\tconsole.log(JSON.stringify(series));\r\n\t\t $('#daily-advertiser-chart-container').highcharts({\r\n\t\t\t \tchart: {\r\n\t\t\t\t type: 'spline'\r\n\t },\r\n\t exporting: {\r\n\t enabled: true\r\n\t },\r\n\t title: {\r\n\t text: title,\r\n\t x: -20 //center\r\n\t },\r\n\t subtitle: {\r\n\t text: subtitle,\r\n\t x: -20\r\n\t },\r\n\t credits:{\r\n\t \thref: 'http://vervemobile.com',\r\n\t \ttext: 'vervemobile.com'\r\n\t },\r\n\t xAxis: {\r\n\t categories: categories,\r\n\t tickmarkPlacement: 'on',\r\n\t title: {\r\n\t enabled: false\r\n\t },\r\n\t gridLineWidth: 1\r\n\t },\r\n\t yAxis: {\r\n\t title: {\r\n\t text: 'Count'\r\n\t },\r\n\t gridLineWidth: 1\r\n\t },\r\n\t legend: {\r\n\t layout: 'vertical',\r\n\t align: 'right',\r\n\t verticalAlign: 'middle',\r\n\t borderWidth: 0\r\n\t },\r\n\t tooltip: {\r\n\t formatter: function() {\r\n\t return '<b>'+ this.x +'</b><br/>'+\r\n\t this.series.name +': '+ accounting.formatNumber(this.y)+'<br/>'\r\n\t }\r\n\t },\r\n\t plotOptions: {\r\n\t \tspline: {\r\n\t \t\tlineWidth: 1,\r\n\t \t\t states: {\r\n\t hover: {\r\n\t lineWidth: 2\r\n\t }\r\n\t },\r\n\t \t\tmarker: {\r\n\t enabled: false\r\n\t }\r\n\t \t}\r\n\t },\r\n\t series: series\r\n\t });\r\n\t\t chart=$('#daily-advertiser-chart-container').highcharts();\r\n\t}", "function initializeHighChart() {\n var highchartConfig = {\n title: {\n text: 'Total Coal Exports - China 1980-2012',\n x: -20 //center\n },\n subtitle: {\n text: 'U.S. Energy Information Administration Data',\n x: -20\n },\n xAxis: {\n type: 'datetime'\n },\n series: [{\n //data points\n name: 'China Coal Exports (Units=Thousand Short Tons)',\n data: newData\n\n\n }]\n\n };\n $('#chart').highcharts(highchartConfig);\n\n }", "get series() {\n if (this._series === null) {\n let coll = new IgrSeriesCollection();\n let inner = coll._innerColl;\n inner.addListener((sender, e) => {\n switch (e.action) {\n case NotifyCollectionChangedAction.Add:\n this._seriesAdapter.insertManualItem(e.newStartingIndex, e.newItems.item(0));\n break;\n case NotifyCollectionChangedAction.Remove:\n this._seriesAdapter.removeManualItemAt(e.oldStartingIndex);\n break;\n case NotifyCollectionChangedAction.Replace:\n this._seriesAdapter.removeManualItemAt(e.oldStartingIndex);\n this._seriesAdapter.insertManualItem(e.newStartingIndex, e.newItems.item(0));\n break;\n case NotifyCollectionChangedAction.Reset:\n this._seriesAdapter.clearManualItems();\n break;\n }\n });\n this._series = coll;\n }\n return this._series;\n }", "function addDataToGraph(theData) {\n const theDataHistorial = theData.historial; //obtener historial del JSON de la tienda\n setGraphData({\n labels: theDataHistorial.map((aName) => aName.fecha), //labels con las fechas de actualización\n datasets: [\n {\n label: \"Quantity of the store\",\n data: theDataHistorial.map((item) => item.cantidadAnterior), //datos con la cantidad anterior en la actualizacion\n fill: false,\n backgroundColor: \"rgb(255, 255, 255)\",\n borderColor: \"#1d2d44\",\n },\n ],\n });\n }", "function newSeries () {\r\n list = []; // Neue Liste der Messstrecken (leer)\r\n state = 0; // Zustand vor dem Start\r\n diagr = false; // Flag für Diagramm löschen\r\n t = 0; // Zeitvariable zurücksetzen\r\n ls = X0+LENGTH/2; // Lichtschranke zunächst in der Mitte\r\n calculation(); // Berechnungen\r\n var s = symbolDisplacement+\" \"; // Anfang der Zeichenkette für den Textbereich (Messstrecke)\r\n s += symbolTime+\"\\n\"; // Zeichenkette ergänzen (Zeit)\r\n for (var i=1; i<=24; i++) s += \"\\u2015\"; // Zeichenkette ergänzen (Trennlinie)\r\n s += \"\\n\"; // Zeichenkette ergänzen (Zeilenumbruch) \r\n ta.value = s; // Textbereich aktualisieren \r\n }", "function Series(options) {\n options = options || {};\n $.jqplot.ElemContainer.call(this);\n // Group: Properties\n // Properties will be assigned from a series array at the top level of the\n // options. If you had two series and wanted to change the color and line\n // width of the first and set the second to use the secondary y axis with\n // no shadow and supply custom labels for each:\n // > {\n // > series:[\n // > {color: '#ff4466', lineWidth: 5, label:'good line'},\n // > {yaxis: 'y2axis', shadow: false, label:'bad line'}\n // > ]\n // > }\n\n // prop: show\n // wether or not to draw the series.\n this.show = true;\n // prop: xaxis\n // which x axis to use with this series, either 'xaxis' or 'x2axis'.\n this.xaxis = 'xaxis';\n this._xaxis;\n // prop: yaxis\n // which y axis to use with this series, either 'yaxis' or 'y2axis'.\n this.yaxis = 'yaxis';\n this._yaxis;\n this.gridBorderWidth = 2.0;\n // prop: renderer\n // A class of a renderer which will draw the series, \n // see <$.jqplot.LineRenderer>.\n this.renderer = $.jqplot.LineRenderer;\n // prop: rendererOptions\n // Options to pass on to the renderer.\n this.rendererOptions = {};\n this.data = [];\n this.gridData = [];\n // prop: label\n // Line label to use in the legend.\n this.label = '';\n // prop: showLabel\n // true to show label for this series in the legend.\n this.showLabel = true;\n // prop: color\n // css color spec for the series\n this.color;\n // prop: negativeColor\n // css color spec used for filled (area) plots that are filled to zero and\n // the \"useNegativeColors\" option is true.\n this.negativeColor;\n // prop: lineWidth\n // width of the line in pixels. May have different meanings depending on renderer.\n this.lineWidth = 2.5;\n // prop: lineJoin\n // Canvas lineJoin style between segments of series.\n this.lineJoin = 'round';\n // prop: lineCap\n // Canvas lineCap style at ends of line.\n this.lineCap = 'round';\n // prop: linePattern\n // line pattern 'dashed', 'dotted', 'solid', some combination\n // of '-' and '.' characters such as '.-.' or a numerical array like \n // [draw, skip, draw, skip, ...] such as [1, 10] to draw a dotted line, \n // [1, 10, 20, 10] to draw a dot-dash line, and so on.\n this.linePattern = 'solid';\n this.shadow = true;\n // prop: shadowAngle\n // Shadow angle in degrees\n this.shadowAngle = 45;\n // prop: shadowOffset\n // Shadow offset from line in pixels\n this.shadowOffset = 1.25;\n // prop: shadowDepth\n // Number of times shadow is stroked, each stroke offset shadowOffset from the last.\n this.shadowDepth = 3;\n // prop: shadowAlpha\n // Alpha channel transparency of shadow. 0 = transparent.\n this.shadowAlpha = '0.1';\n // prop: breakOnNull\n // Wether line segments should be be broken at null value.\n // False will join point on either side of line.\n this.breakOnNull = false;\n // prop: markerRenderer\n // A class of a renderer which will draw marker (e.g. circle, square, ...) at the data points,\n // see <$.jqplot.MarkerRenderer>.\n this.markerRenderer = $.jqplot.MarkerRenderer;\n // prop: markerOptions\n // renderer specific options to pass to the markerRenderer,\n // see <$.jqplot.MarkerRenderer>.\n this.markerOptions = {};\n // prop: showLine\n // wether to actually draw the line or not. Series will still be renderered, even if no line is drawn.\n this.showLine = true;\n // prop: showMarker\n // wether or not to show the markers at the data points.\n this.showMarker = true;\n // prop: index\n // 0 based index of this series in the plot series array.\n this.index;\n // prop: fill\n // true or false, wether to fill under lines or in bars.\n // May not be implemented in all renderers.\n this.fill = false;\n // prop: fillColor\n // CSS color spec to use for fill under line. Defaults to line color.\n this.fillColor;\n // prop: fillAlpha\n // Alpha transparency to apply to the fill under the line.\n // Use this to adjust alpha separate from fill color.\n this.fillAlpha;\n // prop: fillAndStroke\n // If true will stroke the line (with color this.color) as well as fill under it.\n // Applies only when fill is true.\n this.fillAndStroke = false;\n // prop: disableStack\n // true to not stack this series with other series in the plot.\n // To render properly, non-stacked series must come after any stacked series\n // in the plot's data series array. So, the plot's data series array would look like:\n // > [stackedSeries1, stackedSeries2, ..., nonStackedSeries1, nonStackedSeries2, ...]\n // disableStack will put a gap in the stacking order of series, and subsequent\n // stacked series will not fill down through the non-stacked series and will\n // most likely not stack properly on top of the non-stacked series.\n this.disableStack = false;\n // _stack is set by the Plot if the plot is a stacked chart.\n // will stack lines or bars on top of one another to build a \"mountain\" style chart.\n // May not be implemented in all renderers.\n this._stack = false;\n // prop: neighborThreshold\n // how close or far (in pixels) the cursor must be from a point marker to detect the point.\n this.neighborThreshold = 4;\n // prop: fillToZero\n // true will force bar and filled series to fill toward zero on the fill Axis.\n this.fillToZero = false;\n // prop: fillToValue\n // fill a filled series to this value on the fill axis.\n // Works in conjunction with fillToZero, so that must be true.\n this.fillToValue = 0;\n // prop: fillAxis\n // Either 'x' or 'y'. Which axis to fill the line toward if fillToZero is true.\n // 'y' means fill up/down to 0 on the y axis for this series.\n this.fillAxis = 'y';\n // prop: useNegativeColors\n // true to color negative values differently in filled and bar charts.\n this.useNegativeColors = true;\n this._stackData = [];\n // _plotData accounts for stacking. If plots not stacked, _plotData and data are same. If\n // stacked, _plotData is accumulation of stacking data.\n this._plotData = [];\n // _plotValues hold the individual x and y values that will be plotted for this series.\n this._plotValues = {x:[], y:[]};\n // statistics about the intervals between data points. Used for auto scaling.\n this._intervals = {x:{}, y:{}};\n // data from the previous series, for stacked charts.\n this._prevPlotData = [];\n this._prevGridData = [];\n this._stackAxis = 'y';\n this._primaryAxis = '_xaxis';\n // give each series a canvas to draw on. This should allow for redrawing speedups.\n this.canvas = new $.jqplot.GenericCanvas();\n this.shadowCanvas = new $.jqplot.GenericCanvas();\n this.plugins = {};\n // sum of y values in this series.\n this._sumy = 0;\n this._sumx = 0;\n this._type = '';\n }", "function addData(chart, label, data) {\n chart.data.labels.push(label);\n chart.data.datasets.forEach((dataset) => {\n dataset.data.push(data);\n });\n chart.update();\n}", "function addData(chart, label, data) {\n let newDataLength = data.length;\n for(let i = 0; i < newDataLength; i++){\n chart.data.datasets[0].data.push(data[i]);\n chart.data.labels.push(label[i]);\n }\n chart.update();\n}", "function drawSeries(series){\n\t\t\tif(series.lines.show || (!series.bars.show && !series.points.show))\n\t\t\t\tdrawSeriesLines(series);\n\t\t\tif(series.bars.show)\n\t\t\t\tdrawSeriesBars(series);\n\t\t\tif(series.points.show)\n\t\t\t\tdrawSeriesPoints(series);\n\t\t}", "function addToPackage(history) {\n console.log(\"addToPackage\")\n packaged[SOURCE][history.id] =\n new EdisonTelemetrySeries(history.value);\n }", "function AddToChart(index) {\n var dataToAdd = fileData[index];\n console.log(\"Adding\", index, dataToAdd.name);\n if (!Exists(fileData.tableIndex)) {\n dataToAdd.tableIndex = index;\n }\n if (inChart.length > 0 && $.grep(inChart, function (a) { return a.tableIndex == index; }).length != 0) {\n console.warn(\"Already in chart\");\n } else if (inChart.length > 0 && !DataParser.MatchingEvents(inChart[0], dataToAdd)) {\n console.warn(\"Incompatable\");\n } else {\n inChart.push(dataToAdd);\n UpdateChart();\n }\n}", "addSeries(series_title) {\n return new Promise((resolve, reject) => {\n series_id = undefined;\n db.transaction(tx => {\n tx.executeSql(\n Series.Query.INSERT_SERIES_QUERY,\n [series_title],\n (_, { insertId }) => series_id = insertId\n );\n }, error => {\n reject(error);\n }, success => {\n resolve(series_id);\n });\n })\n }", "function addTimeSeries(element) {\n var timeseries = {\n uri: element.data('uri'),\n datasetId: element.data('datasetid'),\n title: element.data('title')\n };\n\n if (timeseriesList.hasOwnProperty(timeseries.uri)) {\n return; // it is already in the list \n }\n timeseriesList[timeseries.uri] = timeseries;\n addToPage(timeseries);\n addToCookie(timeseries);\n }", "function addData(chart, label, data) {\n chart.config.data.labels = label;\n chart.config.data.datasets[0].data = data;\n chart.update();\n}", "function populateGraphs(provider, seriesOptions) {\n Highcharts.setOptions({\n lang: {\n thousandsSep: ','\n },\n });\n Highcharts.stockChart(provider, {\n title: {\n \ttext: provider\n \t\t},\n legend: {\n enabled: true,\n align: 'right',\n backgroundColor: '#FCFFC5',\n borderColor: 'black',\n borderWidth: 2,\n layout: 'vertical',\n verticalAlign: 'top',\n y: 100,\n shadow: true\n },\n\n rangeSelector: {\n selected: 4\n },\n\n yAxis: {\n\n opposite: false,\n\n labels: {\n formatter: function () {\n return (this.value > 0 ? '' : '') + this.value;\n },\n style: {\n fontSize:'15px'\n }\n },\n\n plotLines: [{\n value: 0,\n width: 2,\n color: 'silver'\n }]\n },\n\n plotOptions: {\n series: {\n compare: 'events',\n showInNavigator: true\n }\n },\n\n series: seriesOptions,\n\n\n tooltip: {\n enabled: true,\n pointFormat: '<span style=\"color:{series.color}\">{series.name}</span>: <b>{point.y}</b><br/>',\n // valueDecimals: 2,\n // split: true,\n },\n\n exporting: {\n sourceWidth: 1600,\n sourceHeight: 400,\n // scale: 2 (default)\n chartOptions: {\n subtitle: null\n }\n }\n\n });\n }", "function insertMarkers(series){\n _.each(series, function(s){\n var data = s.data;\n if(data && data.length && !data[0].marker){\n var marker = {symbol: 'url(./assets/' + data[0].name + '_48x48.png)'}\n data[0].marker = marker;\n data[data.length - 1].marker = marker;\n }\n });\n }", "function requestData() {\n //var firtst = null;\n $.ajax({\n url: '../json2.php',\n success: function(point) { \n\n prRada = point[0];\n drRada = point[1];\n console.log(point[0]);\n console.log(point[1]);\n\n for (var i = 0; i < prRada.length; i++) {\n chart.series[0].addPoint(prRada[i],true);\n chart.series[1].addPoint(drRada[i],true); \n }; \n },\n cache: false\n });\n}", "function groupSeriesToCreateAPie(categories, series){\n\tvar array_series = new Array();\n\tif(categories != null && categories.length > 0){\n\t\tvar data;\n\t\tvar value_total = 0;\n\t\tfor(var i = 0; i < categories.length; i++){\n\t\t\tfor(var j = 0; j < series.length; j++){\n\t\t\t\tvalue_total = value_total + parseInt(series[j].yData[i]);\n\t\t\t}\n\t\t\tdata = new Object()\n\t\t\tdata.y = value_total;\n\t\t\tdata.name = categories[i];\n\t\t\tarray_series.push(data);\n\t\t\tvalue_total = 0;\n\t\t} \n\t}\n\treturn array_series;\n}", "function addData(chart, label, data) {\n chart.data.labels = chart.data.labels.concat(label);\n chart.data.datasets.forEach((dataset) => {\n dataset.data = dataset.data.concat(data);\n });\n chart.update();\n}", "function createChart(seriesOptions) {\n\n $('#chart').highcharts('StockChart', {\n\n rangeSelector: {\n selected: false\n },\n\n yAxis: {\n labels: {\n formatter: function () {\n return (this.value > 0 ? ' + ' : '') + this.value + '%';\n }\n },\n plotLines: [{\n value: 0,\n width: 2,\n color: 'silver'\n }]\n },\n\n plotOptions: {\n series: {\n compare: 'percent'\n }\n },\n\n tooltip: {\n pointFormat: '<span style=\"color:{series.color}\">{series.name}</span>: <b>{point.y}</b> ({point.change}%)<br/>',\n valueDecimals: 2\n },\n\n series: seriesOptions\n });\n}", "addPoint(timeTicks, value) {\n const time = new Date(timeTicks);\n this.dataPoints_.push(new DataPoint(time, value));\n\n if (this.dataPoints_.length > MAX_STATS_DATA_POINT_BUFFER_SIZE) {\n this.dataPoints_.shift();\n }\n }", "function renderChart( data, title, container ) {\n chart1 = new Highcharts.Chart({\n\tchart: {\n\t renderTo: container,\n\t defaultSeriesType: 'spline'\n\t},\n\ttitle: {\n\t text: title\n\t},\n\txAxis: {\n\t //categories: $.map(data, function ( datum ) { return datum[0]; }),\n\t plotBands: [{ \n\t\tfrom: 7.5,\n\t\tto: 9.5,\n\t\tcolor: 'rgba(68, 170, 213, 0.1)',\n\t\tlabel: {\n\t\t text: 'Morning Rush',\n\t\t style: {\n\t\t\tcolor: '#606060'\n\t\t }\n\t\t}\n },{\n\t\tfrom: 16.0,\n\t\tto: 19.0,\n\t\tcolor: 'rgba(68, 170, 213, 0.1)',\n\t\tlabel: {\n\t\t text: 'Afternoon Rush',\n\t\t style: {\n\t\t\tcolor: '#606060'\n\t\t }\n\t\t}\n\t }]\n\t},\n\ttooltip: {\n\t formatter: function() {\n\t\treturn '<b>'+ this.series.name +'</b><br/>'+\n\t\t this.x +': '+ this.y;\n\t }\n\t},\n\tseries: [{\n\t name: 'Route Time',\n\t data: data \n\t}]\n });\n}", "function addLine(namePop) {\n data.addColumn('number', namePop['Name']);\n let colNum = data.getNumberOfColumns() - 1;\n years.map(String).forEach((year, index) =>{\n data.setCell(index, colNum, namePop[year]);\n });\n drawGraph();\n}", "function drawDateChart(categories,series,title,subtitle){\r\n\t\tconsole.log('Draw chart by date');\r\n\t\t\r\n\t\t $('#daily-advertiser-chart-container').highcharts({\r\n\t\t\t \tchart: {\r\n\t\t\t \t\tzoomType: 'xy'\r\n\t },\r\n\t exporting: {\r\n\t enabled: true\r\n\t },\r\n\t title: {\r\n\t text: title,\r\n\t x: -20 //center\r\n\t },\r\n\t subtitle: {\r\n\t text: subtitle,\r\n\t x: -20\r\n\t },\r\n\t credits:{\r\n\t \thref: 'http://vervemobile.com',\r\n\t \ttext: 'vervemobile.com'\r\n\t },\r\n\t xAxis: {\r\n\t categories: categories,\r\n\t tickmarkPlacement: 'on',\r\n\t title: {\r\n\t enabled: false\r\n\t },\r\n\t gridLineWidth: 1,\r\n\t labels:{\r\n\t \tformatter: function(){\r\n\t \t\treturn new Date(this.value).format('mmm-dd');\r\n\t \t},\r\n\t \trotation: -45\r\n\t }\r\n\t },\r\n\t yAxis:[{ // Primary yAxis\r\n\t labels: {\r\n\t formatter: function() {\r\n\t return accounting.formatNumber(this.value);\r\n\t },\r\n\t style: {\r\n\t color: '#89A54E'\r\n\t }\r\n\t },\r\n\t title: {\r\n\t text: 'Clicks',\r\n\t style: {\r\n\t color: '#89A54E'\r\n\t }\r\n\t },\r\n\t opposite: true\r\n\t \r\n\t }, { // Secondary yAxis\r\n\t gridLineWidth: 0,\r\n\t title: {\r\n\t text: 'Impressions',\r\n\t style: {\r\n\t color: '#4572A7'\r\n\t }\r\n\t },\r\n\t labels: {\r\n\t formatter: function() {\r\n\t return accounting.formatNumber(this.value) ;\r\n\t },\r\n\t style: {\r\n\t color: '#4572A7'\r\n\t }\r\n\t }\r\n\t \r\n\t }, { // Tertiary yAxis\r\n\t gridLineWidth: 0,\r\n\t title: {\r\n\t text: 'Cta map',\r\n\t style: {\r\n\t color: '#AA4643'\r\n\t }\r\n\t },\r\n\t labels: {\r\n\t formatter: function() {\r\n\t return accounting.formatNumber(this.value) ;\r\n\t },\r\n\t style: {\r\n\t color: '#AA4643'\r\n\t }\r\n\t },\r\n\t opposite: true\r\n\t }],\r\n\t legend: {\r\n\t layout: 'vertical',\r\n\t align: 'left',\r\n\t x: 120,\r\n\t verticalAlign: 'top',\r\n\t y: 10,\r\n\t floating: true,\r\n\t backgroundColor: '#FFFFFF'\r\n\t },\r\n\t tooltip: {\r\n\t shared: true\r\n\t },\r\n\t plotOptions: {\r\n\t \tspline: {\r\n\t \t\tlineWidth: 2,\r\n\t \t\t states: {\r\n\t hover: {\r\n\t lineWidth: 3\r\n\t }\r\n\t },\r\n\t \t\tmarker: {\r\n\t enabled: false\r\n\t }\r\n\t \t},\r\n\t \tareaspline: {\r\n\t \t\tlineWidth: 1,\r\n\t \t\t states: {\r\n\t hover: {\r\n\t lineWidth: 2\r\n\t }\r\n\t },\r\n\t \t\tmarker: {\r\n\t enabled: false\r\n\t }\r\n\t \t}\r\n\t },\r\n\t series: series\r\n\t });\r\n\t\t chart=$('#daily-advertiser-chart-container').highcharts();\r\n\t}", "function PushDataToMap(series, category, year) { \n DataSeries.length = 0; /* Reset DataSeries storage */\n for (row of series) {\n if (row[\"series_code\"] === category) { \n DataSeries.push(row[year]); /* If the currently read category (row) matches with the one selected in Category menu, push to storage */ \n };\n }\n /* Estimate MAX and MINs for calculating legend's boundry values */\n DataMin = Math.min.apply(null, DataSeries); \n DataMax = Math.max.apply(null, DataSeries);\n DataMin = Math.floor(DataMin);\n DataMax = Math.ceil(DataMax);\n LoadMap(); /* Reload map with new data */\n}", "function Series() {\n this.ys = arguments.length > 0 ? arguments[ 0 ] : new Dataset();\n this.xs = arguments.length > 1 ? arguments[ 1 ] : null;\n this.size = this.ys.size;\n this.plot = 'straight';\n this.ylimits = new ns.Limits( 0, 0 );\n Object.defineProperty(\n this,\n 'length',\n { 'get' : function() { return this.ys.length; } }\n );\n this._update();\n }", "function rawChart() {\r\n\tvar chart_title = \"VLMO\";\r\n\t$('#container').highcharts(\r\n\t\t\t{\r\n\t\t\t\tchart : {\r\n\t\t\t\t\tzoomType : 'xy'\r\n\t\t\t\t},\r\n\t\t\t\ttitle : {\r\n\t\t\t\t\ttext : chart_title\r\n\t\t\t\t},\r\n\t\t\t\tsubtitle : {\r\n\t\t\t\t\ttext : 'From ' + selectStartDate.format('yyyy-mm-dd')\r\n\t\t\t\t\t\t\t+ ' To ' + selectEndDate.format('yyyy-mm-dd')\r\n\t\t\t\t},\r\n\t\t\t\tcredits : {\r\n\t\t\t\t\thref : 'http://www.vervemobile.com',\r\n\t\t\t\t\ttext : 'vervemobile.com'\r\n\t\t\t\t},\r\n\t\t\t\txAxis : [ {\r\n\t\t\t\t\tcategories : categories,\r\n\t\t\t\t\t// tickmarkPlacement: 'on',\r\n\t\t\t\t\ttitle : {\r\n\t\t\t\t\t\tenabled : false\r\n\t\t\t\t\t},\r\n\t\t\t\t\t// gridLineWidth: 1,\r\n\t\t\t\t\tlabels : {\r\n\t\t\t\t\t\trotation : -45,\r\n\t\t\t\t\t\tformatter : function() {\r\n\t\t\t\t\t\t\tvar value = this.value;\r\n\t\t\t\t\t\t\tvar now = new Date(value);\r\n\t\t\t\t\t\t\treturn now.format(\"mmm dd\");\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\tyAxis : [ { // Primary\r\n\t\t\t\t\tlabels : {\r\n\t\t\t\t\t\tformatter : function() {\r\n\t\t\t\t\t\t\treturn accounting.formatNumber(this.value);\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tstyle : {\r\n\t\t\t\t\t\t\tcolor : '#01A9DB '\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t},\r\n\t\t\t\t\ttitle : {\r\n\t\t\t\t\t\ttext : 'Clicks',\r\n\t\t\t\t\t\tstyle : {\r\n\t\t\t\t\t\t\tcolor : '#01A9DB'\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t},\r\n\t\t\t\t\topposite : true\r\n\r\n\t\t\t\t}, { // Tertiary\r\n\t\t\t\t\tlabels : {\r\n\t\t\t\t\t\tformatter : function() {\r\n\t\t\t\t\t\t\treturn accounting.formatNumber(this.value);\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tstyle : {\r\n\t\t\t\t\t\t\tcolor : '#DBA901'\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t},\r\n\t\t\t\t\ttitle : {\r\n\t\t\t\t\t\ttext : 'Impressions',\r\n\t\t\t\t\t\tstyle : {\r\n\t\t\t\t\t\t\tcolor : '#DBA901'\r\n\t\t\t\t\t\t}\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\ttooltip : {\r\n\t\t\t\t\tshared : true,\r\n\t\t\t\t\tformatter : function() {\r\n\t\t\t\t\t\tvar date_Value = new Date(this.x);\r\n\t\t\t\t\t\tvar s = '<b>' + date_Value.format('mmm d, yyyy')\r\n\t\t\t\t\t\t\t\t+ '</b>';\r\n\t\t\t\t\t\t$.each(this.points, function(i, point) {\r\n\t\t\t\t\t\t\tif (point.series.name == 'Impressions') {\r\n\t\t\t\t\t\t\t\ts += '<br/><font style=\"color: #DBA901;\">'\r\n\t\t\t\t\t\t\t\t\t\t+ point.series.name + ': '\r\n\t\t\t\t\t\t\t\t\t\t+ accounting.formatNumber(point.y)\r\n\t\t\t\t\t\t\t\t\t\t+ '</font>';\r\n\t\t\t\t\t\t\t} else if (point.series.name == 'Clicks') {\r\n\t\t\t\t\t\t\t\ts += '<br/><font style=\"color: #01A9DB;\">'\r\n\t\t\t\t\t\t\t\t\t\t+ point.series.name + ': '\r\n\t\t\t\t\t\t\t\t\t\t+ accounting.formatNumber(point.y)\r\n\t\t\t\t\t\t\t\t\t\t+ '</font>';\r\n\t\t\t\t\t\t\t} else if (point.series.name == 'Cta any') {\r\n\t\t\t\t\t\t\t\ts += '<br/><font style=\"color: #80FF00;\">'\r\n\t\t\t\t\t\t\t\t\t\t+ point.series.name + ': '\r\n\t\t\t\t\t\t\t\t\t\t+ accounting.formatNumber(point.y)\r\n\t\t\t\t\t\t\t\t\t\t+ '</font>';\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\ts += '<br/>' + point.series.name + ': '\r\n\t\t\t\t\t\t\t\t\t\t+ accounting.formatMoney(point.y);\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\treturn s;\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\tlegend : {\r\n\t\t\t\t\t// layout: 'vertical',\r\n\t\t\t\t\t// align: 'left',\r\n\t\t\t\t\t// x: 100,\r\n\t\t\t\t\t// verticalAlign: 'top',\r\n\t\t\t\t\t// y: 0,\r\n\t\t\t\t\t// floating: true,\r\n\t\t\t\t\tbackgroundColor : '#FFFFFF'\r\n\t\t\t\t},\r\n\t\t\t\tseries : [ {\r\n\t\t\t\t\tname : 'Clicks',\r\n\t\t\t\t\tcolor : '#01A9DB',\r\n\t\t\t\t\ttype : 'areaspline',\r\n\t\t\t\t\tyAxis : 1,\r\n\t\t\t\t\tdata : secondData\r\n\t\t\t\t}, {\r\n\t\t\t\t\tname : 'Impressions',\r\n\t\t\t\t\tcolor : '#DBA901',\r\n\t\t\t\t\ttype : 'column',\t\t\t\t\t\r\n\t\t\t\t\tdata : firstData\r\n\t\t\t\t} ]\r\n\t\t\t});\r\n\tchart = $('#container').highcharts();\r\n}", "function addCategory(cat, data){\r\n //set auto color if no color defined\r\n cat.color=cat.color || colorService.getColor(Object.keys($scope.categories).length);\r\n //$scope.categories.push(cat);\r\n //$scope.chartOptions.dimensions[cat.name]=cat;\r\n //$scope.chartOptions.data=$scope.chartOptions.data.concat(data);\r\n graphManager.add(cat, data);\r\n }", "function addPoint(y) {\n var index = points.length;\n points = points.concat([[index, y]]);\n}", "function drawLineChart(){\n var smoothie = new SmoothieChart({\n grid: {\n strokeStyle: 'rgb(255,255,255)', fillStyle: 'rgb(255, 255, 255)',\n lineWidth: 1, millisPerLine: 250, verticalSections: 10,\n },\n labels: {fillStyle: 'rgb(100, 0, 0)'}\n });\n smoothie.streamTo(document.getElementById(\"linechart\"))\n lineChart = new TimeSeries();\n lineChart.append(new Date().getTime(), 10);\n smoothie.addTimeSeries(lineChart,\n {strokeStyle: 'rgb(0, 255, 0)', fillStyle: 'rgba(255, 255, 255, 0.4)', lineWidth: 3}\n );\n}", "chart1 () { \n \n var myChart1 = echarts.init(document.getElementById('chart1'));\n \n var option = {\n\n title: {\n text: 'Toutes les notes'\n },\n tooltip: {},\n legend: {\n data:['Notes']\n },\n xAxis: {\n data: this.studentsList\n },\n yAxis: {},\n series: [{\n name: 'Notes',\n type: 'bar',\n data: this.values\n }]\n };\n\n \n myChart1.setOption(option);\n }", "function onDataReceived_dayTotalEnergyPlot(series) {\n\n\t\t\t// extract the first coordinate pair so you can see that\n\t\t\t// data is now an ordinary Javascript object\n\t\t\tvar firstcoordinate = '(' + series.data[0][0] + ', ' + series.data[0][1] + ')';\n\n\t\t\t// let's add it to our current data\n\t\t\tif (!alreadyFetched[series.label]) {\n\t\t\t\talreadyFetched[series.label] = true;\n\t\t\t\tdayTotalEnergyData.push(series);\n\t\t\t}\n\t\t\t//debugger;\n\n\t\t\t// and plot all we got\n\t\t\t$.plot(dayTotalEnergyPlaceholder, dayTotalEnergyData, dayTotalEnergyOptions);\n\t\t\t//Now, for shits and giggles, lets do some maths!\n\n\t\t}", "function createMaster(chartindex) {\r\n Highcharts.setOptions({\r\n global: {\r\n\t useUTC : false //puts timestamp axis in local time\r\n }\r\n });\r\n $('#master-container'+chartindex).highcharts('StockChart', {\t\r\n\t chart : {\r\n events : {\r\n load : function () {\r\n\t\t if (charts[chartindex].ios) {\r\n\t\t\t var cardlist = [\"cardA\", \"cardB\",\"cardC\", \"cardD\"];\r\n\t\t\t var ios = charts[chartindex].ios;\r\n\t\t\t var card = cardlist[charts[chartindex].card];\r\n\t\t\t var channel = charts[chartindex].channel;\r\n\t\t\t var series = this.series[0];\r\n\t\t\t var iosresults=[];\r\n\t\t\t setInterval(function() {\r\n\t\t\t //alert(JSON.stringify(data[data.length-1][0]))\r\n\t\t\t var getting = $.getJSON(path+fivesecdb+recents[charts[chartindex].ios]+options,function(result){\r\n\t\t\t\t iosresults = result.rows[0].value;\r\n\t\t\t });\r\n\t\t\t getting.done(function() {\r\n\t\t\t\t var timestamp = iosresults.timestamp;\r\n\t\t\t\t var value = iosresults[card][\"voltages\"][channel];\r\n\t\t\t\t series.addPoint([timestamp*1000, value], true, true);\r\n\t\t\t });\r\n\t\t\t }, 5000);\r\n\t\t } else {\r\n\t\t\t var type = charts[chartindex].type\r\n\t\t\t var channel = charts[chartindex].channel;\r\n\t\t\t var series = this.series[0];\r\n\t\t\t var deltavresults=[];\r\n\t\t\t setInterval(function() {\r\n\t\t\t var getting = $.getJSON(path+onemindb+\"/_view/pi_db\"+options,function(result){\r\n\t\t\t\t deltavresults = result.rows[0].value;\r\n\t\t\t });\r\n\t\t\t getting.done(function() {\r\n\t\t\t\t var timestamp = deltavresults.timestamp;\r\n\t\t\t\t var value = deltavresults[type][\"values\"][channel];\r\n\t\t\t\t if (value!=null) {\r\n\t\t\t\t series.addPoint([timestamp*1000, value], true, true);\r\n\t\t\t\t };\r\n\t\t\t });\r\n\t\t\t }, 5000);\r\n }\r\n\t\t }\r\n }\r\n },\r\n\t rangeSelector: {\r\n buttons: [{\r\n count: 5,\r\n type: 'minute',\r\n text: '5m'\r\n }, {\r\n count: 1,\r\n type: 'hour',\r\n text: '1hr'\r\n }, {\r\n\t\t count: 6,\r\n type: 'hour',\r\n text: '6hr'\r\n }, {\r\n type: 'all',\r\n text: 'All'\r\n }],\r\n inputEnabled: false, //prevents date range input \r\n selected: 1 //selects which button should be automatically pressed when the chart loads\r\n },\r\n\t \r\n title : {\r\n text : charts[chartindex].name \r\n },\r\n\r\n exporting: {\r\n enabled: true\r\n },\r\n\r\n series : [{\r\n name : 'Voltage',\r\n\t data : charts[chartindex].data\r\n }]\r\n });\r\n }", "function drawChart(loc, cycle, ctitle, xtitle, ytitle, dataname, pointnum, xvalue, yvalue){\n\tHighcharts.setOptions({global: {useUTC: false}});\n \n\t$(loc).highcharts({\n\t\tchart: {\n\t\t\ttype: 'spline',\n\t\t\tanimation: Highcharts.svg, // don't animate in old IE\n\t\t\tmarginRight: 10,\n\t\t\tevents: {\n\t\t\t\tload: function() { \n\t\t\t\t\t// set up the updating of the chart each second\n\t\t\t\t\tvar series = this.series[0];\n\t\t\t\t\tsetInterval(function() {\n\t\t\t\t\t\tvar x = eval(xvalue), // current time\n\t\t\t\t\t\t\ty = eval(yvalue);\n\t\t\t\t\t\tseries.addPoint([x, y], true, true);\t\t\t\t\t\t\t\n\t\t\t\t\t}, cycle * 1000);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\ttitle: {text: ctitle},\n\t\txAxis: {\n\t\t\ttype: 'datetime',\n\t\t\ttitle: {text: xtitle}\n\t\t},\n\t\tyAxis: {\n\t\t\ttitle: {text: ytitle},\n\t\t\tplotLines: [{value: 0, width: 1, color: '#808080'}]\n\t\t},\n\t\ttooltip: {\n\t\t\tformatter: function() {\n\t\t\t\t\treturn '<b>'+ this.series.name +'</b><br/>'+\n\t\t\t\t\tHighcharts.dateFormat('%Y-%m-%d %H:%M:%S', this.x) +'<br/>'+\n\t\t\t\t\tHighcharts.numberFormat(this.y, 2);\n\t\t\t}\n\t\t},\n\t\tlegend: {enabled: false},\n\t\texporting: {enabled: false},\n\t\tseries: [{\n\t\t\tname: dataname,\n\t\t\tdata: (function() {\n\t\t\t\t//generate an array of default data, initialize the graph\n\t\t\t\tvar data = [], i; \n\t\t\t\tfor (i = -(pointnum-1); i <= 0; i++) {\n\t\t\t\t\tdata.push({\n\t\t\t\t\t\tx: eval(xvalue) + i * 1000,\n\t\t\t\t\t\ty: 0\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn data;\t\t\t\t\t\n\t\t\t})()\n\t\t}]\n\t});\n}", "function addDataTimeline(chart, dataElement) {\n dataset = {\n label: dataElement.type,\n data: dataElement.data.data,\n title: dataElement.data.title,\n pointRadius: 7,\n backgroundColor: dataElement.background,\n borderColor: dataElement.border,\n };\n chart.data.datasets.push(dataset);\n chart.update();\n}", "function changeGraphicTypeByChart(chart_id, type){\n\tvar highcharts = getChartById(chart_id);\n\tif(highcharts != null){\n\t\tvar series = highcharts.series;\n\t\tif(type == CONST_PIE){\n\t\t\t// caso seja para alterar para o grafico de pizza\n\n\t\t\t// recuperando as categories do grafico barra/linha\n\t\t\tvar categories = getCategoriesByChart(CONST_CHART);\n\t\t\t// recuperando as series do grafico barra/linha\n\t\t\tvar series_chart = getChartById(CONST_CHART).series;\n\t\t\t// criando nova serie para gerar o grafico de pizza\n\t\t\tvar serie = groupSeriesToCreateAPie(categories, series_chart);\n\t\t\t// removendo todas as series antigas\n\t\t\tfor(var i = 0; i < series.length; i++){\n\t\t\t\tseries[i].remove();\n\t\t\t\ti--;\n\t\t\t}\n\t\t\thighcharts.type = type;\n\t\t\thighcharts.addSeries({\n\t\t\t\ttype: type,\n\t\t\t\tname: SUM_TOTAL,\n\t\t\t\tdata: serie\n\t\t\t});\n\t\t} else {\n\t\t\t// caso seja barra ou linha\n\t\t\tfor(var i = 0; i < series.length; i++){\t\n\t\t\t\tseries[i].update({\n\t type: type\n\t });\n\t\t\t}\n\t\t}\n\t}\n}", "function createCameraReports(devicesSerialNo, devicePassNo, deviceFailNo)\n{\n $('#cameragraph').highcharts({\n chart: {\n type: 'column'\n },\n title: {\n text: ''\n },\n xAxis: {\n categories: devicesSerialNo\n },\n yAxis: {\n min: 0,\n title: {\n text: 'Test Cases Report'\n }\n },\n tooltip: {\n headerFormat: '<span style=\"font-size:10px\">{point.key}</span><table>',\n pointFormat: '<tr><td style=\"color:{series.color};padding:0\">{series.name}: </td>' +\n '<td style=\"padding:0\"><b>{point.y:.1f}</b></td></tr>',\n footerFormat: '</table>',\n shared: true,\n useHTML: true\n },\n plotOptions: {\n column: {\n maxPointWidth: 30,\n //pointPadding: 0.1,\n groupPadding: 0.3,\n borderWidth: 0\n }\n },\n series: [{\n name: 'Pass',\n data: devicePassNo,\n color: '#4caf50'\n\n }, {\n name: 'Fail',\n data: deviceFailNo,\n color: 'red'\n\n }, ]\n });\n}", "function create_highchart_series(chart, metric, click_series_fn) {\n\n if (metric.color == null) {\n var new_color = colors[0];\n for (var j=0; j<colors.length; j++) {\n var used = false;\n for (var k=0; k<chart.metrics.length; k++) {\n if (chart.metrics[k].color == colors[j]) {\n used=true;\n break;\n }\n }\n if (!used) {\n new_color = colors[j];\n break;\n }\n }\n metric.color = new_color;\n }\n\n var label = metric.label;\n if (label == null) {\n label = metric.name + \" (\" + metric.agg + \")\";\n }\n\n var r = hexToR(metric.color);\n var g = hexToG(metric.color);\n var b = hexToB(metric.color);\n if (metric.series != null) {\n return {\n name : label,\n type : metric.type,\n color : \"rgba(\" + r + \",\" + g + \",\" + b + \", .8)\",\n yAxis : metric.left ? 0 : 1,\n data: metric.series.data,\n labels: metric.series.labels,\n stack : metric.left ? 0 : 1,\n events: {\n click: function(event) {\n click_series_fn(chart, this.index, event.point.x);\n }\n }\n };\n }\n return null;\n}", "function mostrarSeries(){\n for(let posicion=0; posicion<series.length; posicion++){\n document.write('<br> Serie: '+series[posicion],'<br>');\n }\n}", "async addPointsToHFEvent(eventId, fields, points) {\n const res = await this.post('events/' + eventId + '/series',\n {\n format: 'flatJSON',\n fields: fields,\n points: points\n });\n if (!res.status === 'ok') {\n throw new Error('Failed loading serie: ' + JSON.stringify(res.status));\n }\n return res;\n }", "function addLabel(chart_name, new_label) {\n chart_name.data.labels.push(new_label); \n chart_name.update();\n}", "function addPoints() {\n\t//for every station in the dataset, create a marker\n for(var i=0; i<dataTrento.length; i++) {\n var station=dataTrento[i];\n createMarker(station);\n }\n for(var i=0; i<dataPergine.length; i++) {\n var station=dataPergine[i];\n createMarker(station);\n }\n for(var i=0; i<dataRovereto.length; i++) {\n var station=dataRovereto[i];\n createMarker(station);\n }\n}", "function make_series (id){\n\n var color = d3.scaleOrdinal(d3.schemeCategory10);\n var colorBar = ['#c6dbef','#9ecae1','#6baed6','#3182bd','#08519c',\"#05294d\"];\n\n //Title\n var sHead = d3.select(\"#\"+id).select(\"thead\");\n\n sHead.selectAll(\"tr\")\n .append('th');\n\n //Colours\n var series = d3.select(\"#\" + id).select(\"tbody\");\n\n if(id !== \"edu_tbl\") {\n series.selectAll(\"tr\")\n .append('td')\n .html(function (d, i) {\n return '<svg width=\"20\" height=\"20\"><title>Series color</title><rect width=\"20\" height=\"20\" fill=\"' + color(i) + '\"/> </svg>'\n });\n }\n else{\n series.selectAll(\"tr\")\n .append('td')\n .html(function (d, i) {\n return '<svg width=\"20\" height=\"20\"><title>Series color</title><rect width=\"20\" height=\"20\" fill=\"' + colorBar[i] + '\"/> </svg>'\n });\n }\n\n}", "function addDataPie(chart, dataArray) {\n dataset = {\n data: dataArray,\n title: \"hjhjhjh\",\n backgroundColor: [\n \"#ffc200\",\n \"#ffce32\",\n \"#ffda66\",\n \"#ffe07f\",\n \"#ffecb2\",\n \"#fff8e5\",\n \"#777777\",\n \"#92f28e\",\n \"#a7f4a4\",\n \"#bdf7bb\",\n \"#d3f9d1\",\n \"#e9fce8\",\n \"#ffffff\",\n ],\n };\n chart.data.datasets.push(dataset);\n chart.update();\n}", "addPoint(point) {\n this._points.push(point);\n }", "function updateSparklineChartDemo(source){\n \n var y = Math.round(Math.random() * 100);\n// var data = scope[source + 'IngestRateConfig'].series[0].data;\n// data.push(y);\n scope[source + 'IngestRateToday'] = y;\n// if(data.length > 20) data.shift();\n }", "function buildSeries(tags, line_data) {\n var datasets = new Array();\n\n // Build the datasets for line and bar graphs\n for (var i=0;i<tags.length;i++) {\n if (SINGLEGRAPH_IGNORE_TAGS.indexOf(tags[i]) === -1) {\n datasets.push(\n {\n name:tags[i],\n data:line_data[tags[i]],\n tooltip:{valueDecimals:2},\n });\n }\n }\n\n return datasets;\n}", "addWordSeries(word_id, series_id) {\n return new Promise((resolve, reject) => {\n db.transaction(tx => {\n tx.executeSql(\n WordSeries.Query.INSERT_WORDSERIES_QUERY,\n [word_id, series_id],\n (null)\n )\n }, error => {\n reject(error);\n }, success => {\n resolve(true);\n })\n })\n }", "function visualizeExtraRunIn2016(extraRunIn2016) {\n\n let seriesData = [];\n for (let runs in extraRunIn2016) {\n seriesData.push([runs, extraRunIn2016[runs]]);\n }\n\n Highcharts.chart(\"extra-run-in-2016\", {\n chart: {\n type: \"column\"\n },\n title: {\n text: \"3. Extra Runs By Each Team In 2016\"\n },\n subtitle: {\n text:\n 'Source: <a href=\"https://www.kaggle.com/nowke9/ipldata/data\">IPL Dataset</a>'\n },\n xAxis: {\n type: \"category\",\n title: {\n text: \"Teams\"\n }\n },\n yAxis: {\n min: 0,\n title: {\n text: \"Extra Runs\"\n }\n },\n tooltip: {\n headerFormat: '<span style=\"font-size:13px\"><b>{point.key}</b></span><table>',\n pointFormat:\n '<tr><td style=\"color:{series.color};padding:0\">{series.name}: </td>' +\n '<td style=\"padding:0\"><b>{point.y:.1f} </b></td></tr>',\n footerFormat: \"</table>\",\n shared: true,\n useHTML: true\n },\n series: [\n {\n name: \"Extra Run\",\n data: seriesData\n }\n ]\n });\n}", "addChartsToStocks(stocks, chartResult, range) {\n stocks.forEach((stock) => {\n stock['chart'] = chartResult[stock.symbol]['chart'];\n });\n }", "function addEnsInstrumentGraph() {\r\n\t$('#instrumentationPane').append('<tr>' +\r\n\t\t\t'<td id=\"violinOne\" class=\"instrument\">V1</td>' +\r\n\t\t\t'<td id=\"violinTwo\" class=\"instrument\">V2</td>' +\r\n\t\t\t'<td id=\"viola\" class=\"instrument\">Va</td>' +\r\n\t\t\t'<td id=\"cello\" class=\"instrument\">C</td>' +\r\n\t\t\t'<td id=\"bass\" class=\"instrument\">B</td>' +\r\n\t\t'</tr>');\r\n}", "render() {\n var chartDataSet = [],\n newData = {labels: this.props.xAxis};\n \n if(this.props.data.length > 0) {\n\n let rawData = this.props.data;\n\n for(let i = 0 ; i < rawData.length; i++) {\n const stock = getChartDataSet(\n rawData[i].symbol, \n getStockTypeArr(rawData[i].data, this.props.stockType), \n rawData[i].info.color)\n chartDataSet.push(stock)\n }\n newData.datasets = chartDataSet;\n }\n \n return (\n <div id=\"stockchart\" className=\"left\">\n <Line data={newData} options={chartOption.op1}/>\n </div>\n )\n \n }", "function addLines(lines) {\n for (var j=0; j<lines.length;j++) {\n // create new line\n var linechart = newLine(lines[j].id)\n // attach data\n linechart\n .data(lines[j].values)\n // refresh\n linechart(); \n }\n }", "function highChart(xAxisArr,yAxisArray,subTitle,yTitle){\n var chart = Highcharts.chart('container', {\n title: {\n text: 'IPL Match'\n },\n subtitle: {\n text: subTitle\n },\n xAxis: {\n categories: xAxisArr\n },\n yAxis: {\n title:{\n text:yTitle,\n align:'middle'\n }\n },\n series: [{\n type: 'column',\n colorByPoint: true,\n data: yAxisArray,\n showInLegend: false\n }] \n });\n}", "function drawDailyGraph(canvas, title, data, min, max) {\n //var chart = new Highcharts.Chart({\n $(\"#\" + canvas).highcharts({\n chart: {\n type: 'spline',\n zoomType : 'xy'\n },\n title: {\n text: title \n },\n xAxis: {\n type: 'datetime',\n dateTimeLabelFormats: { // don't display the dummy year\n month: '%e. %b',\n year: '%b'\n },\n title: {\n text: 'Datetime'\n }\n },\n yAxis: {\n title: {\n text: 'unit according to measured counter'\n },\n min: min,\n max: max\n },\n tooltip: {\n headerFormat: '<b>{series.name}</b><br>',\n pointFormat: '{point.x:%H:%M:%S}: {point.y:.2f} '\n },\n plotOptions: {\n spline: {\n marker: {\n enabled: false\n }\n }\n },\n series: data\n });\n}", "function buildChart(temp, chart){\n // chart.data.datasets.forEach((dataset) => {\n // dataset.data.push(data);\n // });\n chart.data.datasets[0].data.push(temp[0])\n chart.data.datasets[0].data.push(parseInt(temp[1]))\n chart.data.datasets[0].data.push(parseInt(temp[2]))\n chart.data.datasets[0].data.push(parseInt(temp[1])) - chart.data.datasets[0].data.push(temp[0])\n chart.data.datasets[0].data.push(parseInt(temp[2])) - chart.data.datasets[0].data.push(temp[0])\n chart.update();\n }", "function createSubmissionChart(dataOfConference,nameOfConference,div){\n console.log(\"dataOfConference is::\");\n console.log(dataOfConference);\n var hchart_submission = new Highcharts.Chart({\n lang :{\n noData : \"No Data to display!\"\n },\n chart:{\n renderTo : \"submissionStatus\",\n type : \"bar\"\n },\n credits: {\n enabled: false\n },title: {\n text: \"Submission Status of \"+nameOfConference\n },xAxis: {\n categories: ['Complete', 'Incomplete','Accepted','Rejected','Closed'],\n title: {\n text: null\n }\n },series :[{\n name : nameOfConference,\n data : dataOfConference\n }]\n \n });\n\n}", "function Si7021_hum() {\r\n var newDataset = {\r\n label: 'Hum_Si7',\r\n func: Si7021_hum,\r\n backgroundColor: \"rgb(13, 152, 87)\",\r\n borderColor: \"rgb(13, 152, 87)\",\r\n data: [],\r\n fill: false\r\n };\r\n if (config.data.datasets.find( element =>element.label === newDataset.label) ){\r\n console.log ( \"Ya existe esta grafica\");\r\n }else{\r\n for (const prop in LocalDatabase_digital){\r\n if(LocalDatabase_digital[prop].Si7021){\r\n newDataset.data.push({x:LocalDatabase_digital[prop].timestamps.substr(11,5) , y:LocalDatabase_digital[prop].Si7021.Humi});\r\n }\r\n }\r\n config.data.datasets.push(newDataset);\r\n updateChart();\r\n }\r\n}", "render(budget_expense_series, viewing_income, grand_total) {\n this.chart = new Highcharts.Chart({\n chart: {\n renderTo: this.el,\n backgroundColor: null\n },\n credits: {\n text: \"[Budget 2013]\",\n href: \"http://www.treasury.govt.nz/\"\n },\n title: {\n text: this.render_title_text(viewing_income, grand_total),\n margin: 20,\n style: {\n fontSize: \"16px\",\n \"font-family\": \"Helvetica, Arial, sans-serif\"\n }\n },\n tooltip: {\n formatter: format_tooltip\n },\n legend: {\n enabled: false\n },\n series: [{\n type: \"pie\",\n data: budget_expense_series,\n size: \"100%\"\n }],\n plotOptions: {\n pie: {\n allowPointSelect: true,\n cursor: \"pointer\",\n dataLabels: {\n formatter() {\n // Draw a label for only thick slices.\n if (this.percentage > 5.6) {\n // Split long labels every two words.\n return this.point.name.replace(/(\\w+ \\w+)/g, \"$1<br/>\");\n }\n },\n distance: -70,\n style: {\n font: \"normal 11px sans-serif\"\n },\n // A little nudging to keep text inside their slices.\n y: -4\n },\n point: {\n events: {\n mouseOver() { return appModel.trigger(\"dept_mouseover\", this.name); },\n select() { return appModel.trigger(\"dept_select\", this.name); }\n }\n }\n }\n }\n });\n }", "function visualizeMatchesPlayedPerYear(matchesPlayedPerYear) {\n const seriesData = [];\n for (let year in matchesPlayedPerYear) {\n seriesData.push([year, matchesPlayedPerYear[year]]);\n }\n console.log(seriesData, \"played per year\");\n Highcharts.chart(\"matches-played-per-year\", {\n chart: {\n type: \"column\",\n },\n title: {\n text: \"Matches Played Per Year\",\n },\n subtitle: {\n text:\n 'Source: <a href=\"https://www.kaggle.com/nowke9/ipldata/data\">IPL Dataset</a>',\n },\n xAxis: {\n type: \"category\",\n },\n yAxis: {\n min: 0,\n title: {\n text: \"Matches\",\n },\n },\n series: [\n {\n name: \"Years\",\n data: seriesData,\n },\n ],\n });\n}", "function drawChart(dataFromServer) {\n\tvar data = new google.visualization.DataTable();\n\t\n\tvar stats = dataFromServer['stats'];\n\t\n\tvar possible_cols = ['Week','Goals','Assists','Saves','Shots','Points']\n\n\tvar col1 = stats[0][0];\n\tvar numSeries = stats[0].length-1;\n\t//Column 0 will always have 'Week', so we can skip this in the loop\n\tdata.addColumn('string',col1);\n\tvar seriesPrep = {};\n\tvar axesPrep = {0:{title:'Number'},1:{title:'Points'}};\n\t\n\tfor(i=1;i<stats[0].length;i++)\n\t{\n\t\tconsole.log(stats[0][i]);\n\t\tdata.addColumn('number',stats[0][i]);\n\t\tif (stats[0][i]==='points') {\n\t\t\tvar j = i -1;\n\t\t\tseriesPrep[j] = {targetAxisIndex:1};\n\t\t}\n\t\telse {\n\t\t\tvar j = i -1;\n\t\t\tseriesPrep[j] = {targetAxisIndex:0};\n\t\t}\n\t}\n\tconsole.log(seriesPrep);\n\tconsole.log(axesPrep);\n\n\tfor (i=1;i<stats.length;i++) {\n\t\tdata.addRow(stats[i]);\n\t}\n\n\tvar materialOptions = {\n\t\ttitle: 'Performance by Season and Week',\n\t\tchartArea: {left:0, top:20},\n\t\tcurveType: 'function',\n\t\twidth: $(document).width()/3,\n\t\theight: 400\n\t};\n\tmaterialOptions.series = seriesPrep;\n\tmaterialOptions.vAxes = axesPrep;\n\t\n\tvar chart = new google.visualization.LineChart(document.getElementById('chart_div'));\n\n\tchart.draw(data,materialOptions);\n}", "function createHighChart() {\n var fakeData = dummyData(100, 100);\n $('#Chart1').highcharts({\n chart: {zoomType: 'xy', alignTicks: false, type: 'line', animation: false},\n credits: {enabled: false},\n exporting: {enabled: false},\n legend: {enabled: false},\n title: {text: null, style: {fontSize: \"12px\", color: \"black\"}},\n tooltip: {shared: true},\n plotOptions: {line: {animation: false}},\n xAxis: [{type: \"datetime\", crosshair: true, labels:{style: {fontSize: \"8px\"}}}],\n yAxis: [{endOnTick: false, startOnTick: false, lineWidth: 0.75, title: {text: null, style: {color: plotColors.pv}},\n labels:{format: \"\", style: {fontSize: \"8px\", color: plotColors.pv}}},\n ],\n series: [\n {data: fakeData, id: 'CANData', name: 'CAN Data', lineWidth: 0.75, color: plotColors.pv, marker: {enabled: false}, yAxis: 0},\n ]\n });\n return $('#Chart1').highcharts();\n}", "function fIsForFamily() {\n $('#graph').highcharts({\n chart: {\n backgroundColor: \"#17202A\",\n spacingTop: 24,\n style: {\n fontSize: 12,\n fontFamily: 'Oxygen, sans-serif',\n fontWeight: 300,\n }\n },\n navigation: {\n buttonOptions: {\n theme: {\n fill: '#333333',\n stroke: '#000',\n states: {\n hover: {\n fill: '#474747',\n stroke: '#333',\n },\n select: {\n fill: '#474747',\n stroke: '#333',\n }\n }\n }\n }\n },\n yAxis: {\n max: 10,\n allowDecimals: false,\n title: {\n text: \"Average iMDb Rating\",\n style: {\n color: \"#FFF\",\n fontWeight: 300,\n }\n },\n labels: {\n style: {\n color: \"#999\",\n }\n },\n gridLineColor: 'rgba(255, 255, 255, .1)'\n },\n xAxis: {\n tickColor: \"#333\", // hide ticks\n lineColor: \"#333\", // hide line\n allowDecimals: false,\n title: {\n text: \"Episode Number\",\n style: {\n color: \"#FFF\",\n fontWeight: 300,\n }\n },\n labels: {\n style: {\n color: \"#999\",\n }\n }\n },\n title: {\n text: $('<div/>').html('F is for Family').text(),\n style: {\n color: \"#FFF\",\n font: '26px Lucida Sans Unicode',\n fontWeight: 300,\n }\n },\n legend: {\n enabled: false\n },\n credits: {\n href: \"http://graphtv.kevinformatics.com\",\n text: \"Inspiration from graphtv\"\n },\n tooltip: {\n useHTML: true,\n formatter: function() {\n return [\n \"<b>\", this.point.id, \"</b>\", \"<br>\",\n this.point.title, \"<br>\", \n \"Rating: \", this.point.rating, \"<br>\", \n \"Votes: \", this.point.votes\n ].join(\"\");\n }\n },\n series: [\n {\n name: 'Season 1',\n color: '#d179f2',\n data: [\n \n {\n x: 1,\n y: 7.6,\n imdb_id: '5218302',\n id: 's01e01',\n title: $('<div/>').html('The Bleedin&#39; in Sweden').text(),\n rating: '7.6',\n votes: '341'\n },\n \n {\n x: 2,\n y: 7.9,\n imdb_id: '5276208',\n id: 's01e02',\n title: $('<div/>').html('Saturday Bloody Saturday').text(),\n rating: '7.9',\n votes: '255'\n },\n \n {\n x: 3,\n y: 8.0,\n imdb_id: '5276214',\n id: 's01e03',\n title: $('<div/>').html('The Trough').text(),\n rating: '8.0',\n votes: '223'\n },\n \n {\n x: 4,\n y: 8.0,\n imdb_id: '5276218',\n id: 's01e04',\n title: $('<div/>').html('&#39;F&#39; Is for Halloween').text(),\n rating: '8.0',\n votes: '205'\n },\n \n {\n x: 5,\n y: 8.5,\n imdb_id: '5276222',\n id: 's01e05',\n title: $('<div/>').html('Bill Murphy&#39;s Day Off').text(),\n rating: '8.5',\n votes: '220'\n },\n \n {\n x: 6,\n y: 8.6,\n imdb_id: '5276226',\n id: 's01e06',\n title: $('<div/>').html('O Holy Moly Night').text(),\n rating: '8.6',\n votes: '212'\n },\n \n ],\n marker: {\n radius: 4,\n symbol: \"circle\"\n }\n },\n \n ]\n });\n}", "function highchart_data_tendance(sums) {\n var admissions = [], sorties =[], fin_semaine = [], weeks=[];\n $.each(sums, function (index, obj) {\n var somme_admissions = obj.total_debut_semaine + obj.ptb + obj.oedemes + obj.rechute + obj.readmission + obj.transfert_interne_i\n ;\n var somme_sorties = obj.gueri + obj.deces + obj.abandon + obj.non_repondant + obj.transfert_interne_o;\n var somme_fin = somme_admissions - somme_sorties;\n admissions.push(Math.round(somme_admissions));\n sorties.push(Math.round(somme_sorties));\n fin_semaine.push(Math.round(somme_fin));\n weeks.push(index);\n });\n var donnees = [{data: admissions, name: \"Admissions\"}, {data: sorties,name: \"Sorties\"}, {data: fin_semaine, type: 'spline', name: \"Total fin de semaine\", marker: {lineWidth: 2, lineColor: Highcharts.getOptions().colors[3], fillColor: 'white'}}];\n return [donnees, weeks];\n}", "function onAdd(){\n // get the inputs\n var input_name = document.getElementById(\"nameInput\").value;\n var type = document.getElementById(\"typeInput\").value;\n var quant = parseFloat( document.getElementById(\"quantityInput\").value );\n var price = parseFloat( document.getElementById(\"priceInput\").value );\n\n // if type is not entered then we will consider input_name as itself a type!\n if( type == \"\"){\n type = input_name;\n }\n\n // \n var isFound = false;\n var data_points = chart.options.data[0].dataPoints;\n for(var i = 0; i < data_points.length; i++){\n if( data_points[i].name == type){\n var assets = data_points[i].assets;\n var assetFound = false;\n for(var j = 0; j < assets.length; j++){\n if( assets[j].name == input_name){\n alert(\"This asset is already present!\");\n assetFound = true;\n } \n }\n\n if( !assetFound){\n assets.push( { \n y: price * quant, \n name: input_name, \n price: price, \n quantity: quant, \n exploded: false\n } );\n\n data_points[i].y += price * quant;\n }\n isFound = true;\n }\n }\n\n // if the type of currency is not present add it\n if( !isFound){\n // lets add the item to out chart\n data_points.push( { \n y: price * quant, \n name: type, \n assets: [], \n exploded: false\n } );\n \n // lets not forget to update sub_chart\n var assets = data_points[data_points.length - 1].assets;\n assets.push({ \n y: price * quant, \n name: input_name, \n price: price, \n quantity: quant, \n exploded: false\n } );\n }\n \n // render\n chart.render();\n sub_chart.render();\n}", "function createMasterD(chartindex) {\r\n Highcharts.setOptions({\r\n global: {\r\n\t useUTC : true //puts timestamp axis in local time\r\n }\r\n });\r\n $('#master-container'+chartindex).highcharts('StockChart', {\t\r\n\t /*chart : {\r\n events : {\r\n load : function () {\r\n var label = this.renderer.label(charts[chartindex].date, 100,120).add();\r\n setTimeout(function () {\r\n label.fadeout();\r\n }, 3000);\r\n\t\t }\r\n }\r\n },*/\r\n\t rangeSelector: {\r\n buttons: [{\r\n count: 5,\r\n type: 'minute',\r\n text: '5m'\r\n }, {\r\n count: 1,\r\n type: 'hour',\r\n text: '1hr'\r\n }, {\r\n\t\t count: 6,\r\n type: 'hour',\r\n text: '6hr'\r\n }, {\r\n type: 'all',\r\n text: 'All'\r\n }],\r\n inputEnabled: false, //prevents date range input \r\n selected: 1 //selects which button should be automatically pressed when the chart loads\r\n },\r\n\t \r\n title : {\r\n text : charts[chartindex].name + \" , \" + charts[chartindex].date\r\n },\r\n\r\n exporting: {\r\n enabled: true\r\n },\r\n\r\n series : [{\r\n name : 'Voltage',\r\n\t data : charts[chartindex].data\r\n }]\r\n });\r\n }", "function ScatterChartSeries() {\n\t _classCallCheck(this, ScatterChartSeries);\n\t\n\t for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n\t args[_key] = arguments[_key];\n\t }\n\t\n\t /**\n\t * previous clicked index.\n\t * @type {?number}\n\t */\n\t var _this = _possibleConstructorReturn(this, _Series.call.apply(_Series, [this].concat(args)));\n\t\n\t _this.prevClickedIndex = null;\n\t return _this;\n\t }", "function plotRawStatistics(results) {\n self.configureHighchartsPie();\n var points = [];\n angular.forEach(results, function(item, key) {\n\n var point = {\n 'name': key,\n 'y': item\n }\n points.push(point);\n\n });\n self.chartConfig.series.push({data: points});\n\n }", "function ChartSeries(label, color, values, flags, offset) {\n\tthis.label = label;\n\tthis.color = color;\n\tthis.values = values;\n\tthis.flags = flags;\n\tthis.offset = offset;\n}", "function add(){\n\n \tvar progress = Math.floor((i/(parsed.length-1))*100);\n \ttinybudget.viewmodel.csvLoadBarProgress(progress);\n\n \t//console.log(progress);\n \tvar gluedDate = parsed[i].month +\"/\"+ parsed[i].day +\"/\"+ parsed[i].year;\n // loadedFromServer set to True, prevents auto loading to server\n var row = new rowitem(true,parsed[i].desc,parsed[i].amt,gluedDate,parsed[i].cat,parsed[i].itemid,null,null);\n tinybudget.viewmodel.userItems.push(row);\n\n\n if (i >= parsed.length-1){\n \treturn;\n } else if (parsed.length - i == 2){\n // if there is 1 item left in parsed to add to the viewmodel, enable highcharts to render when triggered\n tinybudget.viewmodel.sorting = false;\n i++;\n \tsetTimeout(add,100);\n }else {\n \ti++;\n \tsetTimeout(add,100);\n }\n }" ]
[ "0.7620622", "0.7334544", "0.705951", "0.7002387", "0.6879844", "0.6511024", "0.64162505", "0.6291845", "0.6285553", "0.6232612", "0.6224276", "0.6188661", "0.61150205", "0.61108863", "0.610223", "0.60997015", "0.6095512", "0.6060811", "0.6024232", "0.6022714", "0.6002816", "0.59692115", "0.59359294", "0.591348", "0.5911961", "0.5865921", "0.583657", "0.5826996", "0.58262104", "0.58256173", "0.5815556", "0.5815197", "0.578266", "0.5781255", "0.5778621", "0.57769716", "0.5759041", "0.5757041", "0.5738734", "0.572261", "0.57209617", "0.5719334", "0.57175714", "0.57155865", "0.56919384", "0.56870675", "0.56750625", "0.56732434", "0.56397", "0.56340337", "0.56324035", "0.5590938", "0.5590062", "0.5581652", "0.5559215", "0.553029", "0.5520693", "0.5515242", "0.55033344", "0.5501649", "0.54983896", "0.54830277", "0.5451389", "0.5420945", "0.5417238", "0.54151267", "0.5408663", "0.5395867", "0.53820264", "0.53706944", "0.5370427", "0.53667164", "0.5364854", "0.53642917", "0.5362933", "0.53590965", "0.5349915", "0.5349759", "0.53490514", "0.5340978", "0.5333962", "0.5333725", "0.53299516", "0.5326091", "0.53198767", "0.5319668", "0.53173935", "0.5317158", "0.5307534", "0.5306151", "0.5303038", "0.5290428", "0.52897245", "0.5286461", "0.5281865", "0.5280777", "0.52796566", "0.52696776", "0.5268762", "0.5267796" ]
0.66059595
5
called on chart redraw (multiple times)
function chartRedrawEvent(chart) { // track zoom state let wasZoomed = chartIsZoomed; chartIsZoomed = !!(chart.resetZoomButton); chart.yAxis.forEach(function(axis, index) { let extremes = axis.getExtremes(); let chartIncludeMin = Math.min(...chartIncludeValues[index]); let chartIncludeMax = Math.max(...chartIncludeValues[index]); // reset extremes to auto if zoomed if (chartIsZoomed && (chartIsZoomed!=wasZoomed)) { axis.setExtremes(null,null); } // set extremes to include the chartIncludeValues for non zoomed if (!chartIsZoomed && (chartIncludeMin<extremes.min || chartIncludeMax>extremes.max)) { axis.setExtremes(Math.min(extremes.min,chartIncludeMin), Math.max(extremes.max,chartIncludeMax)); } }); // reset x extremes if exiting zoom if (wasZoomed && (chartIsZoomed!=wasZoomed) && chartXStart && chartXEnd) { chart.xAxis[0].setExtremes(chartXStart, chartXEnd); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateChart () {\n \n }", "function redraw(){\n chart.isDirtyBox=true;\n chart.chartWidth=chart.containerWidth;\n chart.reflow();\n chart.redraw();\n }", "function updateChart() {\n removePreviousChart();\n emptyChartData(chart);\n filterCategoryInsertion();\n displayChart(chart);\n}", "function chartDataChanged() {\n clearTimeout(chartUpdateDelay);\n chartUpdateDelay = setTimeout(function() {\n chartUpdateDelay = null;\n updateData();\n }, 250);\n }", "function updateChart() {\n if(hasChartBeenMade === false) {\n makeChart();\n } else {\n myChart.data.labels = chartLabels;\n myChart.data.datasets[0].data = chartValues;\n }\n}", "function OnDataLoaded() {\n\t\tobjChart.showWaiting(false);\t\t\t\t\n\t\tobjChart.reorganize();\t\t\n\t}", "_drawChart()\n {\n\n }", "function resizeChart() {\n if (chart && chart.update) {\n chart.update();\n }\n }", "updateChart() {\n let xLabel = this.getChartX();\n let yLabel = this.getChartY();\n let t = this.getChartTargetArray();\n this.setChartData(this.json[xLabel], this.json[yLabel], t, xLabel, yLabel, this.getModel());\n }", "@action.bound refreshChart() {\n this.newChart();\n }", "function OnReorgDone() {\n\t\tobjChart.showWaiting(false);\n\t\tobjChart.zoomToFitEx(true, 1,false);\n\t}", "update () {\r\n\t\tvar svg = d3.select(this.element);\r\n\t\tsvg.selectAll('*').remove();\r\n\t\tthis.drawChart();\r\n\t}", "function refreshChart() {\n removeSVGElements();\n dataset = randomData();\n datasetDegrees = datasetFromNumbersToDegrees(dataset);\n reverseArray(dataset);\n reverseArray(datasetDegrees);\n\n drawCircle(dataset, datasetColors[0]);\n drawSlices(dataset, datasetDegrees, datasetColors);\n}", "function refreshChart() {\n ctrlChart.isLoading = true;\n // Update with the actual data.\n\n // Refresh electricity data.\n Electricity.refresh(FilterFactory.get('activeElectricityHash'));\n // Redraw the chart.\n render();\n }", "function postPlotDraw() {\n // Memory Leaks patch \n if (this.plugins.barRenderer && this.plugins.barRenderer.highlightCanvas) {\n\n this.plugins.barRenderer.highlightCanvas.resetCanvas();\n this.plugins.barRenderer.highlightCanvas = null;\n }\n \n this.plugins.barRenderer = {highlightedSeriesIndex:null};\n this.plugins.barRenderer.highlightCanvas = new $.jqplot.GenericCanvas();\n \n this.eventCanvas._elem.before(this.plugins.barRenderer.highlightCanvas.createElement(this._gridPadding, 'jqplot-barRenderer-highlight-canvas', this._plotDimensions, this));\n this.plugins.barRenderer.highlightCanvas.setContext();\n this.eventCanvas._elem.bind('mouseleave', {plot:this}, function (ev) { unhighlight(ev.data.plot); });\n }", "componentDidUpdate(prevProps) {\n if (prevProps.chartData.length !== this.props.chartData.length) {\n let chart = this.refs.chart.getChart();\n const chartReflow = chart.reflow;\n chart.reflow = () => {};\n setTimeout(() => (chart.reflow = chartReflow));\n } \n }", "update() {\n if (!this.suspendUpdate) {\n this.draw();\n this.legend.setSeriesViewRect(this.viewRect);\n this.legend.update();\n }\n }", "static updateChart() {\n\t\tif(ChartManager.chartType === 'verticalbattle' ||\n\t\t\tChartManager.chartType === 'horizontalbattle') {\n\t\t\tupdateBattleChart();\n\t\t\treturn;\n\t\t} else if(ChartManager.chartType === 'horizontalBar') {\n\t\t\tChartManager.updateBarChart();\n\t\t} else {\n\t\t\tChartManager.updateNonRadarChart();\t\n\t\t}\n\n\t\tChartManager.chart.config.data = ChartManager.chartData;\n\t\tChartManager.chart.update();\n\t}", "static updateChart() {\n\t\tif(ChartManager.chartType === 'verticalbattle' ||\n\t\t\tChartManager.chartType === 'horizontalbattle') {\n\t\t\tupdateBattleChart();\n\t\t\treturn;\n\t\t} else if(ChartManager.chartType === 'horizontalBar') {\n\t\t\tChartManager.updateBarChart();\n\t\t} else {\n\t\t\tChartManager.updateNonRadarChart();\t\n\t\t}\n\n\t\tChartManager.chart.config.data = ChartManager.chartData;\n\t\tChartManager.chart.update();\n\t}", "function postPlotDraw() {\n\t\t // Memory Leaks patch \n\t\t if (this.plugins.pieRenderer && this.plugins.pieRenderer.highlightCanvas) {\n\t\t this.plugins.pieRenderer.highlightCanvas.resetCanvas();\n\t\t this.plugins.pieRenderer.highlightCanvas = null;\n\t\t }\n\n\t\t this.plugins.pieRenderer = {highlightedSeriesIndex:null};\n\t\t this.plugins.pieRenderer.highlightCanvas = new $.jqplot.GenericCanvas();\n\n\t\t // do we have any data labels? if so, put highlight canvas before those\n\t\t var labels = $(this.targetId+' .jqplot-data-label');\n\t\t if (labels.length) {\n\t\t $(labels[0]).before(this.plugins.pieRenderer.highlightCanvas.createElement(this._gridPadding, 'jqplot-pieRenderer-highlight-canvas', this._plotDimensions, this));\n\t\t }\n\t\t // else put highlight canvas before event canvas.\n\t\t else {\n\t\t this.eventCanvas._elem.before(this.plugins.pieRenderer.highlightCanvas.createElement(this._gridPadding, 'jqplot-pieRenderer-highlight-canvas', this._plotDimensions, this));\n\t\t }\n\n\t\t var hctx = this.plugins.pieRenderer.highlightCanvas.setContext();\n\t\t }", "redraw() {\n\n }", "function updateChart(event) {\n var extent = event.selection\n var t1 = 0;\n var t2 = 0;\n update(selectedOption)\n\n if (brush.empty()) {\n t1 = 0;\n t2 = 0;\n tooltip.innerHTML = ('brush dots to show accumulative data');\n } else {\n\n data.forEach(function (d) {\n if (isBrushed(extent, x(d.iyear), y(d.nkill)))\n t1 += d.nkill;\n if (isBrushed(extent, x(d.iyear), y(d.nwound)))\n t2 += d.nwound;\n });\n tooltip.innerHTML = (\"In the selected region, the number of killed victim is \"+ t1+ \", the number of wounded victim is \" + t2 +\"<br />The ratio is \" + (t1/t2).toFixed(2) + \" to 1\");\n //console.log(t)\n scatterPlot.classed(\"selected\", function(d){ return b1 && isBrushed(extent, x(d.iyear), y(d.nkill) ) } )\n scatterPlot2.classed(\"selected\", function(d){ return b2 && isBrushed(extent, x(d.iyear), y(d.nwound) ) } )\n }\n\n\n\n\n }", "_chartJsChanged(newValue) {\n this.initChart(newValue);\n }", "function resizeChart() {\n selectedChart.renderChart();\n}", "function postPlotDraw() {\n // Memory Leaks patch \n if (this.plugins.pieRenderer && this.plugins.pieRenderer.highlightCanvas) {\n this.plugins.pieRenderer.highlightCanvas.resetCanvas();\n this.plugins.pieRenderer.highlightCanvas = null;\n }\n\n this.plugins.pieRenderer = {highlightedSeriesIndex:null};\n this.plugins.pieRenderer.highlightCanvas = new $.jqplot.GenericCanvas();\n \n // do we have any data labels? if so, put highlight canvas before those\n var labels = $(this.targetId+' .jqplot-data-label');\n if (labels.length) {\n $(labels[0]).before(this.plugins.pieRenderer.highlightCanvas.createElement(this._gridPadding, 'jqplot-pieRenderer-highlight-canvas', this._plotDimensions, this));\n }\n // else put highlight canvas before event canvas.\n else {\n this.eventCanvas._elem.before(this.plugins.pieRenderer.highlightCanvas.createElement(this._gridPadding, 'jqplot-pieRenderer-highlight-canvas', this._plotDimensions, this));\n }\n \n var hctx = this.plugins.pieRenderer.highlightCanvas.setContext();\n this.eventCanvas._elem.bind('mouseleave', {plot:this}, function (ev) { unhighlight(ev.data.plot); });\n }", "function postPlotDraw() {\n // Memory Leaks patch \n if (this.plugins.lineRenderer && this.plugins.lineRenderer.highlightCanvas) {\n this.plugins.lineRenderer.highlightCanvas.resetCanvas();\n this.plugins.lineRenderer.highlightCanvas = null;\n }\n \n this.plugins.lineRenderer.highlightedSeriesIndex = null;\n this.plugins.lineRenderer.highlightCanvas = new $.jqplot.GenericCanvas();\n \n this.eventCanvas._elem.before(this.plugins.lineRenderer.highlightCanvas.createElement(this._gridPadding, 'jqplot-lineRenderer-highlight-canvas', this._plotDimensions, this));\n this.plugins.lineRenderer.highlightCanvas.setContext();\n this.eventCanvas._elem.bind('mouseleave', {plot:this}, function (ev) { unhighlight(ev.data.plot); });\n }", "updateGraphicsData() {\n // override\n }", "function rerenderDoughnut() {\n doughnut.destroy();\n generateChart(typeTransaction, period);\n}", "didDrawChart () {\n this.sendAction ('draw');\n }", "function updateChart() {\n extent = d3.event.selection;\n // console.log(extent);\n // console.log(x.invert(extent[0][0]));\n // lol();\n myCircle.classed(\"selected\", function(d){ return isBrushed(extent, x(d.Sepal_Length), y(d.Petal_Length) ) } )\n }", "function redrawGraph() {\n // Generate data to pass to the graph.\n function get_dataset(i) {\n var dataSet;\n if (subtypeIndex[1] === null) {\n dataSet = calculateGraphPoints(1, 100, parseFloat(ligandTableCell(subtypeIndex[0] + 1, i).value));\n } else {\n dataSet = calculateGraphPoints(2,\n subtypePercentage[0],parseFloat(ligandTableCell(subtypeIndex[0] + 1, i).value),\n subtypePercentage[1],parseFloat(ligandTableCell(subtypeIndex[1]+1, i).value));\n }\n return dataSet\n }\n\n var data = [];\n for (var i = 0; i < 6; i++) {\n if (activeLigandRow()[i]) {\n var dataSet = get_dataset(i);\n var graph = {\n x: dataSet[0],\n y: dataSet[1],\n mode: 'lines',\n line: {\n color: colorTable[i],\n width: 1\n },\n name: ligandNames[ligandTableCell(0, i).value]\n\n };\n data.push(graph);\n }\n }\n\tplotGraph('myDiv',data, false, {staticPlot: true});\n}", "resetChart() {\n this.chart.data.datasets = this.helper.datasetLineLayers().datasets;\n this.chart.config.options.scales.yAxes[0].ticks.stepSize = 1;\n this.chart.update();\n }", "function updateChart() {\n d3elements.rows\n .selectAll('rect')\n .style('fill', function(d) {return colorScale(d);});\n }", "_destroyChart () {\n if (this.chart) {\n // TODO: remove events once they're implemented\n // if (this.chart.off) {\n // this.chart.off();\n // }\n delete this.chart;\n }\n }", "function setCountryData(countryIndex) {\n// instead of setting whole data array, we modify current raw data so that a nice animation would happen\nfor (var i = 0; i < lineChart.data.length; i++) {\nvar di = covid_cc_timeline[i].list;\n\nvar countryData = di[countryIndex];\nvar dataContext = lineChart.data[i];\nif (countryData) {\ndataContext.confirmed = countryData.confirmed;\ndataContext.deaths = countryData.deaths;\n\ndataContext.recovered = countryData.recovered;\ndataContext.active = countryData.confirmed - countryData.recovered - countryData.deaths;\nvalueAxis.min = undefined;\nvalueAxis.max = undefined;\n}\nelse {\ndataContext.confirmed = 0;\ndataContext.deaths = 0;\n\ndataContext.deaths = 0;\ndataContext.active = 0;\nvalueAxis.min = 0;\nvalueAxis.max = 10;\n}\n}\n\nlineChart.invalidateRawData();\nupdateTotals(currentIndex);\nsetTimeout(updateSeriesTooltip, 1000);\n}", "function update(newData) {\n clearGraph();\n graph.allSeries = newData;\n\n draw();\n }", "function redrawTotalLoanAmountChart() {\n nv.addGraph(function() {\n var chart = nv.models.lineChart()\n .useInteractiveGuideline(true);\n chart.width(700);\n chart.margin({left:100});\n chart.color(['#2ca02c', 'darkred','darkblue']);\n chart.x(function(d,i) { return i });\n chart.xAxis\n .axisLabel('Date')\n .tickFormat(function(d) {\n var label = scope.totalLoanAmountData[0].values[d].label1;\n return label;\n });\n chart.yAxis\n .axisLabel('Loan Value')\n .tickFormat(function(d){\n return d3.format(',f')(d);\n });\n d3.select('#totalLoanAmountchart svg')\n .datum(scope.totalLoanAmountData)\n .transition().duration(500)\n .call(chart);;\n nv.utils.windowResize(chart.update);;\n return chart;\n });\n }", "function redrawBallChart() {\n //setChartParameters();\n // svg.selectAll(\"g.y.axis\").call(yAxisGen);\n // svg.selectAll(\"g.x.axis\").call(xAxisGen);\n \n //selects all objects with the class solid, only one ball has that class in this case. \n svg.selectAll(\".solid\")\n .attr({\n cx: (ballDataToPlot - springLength)*parabolaXScale,\n cy: (height-topPad-textPad) - Math.pow((ballDataToPlot - springLength), 2) / parabolaYScale \n });\n\n if (newPoint) {\n svg.select(\".forTrace path\")\n .attr(\"d\", lineFunc(dataSet));\n newPoint = false;\n } \n }", "function updateChart(index) {\n dps_robo[index][\"y\"] = robo[index];\n dps_base[index][\"y\"] = base[index];\n dps_user[index][\"y\"] = user[index];\n chart.render();\n}", "function redrawWithoutAnimation() {\n\t // static update without animation\n\t graph.selectAll(\"path\")\n\t .data([dataSet[0]]) // set the new data\n\t .attr(\"d\", line); // apply the new data values\n\t }", "function resizeChart () {\n console.log('D3collisiondetectionController.resizeChart()');\n draw();\n }", "function updateChart() {\n extent = d3.event.selection;\n myCircle.classed(\"selected\", function(d){ return isBrushed(extent, x(d.xcol), y(d.ycol) ) } );\n }", "function update() {\n plot.setData([getRandomData()]);\n // Since the axes don't change, we don't need to call plot.setupGrid()\n plot.draw();\n setTimeout(update, updateInterval);\n }", "function updateCanvas() {\n clearGraph();\n\n updatePoints();\n}", "function updateChart(init) {\r\n\r\n // get current data range\r\n var dataRange = d3.extent(data, dateFn);\r\n\r\n // get the entire container height and width subtracting the padding\r\n var chartWidth = (document.getElementById('chartContainer')\r\n .getBoundingClientRect().width) - padding.left - padding.right;\r\n\r\n var chartHeight = (document.getElementById('chartContainer')\r\n .getBoundingClientRect().height) - padding.top - padding.bottom;\r\n\r\n // get the height of each chart based on its container size ratio\r\n focusHeight = chartHeight * .9;\r\n\r\n // only redraw chart if chart size has changed\r\n if ((prevChartWidth != chartWidth) || (prevChartHeight != chartHeight)) {\r\n\r\n prevChartWidth = chartWidth;\r\n prevChartHeight = chartHeight;\r\n\r\n //set the width and height of the SVG element\r\n charts.attr('width', chartWidth + padding.left + padding.right)\r\n .attr('height', chartHeight + padding.top + padding.bottom);\r\n\r\n // ranges are based on the width and height available so reset\r\n xScale.range([0, chartWidth]);\r\n yScale.range([focusHeight, 0]);\r\n\r\n if (init) {\r\n\r\n // if first run then just display axis with no transition\r\n focus.select('.x')\r\n .attr('transform', 'translate(0,' + focusHeight + ')')\r\n .call(xAxis);\r\n\r\n focus.select('.y')\r\n .attr('transform', 'translate(' + chartWidth + ',0)')\r\n .call(yAxis);\r\n\r\n // disable resizing of brush\r\n d3.select('.x.brush').select('.background').style('cursor', 'move');\r\n d3.select('.x.brush').select('.resize.e').style('cursor', 'move');\r\n d3.select('.x.brush').select('.resize.w').style('cursor', 'move');\r\n\r\n // create a clipPath for when brushing\r\n clip = charts.append('defs')\r\n .append('clipPath')\r\n .attr('id', 'clip')\r\n .append('rect')\r\n .attr('height', chartHeight)\r\n .attr('width', chartWidth);\r\n\r\n // add a line that marks the current time\r\n focus.append('line')\r\n .attr('class', 'now-line')\r\n .attr('x1', xScale(new Date(now)))\r\n .attr('y1', yScale(36))\r\n .attr('x2', xScale(new Date(now)))\r\n .attr('y2', yScale(420))\r\n .style('stroke-dasharray', ('3, 3'))\r\n .attr('stroke', 'grey');\r\n\r\n // add a y-axis line that shows the high bg threshold\r\n focus.append('line')\r\n .attr('class', 'high-line')\r\n .attr('x1', xScale(dataRange[0]))\r\n .attr('y1', yScale(180))\r\n .attr('x2', xScale(dataRange[1]))\r\n .attr('y2', yScale(180))\r\n .style('stroke-dasharray', ('3, 3'))\r\n .attr('stroke', 'grey');\r\n\r\n // add a y-axis line that shows the low bg threshold\r\n focus.append('line')\r\n .attr('class', 'low-line')\r\n .attr('x1', xScale(dataRange[0]))\r\n .attr('y1', yScale(80))\r\n .attr('x2', xScale(dataRange[1]))\r\n .attr('y2', yScale(80))\r\n .style('stroke-dasharray', ('3, 3'))\r\n .attr('stroke', 'grey');\r\n\r\n // add a x-axis line that closes the the brush container on left side\r\n focus.append('line')\r\n .attr('class', 'open-left')\r\n .attr('stroke', 'white');\r\n\r\n // add a x-axis line that closes the the brush container on right side\r\n focus.append('line')\r\n .attr('class', 'open-right')\r\n .attr('stroke', 'white'); \r\n\r\n } else {\r\n\r\n // for subsequent updates use a transition to animate the axis to the new position\r\n var focusTransition = focus.transition().duration(UPDATE_TRANS_MS);\r\n\r\n focusTransition.select('.x')\r\n .attr('transform', 'translate(0,' + focusHeight + ')')\r\n .call(xAxis);\r\n\r\n focusTransition.select('.y')\r\n .attr('transform', 'translate(' + chartWidth + ', 0)')\r\n .call(yAxis);\r\n \r\n // reset clip to new dimensions\r\n clip.transition()\r\n .attr('width', chartWidth)\r\n .attr('height', chartHeight);\r\n\r\n // clear current brush\r\n d3.select('.brush').call(brush.clear());\r\n\r\n // redraw old brush with new dimensions\r\n d3.select('.brush').transition().duration(UPDATE_TRANS_MS).call(brush.extent(currentBrushExtent));\r\n\r\n // transition high line to correct location\r\n focus.select('.high-line')\r\n .transition()\r\n .duration(UPDATE_TRANS_MS)\r\n .attr('x1', xScale(currentBrushExtent[0]))\r\n .attr('y1', yScale(180))\r\n .attr('x2', xScale(currentBrushExtent[1]))\r\n .attr('y2', yScale(180));\r\n\r\n // transition low line to correct location\r\n focus.select('.low-line')\r\n .transition()\r\n .duration(UPDATE_TRANS_MS)\r\n .attr('x1', xScale(currentBrushExtent[0]))\r\n .attr('y1', yScale(80))\r\n .attr('x2', xScale(currentBrushExtent[1]))\r\n .attr('y2', yScale(80));\r\n\r\n // transition open-top line to correct location\r\n focus.select('.open-top')\r\n .transition()\r\n .duration(UPDATE_TRANS_MS)\r\n .attr('x1', xScale2(currentBrushExtent[0]))\r\n .attr('y1', yScale(30))\r\n .attr('x2', xScale2(currentBrushExtent[1]))\r\n .attr('y2', yScale(30));\r\n\r\n // transition open-left line to correct location\r\n focus.select('.open-left')\r\n .transition()\r\n .duration(UPDATE_TRANS_MS)\r\n .attr('x1', xScale2(currentBrushExtent[0]))\r\n .attr('y1', focusHeight)\r\n .attr('x2', xScale2(currentBrushExtent[0]))\r\n .attr('y2', chartHeight);\r\n\r\n // transition open-right line to correct location\r\n focus.select('.open-right')\r\n .transition()\r\n .duration(UPDATE_TRANS_MS)\r\n .attr('x1', xScale2(currentBrushExtent[1]))\r\n .attr('y1', focusHeight)\r\n .attr('x2', xScale2(currentBrushExtent[1]))\r\n .attr('y2', chartHeight);\r\n\r\n }\r\n }\r\n\r\n // only if a user brush is not active, update brush and focus chart with recent data\r\n // else, just transition brush\r\n var updateBrush = d3.select('.brush').transition().duration(UPDATE_TRANS_MS);\r\n if (!brushInProgress) {\r\n updateBrush\r\n .call(brush.extent([new Date(dataRange[1].getTime() - FOCUS_DATA_RANGE_MS), dataRange[1]]));\r\n brushed(true);\r\n } else {\r\n updateBrush\r\n .call(brush.extent([currentBrushExtent[0], currentBrushExtent[1]]));\r\n brushed(true);\r\n }\r\n\r\n \r\n }", "function onLegendAfterUpdate() {\n var colorAxes = this.chart.colorAxis;\n if (colorAxes) {\n colorAxes.forEach(function (colorAxis) {\n colorAxis.update({}, arguments[2]);\n });\n }\n }", "function updateChart() {\n extent = d3.event.selection;\n dots.classed(\"selected\", function(d) {\n return isBrushed(\n extent,\n xScale(d.visittime) + margin.left,\n yScale(d.safetylevel) + margin.top\n );\n });\n }", "function stockGraphUpdate(){\n for(let i = 0; i < STOCKS.length; i++)\n {\n if(STOCKS[i].graph.data.length == labelLimit)\n {\n STOCKS[i].graph.data.shift();\n }\n STOCKS[i].graph.data.push(STOCKS[i].price);\n\n if(openYeller){console.log(stockUpdateYeller(i));} // constant updates\n }\n chart.update(\"none\"); // \"none\" TO DISABLE UGLY ANIMATIONS\n}", "onAfterSourceLoadData() {\n this.asyncCall(() => {\n this.chartPlugin.removeAllRangeBars();\n this.updateFromSource();\n });\n }", "function refreshValues() {\n filteredData = allData.filter(d => {\n return d['Year'] >= minYear && d['Year'] <= maxYear;\n });\n removeAllFilters();\n mapChart.data = filteredData;\n mapChart.updateVis();\n chordChart.data = filteredData;\n chordChart.updateVis();\n barChart.data = filteredData;\n barChart.globalFilterCalled();\n}", "function updateChart() {\n\n // Recover the new scale\n var newX = d3.event.transform.rescaleX(x);\n var newY = d3.event.transform.rescaleY(y);\n\n // Update axes with these new boundaries\n xAxis.call(d3.axisBottom(newX))\n yAxis.call(d3.axisLeft(newY))\n\n // Update circle position\n \n scat.attr('cx', function (d) {\n return newX(d.Date)\n })\n .attr('cy', function (d) {\n return newY(d.Popularity_log)\n });\n }", "function redrawLoansAmountChart() {\n nv.addGraph(function () {\n var chart = nv.models.discreteBarChart()\n .x(function (d) {\n return d.label\n })\n .y(function (d) {\n return d.value\n })\n .staggerLabels(true)\n .tooltips(true)\n .showValues(true)\n .transitionDuration(350)\n ;\n\n d3.select('#loansbarchart svg')\n .datum(scope.loansData)\n .call(chart);\n\n nv.utils.windowResize(chart.update);\n\n return chart;\n });\n }", "function updateDraw(){\r\n //ToDo\r\n }", "setGraphData (graphData, graphLabel) {\n let chartColor = null;\n this.chartLabels[graphLabel] = [];\n this.chartPlots[graphLabel] = [];\n\n // Set raw data\n this.rawChart[graphLabel] = graphData;\n\n graphData.forEach((plot) => {\n if (graphLabel === 'day') {\n const segmentClose = (plot.marketClose === null) ? plot.close : plot.marketClose;\n if (segmentClose !== null) {\n this.chartLabels[graphLabel].push(plot.label);\n this.chartPlots[graphLabel].push(segmentClose);\n }\n } else {\n // Chart individual plots\n this.chartLabels[graphLabel].push(plot.date);\n this.chartPlots[graphLabel].push(plot.close);\n }\n });\n\n // Push Opening and closing plots\n if (graphLabel === 'day') {\n // Opening\n this.chartLabels[graphLabel].unshift('Open');\n this.chartPlots[graphLabel].unshift(this.quote.open);\n\n // Closing\n if (this.quote.latestSource === 'Close' || this.quote.latestSource === 'Previous close') {\n this.chartLabels[graphLabel].push('Close');\n\n } else {\n this.chartLabels[graphLabel].push('Most Recent');\n }\n this.chartPlots[graphLabel].push(this.quote.latestPrice);\n\n this.chartColor[graphLabel] = this.getIsPositive() === true ? '84, 138, 2' : '186, 56, 60';\n } else {\n const lastPlot = this.chartPlots[graphLabel].length-1;\n const positive = Math.sign(this.chartPlots[graphLabel][0] - this.chartPlots[graphLabel][lastPlot]) > -1 ? false : true;\n this.chartColor[graphLabel] = positive === true ? '84, 138, 2' : '186, 56, 60';\n }\n }", "handleResize() {\n if (this.data === undefined) {\n // do nothing\n } else {\n this.drawBarChart(); // Draw bar chart\n this.forceUpdate(); // Forces re-render so that it takes up the appropriate space\n }\n }", "function graphPlotting(scope) {\n\tdataplotArray.length = 0;\n\tXnCalculation(copy_number_int, cycle_number_int, amplification_eff_int);\n\tchart.render();\n\tchain_reaction_stage.update();\n}", "updateChart() {\r\n this.alpaca.getAccount().then((resp) => {\r\n this.chart.data.datasets[0].data.push({\r\n t: new Date(),\r\n y: resp.equity\r\n });\r\n this.chart.update();\r\n });\r\n this.updateOrders(); // Updates positions and orders in case any changed were made\r\n this.updatePositions();\r\n }", "update(data) {\n this.data = data;\n this.destroy();\n drawChart.call(this);\n }", "function updateChart() {\n var yearValue = $(\"#yearSelect\").val();\n if (yearValue === \"2014\"){\n //John\n myChart6.data.datasets[0].data[0] = null;\n myChart6.data.datasets[0].data[1] = null;\n // Leonardo\n myChart6.data.datasets[1].data[0] = 18378;\n myChart6.data.datasets[1].data[1] = 22284;\n myChart6.data.datasets[1].data[2] = null;\n myChart6.data.datasets[1].data[3] = null;\n //Donatello\n myChart6.data.datasets[7].data[2] = 24473;\n myChart6.data.datasets[7].data[3] = 16286;\n //Paul\n myChart6.data.datasets[2].data[0] = 21630;\n myChart6.data.datasets[2].data[1] = 19603;\n myChart6.data.datasets[2].data[2] = 23947;\n myChart6.data.datasets[2].data[3] = 22444;\n //George\n myChart6.data.datasets[3].data[0] = null;\n myChart6.data.datasets[3].data[1] = null;\n myChart6.data.datasets[3].data[2] = null;\n //Michelangelo\n myChart6.data.datasets[4].data[0] = 11436;\n myChart6.data.datasets[4].data[1] = 18152;\n myChart6.data.datasets[4].data[2] = 17919;\n myChart6.data.datasets[4].data[3] = 12747;\n //Ringo\n myChart6.data.datasets[5].data[0] = null;\n //Raphael\n myChart6.data.datasets[6].data[0] = 15282;\n myChart6.data.datasets[6].data[1] = 16454;\n myChart6.data.datasets[6].data[2] = 19653;\n myChart6.data.datasets[6].data[3] = 10284;\n\n myChart6.update();\n }\n else{\n //John\n myChart6.data.datasets[0].data[0] = 14013;\n myChart6.data.datasets[0].data[1] = 18600;\n // Leonardo\n myChart6.data.datasets[1].data[0] = null;\n myChart6.data.datasets[1].data[1] = null;\n myChart6.data.datasets[1].data[2] = 23353;\n myChart6.data.datasets[1].data[3] = 20756;\n //Paul\n myChart6.data.datasets[2].data[0] = 24149;\n myChart6.data.datasets[2].data[1] = 13119;\n myChart6.data.datasets[2].data[2] = 23184;\n myChart6.data.datasets[2].data[3] = 12697;\n //George\n myChart6.data.datasets[3].data[0] = 23409;\n myChart6.data.datasets[3].data[1] = 13113;\n myChart6.data.datasets[3].data[2] = 17097;\n //Michelangelo\n myChart6.data.datasets[4].data[0] = null;\n myChart6.data.datasets[4].data[1] = null;\n myChart6.data.datasets[4].data[2] = null;\n myChart6.data.datasets[4].data[3] = 22444;\n //Ringo\n myChart6.data.datasets[5].data[0] = 22486;\n //Raphael\n myChart6.data.datasets[6].data[0] = null;\n myChart6.data.datasets[6].data[1] = 18383;\n myChart6.data.datasets[6].data[2] = 19190;\n myChart6.data.datasets[6].data[3] = 21011;\n //Donatello\n myChart6.data.datasets[7].data[2] = null;\n myChart6.data.datasets[7].data[3] = null;\n\n myChart6.update();\n }\n}", "_updateDataset() {\n // if graph hasn't been initialized, don't do anything\n if (!this.graph_obj) { console.log('not initialized'); return; }\n\n // calculate new decision's timestamp as a value between 0 and 1\n const xval = (\n (performance.now() - this.start_time) /\n (this.periodLength * 1000));\n if (isNaN(xval)) return;\n\n // add point for my new decision\n let dataset = this.graph_obj.series[0];\n this._lastElem(dataset.data).remove();\n dataset.addPoint([xval, this.myDecision]);\n dataset.addPoint([xval, this.myDecision]);\n\n // add point for others' new decision\n dataset = this.graph_obj.series[1];\n this._lastElem(dataset.data).remove();\n dataset.addPoint([xval, this.otherDecision]);\n dataset.addPoint([xval, this.otherDecision]);\n }", "prev(){\n\t\t\tif(this.offset <= 0){\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.offset -= this.limit;\n\t\t\tvar container = this.container;\n\t\t\tvar variable = this.variable;\n\t\t\tthis.initializePlot(variable);\n\t\t\tthis.getMeasurements(variable);\n\t\t}", "function drawHistoryChart(){\n if(old_chart != null){\n old_chart.labels = stock_labels;\n old_chart.data.datasets[0].data = stock_data;\n old_chart.data.datasets[0].label = stock_symbol;\n old_chart.update();\n }\n else{\n var chart = new Chart(document.getElementById(\"historyChart\"), {\n type: 'bar',\n showTooltips: false,\n data: {\n labels: stock_labels,\n datasets: [{ \n data: stock_data,\n label: stock_symbol,\n borderColor: \"#3e95cd\",\n fill: false\n }\n ]\n },\n options: {\n title: {\n display: true,\n text: 'Stock Price'\n }\n }\n });\n old_chart = chart;\n }\n}", "function chartUpdater() {\n for (var l = 0; l < imgArray.length; l++) {\n clickedChart.chart.config.data.labels.push('Times ' + imgArray[l].name + ' was picked');\n clickedChart.chart.config.data.labels.push('Times ' + imgArray[l].name + ' was displayed');\n clickedChart.chart.config.data.datasets[0].data.push(imgArray[l].picked);\n clickedChart.chart.config.data.datasets[0].data.push(imgArray[l].displayed);\n clickedChart.chart.config.data.datasets[0].backgroundColor.push('#' + imgArray[l].color);\n clickedChart.chart.config.data.datasets[0].backgroundColor.push('#' + imgArray[l].color);\n percentageChart.chart.config.data.labels.push(imgArray[l].name);\n percentageChart.chart.config.data.datasets[0].data.push(((imgArray[l].picked / imgArray[l].displayed) * 100));\n percentageChart.chart.config.data.datasets[0].backgroundColor.push('#' + imgArray[l].color);\n }\n for (var m = 0; m < 3; m++) {\n whichImageChart.chart.config.data.datasets[0].data.push(whichSide[m]);\n whichImageChart.chart.config.data.datasets[0].backgroundColor.push('#' + imgArray[m].color);\n }\n clickedChart.update();\n percentageChart.update();\n whichImageChart.update();\n document.getElementById('slider_section').style.visibility = 'visible';\n document.getElementById('slider_section').style.overflow = 'visible';\n document.getElementById('slider_section').style.height = '700px';\n document.getElementById('instructional').style.display = 'none';\n document.getElementById('click').style.display = 'none';\n document.getElementById('an').style.display = 'none';\n document.getElementById('image').style.display = 'none';\n}", "function callbackOne() {\n data.setValue(0, 1, 40 + Math.round(60 * Math.random()));\n chart.draw(data, options);\n setTimeout( callbackOne, $scope.interval );\n }", "function updateAmountGraph() {\n amountChartData.data.datasets[0].data = [];\n\n amountChartData.data.datasets[0].data.push(keg.level);\n\n amountChartData.update();\n\n console.log(amountChartData);\n}", "function onSeriesClear() {\n var $thisSeries = this;\n var $thisChart = $thisSeries.ChartProvider;\n var $thisSpecter = $thisChart.Parent;\n\n if (isDefined($thisSeries.onClear)) {\n $thisSeries.onClear();\n }\n\n $thisChart = $thisSpecter.getChart($thisChart.Name);\n delete $thisChart.Selected;\n $thisChart.InDrillMode = false;\n\n\n if (isDefined($thisSeries.DrillItem)) {\n //clear the drillitems Selected values \n\n var drillChart = $thisSpecter.getChart($thisSeries.DrillItem.Name);\n drillChart.CanRender = false;\n if (isDefined(drillChart.Selected)) {\n var currSeries;\n $.each(drillChart.Selected, function (i, sItem) {\n if (currSeries != sItem.$series) {\n currSeries = sItem.$series;\n currSeries.Clear();\n }\n });\n }\n\n $thisSpecter.RemoveFilter($thisSeries.DrillItem.Name);\n }\n\n $thisChart.Render();\n $thisSpecter.RemoveFilter($thisChart.Name);\n\n $.each($thisSeries.LinkedItems, function (index, item) {\n switch (item.Type) {\n case \"Chart\":\n var chart = $thisSpecter.getChart(item.Name);\n if (item.Action == \"SLICE\") {\n if (isDefined(item.Parameters)) {\n $.each(item.Parameters, function (i, parameter) {\n var targetchartprm = findAndGetObj(chart.Parameters, \"Name\", parameter.Name)\n delete targetchartprm.Value;\n });\n }\n if (isUndefined(chart.CanRender) || chart.CanRender == true) {\n chart.Render();\n }\n }\n else if (item.Action == \"SELECT\") {\n\n }\n else if (item.Action == \"RENDER\") {\n if (isUndefined(chart.CanRender) || chart.CanRender == true) {\n chart.Render();\n }\n }\n\n break;\n case \"Slicer\":\n var slicer = $thisSpecter.getSlicer(item.Name);\n if (isUndefined(slicer.CanRender) || slicer.CanRender == true) {\n if (item.Action == \"SLICE\") {\n $.each(item.Parameters, function (i, parameter) {\n var targetchartprm = findAndGetObj(slicer.Parameters, \"Name\", parameter.Name)\n if (isDefined(targetchartprm))\n delete targetchartprm.Value;\n });\n slicer.Render();\n }\n else if (item.Action == \"SELECT\") {\n //since it is triggered by chart event will be undefined\n slicer.Clear();\n }\n }\n break;\n case \"RangePicker\":\n var range = $thisSpecter.getRangePicker(item.Name);\n if (isUndefined(range.CanRender) || range.CanRender == true) {\n if (item.Action == \"SLICE\") {\n $.each(item.Parameters, function (i, parameter) {\n var targetchartprm = findAndGetObj(range.Parameters, \"Name\", parameter.Name)\n if (isDefined(targetchartprm))\n delete targetchartprm.Value;\n });\n range.Render();\n }\n else if (item.Action == \"SELECT\") {\n //since it is triggered by chart event will be undefined\n range.Clear();\n }\n }\n break;\n }\n\n });\n}", "componentDidUpdate() {\n this.chart.update(this.props, this.state);\n }", "function updateChart() {\n extent = d3.event.selection\n // Also updated to use the column names from merged.csv\n myCircle.classed(\"selected\", function (d) { return isBrushed(extent, x(d.Year), y(d.New_Displacements)) })\n }", "function onRefresh3() {\n\tconfig3.data.datasets.forEach(function (dataset) {\n\t\tdataset.data.push({\n\t\t\tx: Date.now(),\n\t\t\ty: powerGenerate_real_3\n\t\t});\n\t});\n}", "function finalDraw() {\n\t Shapes.drawAll(gd);\n\t Images.draw(gd);\n\t Plotly.Annotations.drawAll(gd);\n\t Legend.draw(gd);\n\t RangeSlider.draw(gd);\n\t RangeSelector.draw(gd);\n\t }", "function updateDataTypeChart() {\n showChart(); // make sure the chart is shown (and not specifit country details)\n updateDataType(currentDataType);\n updateHeadline(currentRegion, currentDataType);\n}", "renderGraph(doUpdate) {\n try {\n if (this.graphData && this.graphData.data && this.graphData.config) {\n if (\n this.graphDataSets &&\n this.graphDataSets.length &&\n JSON.stringify(this.graphDataSets) === JSON.stringify(this.graphData.data.datasets)\n ) {\n /**\n * same data as before, we have nothing to do.\n */\n return\n }\n /**\n * append the data for the current chart settings\n */\n let graphOptions = this._setChartOptions()\n graphOptions.data = {\n datasets: this.graphData.data.datasets\n }\n if (this.graphData.data.labels) {\n graphOptions.data.labels = this.graphData.data.labels\n }\n /**\n * Chart declaration\n */\n if (this.ctx && graphOptions.data && graphOptions.options) {\n if (doUpdate && this.chart && this.chart.data) {\n /**\n * redraw the chart with the current options\n * and updated data series\n */\n this.chart.data = graphOptions.data\n this.chart.update({\n duration: 0,\n easing: \"linear\"\n })\n if (this.DEBUGMODE) {\n this.DEBUGDATA.CHARD = {\n chartOptions: graphOptions,\n chartMode: \"update data ready\",\n chartjs: window.Chart3.version,\n chartGraphdata: this.graphData.config\n }\n }\n } else {\n /**\n * set the chart options\n */\n if (this.chart_ready === false && this.ChartControl.register) {\n /**\n * create and draw the new chart with the current settings\n * and the dataseries. Register all plugins\n */\n if (this.graphData.config.gradient) {\n this.ChartControl.register(plugin_gradient)\n }\n /**\n * check trendline\n */\n if (this.graphData.config.trendline && window.plugin_trendline)\n this.ChartControl.register(window.plugin_trendline)\n\n if (\n this.ChartControl &&\n this.chartconfig &&\n this.chartconfig.options &&\n this.chartconfig.options.chartArea &&\n this.chartconfig.options.chartArea.backgroundColor !== \"\"\n ) {\n /**\n * chart background color uses\n */\n this.ChartControl.register({\n id: \"chardbackground\",\n beforeDraw: function (chart) {\n if (chart.config.options.chartArea && chart.config.options.chartArea.backgroundColor) {\n const chartArea = chart.chartArea,\n ctx = chart.ctx\n ctx.save()\n ctx.fillStyle = chart.config.options.chartArea.backgroundColor\n ctx.fillRect(\n chartArea.left,\n chartArea.top,\n chartArea.right - chartArea.left,\n chartArea.bottom - chartArea.top\n )\n ctx.restore()\n }\n }\n })\n }\n\n if (this.graphData.config.thresholds) {\n /**\n * chart thresholds area\n * \n * thresholds: {\n linecolor: 'rgba(244, 67, 54,0.8)', \n backgroundColor: 'rgba(255, 87, 34,0.15)',\n value: 150,\n yScaleID: 'y'\n }\n * \n */\n this.ChartControl.register({\n id: \"thresholds\",\n beforeDraw: function (chart) {\n const _options = chart.config.options.thresholds,\n _rect = getRect(chart, _options),\n ctx = chart.ctx\n\n if (!_options) return\n /**\n * get the rect for the thresholds\n * @param {*} chart\n * @returns\n */\n function getRect(chart, _options) {\n if (_options) {\n const _axis = chart.scales[_options.yScaleID || _options.xScaleID],\n _dir = _options.xScaleID ? \"x\" : \"y\"\n return {\n x: chart.chartArea.left,\n x2: chart.chartArea.right,\n y: _dir === \"y\" ? _axis.getPixelForValue(_options.value) : chart.chartArea.top,\n y2: chart.chartArea.bottom,\n w:\n _dir === \"x\"\n ? chart.chartArea.right - _axis.getPixelForValue(_options.value)\n : chart.chartArea.width,\n h:\n _dir === \"y\"\n ? chart.chartArea.bottom - _axis.getPixelForValue(_options.value)\n : chart.chartArea.height,\n width: chart.chartArea.width,\n height: chart.chartArea.height,\n axis: _dir\n }\n }\n return null\n }\n /**\n * render the thresholds area\n */\n if (_options && _rect) {\n ctx.save()\n const _gradient =\n _rect.axis === \"y\"\n ? ctx.createLinearGradient(0, 0, 0, _rect.h)\n : ctx.createLinearGradient(0, 0, _rect.w, 0),\n _color = _options.backgroundColor || \"rgb(249, 70, 12)\"\n _gradient.addColorStop(0, window.Chart3.helpers.color(_color).alpha(0.85).rgbString())\n _gradient.addColorStop(1.0, window.Chart3.helpers.color(_color).alpha(0.15).rgbString())\n ctx.fillStyle = _gradient\n ctx.fillRect(_rect.x, _rect.y, _rect.width, _rect.h)\n ctx.beginPath()\n ctx.lineWidth = 1.25\n ctx.strokeStyle = _color\n if (_rect.axis === \"y\") {\n ctx.moveTo(_rect.x - 5.0, _rect.y)\n ctx.lineTo(_rect.x2, _rect.y)\n } else {\n ctx.moveTo(_rect.x, _rect.y - 5.0)\n ctx.lineTo(_rect.x, _rect.y2)\n }\n ctx.stroke()\n ctx.restore()\n }\n }\n })\n }\n }\n\n if (this.chart) {\n /**\n * be shure that no chart exits before create..\n */\n this.chart.destroy()\n this.chart = null\n }\n if (this.DEBUGMODE) {\n this.DEBUGDATA.CHARD = {}\n this.DEBUGDATA.CHARD.cart3Options = graphOptions\n }\n /**\n * create new chart and render the content\n */\n this.chart = new window.Chart3(this.ctx, graphOptions)\n this.graphDataSets = this.graphData.data.datasets\n if (this.DEBUGMODE) {\n this.DEBUGDATA.CHARD = {\n chartOptions: graphOptions,\n chartMode: \"new data ready\",\n chartjs: window.Chart3.version,\n chartmodul: \"v \" + this.version,\n chartGraphdata: this.graphData.config\n }\n }\n if (this.chart) {\n this.chart_ready = true\n }\n }\n }\n } else {\n console.error(\"Fatal Error, missing graphdata\", graphOptions)\n }\n } catch (err) {\n console.error(\"Error Render Graph Error on \", this.chart_type, \": \", err, err.message)\n }\n }", "function optionChanged(newSelection) {\n buildChart(newSelection);\n}", "onCustomWidgetAfterUpdate(changedProperties) {\r\n\t\t\tif (\"color\" in changedProperties) {\r\n\t\t\t\tthis._barcolor = changedProperties[\"color\"];\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\tif (\"datajson\" in changedProperties) {\r\n\t\t\t\tthis._datajson = changedProperties[\"datajson\"];\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\tif (\"chWidth\" in changedProperties) {\r\n\t\t\t\tthis.wdth = changedProperties[\"chWidth\"];\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\tif (\"chHeight\" in changedProperties) {\r\n\t\t\t\tthis.hght = changedProperties[\"chHeight\"];\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\tif(scriptAppend){\r\n\t\t\t\td3.select(this.shadowRoot).select(\"svg\").remove();\r\n\t\t\t\tthis.redraw();\r\n\t\t\t}\t\r\n\t\t}", "function drawPointsChanged() {\n if (!drawPoints) {\n drawPoints = true\n } else {\n drawPoints = false\n };\n renderJob1.renderText();\n }", "function updateSelectedCharts(result){\t\r\n\r\n\t\t// store old values\t\r\n\t\toldRes.sel_traffic = chart2.series[0].data[0].y;\r\n\t\t\r\n\t\t//energy\t\t\t\t\t\t\t\t\t\t\r\n\t\tchart2.series[0].setData(result);\r\n\t\r\n}", "function UpdateChartData()\r\n{\r\n while(Points > 10)\r\n {\r\n Points -= 1;\r\n\r\n myLineChart.removeData();\r\n }\r\n\r\n myLineChart.addData([Data[\"Temperature\"]], Math.floor((Date.now() - StartTime) / 1000.0));\r\n myLineChart.update();\r\n Points+=1;\r\n}", "function updateCharts(){\n var uploadValues = vm.loadLineGraphUpload();\n if (vm.uploadHistogram) {\n vm.uploadHistogram.load({\n columns: [\n uploadValues[1]\n ]\n });\n }\n var downloadValues = vm.loadLineGraphDownload();\n if (vm.downloadHistogram) {\n vm.downloadHistogram.load({\n columns: [\n downloadValues[1]\n ]\n });\n }\n if (vm.barChart) {\n vm.barChart.load({\n columns: [\n [$filter('translate')('map.barChart.UNFILTERED_TESTS'), vm.markers.length],\n [$filter('translate')('map.barChart.TOTAL'), vm.markersOrig.length]\n ]\n });\n }\n if (vm.pieChart) {\n vm.pieChart.load({\n columns: [\n [$filter('translate')('map.pieChart.UNFILTERED'), pieChartData()],\n [$filter('translate')('map.pieChart.FILTERED'), 100 - pieChartData()]\n ]\n })\n }\n vm.refreshCharts = ! vm.refreshCharts;\n }", "function resetGraphValuesBeforeRendering (){\n listOfAllGraphElements = [];\n remainingGraphsForAdding = [];\n clearInterval(graphsRenderedInterval);\n graphsRenderedInterval = null;\n }", "function redrawGraphic(){\n\n\twaitForFinalEvent(function(){\n\t\twidthGraphic = $(\"#graphic\").width();\n\n\t\t// Only redraw the graphic if the width changed\n\t\t// Fixes unecessary redraw on iOS Safari\n\t\tif (widthGraphic != widthGraphicOld){\n\t\t\t//d3.select(\"svg\").remove();\n\t\t\td3.select(\"#yAxis\").remove();\n\t\t\t//createGraphic(\"graphic\");\n\t\t\tdrawGraphic(defaultCountry, defaultMetric);\n\t\t}\n\n\t}, 500, \"some unique string\");\n\n}", "componentDidUpdate() {\n this.createChart();\n }", "function refresh() {\n for ( var i = 0; i < $scope.dataset.length; i++) {\n if ($scope.dataset[i].timestamp < (d3.time.second.ceil($scope.currentTime + 1000) - timeInterval)) {\n $scope.dataset.splice(i, 1);\n }\n }\n updateGraph();\n }", "redraw() {\n self.clear();\n self.draw();\n }", "function draw(){\n \n if (counter % 50 === 0){\n data_set.labels.push(counter.toString());\n data_set.datasets[0].data.push(sinu(x_vals[index]));\n data_set.datasets[1].data.push(cosi(x_vals[index]));\n // data_set.datasets[2].data.push(tang(x_vals[index]));\n myChart.update();\n index += 1;\n }\n\n counter += 1;\n}", "function onchange()\r\n{\r\n window.updateHeatmap();\r\n window.updateBar();\r\n window.updateLine();\r\n}", "rerenderCharts() {\n this.getAllSlices().forEach((slice) => {\n setTimeout(() => {\n this.props.actions.renderTriggered(new Date().getTime(), slice.chartKey);\n }, 50);\n });\n }", "function updateChart() {\n\n extent = d3.event.selection\n\n // If no selection, back to initial coordinate. Otherwise, update X axis domain\n if (!extent) {\n if (!idleTimeout) return idleTimeout = setTimeout(idled, 350); // This allows to wait a little bit\n x.domain(d3.extent(person.daily_schedule[0].schedule, function(d) {\n return convert_time_to_num[d.starting_time];\n }))\n } else {\n x.domain([x.invert(extent[0]), x.invert(extent[1])])\n areaChart.select(\".brush\").call(brush.move, null) // This remove the grey brush area as soon as the selection has been done\n }\n\n // Update axis and area position\n xAxis.transition().duration(1000).call(d3.axisBottom(x).ticks(5).tickFormat(function(d) { return data.time_conversion[d + 1] }))\n areaChart\n .selectAll(\"path\")\n .transition().duration(1000)\n .attr(\"d\", area)\n }", "function onTick(e) {\r\n if (!firstTick) {\r\n s.shapes\r\n .transition()\r\n .duration(frameDuration / 2)\r\n .style(\"fill\", function (d) {\r\n return (\r\n getCarrier(d.y) == e ? indicatorColor.fill : defaultColor.fill\r\n )})\r\n .style(\"stroke\", function (d) { \r\n return (\r\n getCarrier(d.y) == e ? indicatorColor.stroke : defaultColor.stroke\r\n )});\r\n }\r\n firstTick = false;\r\n\r\n // Update stacked bar chart title\r\n if (currentFrameValue != e) {\r\n svg.selectAll(\".stacked_title\")\r\n .transition()\r\n .duration(frameDuration / 4)\r\n .style(\"opacity\", 0)\r\n .transition()\r\n .duration(frameDuration / 4)\r\n .text(getTitle()) \r\n .style(\"opacity\", 1);\r\n }\r\n\r\n // Pause animation when it reaches last carrier\r\n if (e == carriers[0]) {\r\n onPause();\r\n }\r\n\r\n // update title state\r\n currentFrameValue = e;\r\n }", "function setNewPosition() {\n\n // kill old charts\n agreePollChartClass.destroy();\n indexCsiChartPersentClass.destroy();\n managerChartClass.destroy();\n alertStatisticChartClass.destroy();\n var chartArr = [\n $('#agree-poll-chart-canvas'),\n // $('#alert-statistic-chart-canvas')\n ];\n\n chartArr.forEach(function (item) {\n var id = $(item).attr('id');\n var parent = $(item).parent();\n $(item).remove();\n $(parent).append('<canvas id=\"' + id + '\"><canvas>');\n });\n\n // set width and height\n setSize();\n\n // generate chart\n generateCharts();\n\n\n agreePollChartClass.update();\n indexCsiChartPersentClass.update();\n managerChartClass.update();\n alertStatisticChartClass.update();\n} // set new width and height for charts", "afterDrawEnd() {\n if (me.draw) {\n me.draw.setActive(false);\n }\n me.drawActive = false;\n HsQueryBaseService.activateQueries();\n }", "function draw() {\n\n var isGridDrawn = false;\n\n if(graph.options.errorMessage) {\n var $errorMsg = $('<div class=\"elroi-error\">' + graph.options.errorMessage + '</div>')\n .addClass('alert box');\n\n graph.$el.find('.paper').prepend($errorMsg);\n }\n\n if(!graph.allSeries.length) {\n elroi.fn.grid(graph).draw();\n }\n\n $(graph.allSeries).each(function(i) {\n\n if(!isGridDrawn && graph.seriesOptions[i].type != 'pie') {\n elroi.fn.grid(graph).draw();\n isGridDrawn = true;\n }\n\n var type = graph.seriesOptions[i].type;\n elroi.fn[type](graph, graph.allSeries[i].series, i).draw();\n\n });\n\n }", "onRowsRerender() {\n this.scheduleDraw(true);\n }", "function onTick(e) {\n if (!firstTick) {\n // Color all shapes the same\n s.shapes\n .transition()\n .duration(frame / 2)\n .style(\"fill\", function (d) { return (d.y === e ? indicatorColor.fill : defaultColor.fill) })\n .style(\"stroke\", function (d) { return (d.y === e ? indicatorColor.stroke : defaultColor.stroke) })\n .style(\"opacity\", function (d) { return (d.yValue === 0 ? 0 : 0.8); });\n }\n firstTick = false;\n }", "function updateChart(chart, data) {\n\t\tchart.selectAll(\"polyline\")\n\t\t .data(data)\n\t\t .attr(\"opacity\", function(d, i){\n\t\t \tif( crimeVisible[d[\"type\"]] ) {\n\t\t \treturn 1;\n\t\t } else {\n\t\t \treturn 0;\n\t\t }\n\t\t });\n\t}", "function addSeriesCB(){\n\t\t\tstx.createDataSet();\n\t\t\tstx.draw();\n\t\t}", "updateDemographicChart() {\n const population = this.model.getAllPopulation();\n this.demographicsChart.receiveUpdate(population);\n }", "function updateChart() {\n const zoomState = zoomTransform(SVG.node());\n\n // recover the new scale\n var newX = zoomState.rescaleX(x);\n var newY = zoomState.rescaleY(y);\n\n \n // update axes with these new boundaries\n xAxis.call(axisBottom(newX))\n yAxis.call(axisLeft(newY))\n \n // update circle position\n scatter\n .selectAll(\"circle\")\n .attr('cx', function(d) {return newX(d.Sepal_Length)})\n .attr('cy', function(d) {return newY(d.Petal_Length)});\n }", "function update_chart() {\n // Ensure X-Axis displays a maximum of x_axis_display_limit data points\n limit_x_axis_display()\n\n \n\n\n // Add new interval data to the chart object's datasets\n chart.data.datasets[0]['data'].push(interval_bot_count);\n chart.data.datasets[1]['data'].push(interval_flow_count);\n\n // Add new xAxes time label to chart object\n let date = new Date();\n let time = date.getHours() + ':' + date.getMinutes() + ':' + date.getSeconds();\n chart.data.labels.push(time);\n\n // Call update on chart object\n chart.update()\n\n\n // Reset interval count variables\n reset_interval_counts();\n\n // Set new update_interval with the slider value\n setTimeout(update_chart, update_interval); \n\n return 0;\n}", "function update_chart() {\n extent = d3.event.selection\n myCircle.selectAll(function(d){\n if(isBrushed(extent, x(d.Y1), y(d.Y2) )){\n //if(selected_countries_pca_scatterplot_by_parallel.includes(d.Country) || selected_countries_pca_scatterplot_by_parallel.length==0){\n d3.select(this)\n //.classed(\"selected\", true)\n //.attr(\"opacity\", 1)\n .attr(\"stroke\", \"#eb04f7\",)\n .attr(\"stroke-width\", \"2px\")\n //}\n //Per la mappa QUIIIIIIIIIIIIIII\n if(!selected_countries_pca_scatterplot.includes(d.Country)){\n selected_countries_pca_scatterplot.push(d.Country)\n scatterplot_selection_interaction(d.Country)\n //console.log(selected_countries_pca_scatterplot)\n }\n\n \n }else{\n d3.select(this)\n //.classed(\"selected\", false)\n //.attr(\"opacity\", 0.5)\n .attr(\"stroke\", \"black\")\n .attr(\"stroke-width\", \"0.1px\")\n if(selected_countries_pca_scatterplot.includes(d.Country)){\n //console.log(selected_countries_pca_scatterplot)\n selected_countries_pca_scatterplot.splice(selected_countries_pca_scatterplot.indexOf(d.Country), 1)\n scatterplot_deselection_interaction(d.Country)\n \n if(!selected_countries_pca_scatterplot_by_parallel.includes(d.Country)){\n d3.select(this).style(\"fill\", function(d){return color_scale(d['Death Percentage'])})\n }\n \n }\n /*if(selected_countries_onAllAxis_by_scatterplot.includes(d.Country)){\n scatterplot_deselection_interaction(d.Country)\n }*/\n \n }\n })\n }", "function renderChart() {\n\n if($scope.currentChartModel==null) {\n $scope.app.getObject($element.find('div'), $scope.currentChart).then(function(model) {\n $scope.currentChartModel = model;\n });\n }\n else {\n $scope.currentChartModel.enigmaModel.endSelections(true)\n .then(destroyObject)\n .then(\n function() {\n $scope.app.getObject($element.find('div'), $scope.currentChart)\n .then(function(model) {\n $scope.currentChartModel = model;\n });\n });\n }\n\n }" ]
[ "0.74662846", "0.72784215", "0.7269396", "0.7202488", "0.71778464", "0.7036196", "0.70253307", "0.6957714", "0.69487715", "0.6930688", "0.6923092", "0.6878351", "0.6818725", "0.6787653", "0.6758963", "0.67191035", "0.6695916", "0.6674819", "0.6674819", "0.66683656", "0.6633173", "0.66311055", "0.65723586", "0.6545229", "0.65413356", "0.6524226", "0.65170246", "0.65037113", "0.64972544", "0.6450022", "0.6426469", "0.64258486", "0.6406955", "0.6405513", "0.64022106", "0.6393078", "0.638212", "0.6379816", "0.63624126", "0.6360349", "0.6350435", "0.63477796", "0.63471025", "0.63428664", "0.6342843", "0.6323619", "0.630146", "0.63009787", "0.62982994", "0.6297572", "0.6286721", "0.62819815", "0.6279082", "0.62623453", "0.62601215", "0.6254445", "0.6253216", "0.62443805", "0.62395495", "0.6239033", "0.6235536", "0.6233418", "0.6224846", "0.6217971", "0.6214686", "0.6213804", "0.62109625", "0.62056404", "0.62027264", "0.6196248", "0.61895806", "0.6185175", "0.6173391", "0.6171573", "0.61693984", "0.61617374", "0.6158435", "0.61517966", "0.6148905", "0.6146073", "0.6140434", "0.61393994", "0.6124059", "0.6119658", "0.61169904", "0.6110291", "0.61090446", "0.6107605", "0.6105576", "0.61026746", "0.6096702", "0.6094648", "0.6094079", "0.6093499", "0.60899496", "0.6088232", "0.6079681", "0.6075558", "0.6073381", "0.6070031" ]
0.62400615
58
add a horizontal reference line (and rescale chart if necessary)
function addReferenceLine(chart, value, yaxis) { yaxis = yaxis || 0; // add reference line chart.yAxis[yaxis].addPlotLine({ value: value, color: 'red', dashStyle: 'dot', width: 2 }); // add to the values that should be included on the chart (ie. rescale list) chartIncludeValues[yaxis].push(value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addLine () {\n\tconst linksCoords = this.getBoundingClientRect();\n\tline.style.width = `${linksCoords.width}px`;\n\tline.style.transform = `translate(${linksCoords.left}px, ${linksCoords.top}px)`;\n\tline.style.opacity = 1;\n}", "function renderAxisLine() {\n ctx.save();\n ctx.setLineDash(renderAttrs.lineDash || []);\n if( renderAttrs.orientation === 'horizontal') {\n drawLine( ctx, { x: renderMin, y: originCrossAxisCoord },\n { x: renderMax, y: originCrossAxisCoord });\n }\n else {\n drawLine( ctx, { x: originCrossAxisCoord, y: renderMin },\n { x: originCrossAxisCoord, y: renderMax });\n }\n ctx.restore();\n }", "function drawLine() {\n\n var data = new google.visualization.DataTable();\n data.addColumn('number', 'X');\n data.addColumn('number', 'Clients');\n data.addRows(self.charts.line.rows);\n\n var options = self.charts.line.options;\n\n var chart = new google.visualization.LineChart(document.getElementById('chart_div'));\n\n chart.draw(data, options);\n }", "function updateLine() {\n d3.selectAll('.line-chart').remove();\n svg_line = d3.select(\"#lines\").append(\"svg\")\n .attr('class', 'line-chart')\n .attr(\"width\", width_line + margin_line.left + margin_line.right)\n .attr(\"height\", height_line + margin_line.top + margin_line.bottom)\n .append(\"g\")\n .attr(\"transform\",\n \"translate(\" + margin_line.left + \",\" + margin_line.top + \")\");\n}", "addVertLine(){\n\t\t// start in center of the x-range\n\t\tlet pos = Math.floor(this.getCenter().x * 10) / 10.;\t// round to nearest .1\n\t\tlet to_shape = {\n\t\t\tid: this.cur_annotation_id,\n\t\t\tname: 'Spike ('+pos+')',\n\t\t\ttype: 'rect',\n\t\t\txref: 'x',\n\t\t\tyref: 'paper',\n\t\t\tx0: pos,\n\t\t\tx1: pos,\n\t\t\ty0: 0,\n\t\t\ty1: 1,\t// go from bottom to top of plot part of window\n\t\t\tline: {\n\t\t\t\tcolor: '#4227ff',\n\t\t\t\topacity: 1.,\n\t\t\t\twidth: 1,\n\t\t\t},\n\t\t}\n\t\tthis.cur_annotation_id ++;\n\t\tPlotly.relayout(this.getElement(), {'shapes[0]': to_shape});\n\t\tthis.refreshAnnotationMarkup();\n\t\tthis.annotations_list_target.last().click();\n\t}", "function render_linePositief() {\n var plotLine = hgiLine().mapping(['meetmoment', 'opgewektheid', 'ontspanning']).yDomain([0, 100]).legend(['Opgewektheid', 'Ontspanning']).yTicks(5).xLabel('Meetmoment').yLabel('Positieve gevoelens');\n //plotLine.overlayScale(0.75).overlayOffset(11);\n d3.select('#linePositief').datum(data).call(plotLine);\n}", "function drawHorizontalRule() {\n var stat = getState(cm);\n _replaceSelection(cm, stat.image, insertTexts.horizontalRule);\n}", "function drawLineChart(raw_line_data) {\n var data = google.visualization.arrayToDataTable(raw_line_data['line']);\n\n var options = {\n title: 'Energy Usage',\n backgroundColor: 'transparent',\n colors: ['#7851a9'],\n 'width': 1000,\n 'height': 750,\n //curveType: 'function', <-- made graph curvy\n legend: { position: 'top' }\n };\n\n var chart = new google.visualization.LineChart(document.getElementById('linechart'));\n\n chart.draw(data, options);\n }", "function horizontalScale() {\n if (svg.element.select('.horizontalScale')) svg.element.select('.horizontalScale').remove()\n if (ruler.container) ruler.container.remove()\n ruler.container = svg.element\n .append('g')\n .attr('transform', 'translate(' + [ruler.y, ruler.x] + ')')\n .attr('class', 'horizontalScale')\n\n ruler.container.append('path')\n .attr('d', d => 'M' + ruler.padding + ',10L' + (ruler.width + ruler.padding) + ',10')\n .attr('stroke-width', 1)\n .attr('stroke', '#000')\n\n ruler.element = ruler.container\n .append('text')\n .attr('class', 'ruler-text')\n .attr('x', ruler.width / 2 + ruler.padding)\n .attr('y', 36)\n .attr('font-family', 'sans-serif')\n .text('')\n .attr('font-size', '14px')\n .attr('fill', '#000')\n .attr('text-anchor', 'middle')\n }", "addLine() {\n this.chart.append(\"path\")\n .datum(this.dataset) // Binds data to the line \n .attr(\"class\", \"line\") // Assign a class for styling \n .attr(\"d\", this.generateLine()) // d is the path to be drawn. Pass the function to call to generate path.\n .style('stroke', this.lineColor || '#ffab00'); // set line color\n }", "function drawPrimaryChart() {\n\n var x = parseInt($('#anio').val(), 10);\n var data = new google.visualization.DataTable();\n\n data.addColumn('string', 'periodo');\n data.addColumn({type: 'string', role: 'annotation'});\n\n\n data.addColumn('number', x - 1);\n data.addColumn('number', 'Mayor historico');\n data.addColumn('number', 'Promedio ' + (x - 1));\n data.addColumn('number', 'Menor historico');\n data.addColumn('number', x);\n\n // Add a new column for your tooltips.\n data.addColumn({\n type: 'string',\n label: 'Tooltip Chart',\n role: 'tooltip',\n 'p': {'html': true}\n });\n\n // Add your data (with the newly added tooltipImg).\n data.addRows(primaryData);\n var visibleDiv = document.getElementById('GraficaPrincipal');\n var primaryChart = new google.visualization.LineChart(visibleDiv);\n primaryChart.draw(data, primaryOptions);\n\n}", "function addLine(pConfLine, pIndex) {\n\t\tvar myCanvas = myCanvasContainer.svg().svg(\"get\"),\n\t\t\tg = myCanvasContainer.find(\"#linesOverlay\").svg(),\n\t\t\tmyElemId = \"line_\" + gCountLines++,\n\t\t\tmyLine = null,\n\t\t\tmyLineHandlers = null;\n\t\tif (gIsDrawingLine) {\n\t\t\tif (!gIsImporting && pConfLine.points.length > 1) {\n\t\t\t\t// We're adding a segment to the line\n\t\t\t\tmyElemId = \"line_\" + --gCountLines;\n\t\t\t\tgCurrentConf.lines.pop();\n\t\t\t}\n\t\t\tvar myLineProps = {};\n\t\t\tfor (var myLinePropName in pConfLine.props) {\n\t\t\t\tswitch (myLinePropName) {\n\t\t\t\t\tcase \"marker-start\":\n\t\t\t\t\tcase \"marker-end\":\n\t\t\t\t\t\tmyLineProps[myLinePropName] = \"url(#\" + pConfLine.props[myLinePropName] + \")\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tmyLineProps[myLinePropName] = pConfLine.props[myLinePropName];\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tmyLine = myCanvas.polyline(g, pConfLine.points, myLineProps);\n\t\t\tfor (var myLinePropName in pConfLine.style) {\n\t\t\t\t$(myLine).css(myLinePropName, pConfLine.style[myLinePropName]);\n\t\t\t}\n\t\t\t$(myLine).addClass(\"drawing\");\n\t\t\t$(myLine).attr(\"id\", myElemId);\n\t\t\tgCurrentLine = myLine;\n\t\t}\n\t\t// Update serialization\n\t\tmyLine = $(myLine);\n\t\tvar myHandlersHtml = \"\";\n\t\tfor (var myPointIndex in pConfLine.points) {\n\t\t\tmyHandlersHtml += \"<div class=\\\"handler point\" + myPointIndex + \"\\\" rel=\\\"\" + myPointIndex + \"\\\" style=\\\"left:\" + (pConfLine.points[myPointIndex][0] + myCanvasContainer[0].offsetLeft - 8) + \"px;top:\" + (pConfLine.points[myPointIndex][1] + myCanvasContainer[0].offsetTop - 8) + \"px\\\"></div>\";\n\t\t}\n\t\tmyLine.on(\"mouseenter\", function(e) {\n\t\t\tif (!gIsReadOnly) {\n\t\t\t\tif (!gIsDrawingLine) {\n\t\t\t\t\tmyLineHandlers = $(\"#lineHandlers\").empty().html(myHandlersHtml).show().find(\".handler\");\n\t\t\t\t\tmyLineHandlers.on(\"mouseenter\", function(e) {\n\t\t\t\t\t\tmyContextMenuLine.css(\"top\", $(this).css(\"top\")).css(\"left\", $(this).css(\"left\"))\n\t\t\t\t\t\t\t.attr(\"rel\", myLine.attr(\"id\"));\n\t\t\t\t\t\tmyContextMenuLine.data(\"point-index\", $(this).attr(\"rel\") * 1);\n\t\t\t\t\t\tmyContextMenuLine.show();\n\t\t\t\t\t\t// Keep menu open for 200ms\n\t\t\t\t\t\tpreventClosingContextMenu = true;\n\t\t\t\t\t\ttimeoutIdContextMenu = window.setTimeout(function() {\n\t\t\t\t\t\t\tpreventClosingContextMenu = false;\n\t\t\t\t\t\t}, 200);\n\t\t\t\t\t});\n\t\t\t\t\tgCurrentElement = pConfLine;\n\t\t\t\t}\n\t\t\t}\n\t\t}).on(\"mouseleave\", function(e) {\n\t\t\tif (!preventClosingContextMenu) {\n\t\t\t\tmyContextMenuLine.hide();\n\t\t\t\t$(\"#lineHandlers\").hide();\n\t\t\t}\n\t\t});\n\t\tif (!gIsImporting) {\n\t\t\tgCurrentConf.lines.push(pConfLine);\n\t\t\tmyLine.data(\"index\", gCurrentConf.lines.length - 1);\n\t\t} else {\n\t\t\tmyLine.data(\"index\", pIndex);\n\t\t}\n\t}", "function drawline() {\n\n if (isDrawing) {\n linePoint2 = d3.mouse(this);\n gContainer.select('line').remove();\n gContainer.append('line')\n .attr(\"x1\", linePoint1.x)\n .attr(\"y1\", linePoint1.y)\n .attr(\"x2\", linePoint2[0] - 2) //arbitary value must be substracted due to circle cursor hover not working\n .attr(\"y2\", linePoint2[1] - 2); // arbitary values must be tested\n\n }\n }", "function setLine(tab){\n var tabWidth = $(tab).outerWidth();\n var tabPos = $(tab).position();\n $(\".indicator-line\").css({\n \"width\": tabWidth,\n \"left\": tabPos.left\n });\n }", "function drawLineChart($scope){\n\tif(!$scope.chartTypeToggle.line){\n\t\treturn;\n\t}\n\tvar svg = $scope.svg;\n\tvar $axisProvider = $scope.$axisProvider;\n\tvar $lineChartProvider = $scope.$injector.get(\"$lineChartProvider\");\n\t$scope.$lineChartProvider = $lineChartProvider;\n\t$lineChartProvider.axisProvider = $axisProvider;\n\t$lineChartProvider.svg = svg;\n\t$lineChartProvider.data = getDataFromScope($scope);\n\t$lineChartProvider.effect = $scope.chartEffect;\n\t$lineChartProvider.dataX = $scope.chartX;\n\t$lineChartProvider.dataY = $scope.chartY;\n\t$lineChartProvider.animate = $scope.chartAnimate;\n \n\t$lineChartProvider.draw();\n\t\n\t$scope.$watch('chartAnimate',function(newValue,oldValue){\n\t\t$lineChartProvider.animate = newValue;\n\t\t//redraw only when animate was turned on from off.\n\t\tif(!oldValue && newValue && $scope.chartTypeToggle.line){\n\t\t\t$lineChartProvider.draw();\n\t\t}\n\t});\n\t$scope.$watch('chartEffect',function(newValue,oldValue){\n\t\t$lineChartProvider.effect = newValue;\n\t\tif(oldValue!=newValue && $scope.chartTypeToggle.line){\n\t\t\t$lineChartProvider.draw();\n\t\t}\n\t});\t\n}", "lineRender(){\n d3.select('.circle-legend').select('svg').append('line').attr('x1',0).attr('x2',180).attr('y1',0).attr('y2',0)\n .attr('transform','translate(0,55)').classed('legendLine',true)\n }", "function showLine(lineData, lineID) {\n\tsvgLine.append(\"path\")\n\t\t .attr(\"class\", \"line\")\n\t\t //We give the lines ID's so we can select and remove them\n\t\t .attr(\"id\", lineID)\n\t\t .attr(\"d\", avgAlcLine(avgAlcConsumption))\n\t\t .transition()\n\t\t .duration(1000)\n\t\t .attr(\"d\", avgAlcLine(lineData));\n}", "function drawHorizonalLine(y, color) {\n ctx.beginPath();\n ctx.strokeStyle = color;\n ctx.moveTo(0, y);\n ctx.lineTo(canvas.width, y);\n ctx.stroke();\n}", "function drawHorizon() {\n push();\n\n // the horizon line\n horizonYAnchor = (hGridNum / 10) * gridH;\n horizonTopY = horizonYAnchor / 2;\n\n fill(greenC);\n beginShape();\n curveVertex(0, horizonYAnchor);\n curveVertex(0, horizonYAnchor);\n curveVertex(width / 2, horizonTopY);\n curveVertex(width, horizonYAnchor);\n curveVertex(width, horizonYAnchor);\n vertex(width, height);\n vertex(0, height);\n vertex(0, horizonYAnchor);\n endShape(CLOSE);\n\n //debug\n //debugE(gridW * (floor(hGridNum/2)-3), trackY);\n //debugE(0, horizonYAnchor);\n //debugE(canvasW / 2, horizonYAnchor / 2);\n //debugE(canvasW, horizonYAnchor)\n pop();\n}", "drawLine(canvas, dependency, points, assignmentData = null) {\n const { client } = this,\n metaId = this.getMetaId(assignmentData);\n\n // Reuse existing element if possible\n let line = dependency.instanceMeta(metaId).lineElement;\n\n if (!line) {\n line = dependency.instanceMeta(metaId).lineElement = document.createElementNS(\n 'http://www.w3.org/2000/svg',\n 'polyline'\n );\n line.setAttribute('depId', dependency.id);\n if (assignmentData) {\n line.setAttribute('fromId', assignmentData.from.id);\n line.setAttribute('toId', assignmentData.to.id);\n }\n canvas.appendChild(line);\n }\n\n // TODO: Use DomHelper.syncClassList\n\n // className is SVGAnimatedString for svg elements, reading attribute instead\n line.classList.length && line.classList.remove.apply(line.classList, line.getAttribute('class').split(' '));\n\n line.classList.add(this.baseCls);\n\n if (dependency.cls) {\n line.classList.add(dependency.cls);\n }\n if (dependency.bidirectional) {\n line.classList.add('b-sch-bidirectional-line');\n }\n if (dependency.highlighted) {\n line.classList.add(...dependency.highlighted.split(' '));\n }\n if (BrowserHelper.isIE11) {\n const ddr = dependency.getDateRange(true),\n viewStart = client.startDate;\n\n if (ddr.start < viewStart) {\n line.classList.add('b-no-start-marker');\n }\n if (ddr.end < viewStart) {\n line.classList.add('b-no-end-marker');\n }\n }\n\n line.setAttribute(\n 'points',\n !points\n ? ''\n : points\n .map((p, i) => (i !== points.length - 1 ? `${p.x1},${p.y1}` : `${p.x1},${p.y1} ${p.x2},${p.y2}`))\n .join(' ')\n );\n\n DomDataStore.set(line, {\n dependency\n });\n }", "function horizontalRescale(increment) {\n if (increment) {\n if (graph.scale.horizontal.value < graph.scale.horizontal.limits[1]) {\n graph.scale.horizontal.increment()\n setNewYPositions()\n applyScaleText()\n }\n } else {\n if (graph.scale.horizontal.value > graph.scale.horizontal.limits[0]) {\n graph.scale.horizontal.decrement()\n setNewYPositions()\n applyScaleText()\n }\n }\n }", "function render_lineOngemak() {\n var plotLine = hgiLine().margin({\n 'top': 20,\n 'right': 140,\n 'bottom': 40,\n 'left': 50\n }).mapping(['meetmoment', 'ik_ben_van_slag', 'lichamelijk_ongemak']).yDomain([0, 100]).legend(['Ik ben van slag', 'Lichamelijk ongemak']).yTicks(5).xTicks(5).xLabel('Meetmoment');\n d3.select('#lineOngemak').datum(data).call(plotLine);\n}", "function render_lineEigenwaarde() {\n var plotLine = hgiLine().mapping(['meetmoment', 'piekeren', 'eigenwaarde']).yDomain([0, 100]).legend(['Gepieker', 'Eigenwaarde']).xLabel('Meetmoment').yTicks(5);\n d3.select('#lineEigenwaarde').datum(data).call(plotLine);\n}", "function UpdateLineChart(){\n var doc = document.getElementById(\"line_chart__\");\n\n doc.height = $('.bars').height() + 70\n doc.width = $('.bars').width()\n $('.line_chart,.lines,#line_chart__').width($('.bar_wrapper').width());\n $('.line_chart,.lines,#line_chart__').height($('.bar_wrapper').height() + 70);\n\n if(!isLineChartInizialized){\n isLineChartInizialized = true;\n chart = new Chart(doc, {\n type: 'line',\n data: {\n labels: getDateArray(),\n datasets: [{ \n data: getOnlyAnwsersFromArray($scope.first_patient_calculated),\n label: $scope.patients[$scope.patient1 - 1],\n borderColor: color1,\n fill: false\n }, { \n data: getOnlyAnwsersFromArray($scope.second_patient_calculated),\n label: $scope.patients[$scope.patient2 - 1],\n borderColor: color2,\n fill: false\n }\n ]\n },\n options: {\n legend: {\n display: false\n },\n scales: {\n yAxes: [{\n ticks: {\n stepSize: 1,\n beginAtZero: true,\n suggestedMax: 4\n }\n }]\n },\n options: {\n events: []\n },\n animation: {\n duration: 2000, // general animation time\n easing:\"easeInOutExpo\"\n },\n elements: {\n line: {\n tension: 0, // disables bezier curves\n }\n },\n label:{\n display: false\n }\n }\n });\n }else{\n chart.data.labels = getDateArray(),\n chart.data.datasets = [{ \n data: getOnlyAnwsersFromArray($scope.first_patient_calculated),\n label: \"Patient \" + $scope.patient1,\n borderColor: color1,\n fill: false\n }, { \n data: getOnlyAnwsersFromArray($scope.second_patient_calculated),\n label: \"Patient \" + $scope.patient2,\n borderColor: color2,\n fill: false\n }\n ]\n chart.update();\n }\n }", "function intializeLine() {\n var svg = document.getElementsByTagName('svg')[0];\n svgLine.setAttribute('stroke', 'black');\n svgLine.setAttribute('x1', line.x1);\n svgLine.setAttribute('y1', line.y1);\n svg.appendChild(svgLine);\n}", "function block_lemo4moodle_drawLinechart() {\n\n var data = new google.visualization.DataTable();\n data.addColumn('date', linechartColDate);\n data.addColumn('number', linechartColAccess);\n data.addColumn('number', linechartColOwnAccess);\n data.addColumn('number', linechartColUser);\n data.addRows(linechartDataArray);\n var options = {\n chart: {\n title: linechartTitle\n },\n hAxis: {\n title: linechartColDate,\n format:'d.M.yy'\n },\n\n };\n var activitychart = new google.visualization.LineChart(document.getElementById('linechart'));\n activitychart.draw(data, options);\n\n}", "function CalculationStepLine(options) {\n // TODO: CLEAN ALL OF THIS CODE\n // TODO: GET RID OF CONSTANT COLUMN POSITIONS\n\n const leftColumnPosition = 100;\n const middleColumnPosition = 100;\n\n let barHeight,\n color,\n domain,\n fontFamily,\n fontSize,\n labelText,\n line,\n scale,\n where;\n\n line = this;\n\n init(options);\n\n return line;\n\n /* INTIIALIZE */\n function init(options) {\n\n _required(options);\n _defaults(options);\n\n scale = defineScale();\n\n line.group = addGroup();\n line.columns = addColumns();\n\n line.label = addLabel()\n .update(labelText);\n\n line.bar = addBar();\n\n }\n\n /* PRIVATE METHODS */\n function _defaults(options) {\n\n barHeight = options.barHeight ? options.barHeight : 10;\n color = options.color ? options.color : \"black\";\n fontSize = options.fontSize ? options.fontSize : \"15pt\";\n fontFamily = options.fontFamily ? options.fontFamily : \"\";\n labelText = options.label ? options.label +\" =\" : \"=\";\n domain = options.domain ? options.domain : [0,1];\n line.lineHeight = options.lineHeight ? options.lineHeight : 25;\n\n }\n\n function _required(options) {\n\n where = options.where;\n\n }\n\n function addBar() {\n let bar;\n\n bar = new CalculationStepLinearIndicator({\n \"where\":line.columns.middle,\n \"color\":color,\n \"scale\":scale,\n \"fontSize\":fontSize,\n \"fontFamily\":fontFamily,\n \"height\":barHeight\n });\n\n return bar;\n }\n\n function addColumns() {\n let groupObject;\n\n groupObject = {};\n\n groupObject.left = explorableGroup({\n \"where\":line.group,\n }).attr(\"transform\",\"translate(\"+leftColumnPosition+\",0)\");\n\n\n groupObject.middle = explorableGroup({\n \"where\":line.group,\n }).attr(\"transform\",\"translate(\"+middleColumnPosition+\",0)\");\n\n\n return groupObject;\n }\n\n function addGroup() {\n let group;\n\n group = explorableGroup({\n \"where\":where\n })\n .attr(\"transform\",\"translate(0,50)\");\n\n return group;\n }\n\n\n function addLabel() {\n let label;\n\n // TODO: DOES COLUMNS REALLY NEED TO BE PUBLIC?\n label = new ExplorableHintedText({\n \"where\":line.columns.left,\n \"textAnchor\":\"end\",\n \"foregroundColor\":color,\n \"fontFamily\":fontFamily,\n \"fontWeight\":\"normal\",\n \"fontSize\":fontSize\n })\n .move({\n \"x\":-5,\n \"y\":0\n });\n\n return label;\n }\n\n\n function defineScale() {\n let scale;\n\n //TODO: DONT HARD CODE DOMAIN AND RANGE\n scale = d3.scaleLinear()\n .domain(domain)\n .range([0,100]);\n\n return scale;\n }\n\n}", "function CalculationStepLine(options) {\n // TODO: CLEAN ALL OF THIS CODE\n // TODO: GET RID OF CONSTANT COLUMN POSITIONS\n\n const leftColumnPosition = 100;\n const middleColumnPosition = 100;\n\n let barHeight,\n color,\n domain,\n fontFamily,\n fontSize,\n labelText,\n line,\n scale,\n where;\n\n line = this;\n\n init(options);\n\n return line;\n\n /* INTIIALIZE */\n function init(options) {\n\n _required(options);\n _defaults(options);\n\n scale = defineScale();\n\n line.group = addGroup();\n line.columns = addColumns();\n\n line.label = addLabel()\n .update(labelText);\n\n line.bar = addBar();\n\n }\n\n /* PRIVATE METHODS */\n function _defaults(options) {\n\n barHeight = options.barHeight ? options.barHeight : 10;\n color = options.color ? options.color : \"black\";\n fontSize = options.fontSize ? options.fontSize : \"15pt\";\n fontFamily = options.fontFamily ? options.fontFamily : \"\";\n labelText = options.label ? options.label +\" =\" : \"=\";\n domain = options.domain ? options.domain : [0,1];\n line.lineHeight = options.lineHeight ? options.lineHeight : 25;\n\n }\n\n function _required(options) {\n\n where = options.where;\n\n }\n\n function addBar() {\n let bar;\n\n bar = new CalculationStepLinearIndicator({\n \"where\":line.columns.middle,\n \"color\":color,\n \"scale\":scale,\n \"fontSize\":fontSize,\n \"fontFamily\":fontFamily,\n \"height\":barHeight\n });\n\n return bar;\n }\n\n function addColumns() {\n let groupObject;\n\n groupObject = {};\n\n groupObject.left = explorableGroup({\n \"where\":line.group,\n }).attr(\"transform\",\"translate(\"+leftColumnPosition+\",0)\");\n\n\n groupObject.middle = explorableGroup({\n \"where\":line.group,\n }).attr(\"transform\",\"translate(\"+middleColumnPosition+\",0)\");\n\n\n return groupObject;\n }\n\n function addGroup() {\n let group;\n\n group = explorableGroup({\n \"where\":where\n })\n .attr(\"transform\",\"translate(0,50)\");\n\n return group;\n }\n\n\n function addLabel() {\n let label;\n\n // TODO: DOES COLUMNS REALLY NEED TO BE PUBLIC?\n label = new ExplorableHintedText({\n \"where\":line.columns.left,\n \"textAnchor\":\"end\",\n \"foregroundColor\":color,\n \"fontFamily\":fontFamily,\n \"fontWeight\":\"normal\",\n \"fontSize\":fontSize\n })\n .move({\n \"x\":-5,\n \"y\":0\n });\n\n return label;\n }\n\n\n function defineScale() {\n let scale;\n\n //TODO: DONT HARD CODE DOMAIN AND RANGE\n scale = d3.scaleLinear()\n .domain(domain)\n .range([0,100]);\n\n return scale;\n }\n\n}", "biggerLine() {\n this.ctx.lineWidth++\n }", "function updateLine(error, data) {\n\n // Remove old lines + axes + title\n if (movieLine != null){movieLine.remove();}\n if (movieLineCompare != null){movieLineCompare.remove();}\n if (movieLabel != null){movieLabel.remove();}\n if (xLabelLine != null){xLabelLine.remove();}\n if (titleLine != null){titleLine.remove();}\n if (svgLine.selectAll(\".axis.axis--x\") != null){svgLine.selectAll(\".axis.axis--x\").remove();}\n if (svgLine.selectAll(\".axis.axis--y\") != null){svgLine.selectAll(\".axis.axis--y\").remove();}\n\n // Draw new lines\n initLine();\n}", "function SVGLineChart() {\r\n }", "function updateDrawingLineOfAPeer(oldLineObj, newLineObj) {\n oldLineObj.set({\n x2: (newLineObj.x1 < 0) ? newLineObj.left + newLineObj.width : newLineObj.left ,\n y2: (newLineObj.y1 < 0) ? newLineObj.top + newLineObj.height : newLineObj.top\n });\n}", "function kaggle_line(data, line_title, line_index){\n var line_data = data.filter(function(d) { return d[line_title]!= \"\"; });\n var line= d3.svg.line()\n .x(function(d) { return x(d.date); })\n .y(function(d) { return y(d[line_title]);});\n\n kaggle_svg.append(\"path\")\n .attr(\"stroke\",kaggle_color(line_title))\n .attr(\"stroke-width\",2)\n .attr(\"d\", line(line_data));\n\n kaggle_svg.selectAll(\"dot\")\n .data(line_data)\n .enter()\n .append(\"a\")\n .attr(\"xlink:href\", function(d) {\n if (d.BlogLink != \"\"){\n return d.BlogLink\n } else {\n return d.CompLink\n }})\n .append(\"circle\")\n .attr(\"r\", 3.5)\n .attr(\"fill\",function(d){\n if (d.BlogLink === \"\"){\n return kaggle_color(line_title)\n } else {\n return \"red\"\n } \n })\n .attr(\"cx\", function(d) { return x(d.date); })\n .attr(\"cy\", function(d) { return y(d[line_title]); });\n\n kaggle_svg.append(\"circle\")\n .attr(\"r\", 3.5)\n .attr(\"cx\",legend_x + legend_margin.left)\n .attr(\"cy\",legend_y + legend_margin.top*line_index)\n .attr(\"fill\",kaggle_color(line_title))\n\n kaggle_svg.append(\"text\")\n .attr(\"x\",legend_x + legend_margin.left + legend_margin.right)\n .attr(\"y\",legend_y + legend_margin.top*line_index)\n .text(line_title)\n\n}", "function addBaseline(datatable) {\n // Create the data table of power values to return.\n var powerTable = new google.visualization.DataTable();\n var numPowerTableRows = 1;\n powerTable.addColumn('date'); // the time of day.\n powerTable.addColumn('number'); // the power in Wh.\n powerTable.addColumn('number'); // the baseline power in Wh.\n powerTable.addRows(numPowerTableRows);\n var timestampVal = datatable.getValue(0, 0);\n var powerVal = Number(datatable.getValue(0, 1).toFixed(0));\n var baselineVal = 3000;\n powerTable.setCell(0, 0, timestampVal);\n powerTable.setCell(0, 1, powerVal);\n powerTable.setCell(0, 2, baselineVal);\n var dateFormatter = new google.visualization.DateFormat({pattern:'MMM d, yyyy, h:mm:ss a'});\n dateFormatter.format(powerTable, 0);\n return powerTable;\n }", "function addline() {\n line(0,sz,sz*3,sz);\n line(0,sz*2,sz*3,sz*2);\n line(sz,0,sz,sz*3);\n line(sz*2,0,sz*2,sz*3);\n}", "function drawLineChart() {\r\n // slicing subset of colours from main array to use for vis.\r\n aleph.coloursSubset = aleph.colours.slice(0, aleph.maxNumberOfLines);\r\n\r\n // dynamically determine year extent of x axis from ingested data file.\r\n aleph.years = d3.keys(aleph.data.line[0]).filter(function (d, i) {\r\n return aleph.LineNonYearFields.indexOf(d) == -1;\r\n });\r\n\r\n aleph.dataYearPopulations = [];\r\n aleph.years.forEach(function (d) {\r\n var yearToProcess = d;\r\n\r\n aleph.dataYearPopulation = 0;\r\n\r\n aleph.data.line.forEach(function (d) {\r\n aleph.dataYearPopulation =\r\n Number(aleph.dataYearPopulation) + Number(d[yearToProcess]);\r\n });\r\n\r\n aleph.dataYearPopulations.push(aleph.dataYearPopulation);\r\n });\r\n\r\n // update dimension values of container div\r\n svgWidth = $(\".aleph-chart.aleph-line-chart\").width();\r\n svgHeight = $(\".aleph-chart.aleph-line-chart\").height();\r\n\r\n checkWindowSize();\r\n\r\n // initialise y axis max variablew\r\n aleph.maxchartYAxisValue = -1;\r\n\r\n // for each SYOA ...\r\n aleph.years.forEach(function (d, i) {\r\n // locally store SYOA\r\n var checkyear = d;\r\n\r\n // detemine maximum of SYOA year\r\n var max = d3.max(aleph.data.line, function (d) {\r\n return +d[checkyear];\r\n });\r\n\r\n if (max >= aleph.maxchartYAxisValue) {\r\n aleph.maxchartYAxisValue = max;\r\n }\r\n });\r\n\r\n var newStartTime = d3.timeMonth.offset(\r\n aleph.parseDate(aleph.years[0]),\r\n -aleph.lineChartXAxisRounding\r\n );\r\n var newEndTime = d3.timeMonth.offset(\r\n aleph.parseDate(aleph.years[aleph.years.length - 1]),\r\n aleph.lineChartXAxisRounding\r\n );\r\n\r\n // initialise declaration of chart x-axis\r\n aleph.xMain = d3\r\n .scaleTime()\r\n .range([\r\n 0,\r\n svgWidth -\r\n aleph.margin.line[aleph.windowSize].left -\r\n aleph.margin.line[aleph.windowSize].right,\r\n ])\r\n .domain([newStartTime, newEndTime]);\r\n\r\n d3.selectAll(\".aleph-chart.aleph-line-chart\")\r\n .on(\"dblclick\", function () {\r\n resetLineChartAxes();\r\n })\r\n .append(\"g\")\r\n .attr(\"class\", \"aleph-lineChart-axis-group\");\r\n\r\n // append g element to hold x axis\r\n d3.selectAll(\".aleph-lineChart-axis-group\")\r\n .append(\"g\")\r\n .attr(\"class\", \"axis axis--x mainAxis\")\r\n .attr(\r\n \"transform\",\r\n \"translate(\" +\r\n aleph.margin.line[aleph.windowSize].left +\r\n \",\" +\r\n (svgHeight - aleph.margin.line[aleph.windowSize].bottom) +\r\n \")\"\r\n )\r\n .call(d3.axisBottom(aleph.xMain).ticks(d3.timeYear.every(2)));\r\n\r\n if (aleph.lineChartyAxisType == \"counts\") {\r\n aleph.lineChartYAxisDomain = [\r\n 0,\r\n Math.ceil(aleph.maxchartYAxisValue / aleph.lineChartYAxisRounding) *\r\n aleph.lineChartYAxisRounding,\r\n ];\r\n } else {\r\n aleph.lineChartYAxisDomain = [0, 100];\r\n }\r\n\r\n // initialise declaration of chart y-axis\r\n aleph.yMain = d3\r\n .scaleLinear()\r\n .range([\r\n svgHeight -\r\n aleph.margin.line[aleph.windowSize].top -\r\n aleph.margin.line[aleph.windowSize].bottom,\r\n 0,\r\n ])\r\n .domain(\r\n aleph.lineChartYAxisDomain /* [\r\n 0,\r\n Math.ceil(aleph.maxchartYAxisValue / aleph.lineChartYAxisRounding) *\r\n aleph.lineChartYAxisRounding,\r\n ] */\r\n );\r\n\r\n // append g element to hold x time axis\r\n d3.selectAll(\".aleph-lineChart-axis-group\")\r\n .append(\"g\")\r\n .attr(\"class\", \"axis axis--y mainAxis\")\r\n .attr(\r\n \"transform\",\r\n \"translate(\" +\r\n aleph.margin.line[aleph.windowSize].left +\r\n \",\" +\r\n aleph.margin.line[aleph.windowSize].top +\r\n \")\"\r\n )\r\n .call(d3.axisLeft(aleph.yMain));\r\n\r\n // https://bl.ocks.org/35degrees/02e5fd2eade71c0a6ffc01d5282def23\r\n d3.selectAll(\".aleph-chart.aleph-line-chart\")\r\n .append(\"defs\")\r\n .append(\"clipPath\")\r\n .attr(\"class\", \"clip\")\r\n .attr(\"id\", \"clip\")\r\n .append(\"rect\")\r\n .attr(\"class\", \"clip-Rect\")\r\n .attr(\"id\", \"clip-Rect\")\r\n .attr(\"x\", aleph.margin.line[aleph.windowSize].left)\r\n .attr(\"y\", aleph.margin.line[aleph.windowSize].top)\r\n .attr(\r\n \"width\",\r\n svgWidth -\r\n aleph.margin.line[aleph.windowSize].left -\r\n aleph.margin.line[aleph.windowSize].right\r\n )\r\n .attr(\r\n \"height\",\r\n svgHeight -\r\n aleph.margin.line[aleph.windowSize].top -\r\n aleph.margin.line[aleph.windowSize].bottom\r\n );\r\n\r\n // initialise and append y-axis main title label\r\n d3.selectAll(\".axis.axis--y.mainAxis\")\r\n .append(\"text\")\r\n .attr(\"class\", \"aleph-yAxisTitle\")\r\n .attr(\"x\", 0)\r\n .attr(\"y\", -25)\r\n .text(aleph.axisMainTitles.lineChart.y);\r\n\r\n // initialise and append x-axis main title label\r\n d3.selectAll(\".axis.axis--x.mainAxis\")\r\n .append(\"text\")\r\n .attr(\"class\", \"aleph-xAxisTitle\")\r\n .attr(\r\n \"x\",\r\n svgWidth -\r\n aleph.margin.line[aleph.windowSize].left -\r\n aleph.margin.line[aleph.windowSize].right\r\n )\r\n .attr(\"y\", 50)\r\n .text(aleph.axisMainTitles.lineChart.x);\r\n\r\n // draw tick grid lines extending from y-axis ticks on axis across scatter graph\r\n var yticks = d3.selectAll(\".axis.axis--y.mainAxis\").selectAll(\".tick\");\r\n yticks\r\n .append(\"svg:line\")\r\n .attr(\"class\", \"aleph-yAxisTicks\")\r\n .attr(\"y0\", 0)\r\n .attr(\"y1\", 0)\r\n .attr(\"x1\", 0)\r\n .attr(\r\n \"x2\",\r\n svgWidth -\r\n aleph.margin.line[aleph.windowSize].left -\r\n aleph.margin.line[aleph.windowSize].right\r\n );\r\n\r\n // set up SVG slider for y-axis on line chart to allow user to expand/contract view ...\r\n setUpLineSliders();\r\n addSVGtoSliders();\r\n\r\n d3.selectAll(\".aleph-chart.aleph-line-chart\")\r\n .append(\"g\")\r\n .attr(\"class\", \"aleph-lineChart-group\");\r\n\r\n //declare g appending for mouseover recctangle\r\n mouseG = d3\r\n .select(\"#aleph-line-chart\")\r\n .append(\"g\")\r\n .attr(\"class\", \"mouse-over-effects\");\r\n\r\n // append to 'g' the black vertical line to follow mouse\r\n mouseG\r\n .append(\"path\")\r\n .attr(\"class\", \"mouse-line\")\r\n .attr(\r\n \"transform\",\r\n \"translate(\" + 0 + \",\" + aleph.margin.line[aleph.windowSize].top + \")\"\r\n );\r\n\r\n aleph.chartLines = document.getElementsByClassName(\"line mainline\");\r\n\r\n getChartDimensions();\r\n\r\n var chartWidth = aleph.xMain.range()[1] - aleph.xMain.range()[0];\r\n var chartHeight = aleph.yMain.range()[0] - aleph.yMain.range()[1];\r\n\r\n d3.selectAll(\".aleph-line-chart\")\r\n .append(\"svg:image\")\r\n .attr(\"class\", \"aleph-wasteBin\")\r\n .attr(\"xlink:href\", \"image/wasteBin.svg\")\r\n .attr(\"width\", 50)\r\n .attr(\"height\", 50)\r\n .attr(\"x\", aleph.margin.line[aleph.windowSize].left + 10)\r\n .attr(\"y\", aleph.margin.line[aleph.windowSize].top + chartHeight - 55)\r\n .on(\"mouseover\", function () {\r\n aleph.lineCanBeBinned = true;\r\n d3.selectAll(\".aleph-wasteBin\").classed(\"aleph-mouseover\", true);\r\n })\r\n .on(\"mouseout\", function () {\r\n aleph.lineCanBeBinned = false;\r\n d3.selectAll(\".aleph-wasteBin\").classed(\"aleph-mouseover\", false);\r\n })\r\n .classed(\"aleph-hide\", true);\r\n\r\n d3.selectAll(\".aleph-line-chart\")\r\n .append(\"svg:image\")\r\n .attr(\"class\", \"aleph-reset\")\r\n .attr(\"xlink:href\", \"image/reset.svg\")\r\n .attr(\"width\", 40)\r\n .attr(\"height\", 40)\r\n .attr(\"x\", aleph.margin.line[aleph.windowSize].left - 125)\r\n .attr(\"y\", aleph.margin.line[aleph.windowSize].top + chartHeight + 55)\r\n .classed(\"aleph-hide\", true)\r\n .on(\"click\", function () {\r\n resetLineChartAxes();\r\n return;\r\n });\r\n\r\n d3.selectAll(\".aleph-line-chart\")\r\n .append(\"svg:image\")\r\n .attr(\"class\", \"aleph-countspercent counts\")\r\n .attr(\"id\", \"aleph-countspercent\")\r\n .attr(\"xlink:href\", function () {\r\n if (aleph.lineChartyAxisType == \"counts\") {\r\n return \"image/percents.svg\";\r\n } else {\r\n return \"image/counts.svg\";\r\n }\r\n })\r\n .attr(\"width\", 40)\r\n .attr(\"height\", 40)\r\n .attr(\"x\", aleph.margin.line[aleph.windowSize].left - 125)\r\n .attr(\"y\", aleph.margin.line[aleph.windowSize].top + chartHeight + 25)\r\n .classed(\"aleph-hide\", false)\r\n .on(\"click\", function () {\r\n transitionLineChartBetweenCounts_and_Percents(this);\r\n return;\r\n });\r\n\r\n return;\r\n}", "get horizontalLineStroke() {\r\n return brushToString(this.i.pb);\r\n }", "draw_line (line, color, line_width, context, layer_name) {\n // Make sure we don't plot below the axis\n let pt_1 = [context.x_low, line.compute_y(context.x_low)];\n if (pt_1[1] < context.y_low) {\n pt_1 = [line.compute_x(context.y_low), context.y_low];\n }\n\n let pt_2 = [context.x_high, line.compute_y(context.x_high)];\n if (pt_2[1] < context.y_low) {\n pt_2 = [line.compute_x(context.y_low), context.y_low];\n }\n\n let curve = new Curve (\n [pt_1[0], pt_2[0]],\n [pt_1[1], pt_2[1]]\n );\n\n this.draw_curve(curve, color, line_width, context, layer_name);\n }", "function InsertLine() {\r\n var range = RTE.Cursor.get_range();\r\n range.deleteContent();\r\n var selection = range.parentElement();\r\n if (!selection) {\r\n return;\r\n }\r\n var line = selection.ownerDocument.createElement('hr');\r\n range.insertNode(line);\r\n RTE.Cursor.get_range().moveToNode(line);\r\n RTE.Cursor.update();\r\n}", "function transitionLineChart() {\r\n if (aleph.lineChartyAxisType == \"counts\") {\r\n aleph.lineChartYAxisDomain = [\r\n 0,\r\n Math.ceil(aleph.maxchartYAxisValue / aleph.lineChartYAxisRounding) *\r\n aleph.lineChartYAxisRounding,\r\n ];\r\n } else {\r\n aleph.lineChartYAxisDomain = [0, 100];\r\n }\r\n\r\n /*\r\n transition chart data axis to accommodarte all lines;\r\n needed to handle new line plotting off .domain extent of current y-axis\r\n */\r\n // update y-axis domain defintion\r\n aleph.yMain.domain(\r\n aleph.lineChartYAxisDomain /* [\r\n 0,\r\n Math.ceil(aleph.maxchartYAxisValue / aleph.lineChartYAxisRounding) *\r\n aleph.lineChartYAxisRounding,\r\n ] */\r\n );\r\n\r\n $(\"#vertical-line-slider-range\")\r\n .slider(\"option\", \"values\", [\r\n aleph.yMain.domain()[0],\r\n aleph.yMain.domain()[1],\r\n ])\r\n .slider(\"option\", \"max\", aleph.yMain.domain()[1]);\r\n\r\n // d3.selectAll(\".slider-label.slider-label-fixed-top\").text(\r\n // numberWithCommas(aleph.yMain.domain()[1])\r\n // );\r\n d3.selectAll(\".slider-label.slider-label-fixed-top\").text(function () {\r\n if (aleph.lineChartyAxisType == \"counts\") {\r\n return numberWithCommas(aleph.yMain.domain()[1]);\r\n } else {\r\n return aleph.yMain.domain()[1].toFixed(1);\r\n }\r\n });\r\n\r\n d3.selectAll(\".aleph-yAxisTitle\").html(\r\n \"Number of UK Population (between \" +\r\n numberWithCommas(aleph.yMain.domain()[0]) +\r\n \" to \" +\r\n numberWithCommas(aleph.yMain.domain()[1]) +\r\n \")\"\r\n );\r\n\r\n d3.selectAll(\".slider-label.slider-label-movable-top\")\r\n .style(\"bottom\", \"100%\")\r\n .text(numberWithCommas(aleph.yMain.domain()[1]) + \" -\");\r\n\r\n d3.selectAll(\".slider-label.slider-label-movable-bottom\")\r\n .style(\"bottom\", \"0%\")\r\n .text(numberWithCommas(aleph.yMain.domain()[0]) + \" -\");\r\n\r\n // transition y axis to new domain extent\r\n d3.selectAll(\".axis.axis--y.mainAxis\")\r\n .transition()\r\n .duration(aleph.lineChartTransitionDuration)\r\n .ease(d3.easeLinear)\r\n .call(d3.axisLeft(aleph.yMain));\r\n\r\n /*\r\n Remove from DOM and redraw tick grid lines extending from y-axis ticks on axis across scatter graph\r\n */\r\n d3.selectAll(\".aleph-yAxisTicks\").remove();\r\n var yticks = d3.selectAll(\".axis.axis--y.mainAxis\").selectAll(\".tick\");\r\n yticks\r\n .append(\"svg:line\")\r\n .attr(\"class\", \"aleph-yAxisTicks\")\r\n .attr(\"y0\", 0)\r\n .attr(\"y1\", 0)\r\n .attr(\"x1\", 0)\r\n .attr(\r\n \"x2\",\r\n svgWidth -\r\n aleph.margin.line[aleph.windowSize].left -\r\n aleph.margin.line[aleph.windowSize].right\r\n );\r\n\r\n // Transition all coloured data lines\r\n d3.selectAll(\".line.mainline\")\r\n .transition()\r\n .duration(aleph.lineChartTransitionDuration)\r\n .ease(d3.easeLinear)\r\n .attr(\"d\", aleph.mainline);\r\n\r\n // Transition all data line vertex markers\r\n d3.selectAll(\".aleph-Line-Vertex-Marker-Circles\")\r\n .transition()\r\n .duration(aleph.lineChartTransitionDuration)\r\n .ease(d3.easeLinear)\r\n .attr(\"cx\", function (d) {\r\n return (\r\n aleph.margin.line[aleph.windowSize].left +\r\n aleph.xMain(aleph.parseDate(d.year))\r\n );\r\n })\r\n .attr(\"cy\", function (d) {\r\n return (\r\n aleph.margin.line[aleph.windowSize].top +\r\n aleph.yMain(d[aleph.lineChartyAxisType] /* .counts */ /* value */)\r\n );\r\n });\r\n\r\n // Bring user interaction rectangle to front of chart, above all data lines and circles.\r\n d3.selectAll(\".aleph-mouseRectangle\").moveToFront();\r\n d3.selectAll(\".aleph-wasteBin\").moveToFront();\r\n\r\n return;\r\n}", "function createX(){\n line(0, 0, -vScale/2, -vScale/2);\n line(0, 0, vScale/2, -vScale/2);\n line(0, 0, vScale/2, vScale/2);\n line(0, 0, -vScale/2, vScale/2);\n}", "function horizontalAxis(x, y) {\n newPath(); // Nueva ruta de gráficos\n arrow(x - 20, y, x + 240, y); // Dibuja el eje horizontal\n var t0 = Math.ceil(tU); // hora del primer tick (s)\n var x0 = x + pixT * (t0 - tU); // posición del primer tic \n for (var i = 0; i <= 10; i++) { // para todos los ticks ... \n var xT = x0 + i * pixT; // Coordenada horizontal de la marca\n line(xT, y - 3, xT, y + 3); // dibujar tick\n if (xT >= x + 5 && xT <= x + 215 // Si la marca no está demasiado a la izquierda o a la derecha ...\n &&\n (t0 + i <= 100 || (t0 + i) % 2 == 0)) // ... y espacio para etiquetado disponible ...\n alignText(\"\" + (t0 + i), 1, xT, y + 13); // ... hacer etiquetado\n }\n alignText(symbolTime, 1, DX + 230, DY + 18); // inscripción (t)\n alignText(text16, 1, DX + 230, DY + 30); // especificación de la (s) unidad (es)\n}", "function redraw(drawingData, drawingLineAttributes) {\n $($(canvas).parent()).prepend(\"<canvas id=\\\"targetChart\\\" style=\\\"margin-left: calc(.02 * 100vh); margin-right: calc(.02 * 100vh); margin-top: calc(.02 * 100vh);\\\" class=\\\"chartClass\\\"></canvas>\");\n canvas.remove();\n\n canvas = document.getElementById(\"targetChart\");\n canvas.width = $(window).width() * chart_width_scalar;\n canvas.height = $(window).height() * chart_height_scalar;\n myChart = new Chart(canvas.getContext(\"2d\")).Line(drawingData, drawingLineAttributes);\n\n }", "function PatchLine() { }", "renderAxisLine(props, style, events) {\n const nativeStyle = NativeHelpers.getStyle(style);\n const { role, shapeRendering, className } = this.props;\n return (\n <Line\n className={className}\n role={role || \"presentation\"}\n shapeRendering={shapeRendering || \"auto\"}\n vectorEffect=\"non-scaling-stroke\"\n {...props}\n {...nativeStyle}\n {...events}\n />\n );\n }", "function draw_line(svg1, data, xScale, yScale,class_name){\r\n\tvar valueline = d3.svg.line();\r\n\t//Tracer la ligne \r\n\tvalueline.x(function (d) { return xScale(d.annee) + (xScale.rangeBand() / 2); })\r\n .y(function (d) { return yScale(d.chiffre_af); });\r\n\t// On appelle ici la fonction valueline qui donne les coordonnées à relier à la ligne.\r\n\t// On les append à notre path\t\r\n\tsvg1.append(\"path\") \r\n .data(data)\r\n\t\t.attr(\"class\",class_name)\r\n\t\t.attr(\"fill\", \"none\")\r\n .attr(\"d\", valueline(data));\r\n}", "function Line(){}", "function addAxis(axis) {\n // set the color of the axis\n var color = new THREE$1.Color();\n color.setRGB(axis.x, axis.y, axis.z);\n var material = new THREE$1.MeshBasicMaterial({\n color : color.getHex()\n });\n\n // setup the rotation information\n var rotAxis = new THREE$1.Vector3();\n rotAxis.crossVectors(axis, new THREE$1.Vector3(0, -1, 0));\n var rot = new THREE$1.Quaternion();\n rot.setFromAxisAngle(rotAxis, 0.5 * Math.PI);\n\n // create the arrow\n var arrow = new THREE$1.Mesh(that.headGeom, material);\n arrow.position.copy(axis);\n arrow.position.multiplyScalar(0.95);\n arrow.quaternion.copy(rot);\n arrow.updateMatrix();\n that.add(arrow);\n\n // create the line\n var line;\n if (lineType === 'dashed') {\n var l = lineDashLength;\n for (var i = 0; (l / 2 + 3 * l * i + l / 2) <= 1; ++i) {\n var geom = new THREE$1.CylinderGeometry(shaftRadius, shaftRadius, l);\n line = new THREE$1.Mesh(geom, material);\n line.position.copy(axis);\n // Make spacing between dashes equal to 1.5 times the dash length.\n line.position.multiplyScalar(l / 2 + 3 * l * i);\n line.quaternion.copy(rot);\n line.updateMatrix();\n that.add(line);\n }\n } else if (lineType === 'full') {\n line = new THREE$1.Mesh(that.lineGeom, material);\n line.position.copy(axis);\n line.position.multiplyScalar(0.45);\n line.quaternion.copy(rot);\n line.updateMatrix();\n that.add(line);\n } else {\n console.warn('[Axes]: Unsupported line type. Not drawing any axes.');\n }\n }", "function createLineNewChart(title, data, color, chartDiv) {\n let container = _amcharts_amcharts4_core__WEBPACK_IMPORTED_MODULE_13__[/* create */ \"h\"](chartDiv, _amcharts_amcharts4_core__WEBPACK_IMPORTED_MODULE_13__[/* Container */ \"b\"]);\n container.layout = \"horizontal\";\n container.fixedWidthGrid = true;\n container.width = _amcharts_amcharts4_core__WEBPACK_IMPORTED_MODULE_13__[/* percent */ \"k\"](100);\n container.height = _amcharts_amcharts4_core__WEBPACK_IMPORTED_MODULE_13__[/* percent */ \"k\"](100);\n let chart = container.createChild(_amcharts_amcharts4_charts__WEBPACK_IMPORTED_MODULE_14__[/* XYChart */ \"j\"]);\n chart.width = _amcharts_amcharts4_core__WEBPACK_IMPORTED_MODULE_13__[/* percent */ \"k\"](45);\n chart.height = 70;\n chart.data = data;\n chart.padding(20, 5, 2, 5);\n let categoryAxis = chart.xAxes.push(new _amcharts_amcharts4_charts__WEBPACK_IMPORTED_MODULE_14__[/* CategoryAxis */ \"a\"]());\n categoryAxis.renderer.grid.template.location = 0;\n categoryAxis.renderer.grid.template.disabled = true;\n categoryAxis.renderer.baseGrid.disabled = true;\n categoryAxis.renderer.labels.template.disabled = true;\n categoryAxis.cursorTooltipEnabled = false;\n categoryAxis.dataFields.category = \"Period\";\n let valueAxis = chart.yAxes.push(new _amcharts_amcharts4_charts__WEBPACK_IMPORTED_MODULE_14__[/* ValueAxis */ \"i\"]());\n valueAxis.min = 0;\n valueAxis.renderer.grid.template.disabled = true;\n valueAxis.renderer.baseGrid.disabled = true;\n valueAxis.renderer.labels.template.disabled = true;\n valueAxis.cursorTooltipEnabled = false;\n chart.cursor = new _amcharts_amcharts4_charts__WEBPACK_IMPORTED_MODULE_14__[/* XYCursor */ \"k\"]();\n chart.cursor.lineY.disabled = true;\n chart.cursor.behavior = \"none\";\n let series = chart.series.push(new _amcharts_amcharts4_charts__WEBPACK_IMPORTED_MODULE_14__[/* LineSeries */ \"e\"]());\n series.tooltipText = \"{Period}: [bold]{value}\";\n series.dataFields.categoryX = \"Period\";\n series.dataFields.valueY = \"value\";\n series.tensionX = 0.8;\n series.strokeWidth = 1;\n series.stroke = '#fff'; // render data points as bullets\n\n let bullet = series.bullets.push(new _amcharts_amcharts4_charts__WEBPACK_IMPORTED_MODULE_14__[/* CircleBullet */ \"b\"]());\n bullet.circle.opacity = 1;\n bullet.circle.fill = color;\n bullet.circle.propertyFields.opacity = \"opacity\";\n bullet.circle.radius = 3;\n return chart;\n }", "function line() {\n var inlineHtml =\n '<hr style=\"height:5px; width:100%; border-width:0; color:red; background-color:#fff\">'\n\n return inlineHtml\n }", "function magicLineCalc($ele) {\r\n\t\t\t\r\n\t\t\tvar el, leftPos, ratio;\r\n\t\t\t\r\n\t\t\tel = $ele.parent();\r\n\t\t\tif (el.length) {\r\n\t\t\t\tleftPos = el.position().left;\r\n\t\t\t\tratio = el.width();\r\n\t\t\t} else {\r\n\t\t\t\tleftPos = ratio = 0;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$ele.parent().parent()\r\n\t\t\t\t.find('.magic-line')\r\n\t\t\t\t.css('transform', 'translateX(' + leftPos + 'px) scaleX(' + ratio + ')');\r\n\t\t}", "function draw_first_line(){\n points.push(start);\n points.push(end);\n}", "function createLineNewChart(title, data, color, chartDiv) {\n let container = _amcharts_amcharts4_core__WEBPACK_IMPORTED_MODULE_15__[/* create */ \"h\"](chartDiv, _amcharts_amcharts4_core__WEBPACK_IMPORTED_MODULE_15__[/* Container */ \"b\"]);\n container.layout = \"horizontal\";\n container.fixedWidthGrid = true;\n container.width = _amcharts_amcharts4_core__WEBPACK_IMPORTED_MODULE_15__[/* percent */ \"k\"](100);\n container.height = _amcharts_amcharts4_core__WEBPACK_IMPORTED_MODULE_15__[/* percent */ \"k\"](100);\n let chart = container.createChild(_amcharts_amcharts4_charts__WEBPACK_IMPORTED_MODULE_16__[/* XYChart */ \"j\"]);\n chart.width = _amcharts_amcharts4_core__WEBPACK_IMPORTED_MODULE_15__[/* percent */ \"k\"](45);\n chart.height = 70;\n chart.data = data;\n chart.padding(20, 5, 2, 5);\n let categoryAxis = chart.xAxes.push(new _amcharts_amcharts4_charts__WEBPACK_IMPORTED_MODULE_16__[/* CategoryAxis */ \"a\"]());\n categoryAxis.renderer.grid.template.location = 0;\n categoryAxis.renderer.grid.template.disabled = true;\n categoryAxis.renderer.baseGrid.disabled = true;\n categoryAxis.renderer.labels.template.disabled = true;\n categoryAxis.cursorTooltipEnabled = false;\n categoryAxis.dataFields.category = \"Period\";\n let valueAxis = chart.yAxes.push(new _amcharts_amcharts4_charts__WEBPACK_IMPORTED_MODULE_16__[/* ValueAxis */ \"i\"]());\n valueAxis.min = 0;\n valueAxis.renderer.grid.template.disabled = true;\n valueAxis.renderer.baseGrid.disabled = true;\n valueAxis.renderer.labels.template.disabled = true;\n valueAxis.cursorTooltipEnabled = false;\n chart.cursor = new _amcharts_amcharts4_charts__WEBPACK_IMPORTED_MODULE_16__[/* XYCursor */ \"k\"]();\n chart.cursor.lineY.disabled = true;\n chart.cursor.behavior = \"none\";\n let series = chart.series.push(new _amcharts_amcharts4_charts__WEBPACK_IMPORTED_MODULE_16__[/* LineSeries */ \"e\"]());\n series.tooltipText = \"{Period}: [bold]{value}\";\n series.dataFields.categoryX = \"Period\";\n series.dataFields.valueY = \"value\";\n series.tensionX = 0.8;\n series.strokeWidth = 1;\n series.stroke = '#fff'; // render data points as bullets\n\n let bullet = series.bullets.push(new _amcharts_amcharts4_charts__WEBPACK_IMPORTED_MODULE_16__[/* CircleBullet */ \"b\"]());\n bullet.circle.opacity = 1;\n bullet.circle.fill = color;\n bullet.circle.propertyFields.opacity = \"opacity\";\n bullet.circle.radius = 3;\n return chart;\n }", "function createLineNewChart(title, data, color, chartDiv) {\n let container = _amcharts_amcharts4_core__WEBPACK_IMPORTED_MODULE_15__[/* create */ \"h\"](chartDiv, _amcharts_amcharts4_core__WEBPACK_IMPORTED_MODULE_15__[/* Container */ \"b\"]);\n container.layout = \"horizontal\";\n container.fixedWidthGrid = true;\n container.width = _amcharts_amcharts4_core__WEBPACK_IMPORTED_MODULE_15__[/* percent */ \"k\"](100);\n container.height = _amcharts_amcharts4_core__WEBPACK_IMPORTED_MODULE_15__[/* percent */ \"k\"](100);\n let chart = container.createChild(_amcharts_amcharts4_charts__WEBPACK_IMPORTED_MODULE_16__[/* XYChart */ \"j\"]);\n chart.width = _amcharts_amcharts4_core__WEBPACK_IMPORTED_MODULE_15__[/* percent */ \"k\"](45);\n chart.height = 70;\n chart.data = data;\n chart.padding(20, 5, 2, 5);\n let categoryAxis = chart.xAxes.push(new _amcharts_amcharts4_charts__WEBPACK_IMPORTED_MODULE_16__[/* CategoryAxis */ \"a\"]());\n categoryAxis.renderer.grid.template.location = 0;\n categoryAxis.renderer.grid.template.disabled = true;\n categoryAxis.renderer.baseGrid.disabled = true;\n categoryAxis.renderer.labels.template.disabled = true;\n categoryAxis.cursorTooltipEnabled = false;\n categoryAxis.dataFields.category = \"Period\";\n let valueAxis = chart.yAxes.push(new _amcharts_amcharts4_charts__WEBPACK_IMPORTED_MODULE_16__[/* ValueAxis */ \"i\"]());\n valueAxis.min = 0;\n valueAxis.renderer.grid.template.disabled = true;\n valueAxis.renderer.baseGrid.disabled = true;\n valueAxis.renderer.labels.template.disabled = true;\n valueAxis.cursorTooltipEnabled = false;\n chart.cursor = new _amcharts_amcharts4_charts__WEBPACK_IMPORTED_MODULE_16__[/* XYCursor */ \"k\"]();\n chart.cursor.lineY.disabled = true;\n chart.cursor.behavior = \"none\";\n let series = chart.series.push(new _amcharts_amcharts4_charts__WEBPACK_IMPORTED_MODULE_16__[/* LineSeries */ \"e\"]());\n series.tooltipText = \"{Period}: [bold]{value}\";\n series.dataFields.categoryX = \"Period\";\n series.dataFields.valueY = \"value\";\n series.tensionX = 0.8;\n series.strokeWidth = 1;\n series.stroke = '#fff'; // render data points as bullets\n\n let bullet = series.bullets.push(new _amcharts_amcharts4_charts__WEBPACK_IMPORTED_MODULE_16__[/* CircleBullet */ \"b\"]());\n bullet.circle.opacity = 1;\n bullet.circle.fill = color;\n bullet.circle.propertyFields.opacity = \"opacity\";\n bullet.circle.radius = 3;\n return chart;\n }", "function setActiveHorizontalLine(thisElementID,HorizontalTabInfoID) {\n\tvar HorizontalTabID = $(\"#HorizontalTab\"+HorizontalTabInfoID).attr(\"data-id\");\n\tvar left = parseInt(HorizontalTabID) * 200;\n\t$(thisElementID).css(\"left\",left+\"px\");\n}", "function drawLine(name,x0, y0, x1, y1, thickness, color, emit){\n listOfCanvas[name].context.beginPath();\n\t\tlistOfCanvas[name].context.globalCompositeOperation=\"source-over\";\n\t\tlistOfCanvas[name].context.moveTo((x0 + $(\"#canvasContainer\" + listOfCanvas[name].container).scrollLeft()), y0);\n\t\tlistOfCanvas[name].context.lineTo((x1 + $(\"#canvasContainer\" + listOfCanvas[name].container).scrollLeft()), y1);\n\t\tlistOfCanvas[name].context.strokeStyle = color;\n\t\tlistOfCanvas[name].context.lineWidth = thickness*scale;\n\t\tlistOfCanvas[name].context.stroke();\n listOfCanvas[name].context.closePath();\n }", "drawLines() {\n // Early bailout for timeaxis without start date\n if (!this.client.timeAxis.startDate) {\n return;\n }\n\n // We cannot rely on timeAxisViewModel because rendered header may not include full top header.\n // This means we should generate whole top level tick and then iterate over ticks, calculating lines position\n // depending on header config\n const me = this,\n { client } = me,\n { timeAxis } = client,\n axisStart = timeAxis.startDate,\n viewModel = client.timeAxisViewModel,\n tickSize = viewModel.tickSize,\n element = client.backgroundCanvas,\n canvas = document.createElement('canvas'),\n ctx = canvas.getContext('2d'),\n linesForLevel = viewModel.columnLinesFor,\n // header to draw lines for\n targetHeader = viewModel.headerConfig[linesForLevel],\n headers = viewModel.headers,\n // header which is used to draw major lines\n upperHeader = headers[headers.indexOf(targetHeader) - 1] || headers[0],\n // header defining ticks\n lowerHeader = headers[headers.length - 1],\n // when unit is year we should use 1 as increment\n startDate = timeAxis.floorDate(\n axisStart,\n false,\n upperHeader.unit,\n upperHeader.unit === 'year' ? 1 : upperHeader.increment || 1\n ),\n endDate = DateHelper.getNext(startDate, upperHeader.unit, upperHeader.increment || 1, timeAxis.weekStartDay),\n // we rendered one upper header and need to calculate how many ticks fit in it\n ticksInHeader =\n Math.round(DateHelper.getDurationInUnit(startDate, endDate, lowerHeader.unit)) / (lowerHeader.increment || 1),\n nbrLinesToDraw =\n Math.round(DateHelper.getDurationInUnit(startDate, endDate, targetHeader.unit)) / (targetHeader.increment || 1),\n // shows how many ticks should we skip before drawing next line\n ratio = ticksInHeader / nbrLinesToDraw;\n\n if (client.isHorizontal) {\n if (axisStart) {\n const doUnitsAlign = headers.length > 1 && DateHelper.doesUnitsAlign(upperHeader.unit, targetHeader.unit),\n offsetDate = doUnitsAlign\n ? startDate\n : timeAxis.floorDate(axisStart, false, targetHeader.unit, targetHeader.increment),\n // TODO: isContinuous check solved the issue I was seeing but not very generic\n offset = !timeAxis.isContinuous\n ? 0\n : (DateHelper.getDurationInUnit(offsetDate, axisStart, lowerHeader.unit, true) / timeAxis.increment) *\n tickSize,\n // this is position from left side of the canvas to draw first line, otherwi\n startPos = 10,\n height = 20;\n\n DomHelper.removeEachSelector(element, '.b-column-line-major');\n\n let isMajor = false,\n majorHeaderIsRegular = true;\n\n if (\n targetHeader !== upperHeader &&\n doUnitsAlign &&\n lowerHeader.unit === 'day' &&\n DateHelper.compareUnits(upperHeader.unit, 'month') !== -1\n ) {\n // This condition means, that major lines are irregular, e.g. when lower level is days and upper is\n // months. Since months have different duration, we cannot safely repeat images\n majorHeaderIsRegular = false;\n timeAxis.forEachAuxInterval(upperHeader.unit, upperHeader.increment, (start, end) => {\n DomHelper.append(element, {\n tag: 'div',\n className: 'b-column-line-major',\n style: `left:${viewModel.getPositionFromDate(end) - 1}px;`\n });\n });\n }\n\n // hack for FF to not crash when trying to create too wide canvas.\n canvas.width = Math.min(ticksInHeader * 2 * tickSize, 32767);\n canvas.height = height;\n ctx.translate(-0.5, -0.5);\n ctx.lineWidth = 2;\n\n for (let i = 0; i < nbrLinesToDraw; i++) {\n // Only first interval may be major\n if (i === 0) {\n // Filtered time axis should not have any major lines\n isMajor = upperHeader !== targetHeader && doUnitsAlign && majorHeaderIsRegular && timeAxis.isContinuous;\n } else {\n isMajor = false;\n }\n\n const tickStyle = (isMajor && me.majorTickStyle) || (!isMajor && me.tickStyle);\n if (tickStyle !== 'solid') {\n switch (tickStyle) {\n case 'dashed':\n ctx.setLineDash([6, 4]);\n break;\n case 'dotted':\n ctx.setLineDash([2, 3]);\n break;\n }\n }\n\n ctx.beginPath();\n ctx.strokeStyle = isMajor ? me.majorTickColor : me.tickColor;\n\n // draw ticks\n ctx.moveTo(i * ratio * tickSize * 2 + startPos - 1, 0);\n ctx.lineTo(i * ratio * tickSize * 2 + startPos - 1, height + 2);\n ctx.stroke();\n }\n\n // use as background image\n element.style.backgroundImage = `url(${canvas.toDataURL()})`;\n element.style.backgroundSize = `${canvas.width / 2}px`;\n element.style.backgroundPositionX = `${-(startPos / 2 + offset)}px`;\n }\n } else {\n // hack for FF to not crash when trying to create too wide canvas.\n canvas.width = client.timeAxisColumn.resourceColumns.columnWidth * 2;\n canvas.height = 2;\n ctx.translate(-0.5, -0.5);\n ctx.lineWidth = 2;\n\n if (axisStart) {\n DomHelper.removeEachSelector(element, '.b-column-line-major');\n\n // Major lines always as divs to not get so large image\n if (targetHeader !== upperHeader) {\n timeAxis.forEachAuxInterval(upperHeader.unit, upperHeader.increment, (start, end) => {\n DomHelper.append(element, {\n tag: 'div',\n className: 'b-column-line-major',\n style: `top:${viewModel.getPositionFromDate(end) - 1}px;`\n });\n });\n }\n\n if (me.tickStyle !== 'solid') {\n switch (me.tickStyle) {\n case 'dashed':\n ctx.setLineDash([6, 4]);\n break;\n case 'dotted':\n ctx.setLineDash([2, 3]);\n break;\n }\n }\n\n const height = ratio * tickSize * 2;\n\n canvas.height = height;\n\n ctx.beginPath();\n ctx.strokeStyle = me.tickColor;\n ctx.lineWidth = 2;\n\n // draw ticks\n ctx.moveTo(0, height - 1);\n ctx.lineTo(canvas.width + 2, height - 1);\n ctx.stroke();\n }\n\n ctx.beginPath();\n ctx.strokeStyle = me.tickColor;\n\n // draw ticks\n ctx.moveTo(canvas.width - 1, 0);\n ctx.lineTo(canvas.width - 1, canvas.height + 2);\n ctx.stroke();\n\n // use as background image\n element.style.backgroundImage = `url(${canvas.toDataURL()})`;\n element.style.backgroundSize = `${canvas.width / 2}px`;\n element.style.backgroundPositionX = '0';\n }\n }", "function LineChart($container, chartData)\n{\n var hc = {\n chart: {\n type: 'spline',\n marginLeft: 35,\n marginTop: 45,\n events: {\n load: function ()\n {\n this.ENVOptions = chartData.options;\n $container.find(\".highcharts-axis-labels text\").removeAttr(\"fill\");\n }\n }\n },\n title: {\n text: chartData.options.title,\n align: 'left',\n x: 15,\n style: ENVCharts.globals.styles.title\n },\n legend: {\n enabled: false\n },\n credits: {\n enabled: false\n },\n xAxis: {\n type: 'datetime',\n startOnTick: true,\n minPadding: 0,\n tickmarkPlacement: 'on',\n tickInterval: chartData.options.timeLabelsAt * 365.25 * 24 * 60 * 60 * 1000,\n labels: {\n style: ENVCharts.globals.styles.axisLabels,\n y: 16\n },\n tickPosition: 'inside',\n tickLength: 2,\n tickColor: '#000000',\n lineColor: '#000000'\n },\n yAxis: {\n title: {\n text: chartData.options.axisTitle,\n align: 'high',\n rotation: 0,\n textAlign: 'left',\n offset: -5,\n y: 4,\n style: ENVCharts.globals.styles.axisTitle\n },\n tickPosition: 'inside',\n tickLength: 2,\n lineWidth: 1,\n tickWidth: 1,\n tickColor: '#000000',\n lineColor: '#000000',\n min: chartData.options.axisMin,\n max: chartData.options.axisMax,\n tickInterval: chartData.options.axisTicksAt,\n labels: {\n step: Math.floor(chartData.options.axisLabelsAt / chartData.options.axisTicksAt),\n style: ENVCharts.globals.styles.axisLabels,\n formatter: function ()\n {\n return Math.round(this.value * Math.pow(10, chartData.options.axisLabelsDecimals)) / Math.pow(10, chartData.options.axisLabelsDecimals);\n }\n },\n gridLineWidth: 0\n },\n plotOptions: {\n spline: {\n shadow: false,\n marker: {\n symbol: 'diamond',\n radius: 2\n },\n states: {\n hover: {\n enabled: true,\n lineWidth: 1\n }\n }\n }\n },\n tooltip: {\n shared: true,\n useHTML: true,\n borderWidth: ENVCharts.globals.line.tooltip.borderWidth,\n borderColor: ENVCharts.globals.line.tooltip.borderColor,\n formatter: ENVCharts.globals.line.tooltip.formatter\n },\n series: chartData.series\n };\n\n $container.highcharts(hc);\n}", "drawLine(canvas, dependency, points, assignmentData = null, cache = true) {\n const scheduler = this.client,\n metaId = this.getMetaId(assignmentData); // Reuse existing element if possible\n\n let line = dependency.instanceMeta(metaId).lineElement;\n\n if (!line || !cache) {\n line = document.createElementNS('http://www.w3.org/2000/svg', 'polyline');\n\n if (cache) {\n dependency.instanceMeta(metaId).lineElement = line;\n }\n\n line.setAttribute('depId', dependency.id);\n\n if (assignmentData) {\n line.setAttribute('fromId', assignmentData.from.id);\n line.setAttribute('toId', assignmentData.to.id);\n }\n\n canvas.appendChild(line);\n } // TODO: Use DomHelper.syncClassList\n // className is SVGAnimatedString for svg elements, reading attribute instead\n\n line.classList.length && line.classList.remove.apply(line.classList, line.getAttribute('class').split(' '));\n line.classList.add(this.baseCls);\n\n if (dependency.cls) {\n line.classList.add(dependency.cls);\n }\n\n if (dependency.bidirectional) {\n line.classList.add('b-sch-bidirectional-line');\n }\n\n if (dependency.highlighted) {\n line.classList.add(...dependency.highlighted.split(' '));\n }\n\n if (BrowserHelper.isIE11) {\n const ddr = dependency.getDateRange(true),\n viewStart = scheduler.startDate;\n\n if (ddr.start < viewStart) {\n line.classList.add('b-no-start-marker');\n }\n\n if (ddr.end < viewStart) {\n line.classList.add('b-no-end-marker');\n }\n }\n\n line.setAttribute('points', !points ? '' : points.map((p, i) => i !== points.length - 1 ? `${p.x1},${p.y1}` : `${p.x1},${p.y1} ${p.x2},${p.y2}`).join(' '));\n DomDataStore.set(line, {\n dependency\n });\n return line;\n }", "updateLastLine(line) { // this is used when drawing with the pen\r\n if (line.length < 2) return;\r\n var point1 = line.points[line.points.length - 1];\r\n var point2 = line.points[line.points.length - 2];\r\n point1 = this.worldPointToChunkScreenPoint(point1);\r\n point2 = this.worldPointToChunkScreenPoint(point2);\r\n this.ctx.beginPath();\r\n this.ctx.lineWidth = Main.Camera.getRelativeWidth(line.width);\r\n this.ctx.strokeStyle = line.style;\r\n this.ctx.lineTo(point1.x, point1.y);\r\n this.ctx.lineTo(point2.x, point2.y);\r\n this.ctx.stroke();\r\n }", "function drawLine(chart_drawboard, data_array, chart_title) {\n var data = google.visualization.arrayToDataTable(data_array);\n\n var options = {\n title: chart_title,\n backgroundColor: { fill:'transparent' }\n };\n\n var chart = new google.visualization.LineChart(document.getElementById(chart_drawboard));\n chart.draw(data, options);\n }", "function render_lineBeweging() {\n var plotLine = hgiLine().margin({\n 'top': 20,\n 'right': 100,\n 'bottom': 40,\n 'left': 50\n }).mapping(['meetmoment', 'beweging', 'buiten_zijn']).yDomain([0, 100]).legend(['Beweging', 'Buiten zijn']).yTicks(5).xLabel('Meetmoment');\n d3.select('#lineBeweging').datum(data).call(plotLine);\n}", "_getHorizontalLineGradient(startX, endX) {\n var lineGradient = this.context.createLinearGradient(startX, 0, endX, 0);\n lineGradient.addColorStop(0, Colors.QUESTION_AND_CHOICES_LINE_BASE);\n lineGradient.addColorStop(0.5, Colors.QUESTION_AND_CHOICES_LINE_SHINE);\n lineGradient.addColorStop(1, Colors.QUESTION_AND_CHOICES_LINE_BASE);\n return lineGradient;\n }", "dxdy_lines() {\r\n\t\t//Now add the lines and text underneath and on the side of the slope line so show d(x) and d(y)\r\n\t\tlet oldLines = this.dxdy.selectAll('line');\r\n\t\toldLines.remove();\r\n\t\tlet oldText = this.dxdy.selectAll('text');\r\n\t\toldText.remove();\r\n\t\t//Line for d(x)\r\n\t\tlet left = this.endPointA, right = this.endPointB;\r\n\t\tlet high = this.endPointA, low = this.endPointB;\r\n\t\tif(this.endPointB.x < this.endPointA.x) {\r\n\t\t\tleft = this.endPointB;\r\n\t\t\tright = this.endPointA;\r\n\t\t}\r\n\t\tif(this.endPointA.y > this.endPointB.y) {\r\n\t\t\tlow = this.endPointA;\r\n\t\t\thigh = this.endPointB;\r\n\t\t}\r\n\t\t//Dealing with the bottom d(x) lines and text\r\n\t\tthis.handle_distance.x = Number(Math.abs(left.x - right.x) * this.unit_per_square.x).toFixed(1);\r\n\t\tthis.dxdy.append('line') //Bottom Left x line\r\n\t\t\t.attr('x1', left.x * this.cell_size + this.offset.x)\r\n\t\t\t.attr('y1', low.y * this.cell_size + this.offset.y + this.cell_size / 3)\r\n\t\t\t.attr('x2', left.x * this.cell_size + this.offset.x)\r\n\t\t\t.attr('y2', low.y * this.cell_size + this.offset.y + this.cell_size / 3 * 2)\r\n\t\t\t.attr('stroke', '#595959');\r\n\t\tthis.dxdy.append('line') //Bottom Right x line\r\n\t\t\t.attr('x1', right.x * this.cell_size + this.offset.x)\r\n\t\t\t.attr('y1', low.y * this.cell_size + this.offset.y + this.cell_size / 3)\r\n\t\t\t.attr('x2', right.x * this.cell_size + this.offset.x)\r\n\t\t\t.attr('y2', low.y * this.cell_size + this.offset.y + this.cell_size / 3 * 2)\r\n\t\t\t.attr('stroke', '#595959');\r\n\t\tthis.dxdy.append('line') //Bottom x line\r\n\t\t\t.attr('x1', left.x * this.cell_size + this.offset.x)\r\n\t\t\t.attr('y1', low.y * this.cell_size + this.offset.y + this.cell_size / 2)\r\n\t\t\t.attr('x2', right.x * this.cell_size + this.offset.x)\r\n\t\t\t.attr('y2', low.y * this.cell_size + this.offset.y + this.cell_size / 2)\r\n\t\t\t.attr('stroke', '#595959');\r\n\t\tthis.dxdy.append('text')\r\n\t\t\t.attr('x', (left.x * this.cell_size + this.offset.x) + (right.x - left.x) * this.cell_size / 2 - 5)\r\n\t\t\t.attr('y', low.y * this.cell_size + this.offset.y + this.cell_size)\r\n\t\t\t.attr('font-family', 'sans-serif')\r\n\t\t\t.attr('font-size', this.text_sizes.normal)\r\n\t\t\t.text(this.handle_distance.x);\r\n\r\n\t\t//Dealing with the side d(y) lines and text\r\n\t\tlet side = left;\r\n\t\tlet side_multiplier = -1;\r\n\t\tif(left.y > right.y) { //Find out which side to draw this line on\r\n\t\t\tside = right;\r\n\t\t\tside_multiplier = 1;\r\n\t\t}\r\n\t\tthis.handle_distance.y = Number(Math.abs(low.y - high.y) * this.unit_per_square.y).toFixed(1);\r\n\t\tthis.dxdy.append('line') //Top Side y line\r\n\t\t\t.attr('x1', side.x * this.cell_size + this.offset.x + this.cell_size / 3 * 2 * side_multiplier)\r\n\t\t\t.attr('y1', high.y * this.cell_size + this.offset.y)\r\n\t\t\t.attr('x2', side.x * this.cell_size + this.offset.x + this.cell_size / 3 * side_multiplier)\r\n\t\t\t.attr('y2', high.y * this.cell_size + this.offset.y)\r\n\t\t\t.attr('stroke', '#595959');\r\n\t\tthis.dxdy.append('line') //Bottom Side y line\r\n\t\t\t.attr('x1', side.x * this.cell_size + this.offset.x + this.cell_size / 3 * 2 * side_multiplier)\r\n\t\t\t.attr('y1', low.y * this.cell_size + this.offset.y)\r\n\t\t\t.attr('x2', side.x * this.cell_size + this.offset.x + this.cell_size / 3 * side_multiplier)\r\n\t\t\t.attr('y2', low.y * this.cell_size + this.offset.y)\r\n\t\t\t.attr('stroke', '#595959');\r\n\t\tthis.dxdy.append('line') //Side y line\r\n\t\t\t.attr('x1', side.x * this.cell_size + this.offset.x + this.cell_size / 2 * side_multiplier)\r\n\t\t\t.attr('y1', high.y * this.cell_size + this.offset.y)\r\n\t\t\t.attr('x2', side.x * this.cell_size + this.offset.x + this.cell_size / 2 * side_multiplier)\r\n\t\t\t.attr('y2', low.y * this.cell_size + this.offset.y)\r\n\t\t\t.attr('stroke', '#595959');\r\n\t\tthis.dxdy.append('text')\r\n\t\t\t.attr('x', (side.x * this.cell_size + this.offset.x + this.cell_size * side_multiplier))\r\n\t\t\t.attr('y', (high.y * this.cell_size + this.offset.y) + (low.y - high.y) * this.cell_size / 2)\r\n\t\t\t.attr('font-family', 'sans-serif')\r\n\t\t\t.attr('font-size', this.text_sizes.normal)\r\n\t\t\t.text(this.handle_distance.y);\r\n\r\n\t\tthis.footer.change_question(this.x_units, this.y_units, this.handle_distance.x, this.handle_distance.y);\r\n\t}", "function updateLineChartVis(collection) {\n\tdrawEmptyLineChartLabel(false);\n\tvar line = d3.line()\n\t\t.x(function(d) {\n\t\t\treturn lineChartObj.xscale(d.Ano);\n\t\t})\n\t\t.y(function(d) {\n\t\t\treturn lineChartObj.yscale(d.PercentagemDesemprego);\n\t\t});\n\tvar ymax = 0;\n\tfor(var i = 0; i < lineChartObj.currentCourses.length; i++) {\n\t\tfor(var k = 0; k < lineChartObj.currentCourses[i].data.length; k++) {\n\t\t\tymax = (lineChartObj.currentCourses[i].data[k].PercentagemDesemprego > ymax) ? lineChartObj.currentCourses[i].data[k].PercentagemDesemprego : ymax;\n\t\t}\n\t}\n\t\n\tlineChartObj.yscale.domain([ymax,0]);\n\tvar yaxis = d3.axisLeft().scale(lineChartObj.yscale);\n\td3.select(\"#lineChartVis\").select(\"svg\").select(\".yaxis\").attr(\"transform\", \"translate(\" + 40 + \",0)\").call(yaxis);\n\n\t//Add/update with the new data\n\td3.select(\"#lineChartVis\").select(\"svg\")\n\t\t.append(\"path\")\n\t\t.datum(collection.data)\n\t\t.attr(\"class\", \"line\")\n\t\t.attr(\"d\", line)\n\t\t.attr(\"stroke\", function(d) {\n\t\t\treturn getColorToArea(\"dummy\",d[0].CodigoArea);\n\t\t})\n\t\t.attr(\"id\", function(d) {\n\t\t\tvar course = new Course(d[0].NomeUniversidade, d[0].NomeFaculdade, d[0].key, d[0].CodigoArea);\n\t\t\treturn \"LineId\" + course.getId();\n\t\t})\n\t\t.on(\"mouseover\", function(d) {\n\t\t\tvar mouseOveredCourse = new Course(d[0].NomeUniversidade, d[0].NomeFaculdade, d[0].key, d[0].CodigoArea);\n\t\t\tdispatch.call(\"mouseOverCourse\", mouseOveredCourse, mouseOveredCourse);\n\t\t})\n\t\t.on(\"mouseout\", function(d) {\n\t\t\tdispatch.call(\"mouseOverCourse\", null, null);\n\t\t})\n\t\t.append(\"title\").text(function(d) {\n\t\t\tvar res = \"\";\n\t\t\tres += \"University: \" + d[0].NomeUniversidade;\n\t\t\tres += \"\\nCollege: \" + d[0].NomeFaculdade;\n\t\t\tres += \"\\nCourse: \" + d[0].key;\n\t\t\treturn res;\n\t\t});\n\n\tdrawCurrentCoursesMenu();\n}", "function addLines(lines) {\n for (var j=0; j<lines.length;j++) {\n // create new line\n var linechart = newLine(lines[j].id)\n // attach data\n linechart\n .data(lines[j].values)\n // refresh\n linechart(); \n }\n }", "drawFrame(lineStyle, title, frame, fillStyle) { //hor: # of hor lines; ver: # of ver lines.\n /*Relative value for diff resolution*/\n let ver = lineStyle[1];\n /*Draw frame*/\n this.chart.fillStyle = fillStyle;\n this.chart.fillRect(this.space, this.space, this.len, this.hei);\n this.chart.fill();\n if (frame[0] == \"frame\"){\n this.chart.clearRect(this.space+frame[1],this.space+frame[1],this.len-frame[1]*2,this.hei-frame[1]*2);\n }else if(frame[0] == \"none\"){\n this.chart.clearRect(0, 0, this.ctx.width, this.ctx.height);\n }else{\n this.chart.clearRect(this.space + frame[1], this.space, this.len, this.hei - frame[1]);\n }\n\n /*Draw Ver line*/\n this.chart.strokeStyle = lineStyle[3];\n this.chart.lineWidth = 1;\n this.chart.beginPath();\n for(let i = 1; i < ver; i++){\n this.chart.moveTo(i * this.len/ver + this.space - 1, this.space + frame[1] + 26);\n this.chart.lineTo(i * this.len/ver + this.space - 1, this.space - frame[1] + this.hei);\n }\n this.chart.stroke();\n\n /*Draw Hor line & label*/\n var chartTop = this.findTop(this.max);\n var chartBom = (this.min > 0)? 0: this.min;\n var grids = lineStyle[0];//default value\n\n this.chart.font = \"10px Calibri\";\n this.chart.fillStyle =\"#373838\";\n this.chart.strokeStyle = lineStyle[2];\n this.chart.lineWidth = 1;\n this.chart.beginPath();\n\n for(let i = 0; i <= grids; i++){\n var txt = ( ((chartTop-chartBom)/ grids + chartBom) % 1 === 0)? i*((chartTop-chartBom)/ grids)+chartBom : (i*((chartTop-chartBom)/ grids)+chartBom).toFixed(2);\n this.chart.fillText(txt, this.space-25, this.hei+this.space - i*(this.hei-30)/grids - frame[1] + 2);\n if(lineStyle[4] && i>0){\n this.chart.moveTo(this.space+frame[1],Math.round(this.hei+this.space - i*(this.hei-30)/grids - frame[1]));\n this.chart.lineTo(this.space-frame[1]+this.len,Math.round(this.hei+this.space - i*(this.hei-30)/grids - frame[1]));\n }\n }\n this.chart.stroke();\n\n // draw chart title\n var fp = (isNaN(parseInt(this.dataSet.title[1])))?6:Math.round(parseInt(this.dataSet.title[1]) *0.3);//default font size is 20px\n var titleX = Math.round(this.ctx.width/2) - this.dataSet.title[0].length * fp;\n this.chart.fillStyle = fillStyle;\n this.chart.font = this.dataSet.title[1];\n this.chart.fillText(this.dataSet.title[0], titleX, this.space+22);\n this.chart.fill;\n\n // draw vertical label, rotate needed\n this.chart.rotate(270 * Math.PI / 180);\n this.chart.font = \"18px Calibri\";\n\n // default font size is \"18px Calibri\", make sure label is print in the middle\n this.chart.fillText(this.dataSet.dataLabel[0],-1 * Math.floor((this.hei + this.dataSet.dataLabel[0].length * 9 * 1.5) / 2), 15);\n this.chart.fill;\n this.chart.rotate( - 270 * Math.PI / 180);\n\n // draw horizontal label, rotate needed\n this.chart.font = \"18px Calibri\";\n\n // default font size is \"18px Calibri\" (lenth * 9 pixels), make sure label is print in the middle\n this.chart.fillText(this.dataSet.dataLabel[1], Math.floor((this.len - this.dataSet.dataLabel[1].length * 9) / 2) + this.space, this.hei + this.space + 30);// 30 pixels under the base line\n this.chart.fill;\n }", "function redrawClientslineChart() {\n nv.addGraph(function() {\n var chart = nv.models.lineChart()\n .useInteractiveGuideline(true);\n chart.width(700);\n chart.margin({left:50});\n chart.color(['#2ca02c', 'darkred','darkblue']);\n chart.x(function(d,i) { return i });\n chart.xAxis\n .axisLabel('Date')\n .tickFormat(function(d) {\n var label = scope.data23[0].values[d].label1;\n return label;\n });\n chart.yAxis\n .axisLabel('Y axis')\n .tickFormat(function(d){\n return d3.format(',f')(d);\n });\n d3.select('#chart svg')\n .datum(scope.data23)\n .transition().duration(500)\n .call(chart);;\n nv.utils.windowResize(chart.update);;\n return chart;\n });\n }", "function drawChart(){\n\n\tdataTable = new google.visualization.DataTable(data);\n\toptions.hAxis.ticks = dataTable.getDistinctValues(0);\n\n\tview = new google.visualization.DataView(dataTable);\n\t\n\toptions['series'] = Series();\n options['selectionMode'] = 'multiple';\n options['tooltip'] = {\n 'isHtml': true,\n trigger: 'both'\n }\n\n\tchart = new google.visualization.LineChart(document.getElementById(containerId));\n\n\tchart.draw(view, options);\n\n\t//google.visualization.drawChart({\n\t//\t\"containerId\": containerId,\n\t//\t\"chartType\": chartType,\n\t//\t\"options\": options,\n\t//\t\"dataTable\": data,\n\t//\t\"view\": view\n\t//})\n}", "function renderXAxis(newLinearXScale, xAxis) {\n\n // Call the axisBottom function to update the axis values\n var bottomAxis = d3.axisBottom(newLinearXScale);\n\n // Transisition to the newly chosen x-axis\n xAxis.transition()\n .duration(1000)\n .call(bottomAxis);\n\n return xAxis;\n}", "function resetLineChartAxes() {\r\n d3.selectAll(\".aleph-reset\").classed(\"aleph-hide\", true);\r\n d3.selectAll(\".aleph-wasteBin\").classed(\"aleph-hide\", true);\r\n\r\n var yAxisMax = -1;\r\n\r\n if (aleph.lineChartyAxisType == \"counts\") {\r\n yAxisMax =\r\n Math.ceil(aleph.maxchartYAxisValue / aleph.lineChartYAxisRounding) *\r\n aleph.lineChartYAxisRounding;\r\n } else {\r\n yAxisMax = 100;\r\n }\r\n\r\n aleph.yMain.domain([0, yAxisMax]);\r\n\r\n d3.selectAll(\".axis.axis--y.mainAxis\")\r\n .transition()\r\n .duration(aleph.lineChartTransitionDuration)\r\n .ease(d3.easeLinear)\r\n .call(d3.axisLeft(aleph.yMain));\r\n\r\n $(\"#vertical-line-slider-range\")\r\n .slider(\"option\", \"values\", [0, yAxisMax])\r\n .slider(\"option\", \"max\", aleph.yMain.domain()[1]);\r\n\r\n d3.selectAll(\".slider-label.slider-label-fixed-top\").text(function () {\r\n if (aleph.lineChartyAxisType == \"counts\") {\r\n return numberWithCommas(aleph.yMain.domain()[1]);\r\n } else {\r\n return aleph.yMain.domain()[1].toFixed(1);\r\n }\r\n });\r\n\r\n // d3.selectAll(\".slider-label.slider-label-movable-top\")\r\n // .style(\"bottom\", \"100%\")\r\n // .text(numberWithCommas(aleph.yMain.domain()[1]));\r\n\r\n d3.selectAll(\".slider-label.slider-label-movable-top\")\r\n .style(\"bottom\", \"100%\")\r\n .text(function () {\r\n if (aleph.lineChartyAxisType == \"counts\") {\r\n return numberWithCommas(aleph.yMain.domain()[1]) + \" -\";\r\n } else {\r\n return aleph.yMain.domain()[1].toFixed(1) + \" -\";\r\n }\r\n });\r\n\r\n // d3.selectAll(\".slider-label.slider-label-movable-bottom\")\r\n // .style(\"bottom\", \"0%\")\r\n // .text(numberWithCommas(aleph.yMain.domain()[0]));\r\n\r\n d3.selectAll(\".slider-label.slider-label-movable-bottom\")\r\n .style(\"bottom\", \"0%\")\r\n .text(function () {\r\n if (aleph.lineChartyAxisType == \"counts\") {\r\n return numberWithCommas(aleph.yMain.domain()[0]) + \" -\";\r\n } else {\r\n return aleph.yMain.domain()[0].toFixed(1) + \" -\";\r\n }\r\n });\r\n\r\n aleph.xMain.domain([\r\n aleph.parseDate(aleph.years[0]),\r\n aleph.parseDate(aleph.years[aleph.years.length - 1]),\r\n ]);\r\n\r\n d3.selectAll(\".axis.axis--x.mainAxis\")\r\n .transition()\r\n .duration(aleph.lineChartTransitionDuration)\r\n .ease(d3.easeLinear)\r\n .call(d3.axisBottom(aleph.xMain));\r\n\r\n $(\"#horizontal-line-slider-range\").slider(\"option\", \"values\", [\r\n aleph.years[0],\r\n aleph.years[aleph.years.length - 1],\r\n ]);\r\n\r\n d3.selectAll(\".slider-label.slider-label-movable-left\")\r\n .style(\"left\", \"0%\")\r\n .text(aleph.years[0]);\r\n\r\n d3.selectAll(\".slider-label.slider-label-movable-right\")\r\n .style(\"left\", \"100%\")\r\n .text(aleph.years[aleph.years.length - 1]);\r\n\r\n d3.selectAll(\".aleph-yAxisTicks\").remove();\r\n\r\n // draw tick grid lines extending from y-axis ticks on axis across scatter graph\r\n var yticks = d3.selectAll(\".axis.axis--y.mainAxis\").selectAll(\".tick\");\r\n yticks\r\n .append(\"svg:line\")\r\n .attr(\"class\", \"aleph-yAxisTicks\")\r\n .attr(\"y0\", 0)\r\n .attr(\"y1\", 0)\r\n .attr(\"x1\", 0)\r\n .attr(\r\n \"x2\",\r\n svgWidth -\r\n aleph.margin.line[aleph.windowSize].left -\r\n aleph.margin.line[aleph.windowSize].right\r\n );\r\n\r\n d3.selectAll(\".aleph-yAxisTitle\").html(\"Number of UK Population\");\r\n\r\n // Transition all coloured data lines\r\n d3.selectAll(\".line.mainline\")\r\n .transition()\r\n .duration(aleph.lineChartTransitionDuration)\r\n .ease(d3.easeLinear)\r\n .attr(\"d\", aleph.mainline);\r\n\r\n // Transition all data line vertex markers\r\n d3.selectAll(\".aleph-Line-Vertex-Marker-Circles\")\r\n .transition()\r\n .duration(aleph.lineChartTransitionDuration)\r\n .ease(d3.easeLinear)\r\n .attr(\"cx\", function (d) {\r\n return (\r\n aleph.margin.line[aleph.windowSize].left +\r\n aleph.xMain(aleph.parseDate(d.year))\r\n );\r\n })\r\n .attr(\"cy\", function (d) {\r\n return (\r\n aleph.margin.line[aleph.windowSize].top +\r\n aleph.yMain(d[aleph.lineChartyAxisType])\r\n );\r\n });\r\n\r\n return;\r\n} // end function resetLineChartAxes", "function addLabelToLine(lineData, label, className) {\n\tvar delay = (label == \"Weekly Average\") ? 0 : 1000;\n\tsvgLine.append(\"text\")\n\t \t\t.attr(\"class\", className)\n\t \t\t.attr(\"transform\", function(d, i) {\n\t \t\t\treturn \"translate(\" + xScale(lineData.length -1 + 15) + \",\"\n\t\t\t\t\t\t\t\t\t+ yScale(lineData[lineData.length-1]) + \")\";\n\t\t\t})\n\t\t\t.attr(\"x\", 6)\n\t \t\t.attr(\"dy\", \"0.3em\")\n\t \t\t.text(label)\n\t \t\t.attr(\"visibility\", \"hidden\")\n\t\t\t.transition()\n\t\t\t.delay(delay)\n\t \t\t.attr(\"visibility\", \"visible\");\n}", "rescale(min, max) {\n if(min === 0){\n min = min + \"\";\n }\n if(max === 0){\n max = max + \"\";\n }\n this.x.domain([min || 30, max || 80]);\n\n this.xAxisElement\n .transition().duration(1500).ease(easeSinInOut) // https://github.com/mbostock/d3/wiki/Transitions#wiki-d3_ease\n .call(this.xAxis);\n\n for (let k in this.data) {\n // Add the valueline path.\n this.lineSvg.select(\".MECU\"+k)\n .transition().duration(1500).ease(easeSinInOut)\n .attr(\"d\", this.valueline(this.data[k].r));\n }\n }", "lineChart() {\n if (this._lineChart === undefined) {\n this._windowWidth = window.innerWidth\n this._lineChart = new LineChart(this.store(), 60, \"[data-viz='wrapper']\", \"[data-viz='tooltip']\")\n }\n return this._lineChart\n }", "function updateExternalMeasurement(cm, line) {\r\n line = visualLine(line);\r\n var lineN = lineNo(line);\r\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\r\n view.lineN = lineN;\r\n var built = view.built = buildLineContent(cm, view);\r\n view.text = built.pre;\r\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\r\n return view;\r\n }", "function addAxis(axis) {\n // set the color of the axis\n var color = new THREE.Color();\n color.setRGB(axis.x, axis.y, axis.z);\n var material = new THREE.MeshBasicMaterial({\n color : color.getHex()\n });\n\n // setup the rotation information\n var rotAxis = new THREE.Vector3();\n rotAxis.crossVectors(axis, new THREE.Vector3(0, -1, 0));\n var rot = new THREE.Quaternion();\n rot.setFromAxisAngle(rotAxis, 0.5 * Math.PI);\n\n // create the arrow\n var arrow = new THREE.Mesh(that.headGeom, material);\n arrow.position.copy(axis);\n arrow.position.multiplyScalar(0.95);\n arrow.quaternion.copy(rot);\n arrow.updateMatrix();\n that.add(arrow);\n\n // create the line\n var line;\n if (lineType === 'dashed') {\n var l = lineDashLength;\n for (var i = 0; (l / 2 + 3 * l * i + l / 2) <= 1; ++i) {\n var geom = new THREE.CylinderGeometry(shaftRadius, shaftRadius, l);\n line = new THREE.Mesh(geom, material);\n line.position.copy(axis);\n // Make spacing between dashes equal to 1.5 times the dash length.\n line.position.multiplyScalar(l / 2 + 3 * l * i);\n line.quaternion.copy(rot);\n line.updateMatrix();\n that.add(line);\n }\n } else if (lineType === 'full') {\n line = new THREE.Mesh(that.lineGeom, material);\n line.position.copy(axis);\n line.position.multiplyScalar(0.45);\n line.quaternion.copy(rot);\n line.updateMatrix();\n that.add(line);\n } else {\n console.warn('[ROS3D.Axes]: Unsupported line type. Not drawing any axes.');\n }\n }", "function renderXAxis(newScale, xAxis){\n var BottomAxis = d3.axisBottom(newScale);\n xAxis.transition().duration(1000).call(BottomAxis);\n return xAxis;\n}", "function Line() {}", "function Line() {}", "function Line() {}", "function Line() {}", "function Line() {}", "function ApacheXYLineChart(\n type, model, svgEmbedId, \n isPerspective, legendPosition)\n{\n this.Init(type, model, svgEmbedId, isPerspective, legendPosition);\n}", "function updateExternalMeasurement(cm, line) {\r\n line = visualLine(line);\r\n var lineN = lineNo(line);\r\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\r\n view.lineN = lineN;\r\n var built = view.built = buildLineContent(cm, view);\r\n view.text = built.pre;\r\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\r\n return view\r\n}", "function updateChart() {\n // What are the selected boundaries?\n var extent = d3.event.selection\n // If no selection, back to initial coordinate. Otherwise, update X axis domain\n if(!extent){\n if (!idleTimeout) return idleTimeout = setTimeout(idled, 350); // This allows to wait a little bit\n x.domain([ 4,8])\n }else{\n x.domain([ x.invert(extent[0]), x.invert(extent[1]) ])\n line.select(\".brush\").call(brush.move, null) // This remove the grey brush area as soon as the selection has been done\n }\n // Update axis and line position\n xAxis.transition().duration(1000).call(d3.axisBottom(x))\n line\n .select('.line_vol')\n .transition()\n .duration(1000)\n .attr(\"d\", d3.line()\n .x(function(d) { return x(new Date(d.timestamp_hour)) })\n .y(function(d) { return y(d.volume) })\n )\n // Update axis and line position\n xAxis.transition().duration(1000).call(d3.axisBottom(x))\n line\n .select('.line_hot')\n .transition()\n .duration(1000)\n .attr(\"d\", d3.line()\n .x(function(d) { return x(new Date(d.timestamp_hour)) })\n .y(function(d) { return y(d.hot) })\n )\n // Update axis and line position\n xAxis.transition().duration(1000).call(d3.axisBottom(x))\n line\n .select('.line_cold')\n .transition()\n .duration(1000)\n .attr(\"d\", d3.line()\n .x(function(d) { return x(new Date(d.timestamp_hour)) })\n .y(function(d) { return y(d.cold) })\n )\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view;\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view;\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view;\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view;\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view;\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view;\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view;\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view;\n }", "function graph_line_generate(category,text,data,dom,title,subtitle,color)\n{\n $('#' + dom).highcharts({\n title: {\n text: title\n },\n subtitle: {\n text: subtitle\n },\n xAxis: {\n categories: category,\n crosshair: true\n },\n yAxis: {\n min: 0,\n title: {\n text: text\n }\n },\n legend: {\n layout: 'vertical',\n align: 'right',\n verticalAlign: 'middle',\n borderWidth: 0\n },\n colors: color,\n series: [data]\n });\n}", "function shift_chart_line(label,shift,cases_data,cObject){\n\n set_index = -1\n new_labels_length = 0\n new_data = []\n shift = parseInt(shift)\n\n for(i=0;i < cObject.data.datasets.length;i++)\n {\n set = cObject.data.datasets[i]\n\n if(set[\"label\"] == label){\n set_index = i\n\n }else{\n if(set.data.length > new_labels_length){\n new_labels_length = set.data.length\n\n }\n\n }\n\n\n\n }\n\n for(i=0;i< cases_data.x.length;i++){\n new_data.push({\n x: i+shift,\n y: parseInt(cases_data.y[i])\n })\n }\n\n if(shift+new_data.length > new_labels_length){\n new_labels_length = shift+new_data.length\n\n }\n\n if(new_labels_length > 0){\n new_labels = []\n for(i=0;i<new_labels_length;i++){\n new_labels.push(i)\n }\n\n cObject.data.labels = new_labels\n\n }\n\n if(set_index != -1){\n extra_data = []\n for(i=0;i<shift;i++)\n extra_data.push({x:i,y:0})\n\n cObject.data.datasets[set_index].data = extra_data.concat(new_data)\n cObject.update()\n }\n\n}", "function redrawScale() {\n scaleX.domain([\n startOfSelectedDateStr.toDate(),\n endOfSelectedDateStr.toDate()\n ]);\n timeline.select('.xAxis')\n .call(xAxis);\n // https://gist.github.com/phoebebright/3098488\n }", "function linkLine(d) {\r\n var dx = d.target.x - d.source.x, dy = d.target.y - d.source.y, dr = Math\r\n .sqrt(dx * dx + dy * dy);\r\n var radius = config.decWidth + 3;\r\n var targetX = d.target.x - ((dx * radius) / dr);\r\n var targetY = d.target.y - ((dy * radius) / dr);\r\n\r\n return [targetX, targetY];\r\n }", "function buildLineData(items, target) {\n var data = new google.visualization.DataTable();\n data.addColumn('number', '');\n data.addColumn('number', '');\n\n $.each(items.CurrentYear, function(i, item) {\n data.addRows([[i,item]]);\n });\n\n var options = {\n title: '',\n legend: { position: 'none' },\n colors: ['#37444e'],\n axisFontSize : 0,\n axisTitlesPosition: 'none',\n vAxis: {\n gridlines: {\n color: 'transparent'\n },\n textStyle: {\n color: '#ffffff',\n fontSize:0\n },\n baselineColor: '#fbfbf6'\n },\n hAxis: {\n title:\"\",\n gridlines: {\n color: 'transparent'\n },\n baselineColor: '#fbfbf6'\n },\n tooltip :{\n trigger :'none'\n }\n };\n var chart = new google.visualization.LineChart(document.getElementById(target));\n\n chart.draw(data, options);\n}", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }" ]
[ "0.6873988", "0.6289484", "0.62650836", "0.6237712", "0.60501766", "0.60153943", "0.59681445", "0.594657", "0.5936607", "0.583125", "0.58251613", "0.5798592", "0.5762405", "0.57575756", "0.5748796", "0.57458395", "0.574221", "0.57418716", "0.574093", "0.5739442", "0.5731919", "0.57266283", "0.57232255", "0.57128096", "0.56758505", "0.56669384", "0.5649844", "0.5649844", "0.56396025", "0.56329244", "0.5625715", "0.56247044", "0.56168324", "0.5608251", "0.55942523", "0.5589614", "0.55720973", "0.5570405", "0.5560223", "0.55552197", "0.5545149", "0.5540402", "0.5538187", "0.55367506", "0.55344886", "0.55150753", "0.5513152", "0.55055654", "0.549933", "0.54913545", "0.548527", "0.548445", "0.54821736", "0.54821736", "0.5481268", "0.54775834", "0.54742837", "0.54718614", "0.54664266", "0.5457891", "0.5454318", "0.5448972", "0.5447554", "0.5446401", "0.5444116", "0.54440683", "0.54422426", "0.5440408", "0.5437335", "0.543283", "0.5430964", "0.54227895", "0.5422404", "0.54223156", "0.54161376", "0.5413242", "0.5409726", "0.54058605", "0.54058605", "0.54058605", "0.54058605", "0.54058605", "0.5403384", "0.54014105", "0.53981817", "0.5397362", "0.5397362", "0.5397362", "0.5397362", "0.5397362", "0.5397362", "0.5397362", "0.5397362", "0.53921235", "0.5391493", "0.5390825", "0.5390428", "0.5389843", "0.53887916", "0.53887916" ]
0.7033804
0
set y axis title and label color
function setYAxisColor(chart, color, yaxis) { yaxis = yaxis || 0; chart.yAxis[yaxis].update({ title: { style: { color: color } }, labels: { style: { color: color } } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setYAxisTitleFtn(chart, index, labels) {\n $log.info('setting the Y Axis title: ' + labels[index]);\n chart.options.vAxis.title = labels[index];\n }", "function setYAxisTitleFtn(chart, index, labels) {\n $log.info('setting the Y Axis title: ' + labels[index]);\n chart.options.vAxis.title = labels[index];\n }", "function appendYAxisTitle(svg, plot) {\n svg.append('text')\n .attr('id', 'yTitle')\n .attr('transform', 'translate(' + (plot.padding.left/3) + ','\n + (plot.padding.top + plot.range.y/2) + ') rotate(-90)')\n .text('Concentration %');\n }", "function drawYAxis() {\n paper.leonardo.vLine(plotArea.x, plotArea.y, plotArea.height);\n\n // TODO: Get rid of magic number. Base text on font size instead.\n var valueX = plotArea.x - opts.tickSize,\n valueTextX = plotArea.x - (3 * opts.tickSize);\n\n plot(scaleValues, function (x, y, value) {\n paper.leonardo.hLine(valueX, y, opts.tickSize);\n paper.text(valueTextX, y, value);\n });\n }", "function plot_set_yLabel(plot_id, text) {\n\tif (! (plot_id in plots)) {\n\t\tconsole.log('Broken plot_set_yLabel');\n\t\treturn;\n\t}\n\tplot_options(plot_id).scales.yAxes[0].scaleLabel.labelString = text;\n}", "function updateYlabel() {\n if (options.ylabel && ylabel) {\n ylabel.text(options.ylabel);\n } else {\n ylabel.style(\"display\", \"none\");\n }\n }", "function customYAxis( g ) {\n\t\t// move axis to align properly with the bottom left corner including tick values\n\t\tg.attr( \"transform\", \"translate(\" + ( -chart_margins.left / 2 ) + \", 0)\" )\n\t\tg.call( yAxis );\n\t\tg.select( \".domain\" );\n\t\tg.attr( \"text-anchor\", \"end\" );\n\t\tg.selectAll( \".tick:not(:first-of-type) line\" ).attr( \"stroke\", \"#777\" ).attr( \"stroke-dasharray\", \"2,2\" );\n\t\tg.selectAll( \".tick text\" ).attr( \"x\", -4 ).attr( \"dy\", 0 );\n\t}", "function customYAxis( g ) {\n\t\t// move axis to align properly with the bottom left corner including tick values\n\t\tchart.attr( \"transform\", \"translate(\" + ( -chart_margins.left / 2 ) + \", 0)\" )\n\t\tchart.call( yAxis );\n\t\tchart.select( \".domain\" );\n\t\tchart.attr( \"text-anchor\", \"end\" );\n\t\tchart.selectAll( \".tick:not(:first-of-type) line\" ).attr( \"stroke\", \"#777\" ).attr( \"stroke-dasharray\", \"2,2\" );\n\t\tchart.selectAll( \".tick text\" ).attr( \"x\", -4 ).attr( \"dy\", 0 );\n\t} // appends y-axis to chart group", "function drawYAxis() {\n // draw tick marks and labels\n var domain = y1Domain,\n styles = vis.__styles,\n ticks = vis.getYTicks(scales.y, c.h, extendRange, useLogScale);\n\n if (!extendRange && ticks[ticks.length-1] != domain[1]) ticks.push(domain[1]);\n\n if ($('body').hasClass('fullscreen')) {\n theme.horizontalGrid['stroke-width'] = 2;\n }\n\n _.each(ticks, function(val, t) {\n var y = scales.y(val), x = c.lpad;\n if (val >= domain[0] && val <= domain[1] || extendRange) {\n // c.paper.text(x, y, val).attr(styles.labels).attr({ 'text-anchor': 'end' });\n\n // axis label\n vis.label(x+2, y-10, formatter.y1(val, t == ticks.length-1), { align: 'left', cl: 'axis' });\n // axis ticks\n if (theme.yTicks) {\n vis.path([['M', c.lpad-25, y], ['L', c.lpad-20,y]], 'tick');\n }\n // grid line\n if (theme.horizontalGrid) {\n vis.path([['M', c.lpad, y], ['L', c.w - c.rpad,y]], 'grid')\n .attr(theme.horizontalGrid);\n }\n }\n });\n\n // draw axis line\n if (domain[0] <= 0 && domain[1] >= 0) {\n y = scales.y(0);\n vis.path([['M', c.lpad, y], ['L', c.w - c.rpad,y]], 'axis')\n .attr(theme.xAxis);\n }\n }", "function styleYAxis(selection) {\n // Add classes for tests.\n selection.attr('class', 'chartYAxis');\n\n // These paths are added by d3.axis, but we don't need them.\n selection.selectAll('path')\n .remove();\n\n selection.selectAll('line')\n .attr('class', 'chartYAxisTick__mark');\n\n // Move the text to the left side of the SVG.\n selection.selectAll('text')\n .attr('class', 'chartYAxisTick__text')\n .attr('dx', -(width - marginRight));\n\n // Add small background boxes behind each tick's text.\n // Remove existing boxes first, to avoid duplicates.\n selection.selectAll('rect')\n .remove();\n selection.selectAll('.tick')\n .insert('rect', ':last-child')\n .attr('class', 'chartYAxisTick__background')\n .attr('x', -marginLeft)\n .attr('y', -8)\n .attr('width', marginLeft)\n .attr('height', 15)\n .attr('rx', 2) // Border-radius\n .attr('ry', 2); // Border-radius\n }", "function drawYlabels(data, chartHeight, element) {\n\n // extracts scale from data\n var scale = data.scale;\n\n // determines the maximum value to be displayed on the Y axis of the chart\n var maxY = findMaxY(data.values, scale);\n\n // creates the label area that the labels are rendered to\n var labelArea = $(\"<div>\").attr(\"id\", \"yArea\");\n $(labelArea).css({height: chartHeight + \"px\"});\n $(element).append(labelArea);\n\n var labelHeight;\n var i;\n\n for (i = 0; i <= maxY / scale; i++) {\n // creates a label for each multiple of scale less than or equal to maxY\n var label = $(\"<div>\").addClass(\"yLabel\");\n\n // determines the label height\n labelHeight = ((i * scale) / maxY) * chartHeight;\n\n // updates the position and text displayed for the label\n $(label).css({marginBottom: (labelHeight - 13) + \"px\"});\n $(label).text((i * scale) + \" -\");\n\n // appends the label to the label area\n $(labelArea).append(label);\n }\n}", "function objectBuildAxisY(colorGrid, colorTick) {\n var axisY = {\n gridColor : colorGrid,\n tickColor : colorTick,\n margin : 20\n };\n return axisY;\n}", "function make_y_gridlines() {\t\t\n \t \treturn d3.axisLeft(yo).ticks(5)\n \t }", "function renderLabelsVertical() {\n var i, origin;\n\n // Y Labels\n for (i = 0; i < this.range.max - this.range.min + 1; i++) {\n origin = getInnerChartPoint([\n 0,\n 100 - (i * 100) / (this.range.max - this.range.min)\n ]);\n\n origin[0] -= LABEL_MARGIN;\n\n this.svg.add('text', origin, String(i + this.range.min), { class: 'chart-label chart-label-y' });\n }\n}", "updatePlot (initialization) {\n const { weightedSumMax } = this.palmMath.getData()\n this.yscale.domain([0, weightedSumMax]).nice()\n this.yAxis.scale(this.yscale)\n\n const container = (initialization)\n ? this.axisContainer\n : this.axisContainer.transition().duration(this.duration)\n\n container\n .call(this.yAxis)\n .selectAll('.tick text')\n .style('font-size', this.fontSize + 'px')\n .style('font-family', this.fontFamily)\n .style('fill', this.fontColor)\n }", "function onUpdate() {\n viz_title.style(\"fill\", (theme.skin() != customSkin) ? theme.skin().labelColor : \"#000\");\n}", "function onUpdate() {\n viz_title.style(\"fill\", (theme.skin() != customSkin) ? theme.skin().labelColor : \"#000\");\n}", "function createYAxis() {\n return d3.svg.axis().scale(that.y).orient('left').ticks(chart.yAxis.tickCount);\n }", "function createYAxis() {\n return d3.svg.axis().scale(that.y).orient('left').ticks(chart.yAxis.tickCount);\n }", "function make_y_axis() {\n return d3.svg.axis()\n .scale(y)\n .orient(\"left\")\n .ticks(10)\n }", "get yAxisAnnotationTextColor() {\r\n return brushToString(this.i.pi);\r\n }", "function make_y_axis() {\n return d3.svg.axis()\n .scale(y)\n .orient(\"left\")\n .ticks(5)\n }", "labelTextAxis(xAxis, yAxis){\n this.xAxis = xAxis;\n this.yAxis = yAxis;\n }", "setFontColor(color){\n this.chart.options.legend.labels.fontColor = color;\n }", "function drawTitle() {\n fill(\"red\");\n textSize(30);\n text(\"[Color Panel] : Does nothing but change color THATS IT!!\", width / 2 + titleOffset, titleOffset);\n}", "function addXYTitles(svg,xTitle,yTitle,xAxis,yAxis,width,height){\n\tvar ticks = svg .append(\"g\")\n\t.attr(\"class\", \"x axis\")\n\t.attr(\"transform\", \"translate(0,\" + height + \")\")\n\t.call(xAxis)\n\t.selectAll('.tick');\n\n\tfor (var j = 0; j < ticks[0].length; j++) {\n\t\tvar c = ticks[0][j],\n\t\t n = ticks[0][j+1];\n\t\tif (!c || !n || !c.getBoundingClientRect || !n.getBoundingClientRect)\n\t\tcontinue;\n\t\twhile (c.getBoundingClientRect().right > n.getBoundingClientRect().left) {\n\t\td3.select(n).remove();\n\t\tj++;\n\t\tn = ticks[0][j+1];\n\t\tif (!n)\n\t\t break;\n\t\t}\n\t}\n\t\n\t/*if(data.length > 7) {\n\t//rotate the x axis labels\n\tsvg.selectAll(\".x text\") // select all the text elements for the xaxis\n\t\t .attr(\"transform\", function(d) {\n\t\t return \"translate(\" + this.getBBox().height*-2 + \",\" + this.getBBox().height + \")rotate(-45)\";\n\t\t });\n\t}*/\n\t\n\tsvg .append(\"g\").append(\"text\")\n\t.attr(\"transform\", \"translate(0,\" + height + \")\")\n\t.attr(\"x\", width / 2)\n\t.attr(\"y\", 25)\n\t.attr(\"dy\", \".71em\")\n\t.style(\"text-anchor\",\"end\")\n\t.text(xtitle)\n\t.attr(\"class\", \"xTitle\");\n\t\n\tsvg\t.append(\"g\")\n\t\t.attr(\"class\", \"y axis\")\n\t\t.call(yAxis).append(\"text\")\n\t\t.attr(\"transform\", \"rotate(-90)\")\n\t\t.attr(\"y\", 6)\n\t\t.attr(\"dy\", \".71em\")\n\t\t.style(\"text-anchor\", \"end\")\n\t\t.text(yaxisname)\n\t\t.attr(\"class\",\"yTitle\");\n}", "function drawTitle(color, title_Y)\n{\n ctx.font = \"50px Arial\";\n ctx.textAlign = \"center\";\n ctx.strokeStyle = color;\n ctx.lineWidth = 3;\n ctx.strokeText(\"CASINO\", MID_CANVAS, title_Y);\n}", "function addBarAxis () {\n\t\t\textraChartGroup.append(\"g\")\n\t\t\t .attr(\"class\", \"barYAxis\")\n\t\t\t .style(\"font-size\", 13 * screenRatio + \"px\")\n\t\t\t .call(leftAxis_extraChart);\n\t\t}", "function grid_y_axis()\r\n\t{\r\n\t\treturn d3.svg.axis()\r\n\t\t\t.scale(yScale)\r\n\t\t\t.orient(\"left\")\r\n\t\t\t.ticks(y_ticks);\r\n\t}", "function gridYaxis() {\t\t\n return d3.axisLeft(y)\n .ticks(5)\n \n}", "function make_y_gridlines() {\n return d3.axisLeft(y)\n .ticks(10);\n }", "function make_y_axis() {\n return d3.svg.axis()\n .scale(y)\n .orient(\"left\")\n .ticks(5)\n}", "function updateBertinMatrixYaxisLabel(collectionHeight) {\n\tvar labelWidth = 90;\n\tvar label = \"\";\n\tif (universityVisObj.currentCollIndex == 0) {\n\t\tlabel = \"Universities\";\n\t} else if (universityVisObj.currentCollIndex == 1) {\n\t\tlabel = \"Colleges\";\n\t} else if (universityVisObj.currentCollIndex == 2) {\n\t\tlabel = \"Courses\";\n\t}\n\tvar x;\n\tif (collectionHeight > 120) {\n\t\tx = -(collectionHeight + labelWidth) / 2;\n\t} else {\n\t\tx = -100;\n\t}\n\n\tuniversityVisObj.svg.select(\".yaxisLabelMatrix\")\n\t\t.transition()\n\t\t.duration(1000)\n\t\t.attr(\"y\", 20)\n\t\t.attr(\"x\", x)\n\t\t.attr(\"transform\", \"rotate(-90)\")\n\t\t.text(label);\n}", "function getYaxisOptions(opts, unit, min, max){\r\n\topts.axes.yaxis = {\r\n min: min,\r\n max: max,\r\n numberTicks: 5,\r\n autoscale: true,\r\n label: unit,\r\n tickOptions: {\r\n          angle: 0\r\n },\r\n tickInterval: null\r\n };\r\n opts.seriesDefaults.shadow = true;\r\n opts.seriesDefaults.pointLabels = {show: true};\r\n opts.seriesDefaults.markerOptions.color = 'darkblue';\r\n opts.highlighter.sizeAdjust = 4; \r\n\r\n return opts;\r\n}", "function make_y_gridlines() {\t\t\n return d3.axisLeft(yScale)\n .ticks(10)\n }", "function make_y_gridlines() {\t\t\n return d3.axisLeft(y)\n .ticks( 2*commentTicks )\n }", "function make_y_gridlines() {\n return d3.axisLeft(YScale)\n .ticks(10)\n }", "function make_y_gridlines() {\t\t\n return d3.axisLeft(y)\n .ticks(5)\n }", "function make_y_gridlines() {\r\n return d3.axisLeft(y)\r\n .ticks(5)\r\n }", "function make_y_gridlines() {\n return d3.axisLeft(y)\n .ticks(5)\n }", "function make_y_gridlines() {\n\t return d3.axisLeft(y)\n\t\t.ticks(11)\n\t}", "function make_y_gridlines() {\t\t\r\n\t\treturn d3.axisLeft(y)\r\n\t\t\t.ticks(5)\r\n\t}", "function yA(data){\n\t\treturn d3.svg.axis()\n\t\t\t.scale(yScales(data))\n\t\t\t.orient(\"left\")\n\t\t\t.ticks(10)\n\t\t\t.tickSize(5,0); //the second argumnet takes the first and last tick off\n\t}", "function highChart(xAxisArr,yAxisArray,subTitle,yTitle){\n var chart = Highcharts.chart('container', {\n title: {\n text: 'IPL Match'\n },\n subtitle: {\n text: subTitle\n },\n xAxis: {\n categories: xAxisArr\n },\n yAxis: {\n title:{\n text:yTitle,\n align:'middle'\n }\n },\n series: [{\n type: 'column',\n colorByPoint: true,\n data: yAxisArray,\n showInLegend: false\n }] \n });\n}", "function drawPlotLabels() {\n\tctx.save();\n\tctx.beginPath();\n\tctx.font = \"bold 20px sans-serif\";\n\tctx.fillText(String(plot.xmax),765,790);\n\tctx.fillText(String(plot.xmin),50,790);\n\tctx.fillText(String(plot.ymax), 10,20);\n\tctx.fillText(String(plot.ymin),10,770);\n\tctx.closePath();\n\tctx.restore();\n}", "function make_y_gridlines() {\n return d3.axisLeft(y).ticks(5)\n }", "function make_y_gridlines() { \n return d3.axisLeft(y0)\n .ticks(10)\n }", "function make_y_gridlines() {\n\t\treturn d3.axisLeft(yScale)\n\t\t\t.ticks(5)\n\t}", "function make_y_gridlines() {\n return d3.axisLeft(yScale)\n .ticks(10)\n }", "_drawYGrid(yAxisTag) {\n let layout = this._chartLayout;\n let yAxisConfig = yAxisTag.axisConfig;\n let yAxisLayout = yAxisTag.axisLayout;\n let yAxisRect = yAxisLayout.areaRect;\n\n this._context.textBaseline = \"middle\";\n this._context.font = yAxisConfig.fontSize + \"px \" + this.displayOptions.chartArea.fontName;\n\n let labelMarginT = scada.chart.DisplayOptions.getMargin(yAxisConfig.labelMargin, 0);\n let labelMarginR = scada.chart.DisplayOptions.getMargin(yAxisConfig.labelMargin, 1);\n let labelMarginB = scada.chart.DisplayOptions.getMargin(yAxisConfig.labelMargin, 2);\n let labelMarginL = scada.chart.DisplayOptions.getMargin(yAxisConfig.labelMargin, 3);\n let prevLblY = NaN;\n let tickL, tickR, minorTickL, minorTickR, axisX, lblX;\n\n if (yAxisConfig.position === scada.chart.AreaPosition.LEFT) {\n this._context.textAlign = \"right\";\n tickR = yAxisRect.right - 1;\n tickL = tickR - yAxisConfig.majorTickSize;\n minorTickR = tickR;\n minorTickL = minorTickR - yAxisConfig.minorTickSize;\n axisX = yAxisRect.right - 1;\n lblX = tickL - labelMarginR;\n } else {\n this._context.textAlign = \"left\";\n tickL = yAxisRect.left;\n tickR = tickL + yAxisConfig.majorTickSize;\n minorTickL = tickL;\n minorTickR = minorTickL + yAxisConfig.minorTickSize;\n axisX = yAxisRect.left;\n lblX = tickR + labelMarginL;\n }\n\n let gridL = layout.plotAreaRect.left + layout.canvasXOffset;\n let gridR = gridL + layout.plotAreaRect.width - 1;\n let axisT = yAxisRect.top + layout.canvasYOffset;\n let axisB = axisT + yAxisRect.height - 1;\n\n for (let y = yAxisLayout.gridStart; y < yAxisTag.max; y += yAxisLayout.gridStep) {\n let ptY = this._trendYToCanvasY(y, yAxisTag);\n\n // horizontal grid line\n if (yAxisConfig.showGridLines) {\n this._setColor(this.displayOptions.plotArea.gridColor);\n this._drawLine(gridL, ptY, gridR, ptY);\n }\n\n // major tick and axis line\n this._setColor(yAxisConfig.lineColor);\n this._drawLine(tickL, ptY, tickR, ptY);\n this._drawLine(axisX, axisT, axisX, axisB);\n\n // minor ticks\n if (yAxisConfig.minorTickCount > 0) {\n for (let minorTickY = y + yAxisLayout.minorTickStep, maxMinorTickY = y + yAxisLayout.gridStep;\n minorTickY < maxMinorTickY && maxMinorTickY < yAxisTag.max; minorTickY += yAxisLayout.minorTickStep) {\n\n let minorTickCnvY = this._trendYToCanvasY(minorTickY, yAxisTag);\n this._drawLine(minorTickL, minorTickCnvY, minorTickR, minorTickCnvY);\n }\n }\n\n // label\n this._setColor(yAxisConfig.textColor);\n let lblY = ptY;\n\n if (isNaN(prevLblY) || prevLblY - lblY > yAxisConfig.fontSize) {\n this._context.fillText(y.toFixed(yAxisLayout.gridDigits), lblX, lblY);\n prevLblY = lblY;\n }\n }\n\n // axis title\n if (yAxisConfig.showTitle && yAxisTag.title) {\n this._context.textAlign = \"center\";\n this._context.save();\n this._context.translate(yAxisRect.left + layout.canvasXOffset, yAxisRect.bottom + layout.canvasYOffset);\n this._context.rotate(-Math.PI / 2);\n let titleY;\n\n if (yAxisConfig.position === scada.chart.AreaPosition.LEFT) {\n this._context.textBaseline = \"top\";\n titleY = labelMarginT;\n } else {\n this._context.textBaseline = \"bottom\";\n titleY = yAxisRect.width - labelMarginB;\n }\n\n this._context.fillText(yAxisTag.title, yAxisRect.height / 2, titleY, yAxisRect.height);\n this._context.restore();\n }\n }", "function setYval(val) {\n\t// Update yVal\n\tyVal = val;\n\t// Update the axis\n\tyScale.domain([d3.min(data, function(d) { return parseFloat(d[yVal]); })-1,\n\t\t\t\t d3.max(data, function(d) { return parseFloat(d[yVal]); })+1])\n\tyAxis.scale(yScale);\n\tyAxisG.call(yAxis);\n\tyLabel.text(yVal);\n\t// Update the points\n\td3.selectAll('.point')\n\t\t.transition()\n\t\t.duration(transDur)\n\t\t.attr('cy', function(d) { return yScale(d[yVal]); });\n}", "function make_y_gridlines() {\n return d3.axisLeft(yScale).ticks(10);\n}", "function setupYScale() {\n var maxSales = d3.max(totalSales, function(d, i) {\n return d.sales;\n });\n y = d3.scaleLinear()\n .range([0, height])\n .domain([maxSales, 0]);\n}", "function make_y_gridlines() {\n return d3\n .axisLeft(y)\n .ticks(10)\n }", "function make_y_gridlines() {\t\t\r\n\t return d3.axisLeft(gdat.var1.yScale)\r\n\t .ticks(5)\r\n\t\t}", "function displayAxisTitles (options) {\n var xTitle = $(\"<h3></h3\").attr( {\"id\": \"xtitle\",\n \"class\": \"axistitle\"});\n xTitle.text(options.xaxistitle);\n var yTitle = $(\"<h3></h3\").attr( {\"id\": \"ytitle\",\n \"class\": \"axistitle\"});\n yTitle.text(options.yaxistitle);\n $(\"#chartarea\").append(xTitle,yTitle);\n\n $(\"#xtitle\").css({\n \"align-self\": \"center\",\n \"margin\": \"2px\",\n \"padding\": \"5px\",\n \"position\": \"absolute\",\n \"top\": \"105%\",\n \"font-size\": \"medium\"\n });\n\n$(\"#ytitle\").css( {\n \"left\": \"-20%\",\n \"margin\": \"2px\",\n \"padding\": \"2px\",\n \"position\": \"absolute\",\n \"top\":\"50%\",\n \"transform\": \"rotate(-90deg)\",\n \"font-size\": \"medium\"\n });\n\n}", "function make_y_gridlines() {\t\t\n return d3.axisLeft(y)\n .ticks(10)\n}", "function make_y_gridlines() {\t\t\n return d3.axisLeft(y)\n .ticks(10)\n}", "function make_y_gridlines() {\t\t\n return d3.axisLeft(y)\n .ticks(5)\n}", "function build_y_axis(y_axis_scale, y_axis_label) {\n var y_axis_elem = d3.svg.axis()\n .scale(y_axis_scale)\n .orient('left')\n .ticks(5);\n\n return d3.select('#yAxis')\n .transition()\n .call(y_axis_elem)\n .select('#xLabel')\n .text(y_axis_label);\n }", "function yAxis() {\t\t\n return d3.axisLeft(y)\n .tickSize(-width)\n .tickFormat(\"\")\n}", "function make_y_gridlines() {\t\t\n return d3.axisLeft(y)\n .ticks(5)\n}", "_defineAxisTitle(yAxisTag) {\n // title should be the same for all trends of the axis\n let axisTitle = \"\";\n let axisTitleSet = false;\n\n for (let trend of yAxisTag.trends) {\n let curTitle = trend.getAxisTitle();\n\n if (axisTitleSet) {\n if (axisTitle !== curTitle) {\n axisTitle = \"\";\n break;\n }\n } else {\n axisTitle = curTitle;\n axisTitleSet = true;\n }\n }\n\n yAxisTag.title = axisTitle;\n }", "function make_y_gridlines() {\n\t\treturn d3.svg.axis()\n\t\t.scale(y)\n\t\t.orient(\"left\")\n\t\t.ticks(10)\n\t}", "function make_y_gridlines() {\t\t\r\n return d3.axisLeft(y_scale);\r\n}", "function make_y_gridlines() {\n return d3.axisLeft(y)\n .ticks(5)\n}", "get yAxisAnnotationBackground() {\r\n return brushToString(this.i.pg);\r\n }", "function draw_axis(c){\n\n let yplot = 40;\n let d =0;\n\n c.beginPath();\n c.strokeStyle = \"blue\";\n \n c.moveTo(count_block(5),count_block(5));\n c.lineTo(count_block(5), count_block(40));\n c.lineTo(count_block(80), count_block(40));\n\n c.moveTo(count_block(5), count_block(40));\n \n \n\n //loop for the y-axix labels\n for(let i = 1 ;i<=10;i++ ){\n c.strokeText(d, count_block(2), count_block(yplot));\n yplot-=5;\n d+=500;\n }\n c.stroke();\n\n}", "function onSeriesBindAxes() {\n var axisTypes = this.axisTypes;\n if (!axisTypes) {\n this.axisTypes = ['colorAxis'];\n }\n else if (axisTypes.indexOf('colorAxis') === -1) {\n axisTypes.push('colorAxis');\n }\n }", "function render(data) {\r\n \r\n var myColor = d3.scaleLinear().domain([0, maxy])\r\n .range(['#BFBFBB', '#0966B3']);\r\n\r\n var yTextPadding = 20;\r\n\r\n svg.append('g');\r\n\r\n var numberOfTicks = 6;\r\n \r\n // EJE X\r\n\r\n xScale = d3.scaleBand()\r\n .range([0, ancho])\r\n //.rangeRound([margins.left,ancho])\r\n .padding(0.4)\r\n ;\r\n\r\n xScale.domain(data.map(function(d){ return d.edificio}));\r\n\r\n xAxis = d3.axisBottom(xScale);\r\n\r\n g.append('g')\r\n .attr('class', 'x axis')\r\n .attr('transform', 'translate(35,'+ alto+')')\r\n .call(xAxis)\r\n .selectAll('text')\r\n .attr('dx', '09px')\r\n .attr('transform', 'rotate(90)')\r\n //.attr('transform', 'translate(0,1)')\r\n .style('text-anchor', 'start')\r\n //.style('le')\r\n ;\r\n\r\n // EJE Y\r\n \r\n y_domain = [maxy, 0];\r\n\r\n yScale = d3.scaleLinear().domain(y_domain).nice()\r\n .range(['0', alto]);\r\n \r\n yAxis = d3.axisLeft(yScale);\r\n\r\n g.append('text')\r\n .attr('class', 'y label')\r\n .attr('text-anchor', 'middle')\r\n .attr('x', -alto/2)\r\n .attr('y', 1)\r\n .attr('dy', '.1em')\r\n .attr('transform', 'rotate(-90)')\r\n .attr('font-size' , '12px')\r\n .text('Altura (metros)');\r\n\r\n g.append('g')\r\n .attr('class', 'y axis')\r\n .attr('transform', 'translate(' + 35 + ',0)')\r\n .call(yAxis);\r\n \r\n // GRID EJE Y\r\n\r\n var yAxisGrid = yAxis.ticks(10)\r\n //.attr('class', 'yGrid')\r\n .tickSize(ancho, 0)\r\n .tickFormat('');\r\n //.orient('right');\r\n\r\n g.append('g')\r\n .attr('transform', 'translate(' + ancho_total + ',0)')\r\n .call(yAxisGrid);\r\n\r\n // BARRAS\r\n\r\n bars = g.selectAll('rect')\r\n .data(data);\r\n\r\n bars.enter()\r\n .append('rect')\r\n .style('width', xScale.bandwidth()+4)\r\n .style('height', d => (alto - yScale(d.oficial)) + 'px')\r\n .style('x', function(d){return xScale(d.edificio)+20})\r\n .style('y', d => (yScale(d.oficial))) //modificar alto de barra\r\n .attr('fill', function(d){return myColor(d.oficial)});\r\n \r\n \r\n // NUMERO DENTRO DE LAS BARRAS\r\n\r\n bars.enter()\r\n .append('text')\r\n .text(function(d) { return d.oficial})\r\n //.attr('transform', 'rotate(90)')\r\n .attr('x', function(d){return xScale(d.edificio)+20})\r\n .attr('y', d => (yScale(d.oficial)) + 'px')\r\n .attr('font-family' , 'sans-serif')\r\n .attr('font-size' , '7px')\r\n .attr('fill' , 'white')\r\n .attr('dy', '09px')\r\n .attr('text-anchor', 'start');\r\n \r\n console.log(alto);\r\n}", "function nameYAxisTitle(axis_shortname){\n\n let axis_name = axis_shortname;\n // console.log(\"Given Axis: \", axis_shortname);\n\n metrics_chosen.map( (metric) => {\n \n // console.log(\"Metric Axis: \", metrics_info[metric].yaxis);\n \n if(metrics_info[metric].yaxis === axis_shortname && metrics_info[metric].name !== axis_shortname){\n axis_name = axis_name + \" (\" + metrics_info[metric].name + \")\";\n }\n });\n\n // if there are no metrics using the y1 axis, set the name to be blank\n if(axis_name === \"y1\"){\n axis_name = \"\";\n }\n\n return axis_name;\n}", "async function makeconfig(title, xlabel, ylabel, dataname) {\n var config = {\n type: 'scatter',\n data: dataname,\n options: {\n title: {\n display: true,\n text: title \n },\n scales: {\n xAxes: [{\n //type: 'data',\n display: true,\n scaleLabel: {\n display: true,\n labelString: xlabel \n },\n ticks: {\n major: {\n fontStyle: 'bold',\n fontColor: '#FF0000'\n }\n }\n }],\n yAxes: [{\n ticks: {\n beginAtZero: true\n },\n display: true,\n scaleLabel: {\n display: true,\n labelString: ylabel \n }\n }]\n }\n }\n }\n return config;\n }", "function draw_axis(c){\n\n let yplot = 40;\n let d =0;\n\n c.beginPath();\n c.strokeStyle = \"black\";\n \n c.moveTo(count_block(5),count_block(5));\n c.lineTo(count_block(5), count_block(40));\n c.lineTo(count_block(80), count_block(40));\n\n c.moveTo(count_block(5), count_block(40));\n \n \n\n //loop for the y-axix labels\n for(let i = 1 ;i<=10;i++ ){\n c.strokeText(d, count_block(2), count_block(yplot));\n yplot-=5;\n d+=500;\n }\n c.stroke();\n\n}", "function Cherry2() {\r\n const opts = {\r\n options: {\r\n chart: {\r\n fontFamily: chartFont,\r\n zoom: {\r\n enabled: false,\r\n },\r\n },\r\n //fill: {\r\n // type: 'solid',\r\n //},\r\n title: {\r\n text: 'Japanese cherry full flowering vs CO₂ by year',\r\n align: 'left',\r\n style: titleStyle\r\n },\r\n subtitle: {\r\n text: 'Source: Osaka Prefecture University'\r\n },\r\n yaxis: {\r\n tickAmount: 7,\r\n max: res_df.cherry2.max + 3,\r\n min: res_df.cherry2.min - 3,\r\n labels: {\r\n formatter: function (val) {\r\n return round(val)\r\n }\r\n },\r\n title: {\r\n text: 'Days from the beginning of the year'\r\n }\r\n },\r\n colors: ['#e1477d', '#999'],\r\n annotations: {\r\n yaxis: [{\r\n y: 90,\r\n borderColor: '#7057c2',\r\n opacity: 0.2,\r\n label: {\r\n borderColor: '#7057c2',\r\n style: {\r\n fontSize: '10px',\r\n color: '#fff',\r\n background: '#7057c2',\r\n },\r\n text: '1st April',\r\n position: 'left',\r\n offsetX: '45%'\r\n },\r\n }, {\r\n y: 120.25,\r\n borderColor: '#7057c2',\r\n opacity: 0.2,\r\n label: {\r\n borderColor: '#7057c2',\r\n style: {\r\n fontSize: '10px',\r\n color: '#fff',\r\n background: '#7057c2',\r\n },\r\n text: '1st May',\r\n position: 'left',\r\n offsetX: '45%'\r\n }\r\n }],\r\n xaxis: [{\r\n x: 2016,\r\n x2: 2045,\r\n borderColor: '#000',\r\n fillColor: '#eee',\r\n opacity: 0.2,\r\n label: {\r\n style: {\r\n fontSize: '10px',\r\n color: '#111',\r\n background: '#eee',\r\n },\r\n text: 'Forecast',\r\n }\r\n }]\r\n },\r\n markers: {\r\n size: res_df.cherry2.markers\r\n },\r\n tooltip: {\r\n y: {\r\n formatter: function(val, opt) {\r\n return round(val) + '-th day';\r\n }\r\n }\r\n\r\n },\r\n stroke: {\r\n curve: 'smooth'\r\n },\r\n legend: {\r\n show: true\r\n },\r\n xaxis: {\r\n type: 'numeric',\r\n tickAmount: 12\r\n }\r\n },\r\n series: res_df.cherry2.series\r\n };\r\n\r\n return (\r\n <ReactApexChart options={opts.options} series={opts.series} type='line' height={500} />\r\n );\r\n}", "drawAxes() {\n this.drawLabels([\n { label: LightTypes.A, column: 9 },\n { label: LightTypes.B, column: 10 },\n ])\n\n let colLabels = new Array(8).fill(null).map((_, i) => ({ label: `${i + 1}`, column: i }))\n this.drawLabels(colLabels)\n\n this.ctx.beginPath()\n this.ctx.strokeStyle = \"black\"\n this.ctx.moveTo(0, this.maxDrawH * 1.01)\n this.ctx.lineTo(this.w, this.maxDrawH * 1.01)\n this.ctx.moveTo(8 * this.barColumnW + this.barColumnW / 2, this.h)\n this.ctx.lineTo(8 * this.barColumnW + this.barColumnW / 2, 0)\n this.ctx.stroke()\n }", "function make_y_gridlines() {\r\n return d3.axisLeft(yLeft)\r\n }", "function make_y_gridlines() {\r\n return d3.axisLeft(yLeft)\r\n }", "function barChartOptions() {\n return {\n axisY: {\n labelInterpolationFnc: function(value) {\n return `${value} mi`;\n },\n },\n };\n}", "function formatAxis() {\n var zeroTick, zeroTickLabel;\n // remove boldness from default axis path\n _.root.selectAll('path')\n .attr({\n 'fill': 'none'\n });\n\n // update fonts\n _.root.selectAll('text')\n .attr({\n 'stroke': 'none',\n 'fill': _.config.color\n });\n\n //Apply padding to the first tick on Y axis\n if (_.config.axisType === 'y') {\n zeroTick = _.root.select('g');\n\n if (zeroTick.node()) {\n zeroTickLabel = zeroTick.text() +\n (_.config.unit ? ' ' + _.config.unit : '');\n zeroTick.select('text').text(zeroTickLabel);\n setZeroTickTranslate(zeroTick);\n }\n }\n\n // apply text background for greater readability.\n _.root.selectAll('.gl-axis text').each(function() {\n\n var textBg = this.cloneNode(true);\n d3.select(textBg).attr({\n stroke: _.config.textBgColor,\n 'stroke-width': _.config.textBgSize\n });\n this.parentNode.insertBefore(textBg, this);\n });\n\n // remove axis line\n _.root.selectAll('.domain')\n .attr({\n 'stroke': 'none'\n });\n }", "function labelAxes() {\n var canvas = document.getElementById(\"GraphCanvas\");\n var context = canvas.getContext(\"2d\");\n\n context.font = \"11px Georgia\";\n context.fillStyle = \"green\";\n context.fillText(\"Date (MM/DD\", 400, 470);\n context.rotate(-Math.PI / 2);\n context.textAlign = \"center\";\n context.fillText(\"Amount Owed\", -250, 10);\n}", "yAxisControl(y) {\n this.yAxis = y;\n this.referringToClass.style.top = `${this.yAxis}px`;\n }", "function plotLabels (labels, dimensions, offset) {\n this.select('.y.axis').selectAll('text.label').data([labels.y])\n .enter()\n .append('text')\n .attr('class', 'label')\n .attr('x', 0)\n .attr('y', 0)\n .style('text-anchor', 'middle')\n .style('fill', '#000')\n .attr('transform', 'translate(' + -offset.left * 0.67 + ',' +\n dimensions.h / 2 + ') rotate(-90)')\n .text(labels.y)\n\n this.select('.x.axis').selectAll('text.label').data([labels.x])\n .enter()\n .append('text')\n .attr('class', 'label')\n .attr('x', 0)\n .attr('y', 0)\n .style('text-anchor', 'middle')\n .style('fill', '#000')\n .attr('transform', 'translate(' + dimensions.w / 2 + ',' +\n offset.bottom * 0.75 + ')')\n .text(function (d) { return d })\n }", "addAxes () {\n }", "function make_y_grid(y, activity) {\n return d3.svg.axis()\n .scale(y)\n .orient(\"left\")\n .tickValues(getCurrentQuestion(activity).ticksY);\n //.ticks(4)\n}", "function onLegendAfterUpdate() {\n var colorAxes = this.chart.colorAxis;\n if (colorAxes) {\n colorAxes.forEach(function (colorAxis) {\n colorAxis.update({}, arguments[2]);\n });\n }\n }", "function make_yMajor_gridlines() {\n return d3.axisLeft(y)\n .ticks(yGridLength)\n }", "function assignYAxisToData(chart, data) {\n\t// console.log('I am assignYAxisToData(%O, %O)', chart, data);\n\tvar columns = data.columns,\n\t\tselectedMeasures = data.measuresSelected,\n\t\tfound, dataName;\n\tfor (var i = 1; i < columns.length; i++) {\n\t\tfound = false;\n\t\tdataName = columns[i][0];\n\t\tfor (var j = 0; j < selectedMeasures.length; j++) {\n\t\t\t// Per le misure selezionate\n\t\t\tif (dataName.includes(selectedMeasures[j].name)) {\n\t\t\t\tif (selectedMeasures[j].type == 0 || selectedMeasures[j].type == 2) {\n\t\t\t\t\tconsole.log(dataName + \" goes to Y\");\n\t\t\t\t\tchart.data.axes()[dataName] = 'y';\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tconsole.log(dataName + \" goes to Y2\");\n\t\t\t\t\tchart.data.axes()[dataName] = 'y2';\n\t\t\t\t}\n\t\t\t\tfound = true; // trovata una misura che sicuramente e' portata\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// Per altre misure\n\t\tif (!found) {\n\t\t\tif (dataName.toLowerCase().includes('[l/s]')) {\n\t\t\t\tconsole.log(dataName + \" goes to Y\");\n\t\t\t\tchart.data.axes()[dataName] = 'y';\n\t\t\t}\n\t\t\telse {\n\t\t\t\tconsole.log(dataName + \" goes to Y2\");\n\t\t\t\tchart.data.axes()[dataName] = 'y2';\n\t\t\t}\n\t\t}\n\t}\n\tchart.flush();\n}", "configYAxis(yConf) {\n // Default: duration, bounds and orient\n const bounds = yConf.bounds;\n const yAxisConfig = {\n duration: yConf.duration,\n bounds,\n orient: yConf.yOrient,\n tickSize: 0,\n };\n\n // Assemble the y-scale object\n const yDomain = yConf.data.map(d => d.category);\n // NOTE: rangebands for bar charts are 'top-to-bottom', unlike\n // other components that run 'bottom-to-top'. This relates to\n // sorting...\n yAxisConfig.scale = D3.scale.ordinal()\n .rangeBands([ 0, bounds.height ], 0.1)\n .domain(yDomain);\n\n return yAxisConfig;\n }", "function createSubtitle(targetData){\n\t//define chart constants\n\tlet svg = d3.select(\".chart\");\n\n\tlet subtitle = svg.append(\"g\")\n\t\t.attr(\"class\", \"chart-subtitle\");\n\tsubtitle.append(\"text\")\n\t\t.attr(\"x\", 70)\n\t\t.attr(\"y\", 50)\n\t\t.attr(\"text-anchor\", \"center\")\n\t\t.style(\"font\", \"15px Archivo\")\n\t\t.style(\"font-style\", \"italic\")\n\t\t.text(targetData.yaxis);\n}", "function make_y_gridlines(yScale, ticks) { \n return d3.axisLeft(yScale)\n .ticks(ticks)\n}", "function make_y_gridlines(yscale, num) {\n return d3.axisLeft(yscale)\n .ticks(num)\n}", "function styleTitulo_(label) {\n label.setStyleAttribute(\"margin-top\",\"20px\");\n label.setStyleAttribute(\"fontSize\", \"14pt\");\n label.setStyleAttribute(\"font-weight\", \"bold\");\n label.setStyleAttribute(\"color\",\"#286389\");\n}", "function buildYAxis(yScaleFn) {\n return axisLeft(yScaleFn).ticks(10, \"%\");\n }", "function renderTextY(textGroup, newYScale, chosenYAxis){\n textGroup.transition()\n .duration(1000)\n .attr(\"y\",function(d){\n return newYScale(d[chosenYAxis]);\n });\n \n return textGroup;\n}", "barChart(dataArr, LabelsArr) {\n var ctx = 'genreChart';\n\n var dataArr = [4, 12, 52, 2, 12];\n var labelsArr = [\"Rock\", \"Hip hop\", \"Blues\", \"Metal\", \"Jazz\"];\n var colorsArr = [\"#3e95cd\", \"#8e5ea2\",\"#3cba9f\",\"#e8c3b9\",\"#c45850\"];\n var options = {\n title: {\n display: true,\n text: 'My big ol bar chart'\n },\n legend: { display: false },\n scales: {\n xAxes: [{\n gridLines: {\n offsetGridLines: true\n }\n }]\n }\n };\n\n\n var myBarChart = new Chart(ctx, {\n type: 'bar',\n data: {\n\n labels: labelsArr,\n datasets: [{\n backgroundColor: colorsArr,\n data: dataArr\n }]\n },\n options: options\n });\n }", "function drawAxisY(svg, yAxis, graphXStart, axisPadding) {\n drawAxis(svg, yAxis, 'translate(' + (graphXStart + axisPadding) + ', 0)', {});\n}", "function showAxis(xaxis, yaxis) {\n\t\n\tg.select('.x.axis')\n\t .call(xaxis)\n\t //.attr('transform', 'translate(0,' + height + ')')\n\t //.transition().duration(400)\n\t //.call(xaxis)\n\t //.selectAll('text')\n\t //.style('text-anchor','end')\n\t //.attr(\"dx\", \"-1em\")\n\t //.attr(\"dy\", \"-0.5em\")\n\t //.attr('transform', function(d){\n\t //\treturn \"rotate(-90)\";\n\t //})\n\t .style('opacity', 1.0)\n\t //.selectAll(\".tick text\")\n\t //.call(wrap, 10)\n\t;\n\t\n\n\tg.select('.y.axis')\n\t .call(yaxis)\n\t .style('opacity', 1.0);\n//\t .transition().duration(400)\n//\t .style('opacity', 1.0);\n\n\t\n//\tg.select('.x.axis')\n//\t .call(axis)\n//\t .transition().duration(500)\n//\t .style('opacity', 1);\n }", "function yAxis(g){\n g.attr(\"transform\", 'translate('+settings.margin.left+',0)')\n .attr('id','yAxis')\n .call(d3.axisLeft(y).tickSize(0))\n .call(g => g.select(\".domain\").remove())\n}", "function plot_set_labels(plot_id, labels) {\n\tif (! (plot_id in plots)) {\n\t\tconsole.log('Broken plot_set_labels');\n\t\treturn;\n\t}\n\tplots[plot_id].data.labels = labels;\n}", "function makeStandardChart(title, subtitle, units, utcData) {\r\n\twindow.utcData = utcData;\r\n\tdataVals = (document.getElementById(\"utcGraph\").checked) ? utcData : adjustDataToTZO(utcData);\r\n\tconsole.log($(\"#duration\").val(), dataVals.length );\r\n\tmarkerRadius = (utcData.length > 200) ? 1 : 2;\r\n\tunits = $.trim(units).toLowerCase();\r\n\tif (units.toLowerCase() in unitAlias) {\r\n\t console.log(units, unitAlias[units.toLowerCase()]); \r\n\t units = unitAlias[units.toLowerCase()]; \r\n\t}\r\n\tvar yAxisArr = [{\r\n title: { \r\n text: units,\n align: 'high',\n rotation:0,\n offset: 10,\n y: -10\n } \r\n }];\r\n //Have two y-axises if there is a conversion\r\n if (units in conversions) {\r\n yAxisArr.push({\r\n title: {\r\n text: conversions[units][0],\r\n align: 'high',\r\n rotation:0,\r\n offset: 20,\r\n y: -10\r\n },\r\n opposite: true,\r\n linkedTo:0,\r\n labels: {\n formatter: function() {\r\n // console.log(\"label converted:\", this.value, convert(this.value, units)[0]);\n return convert(this.value, units)[0];\n }\r\n } \r\n });\r\n }\r\n /// define the options\r\n\tvar options = {\r\n\t\tchart: \r\n\t\t\t{ \r\n\t\t\t\trenderTo: 'chart',\r\n\t\t\t\tevents: {\r\n\t\t\t\t\tload: function(event) {\r\n\t\t\t\t\t chartBusyDone(); \r\n\t\t\t\t\t}\r\n\t\t\t\t} \r\n\t\t\t},\r\n\t\ttitle: { text: title },\r\n\t\tsubtitle: { text: subtitle },\r\n\t\txAxis: { type: 'datetime' },\r\n yAxis: yAxisArr,\r\n\t\t// yAxis: [\n\t\t\t// { title: \n\t\t\t\t// { \n\t\t\t\t\t// text: unitStr,\n\t\t\t\t\t// align: 'high',\n\t\t\t\t\t// rotation:0,\n\t\t\t\t\t// offset: 10,\n\t\t\t\t\t// y: -10\n\t\t\t\t// } \n\t\t\t// }],\r\n\t\tlegend: { enabled: false },\r\n\t\ttooltip: {\r\n\t\t\tshared: true,\r\n\t\t\tcrosshairs: true,\r\n\t\t\tpointFormat: '{series.name}: <b>{point.y}</b> '+units,\r\n\t\t\tformatter: function () {\r\n\t\t\t thisDate = Highcharts.dateFormat('%a %b %e %Y %H:%M', this.x)+\"<br>\";\r\n\t\t\t var value = ((typeof this.y == 'number') && (this.y % 1 != 0))? this.y.toFixed(2) : this.y;\r\n if (units in conversions) {\r\n post = convert(this.y, units);\r\n // var post = parseFloat(this.y*conversions[units][1]).toFixed(1);\r\n // var postUnit = conversions[units][0];\r\n thisDate += title+\": <b>\"+value+units+\"</b>,<b>\"+post[0]+post[1]+\"</b>\";\r\n } else {\r\n thisDate += title+\": <b>\"+value+units+\"</b>\";\r\n } \r\n if (dataVals[0].length == 3) {\r\n thisDate += \"<br>Direction: <b>\"+this.points[0].key+\"\\u00B0</b>\"; //\\u00B0 is degree symbol\r\n }\r\n return thisDate;\r\n\t\t\t},\r\n\t\t\tdateTimeLabelFormats: {\r\n\t\t\t\tmillisecond: '%b %e %y %H:%M:%S.%L',\r\n\t\t\t\tsecond: '%b %e %y %H:%M:%S',\r\n\t\t\t\tminute: '%b %e %y %H:%M',\r\n\t\t\t\thour: '%b %e %y %H:%M',\r\n\t\t\t\tday: '%b %e %y %H:%M',\r\n\t\t\t\tmonth: '%b \\'%y',\r\n\t\t\t\tyear: '%Y'\r\n\t\t\t}\r\n\t\t},\r\n\t\tplotOptions: { \r\n\t\t\tline: {\r\n\t\t\t\tmarker: { radius: markerRadius}\r\n\t\t\t}\r\n\t\t},\r\n\t\tseries: [{ \r\n\t\t\t\t\tname: title,\r\n\t\t\t\t\t// data: dataVals\r\n\t\t\t\t\tdata:[] \r\n\t\t\t\t}]\r\n\t};\r\n\r\n //Direction\r\n if ((typeof dataVals[0] != 'undefined') && (dataVals[0].length == 3)) {\r\n for (i in dataVals){\r\n arr = dataVals[i];\r\n //only use marker symbol if less than 50 points\r\n if (dataVals.length > 100) { //50?!!!\r\n options.series[0].data.push({ x: arr[0], y: arr[1], name: arr[2].toFixed().toString() });\r\n } else {\r\n if(/wind/i.test(title) || /wind/i.test(subtitle)) {\r\n dirMarker = 'url(http://neocoweb.ucsd.edu/cgi-bin/asbs/barb.py?sp='+arr[1]+'&dir='+arr[2]+')'\r\n } else {\r\n //ocean current\r\n dirMarker = 'url(http://neocoweb.ucsd.edu/cgi-bin/asbs/arrow.py?dir='+arr[2]+')'\r\n }\r\n options.series[0].data.push({ x: arr[0], y: arr[1], marker: {symbol: dirMarker}, name: arr[2].toFixed().toString()}); \r\n }\r\n }\r\n } else {\r\n options.series[0].data = dataVals;\r\n // options.tooltip.formatter = function () {}\r\n }\r\n \r\n \r\n\tht = $(\"#chartWrapper\").height();\r\n\twd = $(\"#chartWrapper\").width();\r\n\tmyLayout.south.options.onresize_end = function () {setChartSize();}\r\n\t\r\n\t// if (myLayout.state.south.isVisible == false) {\n\t\t// myLayout.open('south', false);\n\t// }\r\n\r\n\tnoDataMsg = 'No data is available at the selected location and/or with in the \"Time Span\"';\r\n\tif (dataVals.length == 0) {\r\n\t\torig = $(\"#duration\").val();\r\n\t\tvar loop = ((typeof chart == 'undefined') || (loop == true)) ? true: false;\r\n\t\tif ((document.getElementById(\"now\").checked == true) && (orig != 31536000) && (typeof loop != 'undefined') && (loop)) {\r\n\t\t\t$(\"#duration option\").each(function(){\r\n\t\t\t\toptVal = parseInt($(this).val())\r\n\t\t\t\tif (optVal > orig) {\r\n\t\t\t\t\tvar step = function (optVal) {\r\n\t\t\t\t\t\tvar dfrd = $.Deferred();\r\n\t\t\t\t\t\t$(\"#duration\").val(optVal.toString());\r\n\t\t\t\t\t\tconsole.log(\"setting duration:\", optVal);\r\n\t\t\t\t\t\ttimeSpan();\r\n\t\t\t\t\t\tsetGraph();\r\n\t\t\t\t\t\tdfrd.resolve(); // use Deferred??\r\n\t\t\t\t\t\treturn dfrd.promise();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvar callstep = step(optVal);\r\n\t\t\t\t\tstep.done(); //Doesn't work with callstep.done()??\r\n\t\t\t\t\t// step.done(function() {console.log(\"post setGraph\");}); //Not right console log\r\n\t\t\t\t} //else { console.log(\"ignore - smaller duration\");}\r\n\t\t\t});\r\n\t\t\tloop = false;\r\n\t\t} else {\r\n\t\t\tchartError(noDataMsg);\r\n\t\t}\r\n\t\tdelete loop;\r\n\t\t// chartError(noDataMsg);\r\n\t}\t\r\n\tchart = new Highcharts.Chart(options);\r\n\tsetChartSize();\r\n\t$(\"#chart\").val(\"usingChart\");\r\n\r\n}" ]
[ "0.7211678", "0.7211678", "0.69628364", "0.6746738", "0.6605784", "0.65127677", "0.63657725", "0.6360708", "0.61986953", "0.61933553", "0.60415703", "0.58542657", "0.57747245", "0.5773445", "0.5767792", "0.576734", "0.576734", "0.5737276", "0.5737276", "0.57358855", "0.57239246", "0.5669122", "0.56669647", "0.5647003", "0.5633714", "0.56076854", "0.56075114", "0.5600218", "0.5563464", "0.554208", "0.55298215", "0.5523909", "0.5520558", "0.5510844", "0.5503694", "0.5503366", "0.5503061", "0.54972094", "0.5480109", "0.5468883", "0.5467871", "0.54601425", "0.5448471", "0.54405946", "0.54079586", "0.5396776", "0.5383618", "0.5369399", "0.5356719", "0.5351657", "0.5351261", "0.5337777", "0.5320409", "0.53067875", "0.5305547", "0.52976406", "0.52974296", "0.52974296", "0.5296248", "0.528897", "0.5282702", "0.52812946", "0.5270353", "0.5241536", "0.5238166", "0.5232332", "0.5228487", "0.52159613", "0.5184586", "0.51783866", "0.517831", "0.5170568", "0.51587015", "0.5151888", "0.5146376", "0.5130446", "0.5130446", "0.51301867", "0.51208067", "0.51154506", "0.51111066", "0.5088607", "0.50779706", "0.50748146", "0.506735", "0.5062553", "0.5052304", "0.5048566", "0.504793", "0.50441843", "0.50408196", "0.5038502", "0.50383544", "0.50298613", "0.50289655", "0.50282747", "0.5026098", "0.5024173", "0.50085384", "0.5002697" ]
0.73200464
0
helper function to round numbers correctly
function round(value, decimals) { return Number(Math.round(value+'e'+decimals)+'e-'+decimals); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function roundme(val) {\n return val;\n }", "function roundNum(num){\n return Math.round(num * 10) / 10;\n }", "function round(num){\n return Math.round(num*10) / 10;\n }", "function round( nr ) {\n\t\treturn Math.round( 100*nr )/100;\n\t}", "function round(a) {\n\t return Math.floor(a);\n\t }", "function roundNum(num){\n return Number(num.toFixed(2));\n}", "function round(num)\n{\n return (num*100|0)/100;\n}", "function roundNumbers(arr){\n let number = arr[0];\n let precision = arr[1] > 15 ? 15 : arr[1];\n\n return +number.toFixed(precision);\n}", "_round(x) {\n\t\treturn Math.round( x * 1000) / 1000;\n\t}", "function round(value) {\n return Math.round(value);\n}", "function round(n) {\n return Math.round(n * 10000) / 10000;\n}", "function rounding (number) {\n return Math.round(number)\n}", "function roundTo(n, r, s){\r\n return (Math.floor((n-s)/r)*r)+s\r\n}", "function round(a) {\n return Math.floor(a);\n }", "static roundNumber(value) {\n return Math.round(value);\n }", "function round(a) {\n\treturn parseInt(a*1E+5)/1E+5;\n}", "function round(num) {\n return Math.round((num + Number.EPSILON) * 100) / 100;\n}", "function roundValue(x) {\n return Math.round(x);\n}", "function round(x) {\n\treturn Math.round( x * 1000) / 1000;\n}", "function roundit(num,dex) {\n return parseFloat(num).toFixed(dex);\n }", "function Round(x){\nif (x <0.001) {x = \"<0.001\"};\nif (x >1) {x = \"1.0000\"};\nreturn x;\n}", "function round(number) {\n return floor(number + 0.5);\n}", "function roundIt(value) {\n let places = 100;\n if (value < 100) {\n places = 10000;\n } else if (value < 0.001) {\n places = 1000000;\n }\n return Math.round((value + Number.EPSILON) * places) / places;\n }", "function roundNumber(value) {\r\n 'use strict';\r\n console.log(Math.floor(value));\r\n console.log(Math.round(value));\r\n}", "function round(a) {\n\t return Math.floor(a);\n\t }", "function round(a) {\n\t return Math.floor(a);\n\t }", "function round(a) {\n\t return Math.floor(a);\n\t }", "function myRound(val,places) {\n\tvar c = 1;\n\tfor (var i = 0; i < places; i++)\n\t\tc *= 10;\n\treturn Math.round(val*c)/c;\n}", "function round(x) {\n return Math.round( x * 1000) / 1000;\n }", "function round(value)\n{\n\tvalue = +value.toFixed(3)\n\treturn value;\n}", "function round(number) {\n return Math.round(number * 100) / 100;\n}", "function round(a) {\r\n return Math.floor(a);\r\n }", "function round(a) {\r\n return Math.floor(a);\r\n }", "function round(a) {\r\n return Math.floor(a);\r\n }", "function roundTo(n, digits) { //round up\n var negative = false;\n if (digits === undefined) {\n digits = 0;\n }\n if( n < 0) {\n negative = true;\n n = n * -1;\n }\n var multiplicator = Math.pow(10, digits);\n n = parseFloat((n * multiplicator).toFixed(11));\n n = (Math.round(n) / multiplicator).toFixed(2);\n if( negative ) { \n n = (n * -1).toFixed(2);\n }\n return n;\n} //end of roundTo", "function round(x) {\r\n return Math.round(x * 1000) / 1000;\r\n }", "function round(x) {\r\n return Math.round(x * 1000) / 1000;\r\n }", "function round(x) {\r\n return Math.round(x * 1000) / 1000;\r\n }", "function round(x) {\r\n return Math.round(x * 1000) / 1000;\r\n }", "function round(n) {\n return Math.round(n * 100) / 100;\n }", "function round(num) {\n return Math.round(num * 100) / 100;\n }", "function round(num) {\n return Math.floor(num * 1000) / 1000;\n}", "function round_number(number,decimals){\n return Math.round(number*Math.pow(10,decimals))/Math.pow(10,decimals)\n }", "round(value) {\n const context = this.context;\n\n // eslint-disable-next-line\n if (value instanceof window.JQX.Utilities.BigNumber && typeof value._d === 'bigint') {\n return value;\n }\n else if (value instanceof window.JQX.Utilities.BigNumber === false ||\n !context._wordLengthNumber || context._wordLengthNumber < 64) {\n return new JQX.Utilities.BigNumber(Math.round(value.toString()));\n }\n\n const fraction = value.mod(1);\n\n if (!(fraction._d.length === 1 && fraction._d[0] === 0)) {\n // if the entered number is with a decimal value, it is rounded up or down to its nearest integer equivalent\n\n value = value.intPart();\n if (!value._s) {\n // round positive number\n if (fraction._d[1] > 4) {\n value = value.add(1);\n }\n }\n else {\n // round negative number\n if (fraction._d[1] > 5 ||\n fraction._d[1] === 5 && fraction._d[2]) {\n value = value.add(-1);\n }\n }\n }\n return value;\n }", "function round(x) {\n\t\treturn Math.round( x * 1000) / 1000;\n\t}", "function round(x) {\n\t\treturn Math.round( x * 1000) / 1000;\n\t}", "function round(a) {\n return Math.floor(a);\n }", "function round(a) {\n return Math.floor(a);\n }", "function round(a) {\n return Math.floor(a);\n }", "function round(a) {\n return Math.floor(a);\n }", "function round(a) {\n return Math.floor(a);\n }", "function round(a) {\n return Math.floor(a);\n }", "function round(a) {\n return Math.floor(a);\n }", "function round(a) {\n return Math.floor(a);\n }", "function round(a) {\n return Math.floor(a);\n }", "function round(a) {\n return Math.floor(a);\n }", "function round(a) {\n return Math.floor(a);\n }", "function round(a) {\n return Math.floor(a);\n }", "function round(a) {\n return Math.floor(a);\n }", "function round(a) {\n return Math.floor(a);\n }", "function round(a) {\n return Math.floor(a);\n }", "function round(a) {\n return Math.floor(a);\n }", "function roundNumbers(arr) {\n\n for(var i = 0; i < arr.length; i++) {\n\n arr[i] = (Math.round((arr[i]*Math.pow(10,2))+(0.0001))/Math.pow(10,2)).toFixed(2);\n\n }\n\n return arr;\n\n}", "function round(number, precision)\r\n{\r\n divisor = Math.pow(10, precision);\r\n return Math.round(number * divisor) / divisor;\r\n}", "function roundNumber(v) {\n\treturn parseFloat(parseFloat(v).toFixed(2));\n}", "function roundTo(nr, dec){\r\n\tif(Math.abs(nr) < 1/Math.pow(10,dec)){\r\n\t\treturn 0;\r\n\t}\r\n\telse if(Math.abs(nr)-Math.abs(Math.round(nr)) < 1/Math.pow(10,dec)){\r\n\t\treturn Math.round(nr);\r\n\t}\r\n\telse{\r\n\t\treturn Math.floor(nr*Math.pow(10,dec))/Math.pow(10,dec);\r\n\t}\r\n}", "function round(number,decimal_points) {\r\n\tif (number == null) return 'NaN';\r\n\tif (!decimal_points || decimal_points == null) return Math.round(number);\r\n\tvar exp = Math.pow(10, decimal_points);\r\n\tnumber = Math.round(number * exp) / exp;\r\n\treturn parseFloat(number.toFixed(decimal_points));\r\n}", "round(value) {\n return Math.round(value);\n }", "function round(number) {\n return Math.round(number * 100) / 100;\n}", "function round(number) {\n return Math.round(number * 100) / 100;\n}", "function roundNumber(rnum, rlength) {\r\n var newnumber = Math.round(rnum * Math.pow(10, rlength)) / Math.pow(10, rlength);\r\n return parseFloat(newnumber); \r\n}", "function round(n) {\n if (!n) {\n return 0;\n }\n return Math.floor(n * 100) / 100;\n }", "static round(a) {\n\t\treturn round(a);\n\t}", "function roundNum(num, point) {\n return 1 * num.toFixed(point);\n}", "function round(value, fixed){\n\t\treturn parseFloat(Math.round(value * 10.0) / 10.0).toFixed(fixed);\n\t}", "function tidyround(x, r=1) {\n if (r < 0) return NaN\n if (r===0) return +x\n const y = round(x/r)\n const rpow = /^0?\\.(0*)10*$/ // eg .1 or .01 or .001 -- a negative power of 10\n const marr = normberlize(r).match(rpow) // match array; marr[0] is whole match\n if (!marr) return y*r\n const p = -marr[1].length-1 // p is the power of 10\n return +normberlize(`${y}e${p}`)\n}", "function RoundNum(original_number, decimals, pad) \n{\n var result1 = original_number * Math.pow(10, decimals)\n var result2 = Math.round(result1)\n var result3 = result2 / Math.pow(10, decimals)\n\tif (pad == true)\n\t\treturn pad_with_zeros(result3, decimals);\n\telse\n\t\treturn result3;\n}", "function round(x,sd,rm,r){var d,i,j,k,n,ni,rd,xc=x.c,pows10=POWS_TEN;// if x is not Infinity or NaN...\nif(xc){// rd is the rounding digit, i.e. the digit after the digit that may be rounded up.\n// n is a base 1e14 number, the value of the element of array x.c containing rd.\n// ni is the index of n within x.c.\n// d is the number of digits of n.\n// i is the index of rd within n including leading zeros.\n// j is the actual index of rd within n (if < 0, rd is a leading zero).\nout:{// Get the number of digits of the first element of xc.\nfor(d=1,k=xc[0];k>=10;k/=10,d++){;}i=sd-d;// If the rounding digit is in the first element of xc...\nif(i<0){i+=LOG_BASE;j=sd;n=xc[ni=0];// Get the rounding digit at index j of n.\nrd=n/pows10[d-j-1]%10|0}else{ni=mathceil((i+1)/LOG_BASE);if(ni>=xc.length){if(r){// Needed by sqrt.\nfor(;xc.length<=ni;xc.push(0)){;}n=rd=0;d=1;i%=LOG_BASE;j=i-LOG_BASE+1}else{break out}}else{n=k=xc[ni];// Get the number of digits of n.\nfor(d=1;k>=10;k/=10,d++){;}// Get the index of rd within n.\ni%=LOG_BASE;// Get the index of rd within n, adjusted for leading zeros.\n// The number of leading zeros of n is given by LOG_BASE - d.\nj=i-LOG_BASE+d;// Get the rounding digit at index j of n.\nrd=j<0?0:n/pows10[d-j-1]%10|0}}r=r||sd<0||// Are there any non-zero digits after the rounding digit?\n// The expression n % pows10[d - j - 1] returns all digits of n to the right\n// of the digit at j, e.g. if n is 908714 and j is 2, the expression gives 714.\nxc[ni+1]!=null||(j<0?n:n%pows10[d-j-1]);r=rm<4?(rd||r)&&(rm==0||rm==(x.s<0?3:2)):rd>5||rd==5&&(rm==4||r||rm==6&&// Check whether the digit to the left of the rounding digit is odd.\n(i>0?j>0?n/pows10[d-j]:0:xc[ni-1])%10&1||rm==(x.s<0?8:7));if(sd<1||!xc[0]){xc.length=0;if(r){// Convert sd to decimal places.\nsd-=x.e+1;// 1, 0.1, 0.01, 0.001, 0.0001 etc.\nxc[0]=pows10[(LOG_BASE-sd%LOG_BASE)%LOG_BASE];x.e=-sd||0}else{// Zero.\nxc[0]=x.e=0}return x}// Remove excess digits.\nif(i==0){xc.length=ni;k=1;ni--}else{xc.length=ni+1;k=pows10[LOG_BASE-i];// E.g. 56700 becomes 56000 if 7 is the rounding digit.\n// j > 0 means i > number of leading zeros of n.\nxc[ni]=j>0?mathfloor(n/pows10[d-j]%pows10[j])*k:0}// Round up?\nif(r){for(;;){// If the digit to be rounded up is in the first element of xc...\nif(ni==0){// i will be the length of xc[0] before k is added.\nfor(i=1,j=xc[0];j>=10;j/=10,i++){;}j=xc[0]+=k;for(k=1;j>=10;j/=10,k++){;}// if i != k the length has increased.\nif(i!=k){x.e++;if(xc[0]==BASE)xc[0]=1}break}else{xc[ni]+=k;if(xc[ni]!=BASE)break;xc[ni--]=0;k=1}}}// Remove trailing zeros.\nfor(i=xc.length;xc[--i]===0;xc.pop()){;}}// Overflow? Infinity.\nif(x.e>MAX_EXP){x.c=x.e=null;// Underflow? Zero.\n}else if(x.e<MIN_EXP){x.c=[x.e=0]}}return x}", "function roundToNearestHundreth(x){\n return (x).toFixed(2);\n }", "function round(num, prec, mode) {\n mode = mode || 'normal';\n var func = {\n normal: Math.round,\n up: Math.ceil,\n down: Math.floor\n }[mode];\n var k = Math.pow(0.1, prec);\n return func(num / k) * k;\n}", "function roundTo(value, x) {\n return Math.round(value / x) * x;\n}", "function roundC(v) {\r\n return Math.round(v*10)/10;\r\n}", "function round2(num) {\n // if (typeof(num) === 'number') {\n // num = Math.round(num * 100) / 100;\n // }\n return num;\n}", "function roundTo(n, digits) {\n var negative = false;\n if (digits === undefined) {\n digits = 0;\n }\n if( n < 0) {\n negative = true;\n n = n * -1;\n }\n var multiplicator = Math.pow(10, digits);\n n = parseFloat((n * multiplicator).toFixed(11));\n n = (Math.round(n) / multiplicator).toFixed(2);\n if( negative ) { \n n = (n * -1).toFixed(2);\n }\n return n;\n}//end of roundTo", "function roundUsing(number, prec) {\n var tempnumber = number * Math.pow(10, prec);\n tempnumber = Math.round(tempnumber);\n return tempnumber / Math.pow(10, prec);\n}", "function round(num, p) {\n let m = Math.pow(10, p);\n return Math.round(num * m) / m;\n}", "function roundNumber(Number, Decimals) {\n // Argumentos: Numero a redondear, cantidad de decimales\n var Factor = Math.pow(10, Decimals);\n return Math.round(Number * Factor) / Factor;\n}", "function roundg(x) {\r\n return Math.round(x * 1000) / 1000;\r\n }", "function round(num, amount) {\n return (Math.round(num * amount) / amount);\n}", "function round(num, places) {\n var shift = Math.pow(10, places);\n return Math.round(num * shift)/shift;\n }", "function ourOwnRound(theNumber) {\n\n // Create a variable \"results\" with no value given\n var results;\n // Using the % equation, we can extra the decimal place, and store it in \"decimalOFTheNUmber\"\n var decimalOfTheNumber = theNumber % 1;\n\n // WE text the decimal value in \"decimalOfTheNumber\" and test if it is larger or smaller the then .5.....\n if (decimalOfTheNumber >= .5){\n //.... If it is larger, we round the orignal number stored in \"theNumber\" and store that in the results variable.\n results = Math.ceil(theNumber);\n }\n\n else {\n //.....If it is smaller, we round the original number stored in \"theNumber\" and sotre that in the results variable.\n results = Math.floor(theNumber);\n }\n\n // Return the value of results to where ever this function was called.\n return results;\n}", "function roundTo(value, base){\n\t\t\treturn Math.floor((value + base / 2) / base) * base;\n\t\t}", "function round(num, dp){\n\treturn Math.round((num * (Math.pow(10, dp))))/Math.pow(10, dp);\n}", "function formatNumber(obj){\n return Math.round(obj);\n }", "function rounded_price(price){\n //TODO: Make a fancier rounding algorithm\n return Math.ceil(price);\n}", "function round(control) \n{ \n ans = control.value * 1000 \n ans = Math.round(ans /10) + \"\" \n while (ans.length < 3) {ans = \"0\" + ans} \n len = ans.length \n ans = ans.substring(0,len-2) + \".\" + ans.substring(len-2,len)\n control.value = ans; \n}", "round(place = 0) {\r\n const factor = Math.pow(10, place)\r\n return FNumber(Math.round(this.data * factor) / factor)\r\n }", "function round (amount, numOfDecDigits) {\n numOfDecDigits = numOfDecDigits || 2;\n return Math.round(amount * Math.pow(10, numOfDecDigits)) / Math.pow(10, numOfDecDigits);\n }", "function roundNum(num) \n{ \n ans = num * 1000 \n ans = Math.round(ans /10) + \"\" \n while (ans.length < 3) {ans = \"0\" + ans} \n len = ans.length \n ans = ans.substring(0,len-2) + \".\" + ans.substring(len-2,len)\n return ans; \n}", "function roundNumber(value, decPlaces) {\n let decPointShifter = Math.pow(10, decPlaces)\n return Math.round(value * decPointShifter) / decPointShifter\n}", "static round(number, precision) {\n\t\tlet pair = (number + \"e\").split(\"e\");\n\t\tlet value = Math.round(pair[0] + \"e\" + (+pair[1] + precision));\n\t\tpair = (value + \"e\").split(\"e\");\n\t\treturn +(pair[0] + \"e\" + (+pair[1] - precision));\n\t}" ]
[ "0.7889947", "0.78350425", "0.7595077", "0.74883074", "0.7452614", "0.74313205", "0.7386218", "0.73673147", "0.7365495", "0.7317709", "0.7311718", "0.7285321", "0.72780657", "0.7243302", "0.7238937", "0.72291756", "0.7226804", "0.7224358", "0.7216883", "0.7216824", "0.7198773", "0.7198436", "0.7195834", "0.71942496", "0.7189128", "0.7189128", "0.7189128", "0.716757", "0.7167018", "0.7162483", "0.71571535", "0.71515906", "0.71515906", "0.71515906", "0.7138859", "0.71358776", "0.71358776", "0.71358776", "0.71358776", "0.7134483", "0.7132065", "0.71252346", "0.7121017", "0.7120429", "0.71144485", "0.71144485", "0.71133196", "0.71133196", "0.71133196", "0.71133196", "0.71133196", "0.71133196", "0.71133196", "0.71133196", "0.71133196", "0.71133196", "0.71133196", "0.71133196", "0.71133196", "0.71133196", "0.71133196", "0.71133196", "0.7099157", "0.7097818", "0.7083585", "0.70797986", "0.7078565", "0.7073024", "0.7066446", "0.7066446", "0.7063174", "0.70568794", "0.7054856", "0.7050147", "0.70410085", "0.7033226", "0.69912344", "0.69848484", "0.6982097", "0.69782686", "0.69724137", "0.69590145", "0.6956709", "0.69563293", "0.69534725", "0.6946272", "0.6935005", "0.6924968", "0.69244105", "0.6918236", "0.69117254", "0.6901203", "0.68984056", "0.6894073", "0.6883226", "0.6877705", "0.6867958", "0.6866459", "0.6862582", "0.6855245", "0.68402034" ]
0.0
-1
helper function to convert Celsius to Fahrenheit
function temperatureCtoF(tempC) { return round((tempC * 1.8) + 32, 2); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function celsiusToFahrenheit(temperature){\n return (temperature*9/5)+32;\n}", "function celsiusToFahrenheit(temperature){\n return(temperature * 9/5)+32;\n}", "function celsiusToFahrenheit(temp){\n return ((9/5) * temp) + 32;\n}", "function celsiusToFahrenheit(temperature){\n return(temperature *9/5) + 32;\n}", "function celsiusToFahrenheit(celsiusTemp) {\n return (celsiusTemp * 9 / 5) + 32;\n }", "function celsiusToFahrenheit(temperature){\n return (temperature * 9/5) + 32;\n}", "function celsiusToFahrenheit (c) {\n var fahrenheit = ( c * ( 9 / 5) ) + 32;\n return fahrenheit;\n }", "function fahrenheitTocelsius(temp){\n var tempInFahrenheit = temp;\n var tempInCelsius = (tempInFahrenheit - 32) * 5/9;\n return tempInFahrenheit + \"°F is \" + tempInCelsius+ \"°C\";\n }", "function celsiusToFahrenheit(temperature)\n{\n return (temperature *9/5) +32;\n\n}", "function celsiusToFahrenheit(celsius) {\n var ctof = (celsius * 9)/5 + 32;\n console.log(\"\" + celsius + \"°C is \" + ctof + \"°F.\");\n}", "function celsiusToFahrenheit(temperature){\n\treturn (temperature * 9/5) + 32;\n}", "function celsiusTOFahrenheit(temperature) {\n return (temperature * 9 / 5) + 32;\n}", "function celsiusToFahrenheit(temperature) {\n return (temperature * 9 / 5) + 32;\n}", "function convertToF(celsius) {\n let fahrenheit;\n fahrenheit = celsius * (9/5) + 32;\n return fahrenheit;\n}", "function celsiusToFahrenheit(temperature) {\n return (temperature * 9) / 5 + 32;\n}", "function toCelsius(fahrenheit) {\n return (fahrenheit - 32) * 5 / 9;\n}", "function toCelsius(fahrenheit) {\n return (fahrenheit - 32) * 5 / 9;\n}", "function celsiusToFahrenheit(temp){\n var tempInCelsius = temp;\n var tempInFahrenheit = (tempInCelsius * 9/5 + 32);\n return tempInCelsius + \"°C is \" + tempInFahrenheit+ \"°F\";\n }", "function toCelsius (fahrenheit) {\r\n var convertedTemp = (fahrenheit - 32) * .5556;\r\n return convertedTemp;\r\n}", "function celsiusToFahrenheit(celsius){\n let fahrenheit = (celsius * (9/5)) + 32;\n return celsius + \" degrees Celsius is \" + fahrenheit + \" degrees Fahrenheit\";\n}", "function convertCelciusToFahrenheit(number) {\n return oC * 1.8 + 32;\n}", "function convertFahrenheitToCelsius(temp) {\n return ((temp - 32) * 5) / 9;\n}", "function convertToF(celsius) {\n\tlet fahrenheit = celsius * (9 / 5) + 32;\n\treturn fahrenheit;\n}", "function convertToF(celsius) {\n let fahrenheit;\n fahrenheit = (celsius * 9 /5) +32;\n return fahrenheit; \n }", "function convertToF(celsius) {\n let fahrenheit = celsius * 9/5 + 32;\n return fahrenheit;\n}", "function convertCelsius(fahrTemp) {\n return ((5/9) * (fahrTemp - 32)).toFixed(2);\n} // end convertCelsius()", "function celsiusToFahrenheit(c) {\n var f = c * 9 / 5 + 32;\n console.log(c + \"°C is \" + f + \"°F.\");\n}", "function convertToF(celsius) {\n let fahrenheit = celsius * (9 / 5) + 32;\n return fahrenheit;\n}", "function fahrenheitToCelsius(f) {\n var celsius = ( f - 32 ) * ( 9 / 5) ;\n return celsius;\n }", "function toCelsius(fahrenheit) {\n\treturn (fahrenheit - 32) * 5 / 9;\n}", "function convertToF(celsius) { //1\n let fahrenheit = celsius * 9/5 + 32; //2\n\n return fahrenheit; //3\n}", "celsiusToFehrenheit(celsius){\n var f = (celsius * 9/5)+32;\n return f;\n }", "function convertToF(celsius) {\n let fahrenheit = celsius * 9 / 5 + 32;\n return fahrenheit;\n }", "function celsiusToFahrenheit(celsius) {\n if (typeof celsius !== 'number') {\n throw {\n 'name': 'TypeError',\n 'message': 'Function requires ' +\n 'a single number argument'\n };\n }\n return ((celsius * 9) / 5) + 32;\n}", "function toCelsius(f) {\n let celsius = ((f-32)/9)*5;\n console.log(celsius);\n}", "function celsiusToFahrenheit(num){\n return (9/5)*num+32\n}", "function toCelcius(fahrenheit) {\n\treturn (fahrenheit - 32) * 5 /9;\n}", "function toFahrenheit(celcius){\n var fahrenheit = celcius * 1.8 + 32\n console.log(`${celcius} degrees celcius is ${fahrenheit} degrees fahrenheit`)\n}", "function toCelsius(fahrenheit) {\n return (fahrenheit - 32) * 5 / 9;\n }", "function celsiusToFahrenheit(celsius) {\n\tvar celsfahr = celsius * (9/5) + 32;\n\talert(celsius + \"°C is \" + celsfahr + \"°F\");\n}", "function convertToF(celsius) {\n let fahrenheit = celsius * (9/5) + 32;\n return fahrenheit;\n }", "function c2f(celsius) {\n return celsius * 1.8 + 32;\n}", "function convertToF(celsius) {\n let fahrenheit = ((celsius * (9/5)) + 32);\n return fahrenheit;\n}", "function celciusToFarenhite(temperature){\n return (temperature*9/5)+32;\n \n}", "function convertToFahrenheit(tempC) {\n const tempF = tempC * 1.8 + 32;\n return `${Math.round(tempF)} °F`;\n}", "function convertToCelsius(fahrenheit){\n let temp = (Number(fahrenheit)-32) * 5/9;\n return temp.toFixed(2);\n }", "function cToF(celsius) \n{\n var cTemp = celsius;\n var cToFahr = cTemp * 9 / 5 + 32;\n //var message = cTemp+'\\xB0C is ' + cToFahr + ' \\xB0F.';\n return cToFahr.toFixed(2);\n}", "function toCelsius(fahrenheit) {\n\n var c = (5 / 9) * (fahrenheit - 32);\n\n gs.info(c);\n}", "function convertFromFahrenheit(currentFahrenheit) {\n console.log(\"It is currently \" + (currentCelsius = (currentFahrenheit - 32) * (5 / 9)) + \" degrees Celsius.\");\n}", "temp(celsius, fahrenheit)\n\n {\n const cTemp = celsius;\n const cToFahr = cTemp * 9 / 5 + 32;\n console.log(\"Celsius to Fahrenheit:\" + celsius + \"to\" + cToFahr); // (°C × 9/5) + 32 = °F\n const fTemp = fahrenheit;\n const fToCel = (fTemp - 32) * 5 / 9;\n console.log(\"Fahrenheit to Celsius:\" + fahrenheit + \"to\" + celsius);\n\n\n }", "function toCelsius(f){\n\treturn (f-32) * (5/9);\n}", "function convertToFahrenheit(temp){\n let fahr = temp *9/5 +32;\n console.log(`${temp} degrees in C is ${fahr} degrees in F`);\n}", "function temp_converter(celsius_value){\n let F = celsius_value + 32/1.8\n console.log(celsius_value+\"C\"+ \" = \"+ F+\"F\")\n}", "function convertToF(celsius) {\n let fahrenheit;\n fahrenheit = (celsius * 9 / 5) + 32\n return `${celsius}°C is ${fahrenheit}°F.`;\n}", "function convertToF(celsius) {\n\treturn celsius * 9 / 5 + 32;\n}", "function celciusToFarenheit(C){\n return 1.8*C + 32;\n \n}", "function celsiusToFah(temp_c) {\n\tvar temp_f = (9 * temp_c / 5) + 32;\n\treturn temp_f\n}", "function celsToFahr(celsTemp) {\n // your code here\n return celsTemp * 9/5 + 32;\n}", "function convertFahrenheiTtoCelsius(F) {\n\treturn (F - 32) / 1.8;\n}", "function fahrenheitToCelsius(fahrenheitTemp) {\n return (fahrenheitTemp - 32) * 5 / 9;\n }", "function convertCtoF(celsius) {\n return (celsius * 9/5) + 32;\n}", "function farenheitCelsius(temp) {\n return temp - 32 * 5 / 9\n }", "function cToF(celsius)\n {\n var cTemp = celsius;\n var cToFahr = cTemp * 9 / 5 + 32;\n var message = cTemp+'\\xB0C is ' + cToFahr + ' \\xB0F.';//for testing only\n console.log(message);//for testing only\n\n return cToFahr;\n }", "function FahrenheitConversion(f,c,t) {\n return c = (f - c)/ t;\n}", "function convert (celsius){\n var fahrenheit = ((celsius * 9/5) +32);\n console.log(celsius +\" degrees celsius equates to: \"+fahrenheit + \" \"+ \"fahrenheit\");\n }", "function celsiusToFarenheit(c) {\n var farenheit = Math.round((c * 1.8) + 32);\n return (c + \" grados ceslsius son en farenheit \"+ farenheit);\n}", "function convertFahr (celsiusTemp) {\n return (((9/5) * celsiusTemp) + 32).toFixed(2);\n} // end convertFahr()", "function farenheitToCelsius(f) {\n var celsius = Math.round((f - 32) / 1.8);\n return (f + \" grados Farenheit son \" + celsius +\" en Celsius\");\n}", "function convertToF(celsius) { \n \n return( 9*celsius/5 + 32);\n}", "function celsiusToFahrenheit(fahrenheit){\n\n\tfahrenheit = fahrenheit * 9/5;\n\tfahrenheit = fahrenheit + 32;\n\n\tconsole.log(\"Degrees in fahrenheit: \" +fahrenheit);\n\treturn fahrenheit;\n\n\t}", "function fahrenheitToCelsius(fahrenheit) {\n if (typeof fahrenheit !== 'number') {\n throw {\n 'name': 'TypeError',\n 'message': 'Function requires ' +\n ' a single number argument'\n };\n }\n return (fahrenheit - 32) * 5 / 9;\n}", "function fToC(fahrenheit) \n{\n var fTemp = fahrenheit;\n var fToCel = (fTemp - 32) * 5 / 9;\n //var message = fTemp+'\\xB0F is ' + fToCel + '\\xB0C.';\n return fToCel.toFixed(2);\n}", "function celsiusFarenheit(temp) {\n return temp * 9 / 5 + 32\n }", "function CTempToF(val)\r\n{\r\n var CeltoFaren = val * 9 / 5 + 32;\r\n return CeltoFaren; \r\n}", "function convertToCelcius(fahrenheit) {\n return Math.round((fahrenheit - 32) * 5 / 9);\n}", "function convertirFAHaCelsius(gradoFah){\n let celsius = (gradoFah - 32) * 5 / 9;\n return celsius;\n}", "function fahrenheitToCelsius(celsius){\n\n\tcelsius = celsius - 32;\n\tcelsius = celsius * 5/9;\n\n\tconsole.log(\"Degrees in celcius: \" +celsius);\n\treturn celsius;\n\n\t}", "function getFahrenheit(celcius) {\nreturn(celcius + \" Celcius are \" + (celcius*9/5+32) + \" in Fahrenheit\");\n}", "function convertFtoC(fahrenheit) {\n return (fahrenheit - 32) * 5/9\n}", "function tempConvert(){\n\nlet celciusTemp = document.querySelector('input').value;\nlet C = parseInt(celciusTemp);\nlet F= (1.8 * C) + 32;\nalert(\"Temperature in Farenheit is \" + (F));\n}", "function fahrenheitToCelsius(num){\n return (num-32)*5/9\n}", "function celciusToFahreneit(celcius){\n const temperatureInFahreneit = celcius * (9/5) + 32; // in Fahreneit\n console.log(\"Temperature in Fahreneit:\", temperatureInFahreneit);\n\n}", "function FtoC(temperature) {\n let celcius = Math.floor(((temperature - 32) * 5) / 9);\n return celcius;\n}", "function tempKtoF(temp){\n//convert Kelvin to Fahrenheit by using this equation (K − 273.15) × 9/5 + 32 = F\nlet fahrenheit = (temp - 273.15) * 9/5 + 32;\n//assigns fahrenheit to go to 2 decimal places\nfahrenheit = fahrenheit.toFixed(2);\n//returns temperature in Fahrenheit\nreturn fahrenheit;\n}", "function changeToFahrenheit(celsius) \n {\n let celsiusTemp = celsius;\n let ToFar = celsiusTemp * 9 / 5 + 32;\n let msg = celsiusTemp + '\\xB0C is ' + ToFar + ' \\xB0F.';\n console.log(msg);\n }", "function toCelsius() {\r\n var fah = document.getElementById('fah_value').value;\r\n var cel_result = (5/9) * (fah-32);\r\n if (!isNaN(cel_result)) {\r\n document.getElementById('cel_result').value = cel_result;\r\n }\r\n}", "function farenheitCelsius() {\n const fah = 10;\n const cel = ((fah - 32) * (5/9));\n console.log(cel);\n }", "function celsiusToFahrenheit(cDegrees){\n var fahrenheit = (9/5 * cDegrees) + 32\n return fahrenheit\n}", "function CtoF(temperature) {\r\n return (temperature * 9) / 5 + 32;\r\n}", "function celsiusToFarenheit(f){\n var celsius = 20;\n var celsiusToFarenheit = celsius * 9 / 5 + 32;\n \n var farenheit = 68;\n var farenheiToCelsius = (farenheit - 32) * 5 / 9;\n \n alert(<br/>+' + celsius + '+'º Celsius a Farenheit: ' + celsiusToFarenheit);\n alert('<br/>' + farenheit + 'º Farenheit a Celsius: '+ farenheitToCelsius);\n \n}", "function convertToCelsius(fahrenheit){\n if(typeof(fahrenheit)=='string'||typeof(fahrenheit)=='undefined'||typeof(fahrenheit)=='object'){\n return 'Technical Error!';\n } \n return (5/9) * (fahrenheit-32);\n \n}", "function fToC (fahrenheit) {\n return Math.floor((fahrenheit - 32) * 5 / 9);\n}", "function FahrenheitToCelsius(fDegree){\n var celsius = (fDegree - 32)*5 / 9;\n console.log(celsius);\n }", "function convertToF(celsius) {\n let fahrenheit = celsius * (9 / 5) + 32;\n if (typeof fahrenheit !== \"undefined\") return fahrenheit;\n\n return \"fahrenheit not found\";\n}", "function convertCelsius(temperature) {\n temperature = Math.round(((temperature - 32) * 5) / 9);\n return temperature;\n}", "function toFarenheit(temp) {\r\n const celcius = temp - 273.15\r\n const farenheit = (celcius * 1.8) + 32\r\n return Math.floor(farenheit)\r\n}", "fahrenheitToCelsius(fahrenheit) {\n return (fahrenheit - 32) * 5/9;\n }", "function toCelsius(temperature) {\n temperature = Math.round((temperature - 32) / 1.8);\n return temperature;\n}", "function toCelsius(temp) {\n let temperature = (((temp - 32) * 5) / 9).toFixed(0);\n\n return temperature;\n}", "function celcius(fvalue)\n{\n //Kelvin to Celcius\n var cvalue_unrounded = fvalue - 273.15;\n //shows 2 decimal places only\n cvalue = cvalue_unrounded.toFixed(2);\n //Returns results as \"cvalue\" outside of this function\n return cvalue;\n}", "function tempConvert(tempInput) {\n var celcius = parseFloat(tempInput);\n celcius = (celcius - 32) / 1.8;\n value = celcius.toFixed();\n return value;\n\n}" ]
[ "0.8591764", "0.8572324", "0.8557569", "0.855333", "0.8552828", "0.85504115", "0.85355514", "0.85192215", "0.84894556", "0.84592146", "0.843883", "0.8419756", "0.83965737", "0.83819586", "0.8372484", "0.83716947", "0.83716947", "0.83613575", "0.8339583", "0.832744", "0.8324779", "0.8298382", "0.82868415", "0.8286295", "0.82828444", "0.8280982", "0.82692504", "0.8220313", "0.8218658", "0.82178414", "0.8203452", "0.81888527", "0.8187931", "0.81705034", "0.815956", "0.8157144", "0.8156131", "0.8155099", "0.8151662", "0.81454355", "0.8145021", "0.81287897", "0.81184024", "0.8116506", "0.81129205", "0.81096965", "0.81090266", "0.8105292", "0.8068076", "0.80573857", "0.8054297", "0.80421853", "0.8030693", "0.80201644", "0.8015494", "0.7959883", "0.7951493", "0.7937441", "0.7935202", "0.79350513", "0.7896563", "0.7895678", "0.78741455", "0.7871946", "0.78536284", "0.7848682", "0.7823809", "0.78135633", "0.7809934", "0.78051007", "0.78019434", "0.7795213", "0.77752084", "0.7751843", "0.7727612", "0.7698832", "0.7684099", "0.7680701", "0.7679624", "0.766979", "0.7659807", "0.76550245", "0.76492536", "0.76456314", "0.7642242", "0.76334214", "0.76300764", "0.7628209", "0.76267684", "0.7619355", "0.7619007", "0.76126945", "0.7612056", "0.7598016", "0.75944763", "0.75583553", "0.755425", "0.75373065", "0.75331646", "0.7526293", "0.7513889" ]
0.0
-1
! vuerouter v3.0.2 (c) 2018 Evan You
function r(t,e){0}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "private internal function m248() {}", "function jj(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"source.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function TM(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"source.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function BO(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"source.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function version(){ return \"0.13.0\" }", "function Es(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"source.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function fyv(){\n \n }", "function Qw(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "transient private internal function m185() {}", "function yh(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"graticule.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "vampireWithName(name) {\n \n }", "function iP(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"source.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function Uk(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "upgrade() {}", "updated() {}", "protected internal function m252() {}", "function cO(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"source.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function vT(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"layer.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "transient final protected internal function m174() {}", "function SigV4Utils() { }", "function Wx(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "transient protected internal function m189() {}", "added(vrobject){}", "function ow(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function Ak(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "transient private protected internal function m182() {}", "function Bv(e){let{basename:t,children:n,window:r}=e,l=X.exports.useRef();l.current==null&&(l.current=gv({window:r}));let o=l.current,[i,u]=X.exports.useState({action:o.action,location:o.location});return X.exports.useLayoutEffect(()=>o.listen(u),[o]),X.exports.createElement(Fv,{basename:t,children:n,location:i.location,navigationType:i.action,navigator:o})}", "function VI(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"layer.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function Rb(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function comportement (){\n\t }", "function jx(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function dp(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function Ek(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function PD(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "__previnit(){}", "function uf(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"layer.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function Hr(e,t){\"undefined\"!==typeof console&&(console.warn(\"[vue-i18n] \"+e),t&&console.warn(t.stack))}", "function hA(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function Bevy() {}", "function JV(e,t){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+e),t&&console.warn(t.stack))}", "transient final private internal function m170() {}", "function $S(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function vI(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"style.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "init() {\n }", "function Vt(){this.__data__=[]}", "function VO(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};VO.installed||(VO.installed=!0,t.use(i,e),t.use(r,e),t.use(o,e),t.use(a,e),t.use(s,e),t.use(u,e),t.use(l,e),t.use(c,e),t.use(d,e),t.use(h,e),t.use(f,e),t.use(p,e),t.use(m,e),t.use(v,e),t.use(g,e),t.use(_,e),t.use(y,e),t.use(b,e),t.use(x,e),t.use(w,e),t.use(A,e),t.use(M,e),t.use(S,e),t.use(T,e),t.use(k,e),t.use(O,e),t.use(C,e),t.use(L,e),t.use(E,e),t.use(D,e),t.use(j,e),t.use(I,e),t.use(P,e),t.use(Y,e),t.use(F,e),t.use(R,e),t.use(N,e),t.use(B,e),t.use($,e),t.use(z,e),t.use(H,e),t.use(V,e),t.use(G,e))}", "function ea(){}", "transient final private protected internal function m167() {}", "static get tag(){return\"hal-9000\"}", "static final private internal function m106() {}", "function vinewx(t=\"untitled\",s=!1){return new class{constructor(t,s){this.name=t,this.debug=s,this.isQX=\"undefined\"!=typeof $task,this.isLoon=\"undefined\"!=typeof $loon,this.isSurge=\"undefined\"!=typeof $httpClient&&!this.isLoon,this.isNode=\"function\"==typeof require,this.isJSBox=this.isNode&&\"undefined\"!=typeof $jsbox,this.node=(()=>this.isNode?{request:\"undefined\"!=typeof $request?void 0:require(\"request\"),fs:require(\"fs\")}:null)(),this.cache=this.initCache(),this.log(`INITIAL CACHE:\\n${JSON.stringify(this.cache)}`),Promise.prototype.delay=function(t){return this.then(function(s){return((t,s)=>new Promise(function(e){setTimeout(e.bind(null,s),t)}))(t,s)})}}get(t){return this.isQX?(\"string\"==typeof t&&(t={url:t,method:\"GET\"}),$task.fetch(t)):new Promise((s,e)=>{this.isLoon||this.isSurge?$httpClient.get(t,(t,i,o)=>{t?e(t):s({status:i.status,headers:i.headers,body:o})}):this.node.request(t,(t,i,o)=>{t?e(t):s({...i,status:i.statusCode,body:o})})})}post(t){return this.isQX?(\"string\"==typeof t&&(t={url:t}),t.method=\"POST\",$task.fetch(t)):new Promise((s,e)=>{this.isLoon||this.isSurge?$httpClient.post(t,(t,i,o)=>{t?e(t):s({status:i.status,headers:i.headers,body:o})}):this.node.request.post(t,(t,i,o)=>{t?e(t):s({...i,status:i.statusCode,body:o})})})}initCache(){if(this.isQX)return JSON.parse($prefs.valueForKey(this.name)||\"{}\");if(this.isLoon||this.isSurge)return JSON.parse($persistentStore.read(this.name)||\"{}\");if(this.isNode){const t=`${this.name}.json`;return this.node.fs.existsSync(t)?JSON.parse(this.node.fs.readFileSync(`${this.name}.json`)):(this.node.fs.writeFileSync(t,JSON.stringify({}),{flag:\"wx\"},t=>console.log(t)),{})}}persistCache(){const t=JSON.stringify(this.cache);this.log(`FLUSHING DATA:\\n${t}`),this.isQX&&$prefs.setValueForKey(t,this.name),(this.isLoon||this.isSurge)&&$persistentStore.write(t,this.name),this.isNode&&this.node.fs.writeFileSync(`${this.name}.json`,t,{flag:\"w\"},t=>console.log(t))}write(t,s){this.log(`SET ${s} = ${JSON.stringify(t)}`),this.cache[s]=t,this.persistCache()}read(t){return this.log(`READ ${t} ==> ${JSON.stringify(this.cache[t])}`),this.cache[t]}delete(t){this.log(`DELETE ${t}`),delete this.cache[t],this.persistCache()}notify(t,s,e,i){const o=\"string\"==typeof i?i:void 0,n=e+(null==o?\"\":`\\n${o}`);this.isQX&&(void 0!==o?$notify(t,s,e,{\"open-url\":o}):$notify(t,s,e,i)),this.isSurge&&$notification.post(t,s,n),this.isLoon&&$notification.post(t,s,e),this.isNode&&(this.isJSBox?require(\"push\").schedule({title:t,body:s?s+\"\\n\"+e:e}):console.log(`${t}\\n${s}\\n${n}\\n\\n`))}log(t){this.debug&&console.log(t)}info(t){console.log(t)}error(t){console.log(\"ERROR: \"+t)}wait(t){return new Promise(s=>setTimeout(s,t))}done(t={}){this.isQX||this.isLoon||this.isSurge?$done(t):this.isNode&&!this.isJSBox&&\"undefined\"!=typeof $context&&($context.headers=t.headers,$context.statusCode=t.statusCode,$context.body=t.body)}}(t,s)}", "function Mv(){var t=this;ci()(this,{$source:{enumerable:!0,get:function(){return t.$olObject}},$map:{enumerable:!0,get:function(){return t.$services&&uu()(t.$services)}},$view:{enumerable:!0,get:function(){return t.$services&&t.$services.view}},$sourceContainer:{enumerable:!0,get:function(){return t.$services&&t.$services.sourceContainer}}})}", "static private protected internal function m118() {}", "function test_candu_graphs_datastore_vsphere6() {}", "install(Vue, options) {\n Vue.VERSION = 'v0.0.1';\n\n let userOptions = {...defaultOptions, ...options};\n // console.log(userOptions)\n\n // create a mixin\n Vue.mixin({\n // created() {\n // console.log(Vue.VERSION);\n // },\n\n\n });\n Vue.prototype.$italicHTML = function (text) {\n return '<i>' + text + '</i>';\n }\n Vue.prototype.$boldHTML = function (text) {\n return '<b>' + text + '</b>';\n }\n\n // define a global filter\n Vue.filter('preview', (value) => {\n if (!value) {\n return '';\n }\n return value.substring(0, userOptions.cutoff) + '...';\n })\n\n Vue.filter('localname', (value) => {\n if (!value) {\n return '';\n }\n var ln = value;\n if(value!= undefined){\n if ( value.lastIndexOf(\"#\") != -1) { ln = value.substr(value.lastIndexOf(\"#\")).substr(1)}\n else{ ln = value.substr(value.lastIndexOf(\"/\")).substr(1) }\n ln = ln.length == 0 ? value : ln\n }\n return ln\n })\n\n // add a custom directive\n Vue.directive('focus', {\n // When the bound element is inserted into the DOM...\n inserted: function (el) {\n // Focus the element\n el.focus();\n }\n })\n\n }", "function zC(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"layer.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "initialize() {\n\n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }" ]
[ "0.6042088", "0.59192574", "0.58442247", "0.57572705", "0.571358", "0.5663805", "0.56568575", "0.55766237", "0.5550271", "0.5538255", "0.5528895", "0.55286473", "0.5526299", "0.55251426", "0.54889333", "0.5461573", "0.54504114", "0.54407704", "0.5436747", "0.5418446", "0.54034346", "0.53593373", "0.5358997", "0.5358997", "0.5358997", "0.5358997", "0.5358997", "0.5358997", "0.5358997", "0.5358997", "0.5358997", "0.5358997", "0.5358997", "0.5358997", "0.5358997", "0.5358997", "0.5358997", "0.5358997", "0.5358997", "0.5358997", "0.5358997", "0.5358997", "0.5358997", "0.5358997", "0.5358997", "0.5358997", "0.5358997", "0.5358997", "0.5358997", "0.5358997", "0.5358997", "0.5358997", "0.5358997", "0.5358997", "0.5358997", "0.5358997", "0.5358997", "0.5358997", "0.5358997", "0.5357893", "0.53563094", "0.53393066", "0.5333713", "0.5319096", "0.5314978", "0.5308929", "0.53054357", "0.5302163", "0.5287935", "0.5280031", "0.5278769", "0.5265531", "0.52447224", "0.52339464", "0.52338624", "0.52187705", "0.5211941", "0.5207395", "0.51954854", "0.5186968", "0.51842487", "0.517653", "0.5167991", "0.5161712", "0.51584935", "0.5157759", "0.51535666", "0.51227903", "0.51161075", "0.51085585", "0.5100639", "0.5099375", "0.5087969", "0.50773233", "0.50760555", "0.50750196", "0.50750196", "0.50750196", "0.50750196", "0.50750196", "0.50750196" ]
0.0
-1
get the user's project count to implement pagination
async function fetchProjectCount() { if (loggedInUser) { const projectCountResult = await fetch( `/searchProjects/${loggedInUser._id}/count/${query}`, { method: "GET", } ); const parsedProjectsData = await projectCountResult.json(); setProjectCount(parsedProjectsData.count); setIsDataLoading(false); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function numPages(){\n let no_pages = Math.ceil(all_projects.length/per_page);\n return parseInt(no_pages);\n }", "function projectCount() {\n $http.get('../api/project/count')\n .success(function (data, status, headers, config) {\n console.info(data);\n $scope.projectTotal = data;\n\n }).\n error(function (data, status, headers, config) {\n console.info(data);\n });\n }", "function getTutorialCountGroupedByProject(req, res) {\n\tTutorial.aggregate([\n\t\t{\n\t\t\t$group: {\n\t\t\t\t_id: '$tutorialProjectID',\n\t\t\t\tcount: {$sum: 1}\n\t\t\t}\n\t\t}\n\t]).then((counts) => {\n\t\tres.status(200).json(counts)\n\t}).catch((err) => {\n\t\tconsole.log(err);\n\t})\n}", "function getCountOfFinishedTutorialsForAllProjects(req, res) {\n\t// Extract studentID\n\tconst {studentID} = req.params;\n\t// Create query to get count via aggregation\n\tProgress.aggregate([\n\t\t{\n\t\t\t$match: {\"studentID\": new mongoose.Types.ObjectId(studentID)}\n\t\t},\n\t\t{\n\t\t\t$group: {\n\t\t\t\t_id: '$projectID',\n\t\t\t\tcount: {$sum: 1}\n\t\t\t}\n\t\t}\n\t]).then((counts) => {\n\t\tres.status(200).json(counts)\n\t}).catch((err) => {\n\t\tconsole.log(err);\n\t})\n}", "async function getNumPages(page) {\n //var contain the selector of the number of users in the search\n const NUM_USER_SELECTOR = '#js-pjax-container > div > div.columns > div.column.three-fourths.codesearch-results > div > div.d-flex.flex-justify-between.border-bottom.pb-3 > h3'; \n \n let inner = await page.evaluate((sel) => {\n let html = document.querySelector(sel).innerHTML; \n // format is: \"69,803 users\"\n return html.replace(',', '').replace('users', '').trim();\n }, NUM_USER_SELECTOR);\n \n const numUsers = parseInt(inner);\n \n console.log('numUsers: ', numUsers);\n \n /**\n * GitHub shows 10 resuls per page, so\n */\n return Math.ceil(numUsers / 10);\n }", "getUsersTotalCount() {\n return this.intercomClient.get(\"/users\", { per_page: 1 })\n .then((response) => {\n return _.get(response, \"body.total_count\");\n })\n .catch((err) => {\n const fErr = this.intercomClient.handleError(err);\n this.logger.error(\"getUsersTotalCount.error\", fErr);\n return Promise.reject(fErr);\n });\n }", "function getProjectCount()\n\t{\n\t\t$('#spinLoad').show();\n\t\t$.ajax({\n\t\t\ttype: 'get',\n\t\t\turl: localUrl+'getProjectCount',\n\t\t\tcontentType: \"application/json; charset=utf-8\",\n\t\t\tdataType: \"json\",\n\t\t\tsuccess: function(response){\n\t\t\t\tconsole.log('totalProjectCountText : '+response.message);\n\t\t\t\t$('#totalProjectCountText').html(response.message);\n\t\t\t\t$('#spinLoad').hide();\n\t\t\t},\n\t\t\terror: function(){console.log('#totalProjectCountText --> Gala re Pilaa');$('#spinLoad').hide();}\n\t\t});\n\t}", "function getRecordOrFieldCountsMyProjects(thistype, theseVisiblePids) {\t\t\r\n\t// Get projects counts via ajax\r\n\t$.post(app_path_webroot+'ProjectGeneral/project_stats_ajax.php',{ type: thistype, pids: theseVisiblePids }, function(data){\r\n\t\tif (data != '0') {\r\n\t\t\t// Parse JSON\r\n\t\t\tvar json = jQuery.parseJSON(data);\r\n\t\t\t// Loop through each project\r\n\t\t\tif (thistype == 'records') {\r\n\t\t\t\t// RECORDS\r\n\t\t\t\tfor (var this_pid in json) {\r\n\t\t\t\t\t$('#pid-cntr-'+this_pid).html( json[this_pid]['r'] );\r\n\t\t\t\t}\r\n\t\t\t\t// Get list of more pid's to process\r\n\t\t\t\tvar nextVisiblePids = json.next_pids;\r\n\t\t\t\tif (nextVisiblePids.length > 0) {\r\n\t\t\t\t\t// DO MORE\r\n\t\t\t\t\tgetRecordOrFieldCountsMyProjects('records', nextVisiblePids);\r\n\t\t\t\t}\r\n\t\t\t} else if (thistype == 'fields') {\r\n\t\t\t\t// FIELDS/INSTRUMENTS\r\n\t\t\t\tfor (var this_pid in json) {\r\n\t\t\t\t\t$('#pid-cntf-'+this_pid).html( json[this_pid]['f'] );\r\n\t\t\t\t\t$('#pid-cnti-'+this_pid).html( json[this_pid]['i'] );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n}", "function countRepositories( account ) {\n // check to see if account is defined\n if( typeof account == \"undefined\" ) {\n //if not, let's set it to the global default\n account = global_github_account;\n }\n // we have a local variable here called repos\n // that is storing all the repositories in\n // our system... because it's local, noone\n // outside the function can see it\n var repos = {\n \"camerican\": [\"SCC\",\"example_form\"],\n \"someoneelse\": [\"SCC\"]\n }\n // we want to return the number of repos that\n // a given user has... let's make sure we can\n // find the user...\n if( typeof repos[account] != \"undefined\" ) {\n // if we find them in the repos Object, let's\n // return the number of repos\n return repos[account].length;\n } else {\n // else, we weren't able to find them, so they\n // by definition have 0 repos\n return 0;\n }\n}", "static count() {\n return User.find({})\n .then((users)=>{\n return users.length;\n });\n }", "count_of_tags_pre_proejct(req, res) {\n return Associations\n .findAll({\n where: {\n user_id: req.params.user_id,\n },\n order: [\n ['createdAt', 'DESC'],\n ],\n attributes: {exclude: ['createdAt', 'updatedAt', 'user_id'] },\n raw: true\n })\n .then((associations) => {\n let result = [];\n for ( let i in associations){\n result.push(associations[i].project_id)\n }\n get_tags_count_project_list(result, res);\n })\n .catch((error) => res.status(400).send(error));\n }", "function numPages(){\n let no_pages = Math.ceil(all_participants.length/per_page);\n return parseInt(no_pages);\n }", "function renderCounter(selectedProject) {\n const incompleteTasks = selectedProject.tasks.filter(\n (task) => !task.complete\n ).length;\n const tasksLeft = incompleteTasks === 1 ? 'task' : 'tasks';\n counter.innerText = `${incompleteTasks} ${tasksLeft} to go!`;\n}", "function count_users() {\n\tconst q = datastore.createQuery(USER);\n\treturn datastore.runQuery(q)\n\t\t.then( (count) => {\n\t\t\treturn count[0].length;\n\t\t});\n}", "static countUsers(){\n console.log('there are 50 users');\n }", "function RepoCount(data){\n\t// alert(data.total_count);\n\treturn data.total_count\n}", "function getPageCount(){\n\tlet studentCount = 0;\n\n\t//Loops through all students and for each which isn't deselected the loops adds one to the student counter.\n\tfor (var i = 0; i < studentList.length; i++) {\n\t\tif ($(studentList[i]).hasClass(\"deselected\") === false) {\n\t\t\tstudentCount++;\n\t\t}\n\t}\n\n\t//Calculates how many pages by taking the student count and divdeds it with studentsPerPage.\n\tpageCount = Math.ceil(studentCount / studentsPerPage);\n\n}", "async function getUserCount() {\n const query = datastore.createQuery(USERS);\n const entities = await datastore.runQuery(query);\n const count = Object.keys(entities[0]).length;\n return count;\n}", "pageCount() {\n return Math.round(this.itemCount() / this.itemsPerPage)\n }", "function getUserCount() {\n console.log(\"In getUser\");\n \n $.get(\"/app.json\", function(data) {\n completionCount = data;\n console.log(\"This is # of completed tasks in user.js: \"+data);\n console.log(\"Running Count: \"+completionCount);\n\n }).done(getTodos);\n\n}", "static async getUsersQtd() {\n const qtd = await user_model.collection.estimatedDocumentCount()\n return qtd \n }", "pageItemCount(pageIndex) {\n return this.pages[pageIndex] ? this.pages[pageIndex].element.length : -1\n }", "async getAllProjects(offset = 0, limit = 10) {\n return await Projects.findAll({\n offset: offset,\n limit: limit,\n include: {\n model: Users,\n attributes: ['username']\n }\n })\n }", "getTrafficPermissionTotalCount ({ commit }) {\n const getItems = async () => {\n const entities = await api.getAllTrafficPermissions()\n const count = entities.items.length\n\n commit('SET_TOTAL_TRAFFIC_PERMISSION_COUNT', count)\n }\n\n getItems()\n }", "function numberOfPages()\n{\n if(isSearched){\n return Math.ceil(searchResult.length / recordsPerPage);\n } else {\n return Math.ceil(data.length / recordsPerPage);\n }\n \n}", "function initiateNumberOfInvolvedTasks() {\n\n\t\t\t$http.get('http://localhost:8080/activiti-rest/service/runtime/tasks?candidateUser=' + nbc.user.id)\n\t\t\t.then(function(response){\n\t\t\t\t$rootScope.numberOfInvolvedTasks = response.data.total;\n\t\t\t});\n\t\t}", "function getCount() {\n return count;\n}", "function getTotalProjects() {\n fetch('https://inlupp-fa.azurewebsites.net/api/total-projects')\n .then(res => res.json()) \n .then(data => {\n document.getElementById('totalProjects').innerHTML = data.projects;\n document.getElementById('totalProjects-p').innerHTML = data.growth;\n })\n}", "function numberOfPages() {\n let totalPages = Math.ceil(eachStudent.length / studentsPerPage);\n return totalPages;\n}", "function totalFound() {\n numFound.style.display = \"block\";\n axios\n .get(\n `https://api.github.com/search/users?q=${inputString}&per_page=10&page=${pageNum}:last`,\n {\n method: \"get\"\n }\n )\n .then(res => {\n totalUsersFound = res.data.total_count;\n numFound.textContent = `Found ${totalUsersFound} results for \"${inputString}\", page ${pageNum +\n 1}`;\n });\n}", "getNumUsers() {\r\n return this.users.length;\r\n }", "getNumUsers() {\r\n return this.users.length;\r\n }", "function process_count (repos) {\n var total = 0;\n repos.filter(function (r) {\n total += r.stargazers_count\n })\n \n //console.log('Total in github-starz.js : ' + total)\n user_callback(total);\n}", "async loadCount()\n {\n const qParams = this._cache.queryParams;\n if (!qParams)\n {\n throw new Meteor.Error('Calling .loadCount() while query params are not ready');\n }\n\n return this.getEntity().getCount(qParams.filter || {});\n }", "getProxyTemplateTotalCount ({ commit }) {\n const getItems = async () => {\n const entities = await api.getAllProxyTemplates()\n const count = entities.items.length\n\n commit('SET_TOTAL_PROXY_TEMPLATE_COUNT', count)\n }\n\n getItems()\n }", "function calcProjectTotal() {\n self.projects.forEach(function (project) {\n projectMethods.getProjectItemsByProjectId(project.id).then(function(items){\n var projectSum=0;\n items.forEach(function(calculation){\n projectSum += calculation.co2_offset;\n });\n project.projectTotal= Math.floor(projectSum * 10000)/10000;\n });\n\n })\n }", "organismCount( org ){\n return this.organismCounts().get( org );\n }", "getcurrentprojects() { }", "function setTotalUsers() {\n var userCountEl = d.querySelector('#user-count');\n var count = usersElement.querySelectorAll('.user-item');\n userCountEl.innerHTML = count.length;\n }", "function getUserCount(arr) {\n var userCount = arr.length;\n return userCount;\n}", "function numPages() {\r\n\t\treturn Math.ceil(total_cnt / opts.rows_per_page);\r\n\t}", "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 numPages()\n{\n return Math.ceil(objJson.length / records_per_page);\n}", "function loggedInUsers() {\n let count = 0;\n for (const element of Object.values(users)) {\n if (element.isLoggedIn == true) {\n count += 1;\n }\n }\n return count;\n}", "getDataplaneTotalCount ({ commit }) {\n const getItems = async () => {\n const entities = await api.getAllDataplanes()\n const count = entities.items.length\n\n commit('SET_TOTAL_DATAPLANE_COUNT', count)\n }\n\n getItems()\n }", "getPageCount() {\n return this.doc.pages.length;\n }", "function getPageTotal(env) {\n\t\treturn env.$elts.pagination.children().length;\n\t}", "function numPages() {\n console.log(Math.ceil(countryData.length / records_per_page));\n return Math.ceil(countryData.length / records_per_page);\n}", "function getProjects () {\n projectGetWithHeaders(`project/confirmed/${data.user.id}/confirmed`, {\"token\": JSON.parse(localStorage.getItem(\"token\"))}).then(projects => {\n setdata({...data, projects: projects.data.data, isLoading: false})\n }).catch(error => {\n antdNotification(\"error\", \"Fetch Failed\", \"Error fetching project details, please reload screen\")\n })\n }", "function getTotalCount( itcb ) {\n // no need to count total rows if we're on the last page\n if( options.limit && options.skip && options.limit > activities.length ) {\n count = activities.length + options.skip;\n return itcb( null );\n }\n\n let countOptions = {};\n if( options.countLimit ) {\n countOptions.options = {\n countLimit: options.countLimit\n };\n } else if( params.ignoreCountLimit ) {\n countOptions.options = {\n noCountLimit: true\n };\n }\n\n function onCountComplete( err, result ) {\n count = result;\n itcb( err, result );\n }\n\n Y.doccirrus.mongodb.runDb( {\n user: args.user,\n model: 'activity',\n action: 'count',\n query: args.query,\n ...countOptions\n }, onCountComplete );\n }", "async getActiveProjects() {\n\n return await this.request({\n name: 'project.list',\n page: Page.builder().status('ACTIVE').all()\n });\n\n }", "function countProductsOnPage() {\n $('.displayed__localCount').html(document.querySelectorAll('.collection__item').length + ' of');\n}", "function amILiker(req, res){\n knex('UserHasProject')\n .count('uhp_idproject as CNT')\n .where(function (){ \n this.where('uhp_idproject', req.params.uhp_idproject)\n .andWhere('uhp_iduser', req.params.uhp_iduser)\n .andWhere('uhp_userrole', 'liked')\n })\n .then(function(response){\n res.send({\n response: response[0].CNT\n });\n })\n}", "function getAllProjects() {\n\t\n\tuserType = getJavaScriptCookie(\"usertype\"); //From the cookies, stores the type of the user. Admin or superadmin etc\n\tt0 = new Date().getTime();\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': 'getAllProjects'\n\t\t}, success: function (data) {\n\t\t\tprojects = data;\n\t\t\tRETRIEVED_PROJECTS = JSON.parse(projects['projects']);\n\t\t\tlengthProjects = RETRIEVED_PROJECTS.length;\n\t\t\testablishRetrievedProjects();\n\t\t\tif(RETRIEVED_PROJECTS) console.log(\"getAllProjects() - PROJECTS HAVE BEEN RETRIEVED\");\n\t\t\tt1 = new Date().getTime();\n//\t\t\tconsole.log('took: ' + (t1 - t0) + 'ms');\n//\t\t\tconsole.log(\"PROJECTS ARE : \", RETRIEVED_PROJECTS);\n\t\t\t//getSearchCriteria();\n\t\t\t\n\t\t\t//fetchApprovalsAll();\n\t\t\t\t\t\t\t\t\n\t\t\t//fillInvsTable(data);\n\t\t\t\n\t\t\tapprovingMembers();\n\t\t\t\n\t\t\t//getInvs(1);\n\t\t}\n\t});\n}", "function getCMpageCount(){\n\t\t\t\tCMremakeCount = 0\n\t\t\t\t\tCMTimeout = setTimeout(function(){\n\t\t\t\t\t\t//resizeCMTable()\n\t\t\n\t\t\t\t\t\t////log(\"Page count UM:\", my_pageCount)\n\t\t\t\t\t\t//function pageTime(){\n\t\t\t\t\t\t\tfunction pageConfig(table){\n\t\t\t\t\t\t\t\tvar tableInfo = table.page.info()\n\t\t\t\t\t\t\t\tCMPageCount = tableInfo.pages\n\t\t\t\t\t\t\t\tif(noCurrentMatches === true){\n\t\t\t\t\t\t\t\t\tcurrentMatchesTabTime = 5000\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tcurrentMatchesTabTime = (document.getElementById(\"currentTime\").value * 1000) - 4000\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tpageTimeconfig(true, \"CM\", my_currentMatchesTable, CMPageCount,minPageTime, currentMatchesTabTime, allCMdata)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tpageConfig(my_currentMatchesTable)\n\t\t\t\t}, 500)\n\t\t\t}", "getPlaylistCount(args) {\n\t\targs = args || {};\n\t\tconst accountId = args.accountId || this.accountId;\n\n\t\tif (!_.isString(accountId)) {\n\t\t\tthrow new Error('An accountId string is required for getPlaylistCount()');\n\t\t}\n\n\t\treturn this.getAccessToken(args).then(res => {\n\t\t\targs = Object.assign({}, args, {\n\t\t\t\tmethod: 'GET',\n\t\t\t\tbaseUrl: Client.CMS_API_BASE_URL,\n\t\t\t\tpath: `/accounts/${accountId}/counts/playlists`,\n\t\t\t\tcontentType: Client.DEFAULT_CONTENT_TYPE,\n\t\t\t\tauthorization: this.getBearerAuthorization(res.access_token),\n\t\t\t\tquery: Object.assign({}, args.query)\n\t\t\t});\n\n\t\t\treturn this.makeRequest(args);\n\t\t});\n\t}", "projects() {\r\n\t\treturn API.get(\"pm\", \"/list-projects\");\r\n\t}", "static getUserPlaylistsCount(userId) {\n return fetch('http://localhost:8888/getuserplaylistscount/'+userId, {\n }).then(response => {\n return response.json().then(data => {\n return data\n })\n })\n }", "async countStudyParticipants(parent, args, ctx, info) {\n const { where } = args;\n if (!ctx.request.userId) {\n throw new Error(\"You must be logged in to do that!\");\n }\n return ctx.db.query.profilesConnection({ where }, info);\n }", "function calculateTotalNumberOfPagesForPagination (numberOfTotalItemsRetrievedFromDb){\n\n vm.pagination.totalPages = Math.ceil(numberOfTotalItemsRetrievedFromDb / vm.pagination.numberOfItemsByPage);\n vm.pagination.totalItems = numberOfTotalItemsRetrievedFromDb;\n\n }", "static countId() {\n console.log(`total numbers of users: ${User.id}`);\n }", "getNumberOfVideos() { //method to get total number of videos displayed on home page\n return this.videos.length;\n }", "function getUsersCount() {\n\n var count = 0;\n\n // Each user is in a div\n var possibleUsers = document.getElementsByTagName('div');\n\n for (var x = 0; x < possibleUsers.length; x++) {\n // Make sure right class\n if (possibleUsers[x].className == \"user\") {\n count++;\n }\n }\n return count;\n}", "async numberOfIssuesAndPrs() {\n console.log(`Fetching number of issues for repo: ${this.repo}`);\n try {\n const options = await this.octokit.issues.listForRepo.endpoint.merge({\n owner: this.owner,\n repo: this.repo,\n });\n const issues = await this.octokit.paginate(options);\n console.log(`Found ${issues.length} issues`);\n let prs = issues.filter(entry => entry.pull_request);\n return [issues.length - prs.length, prs.length];\n } catch (err) {\n console.error('Could not get Github issues');\n console.error(err);\n }\n }", "function amountOfPages() {\r\n let pages = Math.ceil(eachStudent.length / studentsPerPage);\r\n return pages;\r\n}", "function countTasks(taskPage){\n\t\tvar done = 0 ;\n\t\t//Guarda o numero de tarefas completadas\n $(taskPage).find('tbody tr td.not').each(function(){\n\t\t\tif ($(this).text() == 'sim'){\n\t\t\t\tdone++;\n\t\t\t}\n });\n\t\t\n\t\t//guarda o numero de linhas da tabela\n\t\tvar tasksTotal = $(taskPage).find('#tblTasks tbody tr').length;\n\n\n\t\t//atualiza o numero de tarefas\n\t\t$('#taskCount').text(tasksTotal-done); \n\n\t}", "function getProfileCount(data) {\n return data.length;\n}", "function onGotCount(cnt) {\n $scope.count = count = cnt;\n pageCount = Math.ceil(cnt / pager.pageSize());\n $scope.info = pageInfo();\n }", "static async countParcels(request, response) {\n const { email } = response.locals;\n const userId = response.locals.id;\n const {\n pending,\n transit,\n delivered,\n cancelled,\n } = constants.DEFAULT_STATUS;\n\n const app = new App();\n const isUser = await app.isEmailExist(email, constants.USER);\n\n if (!isUser) {\n response.status(403).json({\n status: 'fail',\n auth: 'invalid',\n message: 'Forbidden, Invalid user authentication key',\n });\n }\n\n const user = new User();\n const all = await user.getParcelNumber(userId);\n const parcelPending = await user.getParcelNumber(userId, pending);\n const parcelInTransit = await user.getParcelNumber(userId, transit);\n const parcelDelivered = await user.getParcelNumber(userId, delivered);\n const parcelCancelled = await user.getParcelNumber(userId, cancelled);\n\n response.status(200).json({\n status: 'success',\n parcel: {\n all,\n pending: parcelPending,\n delivered: parcelDelivered,\n inTransit: parcelInTransit,\n cancelled: parcelCancelled,\n },\n });\n }", "function getPageCount(searchParams, response) {\n return function(error, rows) {\n if (error) {throw error;}\n\n var resultCount = rows[0]['count(*)'];\n var pageCount = resultCount / issuesPerPage;\n if (pageCount != Math.floor(pageCount))\n {\n pageCount++;\n pageCount = Math.floor(pageCount);\n } \n if (pageCount == 0)\n {\n pageCount = 1;\n }\n if (searchParams.page > pageCount)\n {\n searchParams.page = pageCount;\n }\n \n searchParams.resultCount = resultCount;\n searchParams.pageCount = pageCount;\n \n var sqlQuery = 'SELECT * FROM issues ' +\n searchQuery(searchParams.search) + \n orderQuery(searchParams.sortBy, searchParams.direction) +\n ' limit ' + issuesPerPage +\n ' offset ' + (searchParams.page - 1) * issuesPerPage;\n dbAccess.runQuery(sqlQuery, printPage(searchParams, response));\n };\n}", "function getExistingProjects(startRow) {\n toggleResultTable(false);\n toggleSearchingIndicator(true);\n clearTable();\n receivedProjects = 0;\n for (var i = startRow; i < currentPage * elementsPerPage; i++) {\n //end is reached\n if (typeof projects[i] == \"undefined\") {\n break;\n } else {\n receivedProjects++;\n addProjectToTable(projects[i]);\n }\n }\n checkPages();\n toggleSearchingIndicator(false);\n toggleResultTable(true);\n}", "getTrafficLogTotalCount ({ commit }) {\n const getItems = async () => {\n const entities = await api.getAllTrafficLogs()\n const count = entities.items.length\n\n commit('SET_TOTAL_TRAFFIC_LOG_COUNT', count)\n }\n\n getItems()\n }", "function retreiveTotalUsers () {\n\t\t//Vars\n\t\tlet serverID = client.guilds.get(message.guild.id);\n\n\t\t//Number of Users in a Server\n\t\treturn serverID.members.size;\n\t}", "function countQuery_(gmailQuery) {\n var pageToken;\n var return_count = 0;\n do {\n var threadList = Gmail.Users.Threads.list('me', {\n q: gmailQuery,\n pageToken: pageToken\n });\n if (threadList.threads && threadList.threads.length > 0) {\n threadList.threads.forEach(function(thread) {\n \n //console.log(thread);\n \n return_count++;\n });\n }\n pageToken = threadList.nextPageToken;\n } while (pageToken);\n\n return return_count;\n}", "function getProjectActivity(projectList, maxActivity) {\n if (projectList.length > 400) {\n console.log(\"Are you CRAZY?!? That's too many projects.\")\n return;\n }\n var activityPerProject = [];\n for (var i = 0; i < projectList.length; i++) {\n var client = new HttpClient();\n client.get('https://' + window.location.hostname + '/services/v5/projects/' + projectList[i] + '/activity?fields=occurred_at,project(name)&limit=' + maxActivity, function(response) {\n activityPerProject.push(JSON.parse(response));\n if (activityPerProject.length === projectList.length) {\n scoreProjects(activityPerProject, 182);\n }\n });\n }\n}", "get count() {}", "function numPages() {\n\t\t\treturn Math.ceil(maxentries/opts.items_per_page);\n\t\t}", "function numPages() {\n\t\t\treturn Math.ceil(maxentries/opts.items_per_page);\n\t\t}", "function numPages() {\n\t\t\treturn Math.ceil(maxentries/opts.items_per_page);\n\t\t}", "function numPages() {\n\t\t\treturn Math.ceil(maxentries/opts.items_per_page);\n\t\t}", "function numPages() {\n\t\t\treturn Math.ceil(maxentries/opts.items_per_page);\n\t\t}", "function getProjects()\r\n{\r\n\t\r\n\tclear();\r\n\tvar n;\r\n\r\n\tvar aux = System.Gadget.Settings.read(\"noProjects\"); \r\n\t//var aux =2;\r\n\tif ( aux == \"\" ) n = 0; else n = aux;\r\n\tprojects = new Array();\t\t\r\n\tcurrentPage = 1;\r\n\tvar cur = 0;\r\n\tfor ( var cur = 0; cur < n;cur++){ \r\n\t\tvar projectURL = System.Gadget.Settings.read(\"projectURL\"+cur); \r\n\t\tvar useAuth = System.Gadget.Settings.read(\"projectUseAuthentification\"+cur); \r\n\t\tvar userName = System.Gadget.Settings.read(\"projectUserName\"+cur); \r\n\t\tvar passwordInput = System.Gadget.Settings.read(\"projectPassword\"+cur); \r\n\t\tGetProject(projectURL,useAuth,userName,passwordInput, cur);\r\n\t}\r\n\tvar refreshTime = System.Gadget.Settings.read('refresh');\r\n\tif ( refreshTime > 0 ) setTimeout( \"getProjects();\", refreshTime );\r\n\treturn;\r\n}", "constructor(@Inject(ProjectService) projectService) {\n this.projectService = projectService;\n this.projects = [];\n\n // Setting up our functional reactive subscription to receive project changes from the database\n this.projectsSubscription = projectService.change\n // We subscribe to the change observer of our service and deal with project changes in the function parameter\n .subscribe((projects) => {\n this.projects = projects;\n // We create new navigation items for our projects\n this.projectNavigationItems = this.projects\n .filter((project) => !project.deleted)\n .map((project) => {\n return {\n title: project.title,\n link: ['/projects', project._id]\n };\n });\n // Uses functional reduce to get a count over open tasks across all projects\n this.openTasksCount = this.projects\n .reduce((count, project) => count + project.tasks.filter((task) => !task.done).length, 0);\n });\n }", "userAccess (project) {\n let access = null;\n const currentUser = userStore.data.scitran ? userStore.data.scitran._id : null;\n if (project) {\n if (project.permissions && project.permissions.length > 0) {\n for (let user of project.permissions) {\n if (currentUser === user._id) {\n access = user.access;\n }\n }\n } else if (project.group === currentUser) {\n access = 'orphaned';\n }\n }\n return access;\n }", "function taskCounter()\n{\n\treturn JSON.parse(localStorage.getItem(\"tasks\")).length;\n}", "function retrieveAccountRecordCount() {\n\tvar baseUrl = getClientStore().baseURL;\n\tvar cellName = sessionStorage.selectedcell;\n\tvar accessor = objCommon.initializeAccessor(baseUrl, cellName);\n\tvar objAccountManager = new _pc.AccountManager(accessor);\n\tvar uri = objAccountManager.getUrl();\n\turi = uri + \"?$top=0&$inlinecount=allpages\";\n\tvar restAdapter = _pc.RestAdapterFactory.create(accessor);\n\tvar response = restAdapter.get(uri, \"application/json\");\n\tvar json = response.bodyAsJson().d;\n\tvar count = json.__count;\n\treturn count;\n}", "getPageSize() {\n return this.paginator.pageSize\n }", "function countOnline(usersObj) {\n // Only change code below this line\n let count = 0\n for (var user in usersObj){\n if (usersObj[user].online ==true){\n count += 1\n }\n }\n\n return count\n // Only change code above this line\n}", "function getGemCount() {\n // Default to 0 in case errors\n\n // If user has a beta token in localstorage, use that. Else, get one.\n // This needs to be done right now because the CA-API does not currently support auth0 tokens only.\n var gemCount = 0;\n\n $.ajax({\n url: gemCountPath,\n cache: false,\n contentType: 'application/json',\n headers: {\n Authorization: accessToken()\n },\n success: function (data) {\n console.log(data)\n gemCount = data.gem_count;\n },\n error: function (error) {\n // console.log(error.responseJSON)\n },\n complete: function () {\n // Schedule the next request when the current one's complete\n $('#gemCount').text(gemCount);\n }\n });\n}", "function countOnline(usersObj) {\n // Only change code below this line\n let countList = 0;\n for (let user in usersObj){\n if (usersObj[user].online === true){\n countList += 1;\n }\n }return countList\n // Only change code above this line\n }", "function countOnline(usersObj) {\n // Only change code below this line\n let onlineUsers = [];\n for (let user in usersObj) {\n if (usersObj[user].online) {\n onlineUsers.push(user);\n console.log(onlineUsers.length);\n }\n }\n return onlineUsers.length;\n // Only change code above this line\n}", "getVisitorCount () {\n return 1234;\n }", "getRoomCount() {\n return new Promise((res, rej) => {\n this.#database.count({}, (err, count) => {\n if (err) rej(err);\n res(count);\n });\n });\n }", "function getActiveUserProjects() {\n var async = $q.defer();\n // var activeUserId = userSrv.getActiveUser().id;\n\n var projects = [];\n\n const parseProject = Parse.Object.extend('Project');\n const query = new Parse.Query(parseProject);\n query.equalTo(\"userId\", Parse.User.current());\n query.find().then(function (results) {\n\n for (var i = 0; i < results.length; i++) {\n projects.push(new Project(results[i]));\n }\n\n async.resolve(projects);\n\n }, function (error) {\n $log.error('Error while fetching Project', error);\n async.reject(error);\n });\n\n return async.promise;\n }", "function buildCounter(page){ return page; }", "static favouriteEntriesCount() {\n {\n const favEntriesCount = DummyDataHelpers.findFavouriteEntryCount(dummyEntries);\n if (!favEntriesCount) {\n return this.notFound('No count');\n }\n return this.success('Favourite entry count fetched successfully', favEntriesCount);\n }\n }", "function numPages() {\n return Math.ceil(maxentries / opts.items_per_page);\n }", "function count(query, callback) {\n self.emit('count')\n\n auth(function (error, token) {\n if (error) return callback(error)\n\n var opts =\n { timeout: options.timeout\n , json: true\n , headers: { Authorization: 'Bearer ' + token }\n , url: options.appUrl\n , method: 'GET'\n }\n\n request(opts, function (error, res) {\n if (error) return callback(error)\n if (res.statusCode !== 200) return callback(new Error('Count failed'), null, res)\n\n var ugCount = res.body.entities[0].metadata.collections[collection].count\n\n self.emit('received', ugCount)\n\n callback(undefined, ugCount)\n })\n })\n }", "async countStudents() {\n\treturn this.countUsers('student');\n }", "function nbItems(list){\n var count = list.length;\n for (var i = 0; i < list.length; i++) {\n count += list[i].users.length;\n }\n return count;\n }" ]
[ "0.72571236", "0.698243", "0.6689139", "0.6434947", "0.6403922", "0.62969476", "0.6218683", "0.61550844", "0.6129921", "0.610201", "0.60687286", "0.60455346", "0.6043784", "0.6022392", "0.6004966", "0.596928", "0.5943809", "0.59359586", "0.59309965", "0.58342564", "0.5809787", "0.5762213", "0.57419765", "0.57345325", "0.57272243", "0.56747514", "0.56708395", "0.56690216", "0.56548345", "0.5634706", "0.56232053", "0.56232053", "0.56197363", "0.56170565", "0.5617018", "0.5613113", "0.5612403", "0.56062764", "0.5603743", "0.5601845", "0.5601123", "0.55931264", "0.5590568", "0.55789", "0.5575492", "0.5556535", "0.5555505", "0.5551625", "0.55445", "0.5544432", "0.55339515", "0.55199075", "0.55147403", "0.5509409", "0.55000955", "0.5488399", "0.5484208", "0.5480084", "0.54642254", "0.5463416", "0.5458984", "0.5447718", "0.54470325", "0.5442798", "0.54363525", "0.5435463", "0.5431431", "0.5429695", "0.54241353", "0.54181594", "0.5414217", "0.5411144", "0.5405901", "0.5405106", "0.54032713", "0.5400101", "0.53676736", "0.53676736", "0.53676736", "0.53676736", "0.53676736", "0.53658426", "0.53615665", "0.53609055", "0.53582317", "0.5350754", "0.5333339", "0.53331155", "0.5328184", "0.5320515", "0.5312746", "0.53120804", "0.5307724", "0.53042775", "0.5299628", "0.529404", "0.52827686", "0.52795804", "0.5277926", "0.5276716" ]
0.80330926
0
Adds focus event to the input. On focus selects the text content of the input.
addFocusEventListener() { this.input.addEventListener('focus', () => this.input.select()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function focusInputElement () {\n elements.input.focus();\n }", "function focusInputElement () {\n elements.input.focus();\n }", "focus() {\n this.$.input._focusableElement.focus();\n }", "focus () {\n const { textInput } = this;\n textInput && textInput.focus();\n }", "focus() {\n this.textInput.focus();\n }", "function focusInputElement(){elements.input.focus();}", "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 focusInput() { \n input.focus()\n}", "focus() {\n this._inputElement.focus()\n }", "function focus(){}", "focus() {\n this.$.input.focus();\n }", "focus() {\n const { textInput } = this;\n textInput && textInput.focus();\n }", "focus() {\n var self = this;\n if (self.isDisabled) return;\n self.ignoreFocus = true;\n self.control_input.focus();\n setTimeout(() => {\n self.ignoreFocus = false;\n self.onFocus();\n }, 0);\n }", "setFocus(){\n this.getInputEle().focus();\n }", "focus() {\n const inputField = this.shadowRoot.querySelector('input');\n inputField.focus();\n }", "handleFocus(event) {\n event.target.select();\n }", "function inputFocus(input) {\n switch (input) {\n case \"startDate\":\n setTimeout(() => {\n startDateInputRef.current.focus();\n }, 1);\n break;\n case \"endDate\":\n setTimeout(() => {\n endDateInputRef.current.focus();\n }, 1);\n break;\n\n default:\n break;\n }\n }", "focus() {\n this.$refs.input.focus();\n }", "_handleInputFocus(e) {\n this.refs.input.focus();\n }", "bindFocus(input){\n input.onfocus = event => {\n if (document.activeElement != this.focusedInput){\n clearResults();\n this.focusedInput = input;\n if ( event.target.value.length > 0 ){\n this.timer = setTimeout( () => this.search(event), 100);\n }\n }\n };\n }", "focus() {\n this.refs.input.focus();\n }", "focus() {\n this.toggleMenuList();\n this.input.focus();\n }", "function textFieldFocus () {\n status.focusOnTextField = true;\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}", "focus() {\n this.$refs.textInput.focus();\n }", "setFocus() {\n $(this).parent().addClass(\"input-focus\");\n }", "activateFocus() {\n this.isFocused_ = true;\n this.styleFocused_(this.isFocused_);\n if (this.bottomLine_) {\n this.bottomLine_.activate();\n }\n if (this.outline_) {\n this.updateOutline();\n }\n if (this.label_) {\n this.label_.styleShake(this.isValid(), this.isFocused_);\n this.label_.styleFloat(\n this.getValue(), this.isFocused_, this.isBadInput_());\n }\n if (this.helperText_) {\n this.helperText_.showToScreenReader();\n }\n }", "focus() {\n this.$refs.input.focus();\n }", "_focusHandler(event) {\n const that = this;\n\n if (that.disabled) {\n return;\n }\n\n if (event.target === that) {\n that.$.input.focus();\n that._edgeSelect = false;\n return;\n }\n\n that.setAttribute('focus', '');\n\n if (that.selectAllOnFocus) {\n if (navigator.userAgent.match(/Edge/)) {\n const scrollTop = that.$.input.scrollTop;\n\n if (that._edgeSelect) {\n that._edgeSelect = false;\n return;\n }\n\n setTimeout(function () {\n that._edgeSelect = true;\n that.$.input.select();\n that.$.input.scrollTop = scrollTop;\n }, 5);\n }\n else {\n that.$.input.select();\n }\n }\n }", "function onFocus(event) {\n\t\tif (props.onFocus) {\n\t\t\tprops.onFocus(event);\n\t\t}\n\t\tevent.target.select();\n\t\tshowAllSuggestions();\n\t\tsetSelectionToCurrentValue();\n\t}", "onFocus(event) {\n\t if (!this.content.contains(event.target)) {\n\t event.stopPropagation();\n\t this.content.focus();\n\t }\n\t }", "function setFocus(value) {\n hasFocus = value;\n }", "setInputFocus(){\n this.textInput.removeAttribute('disabled');//Remove disabled attrib so input is interactible again\n this.textInput.focus();\n this.textInput.select();\n }", "focus() {\n if (!this.focusElement || this.disabled) {\n return;\n }\n\n this.focusElement.focus();\n\n this._setFocused(true);\n }", "activateFocus() {\n const {FOCUSED, LABEL_FLOAT_ABOVE, LABEL_SHAKE} = MDCTextFieldFoundation.cssClasses;\n this.adapter_.addClass(FOCUSED);\n if (this.bottomLine_) {\n this.bottomLine_.activate();\n }\n this.adapter_.addClassToLabel(LABEL_FLOAT_ABOVE);\n this.adapter_.removeClassFromLabel(LABEL_SHAKE);\n if (this.helperText_) {\n this.helperText_.showToScreenReader();\n }\n this.isFocused_ = true;\n }", "focus() {\n this.container.classList.add('is-focused');\n this.input.focus();\n\n return this;\n }", "focus() {\n this.select.focus();\n }", "function field_focus(obj, val)\n{\n\tif (val != '**') obj.value = val;\n\tobj.focus();\n\tobj.select();\n}", "function focus(selector, text) {\n\n\t\t\tvar el = document.querySelector(selector);\n\n\t\t\tif (!el) {\n\t\t\t\tthrow new Error('Unable to find element with selector \"'+selector+'\".');\n\t\t\t}\n\n\t\t\tif (el.nodeName === 'INPUT') {\n\t\t\t\tel.value = text;\n\t\t\t} else {\n\t\t\t\tel.textContent = text;\n\t\t\t}\n\n\t\t}", "focus() {\n\t\tthis.children.first.focus();\n\t}", "focus() {\n\t\t\tlet std = (this.input.className === \"pass\"? this.stdpass : this.stdin);\n\n\t\t\tlet cvl = std.value.length;\n\t\t\tstd.focus();\n\t\t\tstd.setSelectionRange(cvl, cvl);\n\t\t}", "handleAutocompleteFocus() {\n const self = this;\n if (this.noSelect) {\n this.noSelect = false;\n return;\n }\n\n // select all text (after a delay since works better across browsers), but only if element is\n // still focused to avoid flashing cursor focus trap (since select causes focus event to\n // fire if no longer focused)\n self.element.select();\n }", "onFocus(event) {\n if (!this.content.contains(event.target)) {\n event.stopPropagation();\n this.content.focus();\n }\n }", "focusTextInput() {\n this.textInput.current.focus()\n }", "_focusHandler() {\n const i = document.querySelector('paper-input');\n if (!i) {\n return;\n }\n i.inputElement.focus();\n }", "setFocus() {\n if (this.get('focus')) {\n this.$().val(this.$().val()).focus();\n }\n }", "function focus (jq, query, context) {\n return trigger.execute(jq, query, context, \"focus\");\n }", "function setFocus()\n\t{\n\t\tvar wid = fw.getWidget('answerInput', true);\n\t\twid && wid.focus();\n\t}", "function focusInputField(id,selectIt)\n{\n var f = document.getElementById(id);\n if (f)\n {\n f.focus();\n if(selectIt)\n {\n f.select();\n } \n }\n}", "onFocus() {\r\n // Stub\r\n }", "connectedCallback () {\n this._input.focus() // Sets the text input to have focus from the start\n }", "activateFocus() {\n this.isFocused_ = true;\n this.styleFocused_(this.isFocused_);\n this.adapter_.activateLineRipple();\n this.notchOutline(this.shouldFloat);\n if (this.adapter_.hasLabel()) {\n this.adapter_.shakeLabel(this.shouldShake);\n this.adapter_.floatLabel(this.shouldFloat);\n }\n if (this.helperText_) {\n this.helperText_.showToScreenReader();\n }\n }", "activateFocus() {\n this.isFocused_ = true;\n this.styleFocused_(this.isFocused_);\n this.adapter_.activateLineRipple();\n this.notchOutline(this.shouldFloat);\n if (this.adapter_.hasLabel()) {\n this.adapter_.shakeLabel(this.shouldShake);\n this.adapter_.floatLabel(this.shouldFloat);\n }\n if (this.helperText_) {\n this.helperText_.showToScreenReader();\n }\n }", "onFocus(e) {\n if (this.$isFocused)\n return;\n this.$isFocused = true;\n this.renderer.showCursor();\n this.renderer.visualizeFocus();\n this._emit(\"focus\", e);\n }", "focus() {\n this.setFocus(0, 1);\n }", "focus() {}", "focus() {}", "function dm3_popover_input_focus(trigger, popover) {\n setTimeout(function() { popover.find('input[type=\"text\"]').trigger('focus'); }, 200)\n }", "_focusHandler() {\n const i = this.shadowRoot.querySelector('anypoint-input');\n if (!i) {\n return;\n }\n i.inputElement.focus();\n }", "focus() { }", "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 }", "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 }", "activeFocus() {\n var $_this = this;\n this.$originalSelect.on('focus', function () {\n $_this.$selectableUl.focus();\n });\n }", "onFocusHandler() {\n if (this.props.onSelectCell) {\n this.props.onSelectCell(this.props.value);\n }\n if (this.ele) {\n this.ele.focus();\n }\n }", "function focus_text(){ td.find('input:text').get(0).focus() }", "function focusSearchBoxListener(){ $('#query').val('').focus() }", "function setFocus () {\n\t\t\tdocument.getElementById(\"name\").focus();\n\t\t}", "focus() {\n this.div.focus();\n }", "function selectFocus () {\n\tvar firstElem = document.getElementById('fname');\n\tfirstElem.focus();\n} //end focus", "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}", "get focusElement(){return this._input()||this}", "focus() {\n if (this.disabled) {\n return;\n }\n if (!this._hasFocusInternal) {\n this._onFocus.next({ chip: this });\n }\n this.chipContent.nativeElement.focus();\n }", "focus() {\n this._selectRowByIndex(0);\n this._FBPTriggerWire('--focus');\n }", "setFocus() {\n this.settingInput.focus();\n this.settingInput.select();\n }", "focusEmojiSearchInput() {\n if (this.emojiSearchInput) {\n this.emojiSearchInput.focus();\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\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}", "doFocus() {\n this.__focusOnLast();\n }", "focus() {\n if (this.$data._elementRef === undefined) return;\n\n this.$nextTick(() => {\n const el = this.$el.querySelector(this.$data._elementRef);\n if (el) el.focus();\n });\n }", "onFocus() {\n this.biasAutocompleteLocation();\n this.$emit('focus');\n }", "focus() {\n super.focus();\n document.execCommand(\"selectAll\", false, null);\n document.getSelection().collapseToEnd();\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 inputFocus(x){\n x.previousElementSibling.focus();\n}", "async setFocus() {\n this.el.focus();\n }", "focus(options) {\n this._focusMonitor.focusVia(this._inputElement, 'keyboard', options);\n }", "focus() {\r\n this.native.focus();\r\n }", "function focusInput() {\n this.parentElement.children[1].className = \"cmd_label cmd_active\";\n this.parentElement.children[0].className = this.parentElement.children[0].className.replace(\"error\", \"\");\n }", "function forceFocus() {\n\tinput.trigger(\"click\").focus();\n}", "function onfocusSelect(dt) { dt.select(); }", "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 }", "async setFocus() {\n this.el.focus();\n }", "_onInputFocus () {\n this.getUIElement().classList.add(this.options.activeClass);\n }", "function setFocus(field) {\r\r\tfield.focus();\r\r}", "focus() {\n this._focusMonitor.focusVia(this._elementRef, 'program');\n }", "focus() {\n if (this.disabled) {\n return;\n }\n if (!this._hasFocus()) {\n this._elementRef.nativeElement.focus();\n this._onFocus.next({ chip: this });\n }\n this._hasFocusInternal = true;\n }", "onFocusReturned() {\n $('oobe-eula-md').focus();\n }", "function focusElement () {\n if ($scope.autofocus) elements.input.focus();\n }", "function focusElement () {\n if ($scope.autofocus) elements.input.focus();\n }", "_onFocus() {\n this.setState({ focused: this._containsDOMElement(document.activeElement) })\n }" ]
[ "0.7055412", "0.7055412", "0.68872213", "0.6880144", "0.6875773", "0.6875565", "0.68479896", "0.68452066", "0.6843065", "0.6797068", "0.679039", "0.6767311", "0.66292423", "0.6601434", "0.6599773", "0.6553613", "0.6477195", "0.6431828", "0.6429465", "0.6407373", "0.63576", "0.63386834", "0.6336191", "0.63148516", "0.6301541", "0.6294679", "0.6285149", "0.6265496", "0.6261939", "0.62569803", "0.62501776", "0.62486416", "0.6245855", "0.62440056", "0.62357676", "0.62192345", "0.62155217", "0.62062746", "0.6200063", "0.61973953", "0.6186405", "0.61856174", "0.61759776", "0.6169487", "0.6162562", "0.6159018", "0.6147654", "0.6144185", "0.61440015", "0.61368763", "0.61315006", "0.6126977", "0.6126977", "0.6126637", "0.612606", "0.61256605", "0.61256605", "0.6116947", "0.6094688", "0.608954", "0.60857856", "0.6077322", "0.6075236", "0.6068531", "0.6061273", "0.6049209", "0.60331845", "0.6018579", "0.60052454", "0.60008985", "0.59931076", "0.59894323", "0.598779", "0.59867865", "0.59849405", "0.5980879", "0.5980879", "0.5980284", "0.59719926", "0.59674114", "0.5962176", "0.59525836", "0.59525836", "0.59497106", "0.5945377", "0.59413964", "0.5935722", "0.59208554", "0.5912706", "0.5904188", "0.58935744", "0.5893258", "0.5886648", "0.588585", "0.58810276", "0.5875061", "0.5873091", "0.5872365", "0.5872365", "0.58691466" ]
0.73644197
0
Add Event Listeners Adds a click event listener to the reset button. On click sets the value to every entry in the input matrix to a blank string.
addResetButtonListener() { this.resetBtn.addEventListener('click', () => this.entries().forEach(entry => entry.value = "")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addResetListener() {\n\t\t$('#reset').on('click', resetBoard)\n\t\t\n\t}", "function addResetListener() {\n var resetButton = document.getElementById('reset');\n resetButton.addEventListener('click', resetBoard);\n}", "function reset() {\r\n turn = 1;\r\n clickCounter = 0;\r\n win1 = -1;\r\n\r\n for (let i = 0; i < 3; i++) {\r\n for (let j = 0; j < 3; j++) {\r\n matrix[i][j] = -1;\r\n }\r\n }\r\n document.getElementById(\"00\").innerHTML = \"\";\r\n document.getElementById(\"01\").innerHTML = \"\";\r\n document.getElementById(\"02\").innerHTML = \"\";\r\n document.getElementById(\"10\").innerHTML = \"\";\r\n document.getElementById(\"11\").innerHTML = \"\";\r\n document.getElementById(\"12\").innerHTML = \"\";\r\n document.getElementById(\"20\").innerHTML = \"\";\r\n document.getElementById(\"21\").innerHTML = \"\";\r\n document.getElementById(\"22\").innerHTML = \"\";\r\n}", "handleResetClick(event){\n this.value = '';\n this.tableData = [];\n const evtCustomEvent = new CustomEvent('reset');\n this.dispatchEvent(evtCustomEvent);\n }", "handleResetClick(event){\n this.value = '';\n this.tableData = [];\n const evtCustomEvent = new CustomEvent('reset');\n this.dispatchEvent(evtCustomEvent);\n }", "function clearDisplay()\n{\n const clear = document.querySelector(`#clear`);\n\n clear.addEventListener(`click`, function()\n {\n resetArray();\n resetTotal();\n resetOperator();\n\n updateDisplay(inputArray);\n });\n}", "function setupResetBut(){\r\n resetButton.addEventListener(\"click\",setColors)\r\n }", "function resetForm()\n{\n document.getElementById(\"blanketnum\").value = 0;\n document.getElementById(\"hedgenum\").value = 0;\n document.getElementById(\"bluenum\").value = 0;\n calcEstimate();\n createEventListeners();\n}", "function resetBtnFunctionality () {\n\tresetButton.addEventListener(\"click\", function() {\n\t\treset();\n\t});\n}", "function resetMatrix() {\r\n var id = \"\";\r\n for (var i = 0; i < letters.length; ++i) {\r\n for (var j = 0; j < letters.length; ++j) {\r\n id = letters[i] + \"to\" + letters[j];\r\n document.getElementById(id).value = defaultMatrixValues[i][j];\r\n }\r\n }\r\n}", "function reset(){\n let text =document.getElementById(\"txt\");\n text.value=\"\"; \n number = 0; \n arrNumber=[];\n arrOperation=[];\n}", "function clearOutput() {\n var inputs = matrixC.getElementsByTagName(\"input\");\n for (var i = 0; i < inputs.length; ++i) {\n inputs[i].value = \"\";\n }\n }", "function reset() {\n tfInput.value = \"\";\n tfResultado.value = \"\";\n taLogArea.value = \"\";\n numPrevio = 0;\n numActual = 0;\n numAcumulado = 0;\n strOperacion = \"\";\n cOperador = \"\";\n}", "function resetButtonClick(){\n populateTable();\n}", "function reset(){\n displayInput = [''];\n uniqueNumber = '';\n // clean the screen\n calcLine.textContent = '';\n resultLine.textContent = '';\n}", "function reset() {\n input = [0];\n return display(0);\n}", "function clearScreen () {\n $('.output').html('');\n inputArray = [];\n buttonClick = null;\n operatorClick = null;\n equateClick = null;\n decimalClick = null;\n operand = '';\n console.log('clear');\n}", "function resetButtonPressed() {\n reset();\n}", "function reset() {\n $button.on(\"click\", function(event) {\n // Prevents dupicate click assignments\n event.preventDefault();\n $button.off(\"click\");\n\n // Resets result divs and removes them from page, reloads search div, re-runs input function\n $search.val(\"\");\n $search.css(\"border-bottom\", \"2px solid rgb(255, 255, 255)\");\n $search.off(\"focus\");\n $(\"p\").html(\"\");\n $(\"ul\").html(\"\");\n $inputCard\n .hide()\n .delay(500)\n .fadeIn(1000);\n $alertCard.hide();\n $mapCard.hide();\n $newsCard.hide();\n $button.hide();\n $weatherCard.hide();\n $(\"select\").material_select();\n $(\"#alertDiv\").empty();\n $(\".imgBox\").remove();\n $(\"#tableHead\").empty();\n $(\"#tableRow\").empty();\n $(\"#dropdown1\").empty();\n $(\"#safetyDisplay\").empty();\n input();\n });\n }", "function onReset() {\n clear();\n}", "function clearPressed(){\n inputs = [\"\"];\n $(\"#displayScreen p\").text(0);\n i = 0;\n num1 = null;\n num2 = null;\n operator = null;\n totalInt1= null;\n totalInt2 = null;\n storeNum2 = null;\n equalFire = false;\n\n}", "function clear(){\n \n for(i=0;i<valueBtn.length;i++){\n valueBtn[i].textContent=null;\n }\n move.textContent=\"move:0\";\n time.textContent=\"time:0\";\n msg.textContent=null;\n \n}", "function reset(e){\n \n}", "function resetForm() {\n document.getElementById(\"age\").value = 0;\n document.getElementById(\"feet\").value = 0;\n document.getElementById(\"inches\").value = 0;\n document.getElementById(\"stones\").value = 0;\n document.getElementById(\"pounds\").value = 0;\n document.getElementById(\"cm\").value = 0;\n document.getElementById(\"kilos\").value = 0;\n createEventListeners();\n showImperial();\n}", "function resetClick(event) {\n resetGame();\n const winnerName = document.getElementById(\"winner-name\");\n winnerName.innerText = \"\";\n const winnerDisplay = document.getElementById(\"winner-display\");\n clearBoard();\n winnerDisplay.style.display = \"None\";\n}", "function reset()\n\t{\n\t\tsetValue('')\n\t}", "function resetButtonClicked()\n{\n document.getElementById('batteryLight').style.backgroundColor = \"rgb(165, 164, 164)\";\n powerState = 0;\n document.getElementById('screenTextTop').textContent = \"\";\n document.getElementById('screenTextBottom').textContent = \"\";\n batteryLife = 0;\n number1 = \"\";\n number2 = \"\";\n number3 = 0;\n operatorClicked = false;\n console.log(\"calculator reset\");\n}", "function reset(){\n var ele = document.getElementsByClassName(\"cell\");\n for (var i = 0; i < ele.length; i++){\n //var attr = document.createAttribute(\"value\");\n if (ele[i].readOnly == false){\n ele[i].value = \"\"; // reset DOM\n // reset board\n var index = ele[i].getAttribute(\"name\"); \n var x = index.charAt(0);\n var y = index.charAt(1);\n board[x][y] = \"\";\n } \n }\n}", "function MUD_ResetElements(also_remove_values){\n console.log( \"===== MUD_ResetElements ========= \");\n// --- loop through input elements\n const fields = [\"idnumber\", \"cribnumber\", \"bankname\", \"bankaccount\", \"beneficiary\"];\n for (let i = 0, field, el_input, el_msg; field = fields[i]; i++) {\n el_input = document.getElementById(\"id_MUD_\" + field);\n if(el_input){\n el_input.classList.remove(\"border_bg_invalid\", \"border_bg_valid\");\n if(also_remove_values){ el_input.value = null};\n }\n el_msg = document.getElementById(\"id_MUD_msg_\" + field);\n\n if(el_msg){\n el_msg.innerText = (loc.msg_userdata[field]) ? loc.msg_userdata[field] : null;\n el_msg.classList.remove(\"text-danger\")\n };\n };\n\n// --- reset text on btn cancel\n if(el_MUD_btn_cancel) {el_MUD_btn_cancel.innerText = loc.Cancel};\n\n } // MUD_ResetElements", "function Reset() {\n var resetElement = document.getElementById('reset');\n\n resetElement.addEventListener('click', function () {\n\n var xS = document.getElementById('x').style.display = 'inline';\n\n var yS = document.getElementById('y').style.display = 'inline';\n\n var modal = document.getElementById('modal').style.display = 'block';\n // get modal header\n var modalheader = document.querySelector('.modal-header h2');\n modalheader.textContent = \"Select to be X or O?\";\n\n //game(selectedPlayerChoice, gamePlayer, enemy);\n //hard reset board\n });\n}", "function clear(){\n \n register = 0; /* initiaise calculator answer to 0 */\n formulaeString = \"\"; /* formuale sequence is blank as nothing yet calculated, produced by calcCheck() */\n inputArray = []; /* array to store sequece of keys pressed is empty*/\n equallsFlag = false; /* A flag to determine if the ' = ' button has been pressed previously */\n console.log(\" - - CLEAR formulaeString = \" + formulaeString + \" register = \" + register);\n}", "function resetButton() {\n d3.select(\"div.reset\")\n .append(\"li\")\n .text(\"Reset\")\n .on('click', function() {\n resetSelection();\n state.highlight = [];\n state.green = false;\n state.red = false;\n checkFiltered();\n updateReset();\n });\n }", "reset() {\n this.domSquares.forEach(square => {\n this.setSquare(square, '');\n });\n }", "function resetClicked(evt){\n\t//hide the modal\n modalHide();\t\n\t//reset the cards\n resetCards();\n\t//reset the turn counter\n resetCounter();\n //reset the card list\n cardList = [];\n\t//reset the timer\n resetTimer();\n //reset stars\n resetStars();\n //shuffle the deck\n shuffleCards();\n}", "function reset() {\n student_name_input = 0;\n student_course_input = 0;\n student_grade_input = 0;\n student_grade_average = 0;\n updateData();\n updateStudentList()\n }", "function reset() {\n var calc = document.getElementById(\"calc\");\n var answer = document.getElementById(\"answer\");\n var error = document.getElementById(\"error\");\n\n calc.innerText = \"\";\n answer.innerText = \"\";\n error.innerText = \"\";\n}", "function onClearClick()\n {\n //Reset all the variables back to their initial state.\n runningTotal = 0;\n currentOperand = 0;\n currentOperator = \"\";\n hasPressedOperand = false;\n hasPressedOperator = false;\n \n //Update the display to show the changes.\n updateDisplay();\n }", "function click(){\ndocument.getElementById(\"reset\").reset();}", "function checkButton() {\n calculateBtn.addEventListener(\"mouseup\",function (){\n if(!active) {\n somme = 0;\n active = checkInputValue();\n }\n });\n resetBtn.addEventListener(\"mouseup\",function (){\n somme = 0;\n let inputTab = document.getElementsByTagName(\"input\");\n for(let value of inputTab){\n value.value = \"\";\n value.style.border = \" 3px solid darkblue\";\n }\n document.getElementById(\"resultAll\").innerHTML = \"\";\n });\n}", "function reset_all(){\n input = \"\";\n result = \"0\";\n history = \"0\";\n answer = \"\";\n setResult(\"0\");\n setHistory(\"0\");\n }", "reset() {\n for (let i = 0, l = this.matrix.length; i !== l; i++) {\n this.matrix[i] = 0\n }\n }", "function resetAll(arr){\n arr.forEach(function(el) {\n document.getElementById(el).value = \"\";\n })\n}", "function clearGrid(){\n newGridInput();\n}", "function reset() {\n indexClicked = 0;\n trackClicked = 0;\n}", "resetGame() {\n DATA.boardCells = [0, 1, 2, 3, 4, 5, 6, 7, 8];\n VIEW.resetView();\n document.getElementById(\"main-game\").addEventListener('click', MODIFIER.turn, false);\n }", "function clickedClear() {\n clear();\n panel.textContent = \"0\";\n }", "function reset() {\n calculatorData.isAtSecondValue = false;\n calculatorData.displayValue = '';\n calculatorData.result = '';\n calculatorData.isValueDecimal = false;\n updateDisplay();\n}", "function clearAll() {\r\r\n calcNum = [];\r\r\n currentNum = \"\";\r\r\n lastButton = \"\";\r\r\n lastNum = \"\";\r\r\n lastOper = \"\";\r\r\n isPercentage = false;\r\r\n isDecimal = false;\r\r\n $(\".viewport\").html(\"\");\r\r\n}", "function resetButton(){\r\n populate();\r\n}", "function clickClearButton(event) {\n setDisplay('0')\n setFirstOperand('')\n setOperator(null)\n setSecondOperand('')\n }", "function bindReset () {\n $('#restart-button').on(\"click\", function(){\n $('#restart-button').hide();\n $('#start-button').click();\n $('#reset-cells-button').click();\n pOneScore = 0; // fix\n pTwoScore = 0; // fix\n $('#player-one-score').text(pOneScore); // fix\n $('#player-two-score').text(pTwoScore); // fix\n });\n }", "function clearButton(){\n \tnumbers = [];\n calc = []\n result = 0;\n var display = $('.display');\n display.text(\"\");\n\tconsole.log(numbers);\n}", "function clear() {\t\t\n\t\t\tresetData();\n refreshTotalCount();\n for(var i=0;i<5; i++) { addMutationInvolvesRow(); }\n for(var i=0;i<5; i++) { addExpressesComponentsRow(); }\n for(var i=0;i<5; i++) { addDriverComponentsRow(); }\n\t\t\tsetFocus();\n\t\t}", "function resetAddMatrixPopup(sectionHeaderPreFill) {\r\n\t$('#element_enum_matrix').val('');\r\n\t$('#grid_name').val('');\r\n\t$('#old_grid_name').val('');\r\n\t$('#old_matrix_field_names').val('');\r\n\t$('#field_type_matrix').val('radio');\r\n\t$('#field_rank_matrix').prop('checked', false);\r\n\t$('#section_header_matrix').val(sectionHeaderPreFill);\r\n\t$('.field_label_matrix').val('');\r\n\t$('.field_name_matrix').val('');\r\n\tvar labelvar_row_html = $('.addFieldMatrixRowParent .addFieldMatrixRow:first').html();\r\n\t$('.addFieldMatrixRowParent').html(\"<tr class='addFieldMatrixRow'>\"+labelvar_row_html+\"</tr>\");\r\n\tfitDialog($('#addMatrixPopup'));\r\n}", "function handleClearButton() {\n textArea.value = '';\n inputs.forEach(input => input.value = '');\n }", "function OnResetButton (event)\n{\n var puzzle = [];\n FunctionCallCount = 0;\n document.getElementById ('Info').innerHTML = '';\n errorsExist = false;\n\n for (var i = 1; i <= 9; i++)\n {\n for (var j = 1; j <= 9; j++)\n {\n var cell = document.getElementById ('b' + i + j);\n\n cell.innerText = '';\n cell.style.backgroundColor = cell.getAttribute ('OriginalBGColour'); \n cell.setAttribute ('CellState', 'normal');\n }\n } \n\n currSelCell = null; \n}", "function resetDisplay() {\n\n document.getElementById(\"input1\").value = 0;\n document.getElementById(\"input2\").value = 0;\n document.getElementById(\"input3\").value = 0;\n document.getElementById(\"input4\").value = 0;\n}", "function hardReset() {\n currentAns = 0;\n operatorArr = [];\n numberArr = [];\n fixedNumberArr = [];\n $(\"#answer-p\").text(currentAns);\n $('#formula-p').text(currentAns);\n}", "function pressReset(){\n events.emit('resetBtn', true);\n }", "function buttonClearClickHandler(eventArg) {\n var display = document.getElementById(\"display\");\n display.value = \"\";\n }", "function resetAll() {\n reset();\n\n valueN = 1;\n minN = 1;\n maxN = 30;\n numEachN = 10;\n\n document.getElementById(\"nInput\").value = valueN;\n document.getElementById(\"minInput\").value = minN;\n document.getElementById(\"maxInput\").value = maxN;\n document.getElementById(\"numEach\").value = numEachN;\n}", "reset() {\n arrayEach(this.elements, ui => ui.reset());\n }", "function reset () {\n\t\tfillZero(xs,9);\n\t\tfillZero(os,9);\n\t\tremoveSelected(circles);\n\t\tcurrent = null;\n\t\tcounter = null;\n\t\twin = false;\n\t\tdisplay.textContent = \"tic tac toe\";\n\t}", "function resetAll() {\n\n // Palette1 checked by default\n paletteOne.checked = true;\n\n // Reset form fields\n document.querySelector('#email-input').value = '';\n document.querySelector('#phone-input').value = '';\n document.querySelector('#linkedin-input').value = '';\n document.querySelector('#github-input').value = '';\n document.querySelector('#name-input').value = '';\n document.querySelector('#job-input').value = '';\n\n // Default Name & Rol in preview card\n outputName.innerHTML = 'Nombre Apellidos';\n outputJob.innerHTML = 'Front-end developer';\n\n // Default inputImage y addImpage \n const imageUrl = './assets/images/queen.gif';\n profileImage.style.backgroundImage = `url(${imageUrl})`;\n profilePreview.style.backgroundImage = `url(${imageUrl})`;\n\n // Icons hidden & Default Color\n previewOne();\n emailIcon.classList.add('hidden');\n phoneIcon.classList.add('hidden');\n linkedinIcon.classList.add('hidden');\n githubIcon.classList.add('hidden');\n}", "function reset() {\n let input = id('input-text');\n input.value = '';\n let result = id('result');\n result.innerHTML = '';\n }", "function resetButton() {\n input.value = \"\";\n small.innerHTML = \"\";\n\n for (i = 0; i < info.length; i++) {\n info[i].classList.remove(\"show\");\n }\n}", "function clearAll() {\n clearInputs();\n num1 = '';\n num2 = '';\n inputOperator = '';\n updateCalculatorDisplay();\n}", "function reset(){\n document.getElementById(\"main\").innerHTML=null;\n document.getElementById(\"gameScore\").innerHTML=null;\n document.getElementById(\"resultDisplay\").innerHTML=null;\n gameGrid();\n}", "function resetGrid () {\n gridCounter = 0;\n $('#pass-button').hide();\n $('#reset-cells-button').show();\n\n $('#reset-cells-button').off().on(\"click\", function () {\n for(var i = 0; i < numberInGrid.length; i++) {\n $('.game-cell').css('background-color', 'red');\n generateNumber(); // ensure that correct orientation mode is selected\n selectCell();\n }\n });\n }", "function reset () {\n setCurrentlyClicking(false);\n setCounter(1);\n clearInterval(currentInterval);\n setCurrentInterval(\"\");\n setClickingFast(false);\n setColors(initialColors);\n }", "function reset() {\n\n\tdocument.getElementById(\"c1_r1\").innerHTML = \"\"\n\tdocument.getElementById(\"c2_r1\").innerHTML = \"\"\n\tdocument.getElementById(\"c3_r1\").innerHTML = \"\"\n\tdocument.getElementById(\"c1_r2\").innerHTML = \"\"\n\tdocument.getElementById(\"c2_r2\").innerHTML = \"\"\n\tdocument.getElementById(\"c3_r2\").innerHTML = \"\"\n\tdocument.getElementById(\"c1_r3\").innerHTML = \"\"\n\tdocument.getElementById(\"c2_r3\").innerHTML = \"\"\n\tdocument.getElementById(\"c3_r3\").innerHTML = \"\" \n\n}", "function resetButtonListener() {\n let resetButton = document.getElementById(\"resetButton\");\n resetButton.addEventListener(\"click\", resetGame);\n}", "clearInput() {\n let clearArr = Array.from(this.inputElement);\n clearArr.forEach(arr => arr.value = \"\");\n }", "function clearButton() {\n display.textContent = 0;\n topLine.textContent = \"\";\n outputNum = \"\";\n operationArray = [];\n storedOperator = \"\";\n decimalBtn.disabled = false;\n}", "function Calculator_Reset() {\n Calculator.Display_Value = '0';\n Calculator.First_Operand = null;\n Calculator.Wait_Second_Operand = false;\n Calculator.operator = null;\n}", "function reset() {\n tableCells.forEach(cell => {\n cell.innerText = '';\n });\n errorMsg.style.display = 'none';\n}", "function clickClear() {\n console.log('clicked clear');\n $('#inputNum1').val('');\n $('#inputNum2').val('');\n operator.operator = ''; \n}", "function addListenerResetButton() {\n const resetButton = document.getElementById('resetButton');\n\n resetButton.addEventListener('click', ()=> {\n resetUserData(initialConfig);\n })\n}", "function reset() {\n\t\t\tclear_board()\n\t\t}", "function resetear() {\n eliminarIntegrantesAnteriores();\n ocultarbotonCalculo();\n ocultarIntegrantes();\n ocultarTextoResultado();\n vaciarValorInput();\n}", "function reset(){\r\n\tdocument.getElementById(\"capCol\").value = \"#ff0000\";\r\n\tdocument.getElementById(\"pantsCol\").value = \"#0000ff\";\r\n\tdocument.getElementById(\"faceCol\").value = \"#fcbf79\";\r\n\tdocument.getElementById(\"hairCol\").value = \"#730600\";\r\n\tdocument.getElementById(\"glovesCol\").value = \"#ffffff\";\r\n\tdocument.getElementById(\"shoesCol\").value = \"#701c0f\";\r\n\tupdateCap();\r\n\tupdatePants();\r\n\tupdateFace();\r\n\tupdateHair();\r\n\tupdateGloves();\r\n\tupdateShoes();\r\n\tdocument.getElementById(\"code\").value = \"\";\r\n\tdocument.getElementById(\"type\").innerHTML = \"Click one of the buttons above once you've chosen your colours!\";\r\n}", "function ClickBtnReset() {\n $('#ppZapisnikKreatoriCmb').quiComboBox('clearSelection');\n $('#ppZapisnikDatum').quiDate('setDate', new Date());\n $('#ppZapisnikOrganiCmb').quiComboBox('clearSelection');\n\n $('#ppZapisnikNemaRez').hide();\n\n $('#ppZapisnikSlickGrid').empty();\n $('#ppZapisnikSlickGridPager').empty();\n\n columnFilters = {};\n grid = undefined;\n }", "function clearAll() {\r\n document.getElementById('num1').innerHTML = '';\r\n document.getElementById('num3').innerHTML = '';\r\n document.getElementById('operador').innerHTML = '';\r\n document.getElementById('resultado').innerHTML = '0';\r\n}", "function reset(){\n $(':input').val('');\n $(\"#clock\").text('00:00');\n checkArr = [];\n score = 0;\n }", "function resetValues() {\n document.querySelector('.currText').value = ''\n document.querySelector('.bg-color').value = '#ffffff'\n document.querySelector('.stroke-color').value = '#000000'\n document.querySelector('.shadow-color').value = '#ffffff'\n document.querySelector('.shadow-check').checked = false\n document.querySelector('.shadow-blur-check').checked = false\n document.querySelector('.stroke-check').checked = true;\n}", "function resetValues() {\n var ii = void 0;\n for (ii = 0; ii < allInputTxt.length; ii++) {\n allInputTxt[ii].value = 1;\n }\n calculateCurrency();\n }", "function resetListeners(){\r\n\tresetButton.addEventListener(\"click\", function(){\r\n\t\tif(gameEnd()){\t\t\t\t\t\t\t\t\t\t\t\t\t//if game ended, then new game\t\t\t\t\t\r\n\t\t\tnewGame();\r\n\t\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//else, just update display\r\n\t\trefreshView();\r\n\t\treset();\r\n\t});\r\n}", "function reset(){\n\tcanvas.removeAttribute(\"style\");\n\tfor(var i=0; i< arrayDefault.length; i++){\n\t\tdocument.getElementsByTagName('input')[i+1].value = arrayDefault[i];\n\t}\n\tdefaultValues();\n\tctx.putImageData(imageDataBkp,0,0);\n}", "function resetSquares(){\n\t$('#reset-squares').click(function(){\n\t\tcreateSquares(gridSize);\n\t\tcolorHover();\n\t\t$('#squares-number-input').val('');\n\t\tgridSizeDisplay(gridSize);\n\t\tcolorCondition = false;\n\t\t$(\"#color-button\").removeClass('activeButton');\n\t\t$(\"#black-white-button\").addClass('activeButton');\n\t})\n}", "function clear() {\n firstNumber = null;\n secondNumber = null;\n operator = null;\n output.textContent = \"\";\n decimalButton.addEventListener('click', inputDecimal);\n}", "function App_Reset(){\r\n\r\n\t// i want to remove all events - so i can added them all again.\r\n\t// i assume that adding them and adding them will consume memory.\r\n\t$('*').unbind();\r\n\r\n\t// now make various tables content toggable (2 state for inputs and 3 state for rules).\r\n\t// these click events are added to each <td> that is clickable which is most of them.\r\n\tInitialize_Toggle_2Bit('#input_state');\r\n\tInitialize_Toggle_3Bit('#input_rules');\r\n\tInitialize_Toggle_3Bit('#output_rules');\r\n\tInitialize_List_Click_Edit('#input_list');\r\n\tInitialize_List_Click_Edit('#output_list');\r\n\t\r\n\t// Color in the inputs\r\n\tColor_In( $('#input_state').find('td') );\r\n\t\r\n\t// this lot makes the table rows and colums dragable\r\n\t\r\n\ttable_drag_column('#rule_id','#rule_id, #input_rules, #input_rules_state, #output_rules');\r\n\ttable_drag_row('#input_list','#input_list, #input_state, #input_rules', true);\r\n\ttable_drag_row('#output_list','#output_list, #output_state, #output_rules', true);\r\n\t\r\n}", "function resetGame (){\n document.querySelector('.winmodal').classList.remove('active');\n gameBoard = Array.from(Array(9).keys());\n for(var i=0; i<boardSquares.length; i++){\n\t\tboardSquares[i].innerText = '';\n\t\tboardSquares[i].className = \"boardColumn\";\n\t\tboardSquares[i].style.removeProperty('box-shadow');\n boardSquares[i].addEventListener('click', turnClick, false)\n\t}\n}", "function clearClickHandler(e) {\n calculator.clear();\n document.querySelector('#display').innerText = '';\n}", "function reset(l, c, m) {\n document.getElementById(\"lineSlider\").value = l;\n setL(l);\n document.getElementById(\"collumnSlider\").value = c;\n setC(c);\n document.getElementById(\"mineSlider\").value = m;\n setM(m);\n \n}", "function reset() {\n reset_butt.click();\n}", "function myResetFunction() {\n document.getElementById(\"#reset-btn\").reset();\n }", "function reset(input) {\n // YOUR SOLUTION HERE\n}", "function reset(button, boxlst){\n //when button click\n //console.log(button, boxlst);\n button.addEventListener(\"click\", function() {\n count = 0\n boxlst.forEach(e => {\n e.textContent = null;\n e.classList.remove('O');\n e.classList.remove('X');\n squares[count] = -10\n count = count + 1;\n \n });\n\n let stat = document.getElementById('status');\n stat.textContent = \"Move your mouse over a square and click to play an X or an O.\";\n stat.classList.remove('you-won');\n\n });\n}", "function reset() {\n let originalInpput = document.getElementById('originalInpput')\n originalInpput.value = '';\n\n let convertedOutput = document.getElementById('convertedOutput')\n convertedOutput.value = '';\n\n}", "function resetBoard() {\n var row,col;\n for(row=0; row<9; row++) {\n for(col=0; col<9; col++) {\n spaces[row*9+col].parentNode.innerHTML = '<input maxlength=\"1\">';\n }\n }\n sudoku = document.getElementById('sudoku');\n spaces = document.querySelectorAll(\"#sudoku table input\");\n }" ]
[ "0.6735011", "0.6689606", "0.6662631", "0.66318655", "0.66318655", "0.65800375", "0.6569994", "0.65472484", "0.6508659", "0.6502485", "0.64979905", "0.64452064", "0.64181393", "0.6368874", "0.635599", "0.63265955", "0.6323387", "0.6309487", "0.6270637", "0.6253161", "0.6228662", "0.622532", "0.6216272", "0.621622", "0.6213642", "0.619398", "0.6171837", "0.61599696", "0.61478806", "0.6141767", "0.6141621", "0.61105144", "0.6076276", "0.60690194", "0.60665035", "0.6059725", "0.6048458", "0.6045698", "0.60450983", "0.6039789", "0.6039374", "0.6029036", "0.6025867", "0.60245794", "0.6023971", "0.6021785", "0.60172796", "0.6017259", "0.6008079", "0.60062057", "0.59992015", "0.59980786", "0.59899056", "0.59873724", "0.59869915", "0.5986806", "0.59842044", "0.5980594", "0.5977514", "0.59678495", "0.5966965", "0.5951704", "0.5948438", "0.5945604", "0.5944475", "0.5941939", "0.5938505", "0.5936426", "0.5935128", "0.5928064", "0.59231657", "0.59222394", "0.5918201", "0.5916668", "0.5913194", "0.59128016", "0.5895494", "0.5889094", "0.5888796", "0.5884827", "0.58816814", "0.58814555", "0.58751845", "0.58673525", "0.58650255", "0.58611137", "0.58471304", "0.5843766", "0.5843126", "0.58414745", "0.5836354", "0.5833015", "0.5823683", "0.5823449", "0.5820716", "0.58184433", "0.5816349", "0.58152354", "0.58143437", "0.5813471" ]
0.7311259
0
Initialize Matrix Input Grid Generates the initial entries for the input matrix.
initMatrix() { const rows = this.rows(); const columns = this.columns(); for (let row = 0; row < rows; row++) { for (let col = 0; col < columns; col++) { this.matrix.appendChild(this.createMatrixEntry(row, col, this.ID)); } } this.setMatrixGridRows(rows); this.setMatrixGridCols(columns); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "createInitialGrid() {\n let gridArray = [];\n for(let row = 0; row < this.gridData.getSize(); row++){\n for(let col = 0; col < this.gridData.getSize(); col++){\n let cell = new Cell(row, col);\n gridArray.push(cell);\n }\n }\n\n this._setInitialValues(gridArray);\n }", "function initGrid() {\n row = [];\n for (var j = 0; j < GRID_H; j++) {\n\trow.push('');\n }\n grid = [];\n for (var i = 0; i < GRID_W; i++) {\n\tgrid.push(Array.from(row));\n }\n}", "_initializeMatrix() {\n const row = Array(this.width).fill(0);\n this.matrix = Array(this.height).fill(row.slice(0));\n }", "_init_grid() {\n\t\t\tfor (var i = 0; i < this._internal_grid_size[0]; i++) {\n\t\t\t\tthis._internal_grid.push([]);\n\t\t\t\tfor (var e = 0; e < this._internal_grid_size[1]; e++) {\n\t\t\t\t\tthis._internal_grid[i].push(0);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "initMatrix() {\n this._matrix = {};\n\n for (let i = 0; i < this._y; i++) {\n this._matrix[i] = {};\n for (let j = 0; j < this._x; j++) {\n this._matrix[i][j] = j;\n }\n }\n }", "initializeMatrix() {\n\t\tthis.matrix = new Array(this.height);\n\t\tfor (let i = 0; i < this.height; i++) {\n\t\t\tthis.matrix[i] = new Array(this.width);\n\t\t\tfor (let j = 0; j < this.width; j++)\n\t\t\t\tthis.matrix[i][j] = ' ';\n\t\t}\n\t}", "function initGrid() {\n grid = [];\n for (var i = 0; i < maxWidth/dotSize; i++) {\n grid[i] = [];\n for (var j = 0; j < maxHeight/dotSize; j++) {\n grid[i][j] = [0,0];\n }\n }\n}", "initializeCells() {\n for (var i = 0; i < this._gridSize; i++) {\n this._cells[i] = []; // create an n x n matrix\n for (var j = 0; j < this._gridSize; j++) {\n this._cells[i].push(new Tile(i, j, 0));\n }\n }\n }", "function initialGrid() {\n return Array.from({length:6}, (_, i) => Array.from({length:6}, (_, j) => 0));\n}", "initGrid() {\n this.grid = [];\n this.gameOver = false;\n for(let row = 0; row < this.rowSize; row++) {\n let currentRow = [];\n for(let cell = 0; cell < this.colSize; cell++) {\n currentRow.push(this.getEmptyCell());\n }\n this.grid.push(currentRow);\n }\n }", "constructor() {\n\t\tthis.grid = [];\n\t\tthis.rows = 0;\n\t\tthis.cols = 0;\n\t}", "createGrid() {\n\t\t// loop to create the 8 rows\n\t\tfor (let row = 0; row < 8; row++) {\n\t\t\tthis.grid[row] = [];\n\t\t\t// push in 8 columns of nulls\n\t\t\tfor (let column = 0; column < 8; column++) {\n\t\t\t\tthis.grid[row].push(null);\n\t\t\t}\n\t\t}\n\t}", "function initGrid()\n {\n for (var i = 0; i < GRIDSIZE ; i++)\n {\n GRID[i] = new Array(GRIDSIZE);\t\t// each element is an array\n mazeObjects[i] = new Array(GRIDSIZE); //also make the array that tracks maze objects 2d\n agentMap['lineOfSight'][i] = new Array(GRIDSIZE); //also make the agent's lineOfSight array 2d\n enemyMap['lineOfSight'][i] = new Array(GRIDSIZE); //also make the enemy's lineOfSight array 2d\n\n for (var j = 0; j < GRIDSIZE ; j++)\n {\n GRID[i][j] = GRID_BLANK ;\n }\n }\n }", "function initializeGrid(gridWidth, gridHeight) {\n\n Tile.count = 0;\n\n for (let i = 0; i < gridHeight; i++) {\n grid[i] = [];\n for (let j = 0; j < gridWidth; j++) {\n grid[i][j] = new Tile(false, false, 0);\n }\n }\n\n}", "function init() {\n for (let i = 0; i < columns; i++) {\n for (let j = 0; j < rows; j++) {\n currentBoard[i][j] = 0;\n nextBoard[i][j] = 0;\n }\n }\n \n\n}", "initRow() {\n let prevSetNr = 1; // previous set number holder\n for (let i = 1; i <= this.width; i++) {\n // Initialize cells that are not yet initialized by previous row\n if (!this.cell[i]) {\n for (let j = prevSetNr; j <= this.width; j++) {\n if (!this.set[j]) {\n prevSetNr = j;\n break;\n }\n }\n this.set[prevSetNr] = [i];\n this.cell[i] = prevSetNr;\n }\n }\n }", "function initialiseGrid(size) {\n grid = [];\n for (var i=0; i < size; i++){\n //initialising the row//\n grid[i] = [];\n //initialising the columns, one for each row//\n for (var j=0; j < size; j++){\n //filling the grid with zeros to check if tile is already placed or not//\n grid[i][j] = 0;\n }\n }\n}", "function initTerrainMatrix() {\n const outer = BLOCK_HEIGHT;\n const inner = BLOCK_WIDTH;\n terrainMatrix = new Array(outer);\n for (let i = 0; i < outer; i++) {\n terrainMatrix[i] = new Array(inner);\n }\n}", "function init() {\r\n\t\t\t\r\n\t\t\tvar grid = document.getElementById(\"grid\");\r\n\t\t\tfor(var i=1; i<=4; i++){\r\n\t\t\t\tvar riga = document.createElement(\"div\");\r\n\t\t\t\triga.setAttribute(\"Id\", \"riga\"+i);\r\n\t\t\t\tfor(var j=0; j<4; j++){\r\n\t\t\t\t\tvar casella = document.createElement(\"input\");\r\n\t\t\t\t\tvar n = i*4+j;\r\n\t\t\t\t\tcasella.setAttribute(\"Id\", \"casella\"+n );\r\n\t\t\t\t\tcasella.setAttribute(\"readonly\", \"readonly\");\r\n\t\t\t\t\tcasella.setAttribute(\"value\", 0);\r\n\t\t\t\t\triga.appendChild(casella);\r\n\t\t\t\t}\r\n\t\t\t\tgrid.appendChild(riga);\r\n\t\t\t\t}\t\t\t\r\n\t\t}", "initGrid(cellSize) {\n this.gridCells = {\n x: [],\n y: []\n }\n for (let i = 0; i < this.width - cellSize; i += cellSize) {\n this.gridCells.x.push(i)\n }\n for (let i = 0; i < this.height - cellSize; i += cellSize) {\n this.gridCells.y.push(i)\n }\n }", "setupInitialValues() {\n this.__xSpacingInput.value = \"1.0\";\n this.__ySpacingInput.value = \"1.0\";\n\n this.__xDimInput.value = 5;\n this.__yDimInput.value = 1;\n }", "init() {\n for (let i = 0; i < GRID_SIZE; ++i) {\n for (let j = 0; j < GRID_SIZE; ++j) {\n this.grid[i][j] = EMPTY\n }\n }\n this.grid[THREE][THREE] = PLAYER1; this.grid[THREE][FOUR] = PLAYER2\n this.grid[FOUR][THREE] = PLAYER2; this.grid[FOUR][FOUR] = PLAYER1\n }", "function initial() {\n //add sets for empty cell\n for (let i = 0; i < 9; i++) {\n solved[i] = [];\n for (let j = 0; j < 9; j++) {\n solved[i][j] = matrix[i][j];\n if (solved[i][j] == 0)\n solved[i][j] = new Set([1, 2, 3, 4, 5, 6, 7, 8, 9]);\n }\n }\n }", "function populateGameGrid(grid) {\r\n\r\n for (var i = 0; i < NUM_ROWS; i += 1) {\r\n for (var j = 0; j < NUM_COLS; j += 1) {\r\n //fills all grid with initial cells\r\n grid[i][j] = new Cell();\r\n //x position match x coordinates\r\n grid[i][j].xPosition = j * CELL_SIZE;\r\n //y position match y coordinates\r\n grid[i][j].yPosition = i * CELL_SIZE;\r\n }\r\n\r\n } \r\n\r\n }", "function initArray(matrix, rows, cols) {\n for (let i = 0; i < rows; i++) {\n for (let j = 0; j < cols; j++) {\n\n /* Conditions used to seperate out the Borders */\n if (i == 0 || j == 0 || i == rows - 1 || j == cols - 1) {\n matrix[i][j] = 5;\n } else {\n matrix[i][j] = 0;\n }\n }\n }\n }", "function init() {\n var i, j, rooms, room;\n\n I = readline().split(' ');\n W = parseInt(I[0]); // number of columns.\n H = parseInt(I[1]); // number of rows.\n\n for (i = 0; i < H; i++) {\n MAP[i] = [];\n rooms = readline().split(' ');\n for(j = 0; j < W; j++) {\n room = translateRoom(parseInt(rooms[j]));\n MAP[i][j] = room;\n }\n }\n }", "function initializeMaze(rows, columns) {\n let s = [];\n for (let z = 0; z < rows; z++) {\n let t = [];\n for (let x = 0; x < columns; x++) {\n t.push(0);\n }\n s.push(t);\n }\n return s;\n}", "createGrid() {\n // loop to create the 8 rows\n for (let row = 0; row < 8; row++) {\n this.grid[row] = [];\n // push in 8 columns of nulls\n for (let column = 0; column < 8; column++) {\n this.grid[row].push(null);\n }\n }\n }", "createGrid() {\n // loop to create the 8 rows\n for (let row = 0; row < 8; row++) {\n this.grid[row] = [];\n // push in 8 columns of nulls\n for (let column = 0; column < 8; column++) {\n this.grid[row].push(null);\n }\n }\n }", "createGrid() {\n // loop to create the 8 rows\n for (let row = 0; row < 8; row++) {\n this.grid[row] = [];\n // push in 8 columns of nulls\n for (let column = 0; column < 8; column++) {\n this.grid[row].push(null);\n }\n }\n }", "createGrid() {\n // loop to create the 8 rows\n for (let row = 0; row < 8; row++) {\n this.grid[row] = [];\n // push in 8 columns of nulls\n for (let column = 0; column < 8; column++) {\n this.grid[row].push(null);\n }\n }\n }", "createGrid() {\n let grid = new Array(parseInt(this.width)).fill(0)\n\n for(let col = 0; col < this.width; col++) {\n grid[col] = new Array(parseInt(this.height)).fill(0)\n }\n return grid\n }", "function initGrid (){\n for (var row = 0; row < numRows; row += 1) {\n for (var col = 0; col < numCols; col += 1) {\n drawCustomCell(row, col, window.cells[row][col].state,'none', true);\n }\n }\n}", "initCells(){\n for(var j=0; j<this.rows;j++){\n for(var i=0; i<this.columns ; i++){\n this._cells.push(new Cell({column:i, row:j})) ;\n }\n }\n }", "function init_grid() {\n for (let i = 0; i < rows; i++) {\n for (let j = 0; j < cols; j++) {\n if (random() < 0.9) {\n grid[i][j] = 1;\n }\n if (random() < 0.04) {\n grid[i][j] = 2;\n }\n }\n }\n}", "function initializeMatrix (matrix){\n for (var i=0; i<9; i++){\n if(matrix[i] === undefined){\n matrix.push([]);\n }\n for (var j=0; j<9; j++){\n if(matrix[i][j] === undefined){\n matrix[i].push('');\n }else{\n matrix[i][j] = '';\n }\n }\n }\n}", "init_grid() {\n this.grid_default = new Array(8);\n\n for (let i = 0; i < 8; ++i) {\n this.grid_default[i] = new Array(8);\n }\n this.grid_default[0][0] = new Tour(1, 0, 0);\n this.grid_default[0][1] = new Cavalier(1, 1, 0);\n this.grid_default[0][2] = new Fou(1, 2, 0);\n this.grid_default[0][3] = new Dame(1, 3, 0);\n this.grid_default[0][4] = new Roi(1, 4, 0);\n this.grid_default[0][5] = new Fou(1, 5, 0);\n this.grid_default[0][6] = new Cavalier(1, 6, 0);\n this.grid_default[0][7] = new Tour(1, 7, 0);\n for (let i = 0; i <= 7; ++i) {\n this.grid_default[1][i] = new Pion(1, i, 1);\n }\n\n this.grid_default[7][0] = new Tour(0, 0, 7);\n this.grid_default[7][1] = new Cavalier(0, 1, 7);\n this.grid_default[7][2] = new Fou(0, 2, 7);\n this.grid_default[7][3] = new Dame(0, 3, 7);\n this.grid_default[7][4] = new Roi(0, 4, 7);\n this.grid_default[7][5] = new Fou(0, 5, 7);\n this.grid_default[7][6] = new Cavalier(0, 6, 7);\n this.grid_default[7][7] = new Tour(0, 7, 7);\n for (let i = 0; i <= 7; ++i) {\n this.grid_default[6][i] = new Pion(0, i, 6);\n }\n\n for (let i = 2; i <= 5; ++i) {\n for (let j = 0; j <= 7; ++j) {\n this.grid_default[i][j] = undefined;\n }\n }\n return this.grid_default;\n }", "function init() {\n this.grid = setupGrid(this.rows, this.lines, this.pattern);\n draw(this.canvas, this.grid);\n}", "_empty_grid() {\n\t\t\tfor (var x = 0; x < this._internal_grid_size[0]; x++) {\n\t\t\t\tfor (var y = 0; y < this._internal_grid_size[1]; y++) {\n\t\t\t\t\tthis._set_grid_value(x, y, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function genMatrix() {\r\n\tvar i, j;\r\n\tfor(i = 1; i <= maxRow; i++) {\r\n\t\tmatrix[i] = [];\r\n\t\tfor(j = 1; j <= maxColl; j++) {\r\n\t\t\tmatrix[i][j] = 0;\r\n\t\t}\r\n\t}\r\n}", "constructor(rows, cols) {\n this.grid = [];\n for (let j = 0; j < rows; j++) {\n this.grid[j] = [];\n for (let i = 0; i < cols; i++) {\n this.grid[j][i] = new Node(i, j);\n }\n }\n }", "function initArray() {\r\n for(var k = 0; k < NUM_ROWS; ++k)\r\n {\r\n gameGrid[k] = new Array(NUM_COLS);\r\n }\r\n }", "constructor(rows, columns) {\n this.rows = rows;\n this.columns = columns;\n\n this.matrix = new Array(this.rows)\n for (int i=0; i<this.matrix.length; i++) {\n this.matrix[i] = new Array(this.columns).fill(0);\n }\n }", "initGrid () {\n\n // Init all rows one by one\n for ( const [ , row ] of this.rows.entries () ) {\n this.initSortableRow ( row );\n }\n\n // Init sortable grid\n Sortable.create (\n this.$el.firstChild,\n {\n ...this.getSortableOptions,\n ...{\n group: {\n name: 'vgd-rows',\n pull: 'vgd-rows',\n put : 'vgd-rows'\n }\n }\n }\n );\n\n this.setModeClass();\n\n this.$emit ( 'ready' );\n\n }", "async function initializeMatrix() {\n let allTasks = [];\n let matrixTasks = [];\n await getAllTasks(allTasks);\n matrixTasks = getMatrixTasks(allTasks);\n checkTasksForArrivingDueDate(matrixTasks);\n initializeTasksInMatrix(matrixTasks);\n storeMatrixTasksInLocalStorage(matrixTasks);\n}", "init() {\n let i, cells, cell, cellMeta;\n let width = null;\n let height = null;\n\n if (!this.config.isFullScreen) {\n width = this.canvas.width;\n height = this.canvas.height;\n }\n\n this.board.calculateCellLayout(width, height);\n this.canvas.width = this.board.width;\n this.canvas.height = this.board.height;\n cells = this.board.populateBoard(this.config.isRandom);\n\n this.drawCells(cells);\n this.isInitialized = true;\n }", "function resetGrid() {\n var column;\n var i = 0;\n var j = 0;\n var grid = [];\n\n for (i = 0; i < Grid.WIDTH; i++) {\n column = [];\n for (j = 0; j < Grid.HEIGHT; j++) {\n column.push(new Cell());\n }\n grid.push(column);\n }\n \n return grid;\n}", "initializeGrid() {\n const gridInit = new BrewGridInit(BrewGridStore.getBrewAssets());\n assetGrid = gridInit.getAssetGrid();\n tanks = gridInit.getTanks();\n let statusGrid = StatusGrid.convert(assetGrid, BrewGridStore.getAssetStatus());\n fluidSim = new FluidSimulation(assetGrid, tanks, statusGrid);\n this.setState({\n fluidGrid: fluidSim.getFluidGrid(),\n statusGrid: statusGrid,\n });\n }", "function init() {\n colW = width / cols;\n rowH = height / rows;\n}", "function initializeRow(){\n var initialRow = [];\n for(var i = 0; i < squaresPerRow; i++){\n var state = Math.round(Math.random());\n initialRow.push(state);\n }\n return initialRow;\n }", "initGrid() {\n const columns = Math.floor((this.limits.right - this.limits.left) / this.options.gridStep) + 1;\n const rows = Math.floor((this.limits.bottom - this.limits.top) / this.options.gridStep) + 1;\n\n const grow = !this.grid || columns > this.grid.length || rows > this.grid[0].length;\n\n if (grow) {\n this.grid = new Array(columns);\n }\n\n for (let col = 0, x = this.limits.left; col < columns; col ++, x += this.options.gridStep) {\n if (grow) {\n this.grid[col] = new Array(rows);\n }\n\n for (let row = 0, y = this.limits.top; row < rows; row ++, y += this.options.gridStep) {\n // If the current grid node is inside an obstacle,\n // set the \"obstacle\" property of the node.\n const obstacle = this.obstacles.some(\n r => x >= r.left && x <= r.right &&\n y >= r.top && y <= r.bottom\n );\n\n this.grid[col][row] = {\n col, row, // The coordinates of this node in the grid array\n x, y, // The coordinates of this node in the exploration area\n obstacle, // Is there an obstacle at this node?\n\n // The following properties are updated by the pathfinding algorithm\n\n g: 0, // Cost from the start node to this node (g score)\n f: 0, // Estimated cost from the start node\n // to the goal node through this node (f score)\n parent: null, // The previous node in the current explored path\n open: false, // Does this node belong to the open set?\n closed: false, // Has this node already been processed?\n groupCount: 0, // The number of groups passing by this node\n groups: {} // A map of booleans indicating which groups pass by this node\n };\n }\n }\n }", "initializeDefault() {\n this.tiles = Array.from(Array(8), () => new Array(8));\n for (var row = 8; row > 0; row--)\n for (var col = 1; col <= 8; col++) {\n this.tiles[row - 1][col - 1] = new Tile(row, col);\n this.tiles[row - 1][col - 1].initializeDefault();\n }\n }", "T() {\n let dims = this.shape();\n let newGrid = [];\n for (let i = 0; i < dims[1]; i++) {\n let row = [];\n for (let j = 0; j < dims[0]; j++) {\n row.push(this.grid[j][i]);\n }\n newGrid.push(row);\n }\n this.grid = newGrid;\n }", "function init() {\n let grid = new Grid()\n grid.renderGrid();\n}", "constructor() {\n this.grid = [];\n }", "function makeGrid(){\n\tfor(let row = 0; row < inputHeight.value; row++){\n\t\tconst tableRow = pixelCanvas.insertRow(row);\n\t\tfor(let cell = 0; cell < inputWidth.value; cell++){\n\t\t\tconst cellBlock = tableRow.insertCell(cell);\n\t\t}\n\t}\n}", "function Grid(rows, cols) {\n this.rows = rows;\n this.cols = cols;\n this.arr = Array(rows * cols).fill(0); // single dimension array starting at 0\n}", "begin(grid) {\n init();\n }", "function prepare() {\n var matrix = this.matrix,\n dataProvider = this.dataProvider;\n visualRows = new WeakMap();\n (0, _array.arrayEach)(matrix.data, function (cell) {\n visualRows.set(cell, dataProvider.t.toVisualRow(cell.row));\n });\n}", "function fillZeros() {\r\n for (var i = 0; i < cols; i++)\r\n for (var j = 0; j < rows; j++) \r\n grid[i][j] = 0;\r\n}", "function initGrid(){\n var key = document.getElementById(\"inp\").value\n grid = []\n\n // Loop through the rows computing hashes\n for (var i = 0; i < 128; i++){\n var hash = knotHash(key + \"-\" + i)\n grid[i] = tostr2(hash)\n }\n }", "function initGrid(n) { \r\n\tgridcopy = [];\r\n\tfor (let i=0; i<grids[n].length; i++)\r\n\t\tgridcopy[i] = grids[n][i].join('').split('');\r\n}", "function _createGrid() {\n\t_grid = [$game.VIEWPORT_WIDTH];\n\tvar i = $game.VIEWPORT_WIDTH;\n\twhile(--i >= 0) {\n\t\t_grid[i] = [$game.VIEWPORT_HEIGHT];\n\t\tvar j = $game.VIEWPORT_HEIGHT;\n\t\twhile(--j >= 0) {\n\t\t\t//place random object\n\t\t\tvar item = _makeRandomItem();\n\t\t\t_grid[i][j] = {\n\t\t\t\titem: item,\n\t\t\t\titemRevealed: false\n\t\t\t};\n\t\t}\n\t}\n}", "function makeEmpty3DArray() {\n grid = []; // reset the grid\n for (let j = 0; j < config.numRows; j++) {\n grid.push([]);\n for (let i = 0; i < config.numCols; i++) {\n grid[j].push([]);\n }\n }\n }", "MakeMatrix(RowCount, ColCount, min, max)\n {\n var RowCollection = [];\n var ColumnCollection = []\n for(var i = 0; i < RowCount; i++)\n {\n for(var j = 0; j < ColCount; j++)\n {\n ColumnCollection.push(RandomInt(max, min));\n }\n RowCollection.push(ColumnCollection);\n ColumnCollection = [];\n }\n return RowCollection;\n }", "function initMinesweeper(){\n initTopBar();\n //initGridAttributes();\n initGridFlags();\n initGrid();\n initMinesweeperBot();\n}", "function createGrid(){\r\n\tfor (var i = 0; i < grid.length; i++) { //Depends on the size initialised\r\n\t\t//Initialize the arrays\r\n\t\tgrid[i] = new Array(size);\r\n\t\tstoreGrid[i] = new Array(size);\t\t\r\n\t} \r\n\tfor (var i = 0; i < size; i++) { \r\n\t\tfor (var j = 0; j < size; j++) { \r\n\t\t\tgrid[i][j] = 0; //Fill data with zero\r\n\t\t\tstoreGrid[i][j] = {history:[],up:0,down:0,right:0,left:0};//Initialize all the values\r\n\t\t} \r\n\t} \r\n\tgridDisplay();//Display\r\n}", "function aStarInit() {\r\n var i, j;\r\n // create the aStarGrid\r\n for (i = 0; i < gridsize; i++) {\r\n aStarGrid[i] = [];\r\n for (j = 0; j < gridsize; j++) {\r\n aStarGrid[i][j] = new gridSpot(i, j);\r\n // console.log(\"A* Initialise: \" + i + \", \" + j);\r\n }\r\n }\r\n\r\n for (i = 0; i < gridsize; i++) {\r\n for (j = 0; j < gridsize; j++) {\r\n aStarGrid[i][j].addNeighbors();\r\n }\r\n }\r\n console.info(\"A* Initialise: Complete\");\r\n}", "function initializeRows() {\n requestsContainer.empty();\n var requestsToAdd = [];\n for (var i = 0; i < requests.length; i++) {\n requestsToAdd.push(createNewRow(requests[i]));\n }\n requestsContainer.append(requestsToAdd);\n }", "function initBricksMap () {\n var matrix = new Array(5);\n for (var i = 0;i < 5;i++) {\n matrix[i] = new Array(10);\n for (var j = 0;j < 10;j++) {\n matrix[i][j] = 1;\n }\n }\n return matrix;\n}", "constructor(cells) {\n this.bitmasks = [];\n this.views = [];\n this.matrix_cells = [];\n this.cells = cells;\n each(this.cells, (cell, index) => this.matrix_cells[index] = []);\n }", "newGrid(width, height) {\r\n if (width == undefined) { // Called by someone who just wants to clear the grid.\r\n width = this.grid.length\r\n height = this.grid[0].length\r\n }\r\n this.grid = []\r\n for (var x=0; x<width; x++) {\r\n this.grid[x] = []\r\n for (var y=0; y<height; y++) {\r\n if (x%2 === 1 && y%2 === 1) this.grid[x][y] = undefined\r\n else this.grid[x][y] = {'type':'line', 'color':0}\r\n }\r\n }\r\n // Performance: A large value which is === 0 to be used for pillar wrapping.\r\n this.largezero = width * height * 2\r\n }", "function initializeRows() {\n menuContainer.empty();\n var menusToAdd = [];\n for (var i = 0; i < menus.length; i++) {\n menusToAdd.push(createNewRow(menus[i]));\n }\n menuContainer.append(menusToAdd);\n }", "function newGrid(rows, cols){\n\tvar grid = [];\n\tfor (var r=0; r<rows; r++){\n\t\tgrid.push([]);\n\t\tfor (var c=0; c<cols; c++){\n\t\t\tgrid[r][c] = 0;\n\t\t}\n\t}\n\treturn grid;\n}", "function prepare() {\n var matrix = this.matrix,\n dataProvider = this.dataProvider;\n visualRows = new WeakMap();\n Object(_helpers_array__WEBPACK_IMPORTED_MODULE_6__[\"arrayEach\"])(matrix.data, function (cell) {\n visualRows.set(cell, dataProvider.t.toVisualRow(cell.row));\n });\n}", "function rowInitializer(maze, m)\n {\n maze.cells[m] = new Array(columns);\n\n for(n = 0; n < rows; n++)\n {\n maze.cells[m][n] = new cell();\n }\n \n return m + 1;\n }", "function resetGrid() {\n // remove the old grid\n const cells = Array.from(grid.childNodes);\n for(let i = 0; i < cells.length; i++)\n grid.removeChild(cells[i]);\n\n // get the new size\n let size = 0;\n while(size < 2 || size > 100 || isNaN(size)) {\n size = prompt(\"Enter a new grid size between 2 and 100:\");\n }\n // create a grid with the new size\n makeRows(size, size);\n}", "function initializeLogicalBoard() {\n\tSNAKE_BOARD_LOGICAL = [];\n\tfor (let r=0; r<NUM_ROWS; r++) {\n\t\tSNAKE_BOARD_LOGICAL[r] = [];\n\t\tfor (let c=0; c<NUM_COLS; c++) {\n\t\t\tSNAKE_BOARD_LOGICAL[r][c] = EMPTY;\n\t\t}\n\t}\n}", "_createMatrix () {\n let matrix = Array(...Array(200)).map(() => Array(200).fill(0))\n return matrix\n }", "function initBoard(rowNums, colNums, lengths, hints) {\n // math check\n var rowSum = rowNums.reduce(function(sum, next) { return sum + next; }, 0);\n var colSum = colNums.reduce(function(sum, next) { return sum + next; }, 0);\n var lenSum = lengths.reduce(function(sum, next) { return sum + next; }, 0);\n if(rowSum !== colSum || colSum !== lenSum)\n throw new Error('Invalid row/col/len definitions ('+rowSum+','+colSum+','+lenSum+')');\n\n var board = [];\n board.row = rowNums.map(function(num) { return { total: num, count: 0 }; });\n board.col = colNums.map(function(num) { return { total: num, count: 0 }; });\n board.len = lengths.map(function(num) { return { size: num, done: false, over: false }; });\n if(hints) board.hints = hints;\n\n rowNums.forEach(function() {\n var row = [];\n colNums.forEach(function() {\n var cell = {};\n cell.state = 'none';\n row.push(cell);\n });\n board.push(row);\n });\n\n redoCounts(board);\n\n return board;\n}", "newGrid(width, height) {\n if (width == null) { // Called by someone who just wants to clear the grid.\n width = this.width\n height = this.height\n }\n this.grid = []\n for (var x=0; x<width; x++) {\n this.grid[x] = []\n for (var y=0; y<height; y++) {\n if (x%2 === 1 && y%2 === 1) this.grid[x][y] = null\n else this.grid[x][y] = {'type':'line', 'line':LINE_NONE}\n }\n }\n // Performance: A large value which is === 0 to be used for pillar wrapping.\n // Performance: Getting the size of the grid has a nonzero cost.\n // Definitely getting the length of the first element isn't optimized.\n this.largezero = width * height * 2\n this.width = this.grid.length\n this.height = this.grid[0].length\n }", "function makeEmptyGrid() {\n var grid = [];\n for (var i = 0; i < 3; i++) {\n grid[i] = [];\n for (var j = 0; j < 3; j++) {\n grid[i][j] = new Tile(\"\", i, j);\n }\n }\n return grid;\n}", "function init() {\n\tgrid.innerHTML = \"\";\n\tw = window.innerWidth;\n\th = window.innerHeight;\n\tROWS = Math.ceil(window.innerHeight / dim);\n\tCOLS = Math.ceil(ROWS * (w / h));\n\tfor(var i = 0; i < ROWS; i++) {\n\t\tgrid.innerHTML += '<div class=\"row\"></div>';\n\t}\n\trows = document.getElementsByClassName('row');\n\tfor(var i = 0; i < ROWS; i++) {\n\t\tfor(var j = 0; j < COLS; j++) {\n\t\t\tvar cell = '<div class=\"cell\">'+\n\t\t\t\t\t\t\t'<div class=\"inner\"></div>'+\n\t\t\t\t\t\t'</div>';\n\t\t\trows[i].innerHTML += cell;\n\t\t}\n\t}\n\tcells = document.querySelectorAll(\".cell\");\n\tprev = Array(cells.length).fill(0);\n\tlaps = Array(cells.length).fill(0);\n\tprevYs = Array(cells.length).fill(0);\n\tvar origin = new Point(0, 0);\n\tmaxDist = origin.getDist(w, h);\n\trotateTo(w/2, h/2);\n}", "function buildGrid() {\n return new Array(COLS).fill(null)\n .map(()=> new Array(ROWS).fill(null)\n .map(()=> Math.floor(Math.random()*2)));\n}", "InitializeLayout() {\n for (let i = 0; i < FrackerSettings.k_worldTiles; ++i) {\n this.m_material[i] = Fracker_Material.EMPTY;\n this.m_bodies[i] = null;\n }\n }", "function initBoardArray() {\n\tfor (var i = 0; i < row; i++) {\n\t\tboardArray[i]= new Array();\n\t\tfor (var j = 0; j < column; j++) {\n\t\t \tboardArray[i][j] = 0;\n\t\t}\n\t}\n}", "function initValues() {\n\tvalues = [];\n\tfor (var i=0; i<NY; i++) {\n\t\tvar row = [];\n\t\tfor (var j=0; j<NX; j++) {\n\t\t\trow.push(0);\n\t\t}\n\t\tvalues.push(row);\n\t}\n}", "function init() {\n\tinitalizeGrid();\n\tupdateCanvasGrid();\n\tdrawPalette();\n\tdrawCurrentColor();\n\tdecodeOnFirstLoad();\n}", "init() {\n if (this._initialized) {\n return true\n }\n\n for (let i = 0; i < this._board.length; i++) {\n this._board[i] = new Array(this._size)\n\n for (let j = 0; j < this._board[0].length; j++) {\n this._board[i][j] = new Tile(j, i, '1')\n }\n }\n\n this._initialized = true\n }", "function buildMatrices() {\r\n let tempLine1 = []; // used to generate random letters\r\n let tempLine2 = []; // used to build up taken matrix\r\n\r\n for (let i = 0; i < ROWS; i++) {\r\n\r\n // build up each line\r\n for (let j = 0; j < COLS; j++) {\r\n tempLine1[j] = randomLetter();\r\n tempLine2[j] = false;\r\n }\r\n\r\n // push each line onto matrices\r\n grid[i] = tempLine1.slice(0);\r\n taken[i] = tempLine2.slice(0);\r\n }\r\n}", "getMatrix(){\n const matrix = [];\n while(this.height > 0){\n matrix.push(new Array(this.width).fill(0))//create new row and fill it with zeros\n this.height--;\n }\n return matrix;\n }", "function initialDrawGrid() {\n for (r = 0; r < ROW; r++) {\n for (c = 0; c < COLUMN; c++) {\n initialDrawSquare(c, r, grid[r][c]);\n }\n }\n}", "initGame() {\n this.board = [];\n for(let x = 0; x < 9; ++x) {\n let col = [];\n for(let y = 0; y < 9; ++y){\n let row = [];\n for(let z = 0; z < 3; ++z){\n row.push(null);\n }\n col.push(row);\n }\n this.board.push(col);\n }\n }", "function createMatrix() {\n\n /* Initializing the created array with 0 and borders with 5 */\n function initArray(matrix, rows, cols) {\n for (let i = 0; i < rows; i++) {\n for (let j = 0; j < cols; j++) {\n\n /* Conditions used to seperate out the Borders */\n if (i == 0 || j == 0 || i == rows - 1 || j == cols - 1) {\n matrix[i][j] = 5;\n } else {\n matrix[i][j] = 0;\n }\n }\n }\n }\n\n /* Created a new Array of dimension [rowsxcols] */\n var matrix = new Array(rows);\n for (let i = 0; i < rows; i++) {\n matrix[i] = new Array(cols);\n }\n\n /* Calling Function to initialize the values after creating matrix */\n initArray(matrix, rows, cols);\n\n /* Return the Matrix */\n return matrix;\n}", "generate(){\r\n for(let r = 0; r < this.rows;r++){//for every row\r\n let row = []\r\n for(let c = 0; c < this.cols;c++){//for every column\r\n row.push(new cell(r,c,this)) //push cells into the row\r\n }\r\n this.mazegrid.push(row)//push the rows into the grid\r\n }\r\n curr = this.mazegrid[0][0]\r\n }", "function initialize() {\n\n for (var i = 0; i < x_size; i++) {\n for (var j = 0; j < y_size; j++) {\n var tile = new TileFull(i, j, null, null, 0);\n\n board[i][j] = tile;\n randArray[i][j] = tile;\n inBag[i][j] = true;\n }\n }\n\n Console.log(\"Board initialized\")\n}", "function read_state() {\n let grid=Array(3).fill(0).map(x => Array(3));\n for(let k=0;k<9;++k) {\n let input=document.getElementById(\"input_pos\"+k);\n let j=Math.floor(k/3);\n let i=k%3;\n if(input.value==\"\") grid[j][i]=0;\n else grid[j][i]=parseInt(input.value,10);\n }\n return {\n grid : grid\n };\n}", "static makeZero(rows, cols){\n let X = new Matrix();\n X.rows = rows;\n X.cols = cols;\n X.matrix = [];\n for(let i = 0; i < X.rows; i++){\n X.matrix[i] = [];\n for(let j = 0; j < X.cols; j++){\n X.matrix[i][j] = 0; \n }\n }\n return X;\n}", "function _initGridModel(gridTable) {\r\n\t\tvar state = $d(gridTable, \"datagrid\");\r\n\t\tvar opts = state.options;\r\n\t\tvar dc = state.dc;\r\n\t\tvar $panelContent = state.panel;\r\n\r\n\t\t$panelContent.panel($.extend({}, opts, {\r\n\t\t\turl : null,\r\n\t\t\tid : null,\r\n\t\t\tdoSize : false,\r\n\t\t\tonResize : function(width, height) {\r\n\t\t\t\tsetTimeout(function() {\r\n\t\t\t\t\tif ($d(gridTable, \"datagrid\")) {\r\n\t\t\t\t\t\t_setViewSize(gridTable);\r\n\t\t\t\t\t\tfitColumnsWidth(gridTable);\r\n\t\t\t\t\t\topts.onResize.call($panelContent, width, height);\r\n\t\t\t\t\t}\r\n\t\t\t\t}, 0);\r\n\t\t\t},\r\n\t\t\tonExpand : function() {\r\n\t\t\t\tfixRowHeight(gridTable);\r\n\t\t\t\topts.onExpand.call($panelContent);\r\n\t\t\t}\r\n\t\t}));\r\n\t\tstate.rowIdPrefix = \"datagrid-row-r\" + (++gridCount);\r\n\r\n\t\t// init header\r\n\t\t_initHeader(dc.header1, opts.frozenColumns, true);\r\n\t\t_initHeader(dc.header2, opts.columns, false);\r\n\t\t_initColumnsStyle();\r\n\r\n\t\tdc.header1.add(dc.header2).css(\"display\", opts.showHeader ? \"block\" : \"none\");\r\n\t\tdc.footer1.add(dc.footer2).css(\"display\", opts.showFooter ? \"block\" : \"none\");\r\n\r\n\t\t// init toolbar\r\n\t\tif (opts.toolbar) {\r\n\t\t\tif (typeof opts.toolbar == \"string\") {\r\n\t\t\t\t$ac(\"datagrid-toolbar\", $(opts.toolbar)).prependTo($panelContent);\r\n\t\t\t\t$(opts.toolbar).show();\r\n\t\t\t} else {\r\n\t\t\t\t$(\"div.datagrid-toolbar\", $panelContent).remove();\r\n\t\t\t\tvar tb = $('<div class=\"datagrid-toolbar\"><table cellspacing=\"0\" cellpadding=\"0\"><tr></tr></table></div>').prependTo($panelContent);\r\n\t\t\t\tvar tr = $f(\"tr\", tb);\r\n\t\t\t\tfor ( var i = 0; i < opts.toolbar.length; i++) {\r\n\t\t\t\t\tvar btn = opts.toolbar[i];\r\n\t\t\t\t\tif (btn == \"-\") {\r\n\t\t\t\t\t\t$('<td><div class=\"datagrid-btn-separator\"></div></td>').appendTo(tr);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tvar td = $(\"<td></td>\").appendTo(tr);\r\n\t\t\t\t\t\tvar $btn = $('<a href=\"javascript:void(0)\"></a>').appendTo(td);\r\n\t\t\t\t\t\t// $btn[0].onclick = $fn(btn.handler || function() {\r\n\t\t\t\t\t\t// });\r\n\t\t\t\t\t\t$btn.button($.extend({}, btn, {\r\n\t\t\t\t\t\t\tplain : true\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} else {\r\n\t\t\t$(\"div.datagrid-toolbar\", $panelContent).remove();\r\n\t\t}\r\n\r\n\t\t// init pager\r\n\t\t$(\"div.datagrid-pager\", $panelContent).remove();\r\n\t\tif (opts.pagination) {\r\n\t\t\tvar $pager = $('<div class=\"datagrid-pager\"></div>');\r\n\t\t\tif (opts.paginationPos == \"bottom\") {\r\n\t\t\t\t// append bottom pager\r\n\t\t\t\t$pager.appendTo($panelContent);\r\n\t\t\t} else if (opts.paginationPos == \"top\") {\r\n\t\t\t\t// append top pager\r\n\t\t\t\t$ac(\"datagrid-pager-top\", $pager).prependTo($panelContent);\r\n\t\t\t} else {\r\n\t\t\t\t// append top and bottom pager\r\n\t\t\t\tvar $topPager = $('<div class=\"datagrid-pager datagrid-pager-top\"></div>').prependTo($panelContent);\r\n\t\t\t\t$pager.appendTo($panelContent);\r\n\t\t\t\t$pager = $pager.add($topPager);\r\n\t\t\t}\r\n\r\n\t\t\t$pager.pagination({\r\n\t\t\t\ttotal : 0,\r\n\t\t\t\tpageIndex : opts.pageIndex,\r\n\t\t\t\tpageSize : opts.pageSize,\r\n\t\t\t\tpageOptions : opts.pageOptions,\r\n\t\t\t\tbuttons : opts.pageButtons,\r\n\t\t\t\tonSelectPage : function(pageIndex, pageSize) {\r\n\t\t\t\t\topts.pageIndex = pageIndex;\r\n\t\t\t\t\topts.pageSize = pageSize;\r\n\t\t\t\t\t$pager.pagination(\"refresh\", {\r\n\t\t\t\t\t\tpageIndex : pageIndex,\r\n\t\t\t\t\t\tpageSize : pageSize\r\n\t\t\t\t\t});\r\n\t\t\t\t\tloadGridData(gridTable);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\topts.pageSize = $pager.pagination(\"options\").pageSize;\r\n\t\t}\r\n\r\n\t\t// init header\r\n\t\tfunction _initHeader($header, columns, frozen) {\r\n\t\t\tif (!columns) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t$header.show();\r\n\t\t\t$header.empty();\r\n\t\t\tvar $headerTable = $('<table class=\"datagrid-htable\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tbody></tbody></table>').appendTo($header);\r\n\t\t\tfor ( var i = 0; i < columns.length; i++) {\r\n\t\t\t\tvar tr = $('<tr class=\"datagrid-header-row\"></tr>').appendTo($(\"tbody\", $headerTable));\r\n\t\t\t\tvar cols = columns[i];\r\n\t\t\t\tfor ( var j = 0; j < cols.length; j++) {\r\n\t\t\t\t\tvar col = cols[j];\r\n\t\t\t\t\tvar tdAttrs = \"\";\r\n\t\t\t\t\tif (col.rowspan) {\r\n\t\t\t\t\t\ttdAttrs += 'rowspan=\"' + col.rowspan + '\" ';\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (col.colspan) {\r\n\t\t\t\t\t\ttdAttrs += 'colspan=\"' + col.colspan + '\" ';\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvar td = $('<td ' + tdAttrs + '></td>').appendTo(tr);\r\n\t\t\t\t\tif (col.checkbox) {\r\n\t\t\t\t\t\ttd.attr(\"field\", col.field);\r\n\t\t\t\t\t\t$('<div class=\"datagrid-header-check\"></div>').html('<input type=\"checkbox\"/>').appendTo(td);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif (col.field) {\r\n\t\t\t\t\t\t\ttd.attr(\"field\", col.field);\r\n\t\t\t\t\t\t\ttd.append('<div class=\"datagrid-cell\"><span>' + col.title || \"\" + '</span><span class=\"datagrid-sort-icon\">&nbsp;</span></div>');\r\n\t\t\t\t\t\t\tvar $headerCell = $f(\"div.datagrid-cell\", td);\r\n\t\t\t\t\t\t\tif (col.resizable == false) {\r\n\t\t\t\t\t\t\t\t$headerCell.attr(\"resizable\", \"false\");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif (col.width) {\r\n\t\t\t\t\t\t\t\t$headerCell.ow(col.width);\r\n\t\t\t\t\t\t\t\tcol.boxWidth = parseInt($headerCell[0].style.width);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tcol.auto = true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$headerCell.css(\"text-align\", (col.halign || col.align || \"\"));\r\n\t\t\t\t\t\t\tcol.cellClass = \"datagrid-cell-c\" + gridCount + \"-\" + col.field.replace(/\\./g, \"-\");\r\n\t\t\t\t\t\t\tcol.cellSelector = \"div.\" + col.cellClass;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$('<div class=\"datagrid-cell-group\"></div>').html(col.title).appendTo(td);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (col.hidden) {\r\n\t\t\t\t\t\ttd.hide();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// init row number\r\n\t\t\tif (frozen && opts.rownumbers) {\r\n\t\t\t\tvar td = $('<td rowspan=' + opts.frozenColumns.length + '\"><div class=\"datagrid-header-rownumber\"></div></td>');\r\n\t\t\t\tif ($(\"tr\", $headerTable).length == 0) {\r\n\t\t\t\t\t$p(td.wrap('<tr class=\"datagrid-header-row\"></tr>')).appendTo($(\"tbody\", $headerTable));\r\n\t\t\t\t} else {\r\n\t\t\t\t\ttd.prependTo($(\"tr:first\", $headerTable));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfunction _initColumnsStyle() {\r\n\t\t\tvar ss = [ '<style type=\"text/css\">' ];\r\n\t\t\tvar fields = getColumnFields(gridTable, true).concat(getColumnFields(gridTable));\r\n\t\t\tfor ( var i = 0; i < fields.length; i++) {\r\n\t\t\t\tvar col = getColumnOption(gridTable, fields[i]);\r\n\t\t\t\tif (col && !col.checkbox) {\r\n\t\t\t\t\tss.push(col.cellSelector + \" {width:\" + col.boxWidth + \"px;}\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tss.push(\"</style>\");\r\n\t\t\t$(ss.join(\"\\n\")).prependTo(dc.view);\r\n\t\t}\r\n\t}", "function createMatrix() {\n var board = [];\n for (var i = 0; i < gLevel.SIZE; i++) {\n board[i] = [];\n for (var j = 0; j < gLevel.SIZE; j++) {\n var cell = {\n minesAroundCount: 0,\n isShown: false,\n isMine: false,\n isMarked: false,\n }\n board[i][j] = cell;\n }\n }\n return board;\n}" ]
[ "0.72385544", "0.71468896", "0.70017624", "0.6849892", "0.66762555", "0.667294", "0.6483828", "0.6481032", "0.64789253", "0.64389604", "0.6355339", "0.62756467", "0.6231351", "0.62100494", "0.62091005", "0.61918527", "0.6187529", "0.6180396", "0.6161365", "0.6132321", "0.6129611", "0.6045691", "0.6041614", "0.60252774", "0.60160094", "0.5994544", "0.59681004", "0.5967218", "0.5967218", "0.5967218", "0.5967218", "0.5964869", "0.5943009", "0.5938791", "0.59244704", "0.59228086", "0.5919165", "0.5902949", "0.5878394", "0.5870252", "0.58520854", "0.5843742", "0.58359915", "0.5831651", "0.5787725", "0.57731843", "0.5771381", "0.5770964", "0.57519966", "0.57448375", "0.57412064", "0.5740965", "0.5714652", "0.5697664", "0.569643", "0.56819236", "0.56693476", "0.56565845", "0.56552076", "0.5654592", "0.5636334", "0.56355286", "0.5631377", "0.5623577", "0.5620924", "0.56048226", "0.56008947", "0.5598402", "0.559629", "0.5586972", "0.55860984", "0.5585146", "0.55825716", "0.55502045", "0.55398715", "0.5530193", "0.5515173", "0.5512599", "0.5510406", "0.5506216", "0.5497985", "0.54903215", "0.54902023", "0.54856884", "0.5477765", "0.5465128", "0.5459094", "0.5456797", "0.5454202", "0.5453285", "0.5441648", "0.54410815", "0.54373914", "0.5435984", "0.5429146", "0.5428968", "0.54289", "0.5425589", "0.54251283", "0.5424485" ]
0.7775112
0
Constructs a new RoomPool and sets listeners and emitters from the given socket.io instance.
constructor(socketIoInstance) { this.rooms = {}; SafeSocket.socketsOn(socketIoInstance, 'connection', (socket) => { Logger.logInfo('socket ' + socket.id + ' connected'); socket.emit('clientConnectedToServer', { socketId: socket.id }); // Default socket.io actions socket.on('disconnect', () => { this.onDisconnect(socket); }); socket.on('disconnecting', () => { this.playerAttemptLeaveRoom(socket, {}); }); // Custom actions socket.on('hostAttemptEndGame', (data) => { this.hostAttemptEndGame(socket, data) }); socket.on('hostAttemptStartGame', (data) => { this.hostAttemptStartGame(socket, data) }); socket.on('playerAttemptCreateRoom', (data) => { this.playerAttemptCreateRoom(socket, data) }); socket.on('playerAttemptJoinRoom', (data) => { this.playerAttemptJoinRoom(socket, data) }); socket.on('playerAttemptLeaveRoom', (data) => { this.playerAttemptLeaveRoom(socket, data) }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function RoomSocket(io, roomId){\n this.roomId = roomId;\n this.io = io;\n}", "constructor(socket, logger, socketManager) {\n this.socket = socket;\n this.logger = logger;\n this.socketManager = socketManager;\n\n /**\n * Create a map of event handlers to be used during the\n * handler binding process to a socket. We call the bind\n * method on each handler method in this class to tell\n * the interpreter what the \"this\" keyword refers to.\n */\n this.handlers = {\n joinRoom: this.joinRoom.bind(this),\n leaveRoom: this.leaveRoom.bind(this),\n nickname: this.nickname.bind(this)\n };\n }", "constructor () {\n super();\n this.joinedRooms = this.rooms = [];\n this.socketClient = new SocketClient(this);\n this._emitFn = componentEmitter.prototype.emit;\n this.generalCallbacks = {};\n this.broadcast = {\n /**\n * Broadcast to room\n * @param {string} roomKey the roomkey which need to be attached to\n * @return {object}\n **/\n to: roomKey => {\n return {\n /**\n * Emitting\n * @param {string} eventKey\n * @param {object} payload\n **/\n emit: (eventKey, payload) => {\n if (this.generalCallbacks[eventKey]) {\n this.generalCallbacks[eventKey](createPayload(payload), roomKey);\n }\n }\n }\n }\n };\n }", "setupSocket() {\n this.socket = io('/gameroom');\n this.socket.on('connect', () => {\n this.socket.emit('setup_client')\n });\n this.socket.on('packet', this.handleSocketMessages)\n }", "function setupSocket(){\n socket = io();\n socket.on('disconnect', function(){\n changeState(gameConfig.GAME_STATE_END);\n });\n socket.on('setSyncUser', function(user){\n gameConfig.userID = user.objectID;\n });\n //change state game on\n socket.on('resStartGame', function(userDatas, foodsDatas, virusesDatas){\n Manager.setUsers(userDatas);\n Manager.setFoods(foodsDatas);\n Manager.setViruses(virusesDatas);\n console.log(Manager.users);\n\n canvasAddEvent();\n documentAddEvent();\n\n changeState(gameConfig.GAME_STATE_GAME_ON);\n });\n socket.on('userJoined', function(data){\n Manager.setUser(data);\n });\n socket.on('createViruses', function(virusesData){\n Manager.createViruses(virusesData);\n });\n socket.on('deleteVirus', function(virusID){\n Manager.deleteVirus(virusID);\n });\n socket.on('createFoods', function(foodsDatas){\n Manager.createFoods(foodsDatas);\n });\n socket.on('deleteFood', function(foodID){\n Manager.deleteFood(foodID);\n });\n socket.on('updateUser', function(userDatas){\n Manager.updateUsers(userDatas);\n });\n socket.on('userDestroy', function(userID){\n if(userID === gameConfig.userID){\n changeState(gameConfig.GAME_STATE_END);\n }\n Manager.deleteUser(userID);\n })\n socket.on('userLeave', function(objID){\n Manager.kickUser(objID);\n });\n socket.on('rename', function(){\n changeState(gameConfig.GAME_STATE_START_SCENE);\n });\n}", "function initSockets(){\n //connect to the io opened tunnel in the server\n var socket = io();\n socket.on(\"Order Status\", function(obj){\n createReadyOrders(obj.nowServing);\n createToBeCooked(obj.kitchen);\n });\n\n}", "function socket_init(map_){\n socket = new io.Socket(null, {port: 3000, rememberTransport: false});\n socket.connect();\n map = map_;\n\n var socket_events = {\n 'connect' : connectHandler\n ,'disconnect' : disconnectHandler\n ,'reconnect' : reconnectHandler\n ,'reconnecting' : reconnectingHandler\n ,'reconnect_failed' : reconnect_failedHandler\n ,'message' : messageHandler\n }\n\n _.forEach(socket_events, function(func, event) {\n if(!func) console.log(\"Cannot find \" + event + 'function. Please create it!' );\n else socket.on(event,func);\n });\n}", "constructor() {\n this.io = require('socket.io')();\n }", "_setDefaultListeners () {\n this.io.on('connection', (objSocket) => {\n console.log('Socket client connected', this.io.engine.clientsCount);\n objSocket.on('join_room', (strRoom) => {\n console.log('Joining room', strRoom);\n objSocket.join(strRoom);\n });\n })\n }", "function initSocketIO() {\n io.on('connection', function (socket) {\n\n console.log(\"Client connected\");\n\n currentConnections[socket.id] = {socket: socket};\n\n socket.on('join', function(data) {\n console.log(data);\n console.log(socket.id);\n join(socket, data);\n });\n socket.on('send_emoji', function (data) {\n console.log(data);\n sendEmoji(socket, data);\n });\n socket.on('play_card', function (data) {\n console.log(data);\n playCard(socket, data);\n });\n socket.on('minion_attack', function (data) {\n minionAttackCommand(socket, data);\n });\n socket.on('disconnect', function() {\n var room_id = currentConnections[socket.id]['room_id'];\n if(room_id != undefined && room_id != null && connectionRooms[room_id]) {\n connectionRooms[room_id].forEach(function (player) {\n if(player.socket.id != socket.id) {\n players.push({socket:player.socket, id:player.id});\n }\n player.socket.leave(room_id);\n });\n delete connectionRooms[room_id];\n }\n delete currentConnections[socket.id];\n });\n });\n}", "function GameSocketServer(io, debug) {\n io.on('connection', socket => {\n\n if (debug) console.log(`Client joined! id: ${socket.id}`)\n\n // Triggered on room creation or joining\n socket.on('room', (username, userType, roomCode) => {\n\n // Set socket info\n socket.username = username\n socket.userType = userType\n\n const rooms = io.sockets.adapter.rooms\n\n if (socket.userType === 'player') {\n if (debug) console.log(`Player ${socket.username} wants to join a room.`)\n\n if (rooms[roomCode]) {\n // If the room exists\n if (debug) console.log(`Player ${socket.username} joined a room. code: ${roomCode}`)\n joinOrCreateRoom(roomCode)\n } else {\n // If the room does not exist\n if (debug) console.log(`Player ${socket.username} requested a non-existent room.`)\n socket.emit('no_room', 'Room does not exist.')\n }\n } else if (socket.userType === 'gm') {\n if (debug) console.log(`GM ${socket.username} requested a room.`)\n if (!rooms[roomCode]) {\n // If the room does not exist already, generate a new code\n // This prevents GMs from setting their own room code\n roomCode = genRoomCode()\n if (debug) console.log(`GM ${socket.username} created a room. code: ${roomCode}`)\n } else {\n // If the room exists already, don't set a new code, so they just join the room\n if (debug) console.log(`GM ${socket.username} joined a room. code: ${roomCode}`)\n }\n joinOrCreateRoom(roomCode)\n } else {\n // If anything other than the right user types were set\n socket.userType = 'player'\n socket.emit('error', 'Invalid user type.')\n }\n })\n\n // Short hand callback for broadcasting new stores\n socket.on('broadcast_stores', broadcastStores)\n\n // Short hand callback for broadcasting clear stores message\n socket.on('clear_stores', clearStores)\n\n // Sometimes the socket is undefined on improper disconnection\n socket.on('disconnect', reason => {\n if (socket) {\n updateGMRoomMembers()\n }\n const name = socket.username || \"Someone\"\n if (debug) console.log(`${name} disconnected: ${reason}`)\n })\n\n // Sends room members in a callback\n function getRoomMembers(cb) {\n // Get all room members\n io.of('/').in(socket.roomCode).clients((error, clients) => {\n if (error) throw error\n // Create empty room\n const roomPkg = [],\n connected = io.sockets.connected\n for (let id of clients) {\n // Get each socket by id\n const client = connected[id]\n // Push the socket info into the room\n roomPkg.push({\n id: id,\n username: client.username,\n userType: client.userType\n })\n }\n cb(roomPkg)\n })\n }\n\n // Sends a GM the current room member information\n function updateGMRoomMembers() {\n getRoomMembers(members => {\n for (let member of members) {\n // Find the GM\n if (member.userType === 'gm') {\n // Send them the members\n io.to(member.id).emit('room_members', members)\n return\n }\n }\n })\n }\n\n // Sends store information to all selected recipients\n function broadcastStores(stores, recipients) {\n if (debug) {\n console.log(\"Sending stores:\")\n console.log(stores)\n console.log(\"To:\")\n console.log(recipients)\n }\n for (var i = 0; i < recipients.length; i++) {\n io.to(recipients[i]).emit('new_stores', stores)\n }\n }\n\n // Sends a clear stores message to selected recipients\n // If none are provided, it sends the message to whole room\n function clearStores(recipients) {\n if (!recipients.length) {\n getRoomMembers(members => {\n sendClearStoresMessage(members)\n })\n } else {\n sendClearStoresMessage(recipients)\n }\n }\n\n // Helper function\n function sendClearStoresMessage(recipients) {\n for (var i = 0; i < recipients.length; i++) {\n io.to(recipients[i].id).emit('clear_stores')\n }\n }\n\n // Adds the socket to a room if it exists, or creates and then adds if it doesn't\n function joinOrCreateRoom(roomCode) {\n socket.join(roomCode, () => {\n // Sets the socket's room code\n socket.roomCode = roomCode\n // Sends room code to client\n socket.emit('room_joined', roomCode)\n // Updates GM's player list\n updateGMRoomMembers()\n })\n }\n\n // Generates a 5 character room code\n function genRoomCode() {\n const roomSeed = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',\n rooms = io.sockets.adapter.rooms;\n let code\n do {\n code = ''\n for (var i = 0; i < 5; i++) {\n code += roomSeed[getRandomInt(roomSeed.length)]\n }\n // Keep generating new codes if the code is already in use\n } while (rooms[code])\n return code\n }\n\n // Helper function\n function getRandomInt(upperBound) {\n return Math.floor(Math.random() * upperBound)\n }\n\n })\n}", "initSocket(callback, idhandler, userhandler) {\n this.io.on('assignment', idhandler);\n this.io.on('questionAsked', callback);\n this.io.on('newUser', userhandler);\n }", "function setupRoom(roomID) {\n\t\t\tvar room = io.connect('https://heathio-server-tagger94.c9users.io:8080/' + roomID);\n\t //room = io('/' + roomID);\n\t console.log(\"set room to \" + roomID);\n\t room.on('connect', function(socket) {\n\t console.log(\"Connected room to server\");\n\t\t\t\t\n\t });\n\t room.on('disconnect', function(msg) {\n\t console.log(\"disconnect from server\");\n\t });\n\t //Setup Alert message\n\t room.on('alert', recieveAlert);\n\t }", "init() {\n this.io.on('connection', function (socket) {\n /**\n * Triggered when a socket disconnects\n */\n socket.on('disconnect', function () {\n console.log(`[SOCKET] Client disconnected! ID: ${socket.id}`);\n });\n\n console.log(`[SOCKET] New client connected! ID: ${socket.id}`);\n });\n\n /**\n * Start listening on the right port/host for the Socket.IO server\n */\n console.log('[SYSTEM] Socket.IO started !');\n }", "function socketInit() {\r\n\tsocket = io();\r\n\r\n\tsocket.on('message', parsedMessage => {\r\n\t\tconsole.info('Received message: ' + parsedMessage.id);\r\n\r\n\t\tswitch (parsedMessage.id) {\r\n\t\t\t//event for self user, when he leaves the room\r\n\t\t\tcase 'disconn':\r\n\t\t\t\tparticipants[userId].disposeSelf();\r\n\t\t\t\tsocket.close();\r\n\t\t\t\tbreak;\r\n\t\t\t// event for new user to connect to KMS and register other users in room\r\n\t\t\tcase 'existingParticipants':\r\n\t\t\t\tonExistingParticipants(parsedMessage);\r\n\t\t\t\tbreak;\r\n\t\t\t// event for other users to register new participant\r\n\t\t\tcase 'newParticipantArrived':\r\n\t\t\t\tonNewParticipant(parsedMessage);\r\n\t\t\t\tbreak;\r\n\t\t\t// event for other users to register the leaving of user\r\n\t\t\tcase 'participantLeft':\r\n\t\t\t\tonParticipantLeft(parsedMessage);\r\n\t\t\t\tbreak;\r\n\t\t\t// event to register answers : user-KMS and user-user\r\n\t\t\tcase 'receiveVideoAnswer':\r\n\t\t\t\treceiveVideoResponse(parsedMessage);\r\n\t\t\t\tbreak;\r\n\t\t\t// event for exchanging ICE candidates between WebRTC peers\r\n\t\t\tcase 'iceCandidate':\r\n\t\t\t\tparticipants[parsedMessage.userId].rtcPeer.addIceCandidate(parsedMessage.candidate, function (error) {\r\n\t\t\t\t\tif (error) {\r\n\t\t\t\t\t\tconsole.error(\"Error adding candidate: \" + error);\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\tbreak;\r\n\t\t\tcase'chat message':\r\n\t\t\t\treceiveChatMessage(parsedMessage);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t// event for new user to receive a response of moderator\r\n\t\t\tcase 'moderatorResponse':\r\n\t\t\t\tmoderatorResponse(parsedMessage.accepted, socket);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'videoDisabled':\r\n\t\t\t\tputNameOverVideo(document.getElementById(parsedMessage.userId));\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'videoEnabled':\r\n\t\t\t\tputVideoOverName(document.getElementById(parsedMessage.userId));\r\n\t\t\t\tbreak;\r\n\r\n\t\t}\r\n\t});\r\n\t// event fired when moderator enters the room or if the moderator is not available\r\n\tsocket.on('onEnterNotification', error => {\r\n\t\tif (error === null) {\r\n\t\t\tenter('moderator');\r\n\t\t} else {\r\n\t\t\talert(error);\r\n\t\t}\r\n\t});\r\n\t// event for requesting permission from the moderator to log in a new user\r\n\tsocket.on('requestForModerator', (socketId, fullName) => {\r\n\t\tlet data = {\r\n\t\t\tid: 'moderatorResponse',\r\n\t\t\tuserId: socketId,\r\n\t\t\taccepted: false\r\n\t\t}\r\n\r\n\t\taddModal(fullName, (modalId) => {\r\n\t\t\tdata.accepted = true;\r\n\t\t\tdocument.getElementById(modalId).remove();\r\n\t\t\tsendMessage(data);\r\n\t\t}, (modalId) => {\r\n\t\t\tdocument.getElementById(modalId).remove();\r\n\t\t\tsendMessage(data);\r\n\t\t});\r\n\r\n\t});\r\n\tsocket.on('waitModeratorResponse', () => {\r\n\t\talert('Please wait until moderator accepts your entry');\r\n\t});\r\n}", "function bind(io) {\n return io.on('connection', (socket) => {\n let user = socket.request.user.user;\n socket.user = user;\n\n registerUser(socket.user, socket.request.user);\n\n getQueues().then((queues) => {\n queues.forEach((queue, index) => {\n getQueue(queue).then((data) => {\n io.emit('update', {'waiting': data, 'queue': queue});\n });\n });\n });\n\n socket.on('join', joinQueue(io, socket));\n socket.on('leave', leaveQueue(io, socket));\n });\n}", "constructor() {\n super()\n console.info('construct')\n // Maximum number of clients allowed to connect into the room.\n // When room reaches this limit, it is locked automatically.\n // Unless the room was explicitly locked by you via lock() method,\n // the room will be unlocked as soon as a client disconnects from it.\n this.maxClients = 2\n // Frequency to send the room state to connected clients (in milliseconds)\n this.setPatchRate(patchRate)\n }", "initNewPlayer(socket) {\n this.sockets.set(socket.id, socket);\n socket.emit(\"init\")\n }", "constructor(roomCode) {\n this.roomCode = roomCode; // Room code (e.g. 'abcd' or 'foo1')\n this.playerMap = new PlayerMap(); // PlayerMap of the room\n this.hostSocket = undefined; // Reference to host socket\n this.gameServer = // Game server that will handle game interactions\n new GameServer(this.playerMap);\n }", "function newRoom() {\n socket.emit(\"newRoom\");\n}", "function createNewRoom() {\r\n // Generate room id.\r\n const newID = uuidv4().substring(0, 8);\r\n\r\n // Join room\r\n socket.join(newID);\r\n\r\n // Update corressponding object in usersArray\r\n updateUserRoom(socket, newID);\r\n\r\n // Send room data to socket\r\n io.to(socket.id).emit(\"roomData\", {\r\n roomId: newID,\r\n });\r\n }", "function bind() {\r\n\r\n socket = new io.Socket(postmile.api.domain, { port: postmile.api.port, rememberTransport: false });\r\n\r\n socket.on('connect', function () {\r\n Y.log('Connected!');\r\n });\r\n\r\n socket.on('message', function (message) {\r\n handleStreamMessage(message);\r\n });\r\n\r\n socket.connect();\r\n\r\n Y.on(\"postmile:subscribeProject\", function (project) {\r\n subscribe(project);\r\n });\r\n\r\n }", "socketsJoin(room) {\r\n this.adapter.addSockets({\r\n rooms: this.rooms,\r\n except: this.exceptRooms,\r\n }, Array.isArray(room) ? room : [room]);\r\n }", "setupChatNs() {\r\n\t\tthis.ns.chat.on(\"connection\", baseSocket => {\r\n\t\t\tconst socket = new Proxy(baseSocket, new ExtendedSocket()); //extend socket\r\n\r\n\t\t\tsocket.log(chalk.cyan(\"connected\"));\r\n\t\t\tthis.sockets.add(socket);\r\n\r\n\t\t\t//socket wants to join a room\r\n\t\t\tsocket.on(ACTION_TYPE.JOIN_ROOM, ({\r\n\t\t\t\troom,\r\n\t\t\t\tnick\r\n\t\t\t}) => {\r\n\t\t\t\tsocket.changeRoomTo(room);\r\n\r\n\t\t\t\tif (nick) {\r\n\t\t\t\t\tsocket.nick = nick;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//give the socket a random name if it doesnt have any yet\r\n\t\t\t\tif (!socket.nick) {\r\n\t\t\t\t\tsocket.nick = randomNick();\r\n\t\t\t\t\tsocket.emit(ACTION_TYPE.OWN_NICK_CHANGE, {\r\n\t\t\t\t\t\tuser: {\r\n\t\t\t\t\t\t\tnew: socket.nick\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//send the initial state of the room\r\n\t\t\t\tthis.getRoomState(room).then(state => {\r\n\t\t\t\t\tsocket.emit(ACTION_TYPE.ROOM_STATE, {\r\n\t\t\t\t\t\tstate\r\n\t\t\t\t\t});\r\n\t\t\t\t}).catch(err => console.error(err));\r\n\r\n\t\t\t\t//tell others\r\n\t\t\t\tsocket.broadcastToRoom(ACTION_TYPE.ENTERED_ROOM, {\r\n\t\t\t\t\tuser: socket.user\r\n\t\t\t\t});\r\n\r\n\t\t\t\tsocket.log(chalk.green(\"joined\"), room);\r\n\t\t\t});\r\n\r\n\t\t\t//socket wants to leave a room\r\n\t\t\tsocket.on(ACTION_TYPE.LEAVE_ROOM, ({room}) => {\r\n\t\t\t\tsocket.broadcastToRoom(ACTION_TYPE.LEFT_ROOM, {\r\n\t\t\t\t\tuser: socket.user\r\n\t\t\t\t});\r\n\t\t\t\tsocket.leaveAllRooms();\r\n\t\t\t});\r\n\r\n\t\t\t//socket sent a chat message\r\n\t\t\tsocket.on(ACTION_TYPE.ADD_CHAT_MESSAGE, message => {\r\n\t\t\t\tdb.addChatMessage(socket.currentRoom, message).catch(console.error.bind());\r\n\t\t\t\tsocket.broadcastToRoom(ACTION_TYPE.ADD_CHAT_MESSAGE, {\r\n\t\t\t\t\tmessage\r\n\t\t\t\t});\r\n\t\t\t});\r\n\r\n\t\t\tsocket.on(ACTION_TYPE.OWN_NICK_CHANGE, nick => {\r\n\t\t\t\tsocket.broadcastToRoom(ACTION_TYPE.NICK_CHANGE, {\r\n\t\t\t\t\tuser: {\r\n\t\t\t\t\t\told: socket.nick,\r\n\t\t\t\t\t\tnew: nick\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\tsocket.nick = nick;\r\n\t\t\t});\r\n\r\n\t\t\tsocket.on(\"disconnect\", () => {\r\n\t\t\t\tsocket.broadcastToRoom(ACTION_TYPE.LEFT_ROOM, {\r\n\t\t\t\t\tuser: socket.user\r\n\t\t\t\t});\r\n\t\t\t\tthis.sockets.delete(socket);\r\n\t\t\t\tsocket.log(STRINGS.DISCONNECTED);\r\n\t\t\t});\r\n\r\n\t\t\tsocket.on(\"error\", err => {\r\n\t\t\t\tsocket.log(STRINGS.ERROR, err);\r\n\t\t\t});\r\n\t\t});\r\n\t}", "function init(options) {\n options = options || {}\n var port = options.port || 6466\n global.client = global.client || socketIOClient(`http://localhost:${port}`)\n client = global.client\n log.debug(`Started global js socketIO client for ${process.env.ADAPTER} at ${port}`)\n client.emit('join', ioid) // first join for serialization\n client.on('disconnect', client.disconnect)\n client.on('take', hasher.handle) // add listener\n \n // add methods\n client.pass = pass\n client.clientPass = clientPass\n return client\n}", "function Factory(io, uri, opts) {\n opts = opts || {};\n if (!io.protocol || !io.connect ) {\n throw Error('Please include socket.io client.');\n }\n return new Manager(io, uri, opts);\n}", "constructor () {\r\n // run super\r\n super ();\r\n\r\n // bind methods\r\n this.room = this.room.bind (this);\r\n this.user = this.user.bind (this);\r\n this.emit = this.emit.bind (this);\r\n this.session = this.session.bind (this);\r\n\r\n // setup redis conn\r\n let conn = config.get ('redis');\r\n\r\n // add key\r\n conn.key = config.get ('domain') + '.socket';\r\n }", "function Server( config ){\n\t\tvar io = this.io = config.socketServer;\n\t\tvar s = this;\n\t\t\n\t\tio.set( \"log level\", 1 );\n\t\tio.sockets.on( \"connection\", function( socket ) { s.onConnection( socket ); } );\n\t\t\n\t\tthis.eventHandlers = {};\n\t\tthis.activeNicknames = {};\n\t\tthis.activeAddresses = {};\n\t\t\n\t\tthis.maxSlots = config.slots;\n\t\tthis.usedSlots = 0;\n\t\t\n\t\tthis.oneUserPerIp = config.oneUserPerIp;\n\t\tthis.world = config.world;\n\t\tthis.log = config.log || function(){};\n\t\t\n\t\tconfig.spawnProtection = config.spawnProtection || {};\n\t\tthis.spawnProtection = config.spawnProtection.enabled;\n\t\tthis.spawnProtectionRadius = config.spawnProtection.radius || 10;\n\t}", "function SocketService($http, config, $q, localStorageService) {\n\n var service = {\n socket: null,\n\n connect: connect,\n getMsgs: getMsgs,\n getRoomInfo: getRoomInfo,\n joinRoom: joinRoom,\n submitMsg: submitMsg,\n propagateProfPage: propagateProfPage,\n getProfPageChange: getProfPageChange,\n getAnnotationMsg: getAnnotationMsg,\n propagateAnnotationAdded: propagateAnnotationAdded\n };\n\n return service;\n\n ///////////////\n\n /**\n * Connects to die sails.io.js WebSocket.\n */\n function connect() {\n var q = $q.defer();\n\n try {\n service.socket = io.connect(config.socketUrl);\n q.resolve();\n }\n catch(err) {\n q.reject();\n }\n\n return q.promise;\n }\n\n function getMsgs(cb) {\n service.socket.on('room:message', function(msgObj) {\n msgObj.type = 'msg';\n cb(msgObj);\n });\n }\n\n function getProfPageChange(cb) {\n service.socket.on('pdf:profpage', function(page) {\n cb(page);\n });\n }\n\n /**\n * Request all users from the specified room.\n * @param {int} roomId [Database room id]\n * @param {function} cb [Callback: user-array]\n */\n function getRoomInfo(roomId, cb) {\n // make request\n service.socket.emit('room:info', roomId);\n\n // wait for answers\n service.socket.on('room:info', function(userArray) {\n return cb(userArray);\n });\n }\n\n function getAnnotationMsg(cb) {\n service.socket.on('room:annotation', function(annotations) {\n cb(annotations);\n });\n };\n\n /**\n * Joins the room identified by its database id.\n * @param {int} roomId [Database room id]\n */\n function joinRoom(roomId) {\n service.socket.emit('room:join', roomId);\n }\n\n /**\n * Submits a msg to the the socket.\n * @param {string} msg [Message string]\n */\n function submitMsg(msg) {\n service.socket.emit('room:message', msg);\n }\n\n\n /**\n * Tells everyone which page the prof is on\n */\n function propagateProfPage(page) {\n service.socket.emit('pdf:profpage', page);\n }\n\n function propagateAnnotationAdded(annotation) {\n service.socket.emit('room:annotation', annotation);\n }\n\n }", "async function init() {\n console.log(chalk.bold.cyan('Starting osu!autoref'));\n await initPool();\n console.log(chalk.bold.green('Loaded map pool!'));\n console.log(chalk.cyan('Attempting to connect...'));\n \n try {\n await client.connect();\n console.log(chalk.bold.green(\"Connected to Bancho!\"));\n channel = await client.createLobby(`${match.tournament}: ${match.teams[BLUE].name} vs ${match.teams[RED].name}`);\n } catch (err) {\n console.log(err);\n console.log(chalk.bold.red(\"Failed to create lobby\"));\n process.exit(1);\n }\n\n lobby = channel.lobby;\n\n const password = Math.random().toString(36).substring(8);\n await lobby.setPassword(password);\n await lobby.setMap(1262832); //hitorigoto dayo\n\n console.log(chalk.bold.green(\"Lobby created!\"));\n console.log(chalk.bold.cyan(`Name: ${lobby.name}, password: ${password}`));\n console.log(chalk.bold.cyan(`Multiplayer link: https://osu.ppy.sh/mp/${lobby.id}`));\n console.log(chalk.cyan(`Open in your irc client with \"/join #mp_${lobby.id}\"`));\n\n lobby.setSettings(bancho.BanchoLobbyTeamModes.TeamVs, bancho.BanchoLobbyWinConditions.ScoreV2);\n\n createListeners();\n}", "function setupSocket(){\n\t\tvar pos = {\n\t\t\tx: Math.floor(Math.random()*451),\n\t\t\ty: Math.floor(Math.random()*451),\n\t\t};\n\n\t\tvar color = {\n\t\t\tr: Math.floor(Math.random()*256),\n\t\t\tg: Math.floor(Math.random()*256),\n\t\t\tb: Math.floor(Math.random()*256)\n\t\t};\n\n\t\tuser.pos = pos;\n\t\tuser.radius = 20;\n\t\tuser.color = color;\n\t\tuser.hit = 0;\n\n\t\tsocket.emit('join', {\n\t\t\tname: user.name,\n\t\t\tpos: pos,\n\t\t\tradius: 20,\n\t\t\tcolor: color,\n\t\t\thit: 0,\n\t\t\tscore: 0,\n\t\t});\n\n\t\t// get other clients data from server\n\t\tsocket.on('initData', function(data){\n\t\t\tplayers = data.players;\n\t\t\tarrayBullets = data.arrayBullets;\n\t\t});\n\n\t\t// updates player movements & bullets\n\t\tsocket.on('update', function(data){\n\t\t\tplayers = data.players;\n\t\t\tarrayBullets = data.arrayBullets;\n\t\t\tdraw();\n\t\t});\n\t}", "Sockets() {\n this.io = socketIo(this.server);\n let sockets = new Socket_1.Socket(this.io);\n }", "registerListeners(){\n this.io.on('connection', socket => {\n this.App.debug(\"Client connected\", this.prefix);\n\n this.registerSocketListener(socket, 'send-message', data => {\n this.App.MessageOrm.getByChatName({chatName: data.room}, (err, rows) => {\n if (err) return this.App.throwErr(err, this.prefix);\n if (rows) rows.forEach(row => row.userId = this.App.serializeSalt(row.userId));//Serialize userId\n this.send(this.io.sockets, 'get-message', rows)\n })\n });\n\n this.registerSocketListener(socket, 'refresh', data => {\n this.App.MessageOrm.getByChatName({chatName: data.room}, (err, rows) => {\n if (err) return this.App.throwErr(err, this.prefix);\n if (rows) rows.forEach(row => row.userId = this.App.serializeSalt(row.userId));//Serialize userId\n this.send(this.io.sockets, 'refresh', rows)\n })\n })\n })\n }", "function init (log) {\n// Establish update loop\n const digest = createDigest(io.sockets)\n Observable.timer(0, 15).subscribe(() => {\n eventBus.put('updateAll', {})\n digest.send()\n })\n\n // Set up handlers to consume events from the bus and update the digest\n eventHandlers.forEach(([name, handler]) => {\n eventBus.get(name).subscribe(handler(digest))\n })\n\n // We will process these events when a client sends them\n const clientEvents = ['updateDirection']\n\n // configure websockets\n io.on('connection', socket => {\n socket.on('disconnect', () => {\n log(`User ${player.id} disconnected.`)\n eventBus.put('remove', {\n id: player.id\n })\n })\n\n // create a new player\n const player = saveBlob(createBlob(100, 100, 100))\n log(`User ${player.id} connected.`)\n\n // initialize the client\n socket.emit('initialize', {\n id: player.id,\n location: player.location,\n size: player.size,\n blobs: blobs\n })\n\n // route known events coming in on this socket to the main event bus\n clientEvents.forEach(type => socket.on(type, data => {\n eventBus.put(type, data)\n }))\n\n // let the world know what just happened!\n eventBus.put('newPlayer', player)\n })\n\n // Some error handling. It's unlikely that these will occur but when they do we want\n // to know about it.\n io.on('connect_error', data => {\n log('connect error!', data)\n })\n\n io.on('connect_timeout', () => {\n log('connect timeout!')\n })\n\n io.on('error', data => {\n log('error!', data)\n })\n\n return server\n}", "function initializeSocket(http) {\n socketIO = require(\"socket.io\")(http);\n}", "createMultiplayerIO() {\n\n\t\tthis.socket.on(\"pong\", (pingTimestamp) => {\n\t\t\tvar pongTimestamp = Date.now();\n\t\t\tvar ping = pongTimestamp - pingTimestamp;\n\t\t\tthis.events.emit('ping', ping);\n\t\t});\n\n\t\tthis.otherPlayers = this.physics.add.group();\n\n\t\tthis.socket.on('currentPlayers', function (data) {\n\t\t\tthis.createAllPlayers(data.players);\n\t\t}.bind(this));\n\n\t\tthis.socket.on('newPlayer', function (data) {\n\t\t\tthis.addOtherPlayers(data.players);\n\t\t}.bind(this));\n\n\t\tthis.socket.on('disconnectPlayer', function (playerId) {\n\t\t\tif (!this.sys.isActive()) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar players = this.otherPlayers.getChildren();\n\t\t\tvar player = players[this.playerIdMapping[playerId]]\n\t\t\tplayer.destroy();\n\t\t\tthis.state.noPlayers -= 1;\n\n\t\t}.bind(this));\n\n\t\tthis.socket.on('playerMoved', function (playerInfo) {\n\t\t\tif (!this.sys.isActive()) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar players = this.otherPlayers.getChildren();\n\t\t\tvar player = players[this.playerIdMapping[playerInfo.playerId]]\n\t\t\tplayer.setPosition(playerInfo.x, playerInfo.y);\n\n\t\t\t// Player movement; Velocity given in pixel per second\n\t\t\tif (this.playAnimation) {\n\t\t\t\tswitch (playerInfo.direction) {\n\t\t\t\t\tcase 'left':\n\t\t\t\t\t\tplayer.anims.play('left', true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'right':\n\t\t\t\t\t\tplayer.anims.play('right', true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'up':\n\t\t\t\t\t\tplayer.anims.play('up', true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'down':\n\t\t\t\t\t\tplayer.anims.play('down', true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tplayer.anims.play('idle', true);\n\t\t\t\t}\n\t\t\t}\n\t\t}.bind(this));\n\n\t\tthis.socket.on('startGame', function (gameInfo) {\n\t\t\tthis.scene.stop('LobbyScene');\n\t\t\tthis.state.virusID = gameInfo.virusID;\n\n\t\t\t// start UI scene\n\t\t\tthis.scene.launch(\"UIScene\");\n\t\t\t// start Game\n\t\t\tthis.scene.start('WorldScene', { socket: this.socket, players: gameInfo.players, state: this.state, noTasks: gameInfo.noTasks })\n\t\t}.bind(this));\n\t}", "function socketListeners(){\n\tsocket.on('joined',function(){\n\t\tuser.success();\n\t});\n\tsocket.on('exists',function(err){\n\t\tuser.error(err);\n\t});\n\tsocket.on('roomList',function(roomlist){\n\t\tchatRoom.populate(roomlist);\n\t});\n}", "newRoom(roomId) {\r\n\t\tlet room = new ServerRoom(roomId);\r\n\t\tthis.rooms[room.id] = room;\r\n\t\treturn room;\r\n\t}", "function init(){\r\n\tsocket = io();\r\n\tsocket.emit(\"startmeup\");\r\n\tsocket.on(\"displayName\",function(name){\r\n\t\tdisplayName(name);\r\n\t});\r\n\t\r\n\t//Get questions from the server\r\n\tsocket.on(\"initialize\",function(questions){\r\n\t\tloadQuestions(questions);\r\n\t});\r\n\t\r\n\t//Load the chat\r\n\tsocket.on(\"loadChat\",function(messages){\r\n\t\tchat(messages);\r\n\t});\r\n\t\r\n\t//Diplay the player's name\r\n\tsocket.on(\"yourname\",function(name){\r\n\t\tdocument.getElementById(\"playername\").innerHTML = \"Username: \" + name;\r\n\t})\r\n\t\r\n\t//Load new message from player\r\n\tsocket.on(\"loadMessage\",function(messages){\r\n\t\tloadMessage(messages);\r\n\t});\r\n\t\r\n\t//Update the scoreboard\r\n\tsocket.on(\"updateScoreboard\",function(scores){\r\n\t\tupdateScoreboard(scores);\r\n\t})\r\n\t\r\n\t//Load next question\r\n\tsocket.on(\"nextQuestion\",function(question){\r\n\t\tloadQuestions(question);\r\n\t})\r\n\t\r\n\t//Display winner onscreen\r\n\tsocket.on(\"winner\",function(name){\r\n\t\tdisplayWinner(name);\r\n\t})\r\n\t\r\n\t//Change player's name colour if they have answered\r\n\tsocket.on(\"hasAnswered\",function(name){\r\n\t\tdocument.getElementById(name).style.color = \"green\";\r\n\t})\r\n\t\r\n\t//Load private message\r\n\tsocket.on(\"privateMessage\",function(incoming){\r\n\t\tloadPrivateMessage(incoming);\r\n\t})\r\n\t\r\n\t//Kick player out and alert them that they've been kicked\r\n\tsocket.on(\"kickedOut\",function(){\r\n\t\talert(\"You've been kicked from the game!\");\r\n\t\tsocket.emit(\"kickMe\");\r\n\t})\r\n\t\r\n\t//Display current question number\r\n\tsocket.on(\"whichRound\", function(round){\r\n\t\tlet curRound = document.getElementById(\"roundnumber\");\r\n\t\tcurRound.innerHTML = \"Question: \" + round;\r\n\t})\r\n}", "constructor(scene){\n this.game = scene;\n var ioUrl = (PRODUCTION)? window.location.href : \"localhost:8080\";\n this.socket = io.connect(ioUrl);\n var self = this;\n\n this.socket.on('newplayer', function(data){\n console.log(\"newplayer:\"+data.id);\n self.game.addPlayer(data.id, data.x, data.y, data.health, data.name);\n });\n\n this.socket.on('newenemyplayer', function(data){\n console.log(\"newenemyplayer:\"+data.id);\n self.game.addNewPlayer(data.id, data.x, data.y, data.health, data.name);\n });\n\n this.socket.on('allplayers', function(data){\n console.log(data);\n for(var i = 0; i<data.length; i++){\n self.game.addNewPlayer(data[i].id, data[i].x, data[i].y, data[i].health, data[i].name);\n }\n });\n\n this.socket.on('pong', function(ms){\n console.log(ms+\"ms\")\n })\n\n // this.socket.on('move', function(data){\n // self.game.movePlayer(data.id, data.x, data.y);\n // });\n this.socket.on(\"gameState\", function(pack){\n self.game.updateState(pack);\n })\n\n this.socket.on('remove', function(id){\n self.game.removePlayer(id);\n })\n\n this.askNewPlayer = function(name){\n this.socket.emit('newplayer', name);\n };\n\n this.moveUp = function(){\n this.socket.emit('moveUp');\n }\n this.moveDown = function(){\n this.socket.emit('moveDown');\n }\n this.moveLeft = function(){\n this.socket.emit('moveLeft');\n }\n this.moveRight = function(){\n this.socket.emit('moveRight');\n }\n\n this.shoot = function(pointer){\n this.socket.emit(\"shoot\", pointer);\n }\n\n this.dash = function(pointer){\n this.socket.emit(\"dash\", pointer);\n }\n\n this.chat = function(message){\n this.socket.emit('chat', message);\n }\n\n this.restart = function(){\n this.socket.emit('restart');\n }\n\n this.socket.on('recieveChat', function(chat){\n self.game.chat.receiveMessage(chat.name, chat.message);\n })\n }", "_createRoom(socketId, topic) {\n return {\n id: UUID(),\n users: [socketId],\n topic\n }\n }", "function createRoom(){\n roomToken = random()\n roomsRegistry[roomLabel].notFull[roomToken] = {clients:[],limit:roomLimit}\n roomsRegistry[roomLabel].notFull[roomToken].clients.push(clientId)\n }", "constructor(socket, nickname, lobby) \n {\n this.socket = socket;\n this.nickname = nickname;\n this.lobby = lobby;\n this.room = null;\n\n // Wait for the user to get a nickname before listening for\n // other events.\n waitForNickname(this);\n }", "function initSocket(socket) {\n let id;\n // proxyMethods('socket-' + (socketNo + 1), socket)\n const registerOrIdentify = async (data) => {\n // id = await users.create(socket, data);\n const roomName = data.room\n id = await users.create(socket, data);\n console.log(\"REG OR IDENTIFY\", roomName)\n if (!roomName || roomName === 'undefined') return\n if (!rooms.exists(roomName)) {\n rooms.create(roomName)\n }\n rooms.join(roomName, data.id)\n // rooms.computeCascade(roomName)\n // console.log(\"Send to members\", rooms.members(roomName))\n rooms.sendToMembers(roomName, 'members', { members: rooms.members(roomName) })\n }\n\n const doIdentify = () => {\n\n socket.emit('identify')\n .on('identified', async (data) => {\n console.log(\"identified client\", data.id, data.name)\n registerOrIdentify(data)\n })\n }\n\n const timeoutIdentify = setTimeout(doIdentify, 1)\n socket.on('init', () => clearTimeout(timeoutIdentify))\n socketNo++\n console.log(`Socket # ${socketNo} initialized`)\n socket\n .on('init', async (data) => {\n // console.log(\"init message received with\", data)\n id = await users.create(socket, data);\n console.log(\"Sending id\", id)\n socket.emit('init', { id });\n })\n\n .on('peerconnect', (data) => {\n console.log('peerconnect', data.trackNo, data.room, data.from, data.friend, JSON.stringify(data.details))\n // rooms.next()\n })\n // .on('cascade', async (data) => {\n // console.log(\"GOT CASCADE\")\n // // doConnect(data.room)\n // })\n .on('relay', (data) => {\n // console.log(\"Relay \", data.op, \"from\", id, \"to\", data.to)\n //sendToReceiver(data.to, data.op, data);\n\n const receiver = users.getReceiver(data.to);\n if (receiver) {\n receiver.emit(data.op, data);\n } else {\n socket.emit('relayError', data)\n }\n })\n .on('register', async (data) => {\n registerOrIdentify(data)\n })\n .on('debug', (message) => { console.log(\"debug\", message) })\n .on('joincall', (data) => {\n // console.log(\"joincall\", data)\n // data.from = id\n //sendToReceiver(data.responder,'joincall', data);\n\n const receiver = users.getReceiver(data.responder);\n if (receiver) {\n receiver.emit('joincall', data);\n }\n })\n .on('call', (data) => {\n // const keys = Object.keys(data)\n // console.log(\"call message\", { to: data.to, from: id, keys })\n //sendToReceiver(data.id, 'call', { ...data, from: id });\n const receiver = users.getReceiver(data.to);\n if (receiver) {\n receiver.emit('call', { ...data, from: id });\n } else {\n socket.emit('failed');\n }\n })\n .on('end', (data) => {\n // if (version) {\n // rooms.clearRoom(users.getRoom(id))\n // }\n // sendToReceiver(data.id, 'end', { from: id });\n const receiver = users.getReceiver(data.to);\n if (receiver) {\n receiver.emit('end', { from: id });\n }\n })\n .on('disconnect', () => {\n const roomName = users.getRoom(id)\n rooms.leave(roomName, id)\n users.remove(id);\n console.log(id, 'disconnected');\n rooms.sendToMembers(roomName, 'members', {\n members: rooms.members(roomName)\n // , cascade: rooms.cascade(roomName)\n })\n })\n}", "_constructSocketListeners () {\n /* Handles our open event */\n this._ws.addEventListener('open', evt => {\n setInterval(() => {\n this._sendArray([{ m: '+ls' }])\n }, this._roomScanMS)\n this._isConnected = true\n this._sendArray([{ m: 'hi' }])\n this._heartbeatInterval = setInterval(() => {\n this._sendArray([{ m: 't', e: Date.now() }])\n }, this._heartbeatMS)\n this.emit('connected')\n this.setChannel('lobby')\n this._noteFlushInterval = setInterval(() => {\n if (this._noteBufferTime && this._noteBuffer.length > 0) {\n this._sendArray([{ m: 'n', t: this._noteBufferTime + this._serverTimeOffset, n: this._noteBuffer }])\n this._noteBufferTime = 0\n this._noteBuffer = []\n }\n }, this._noteFlushIntervalMS)\n })\n\n /* Handles our close event */\n this._ws.addEventListener('close', evt => {\n clearInterval(this._heartbeatInterval)\n clearInterval(this._noteFlushInterval)\n if (!this.hasErrored) this.emit('disconnected')\n })\n\n /* Handles our errors */\n this._ws.addEventListener('error', error => {\n if (error.message === 'WebSocket was closed before the connection was established') return\n this.emit('error', new Error(error))\n this._ws.close()\n })\n\n /* Handles generic messages */\n this._ws.addEventListener('message', evt => {\n if (typeof evt.data !== 'string') return\n try {\n const transmission = JSON.parse(evt.data)\n for (var i = 0; i < transmission.length; i++) {\n var msg = transmission[i]\n if (msg.m === 'hi') {\n this._recieveServerTime(msg.t, msg.e || undefined)\n }\n if (msg.m === 't') {\n this._recieveServerTime(msg.t, msg.e || undefined)\n }\n if (msg.m === 'a') {\n this.emit('message', {\n content: msg.a,\n user: {\n id: msg.p.id,\n name: msg.p.name,\n color: msg.p.color\n },\n time: msg.t\n })\n }\n if (msg.m === 'ch') {\n this.room.name = msg.ch._id\n this._channelHasJoined = true\n if (this.room.users.length !== 0) return\n msg.ppl.forEach(person => {\n this.room.users.push({\n id: person.id,\n name: person.name,\n color: person.color\n })\n })\n }\n if (msg.m === 'p') {\n const formattedUser = {\n id: msg.id,\n name: msg.name,\n color: msg.color\n }\n this.emit('userJoined', formattedUser)\n this.room.users.push(formattedUser)\n }\n if (msg.m === 'bye') {\n const user = this.room.users.filter(e => e.id === msg.p)[0]\n this.room.users = this.room.users.filter(e => e.id !== msg.p)\n this.emit('userLeave', user)\n }\n if (msg.m === 'ls') {\n this.rooms = []\n msg.u.forEach(room => {\n this.rooms.push({\n name: room._id,\n count: room.count\n })\n })\n this._sendArray([{ m: '-ls' }])\n }\n if (msg.m === 'n') {\n this.emit('notePress', {\n note: msg.n,\n user: msg.p\n })\n }\n }\n } catch (error) {\n this.emit('error', error)\n }\n })\n }", "function initializeSocketIO(httpServer) {\n let io = require('socket.io')(httpServer);\n\n //------------------------------------------------------------------\n //\n // Notifies the already connected clients about the arrival of this\n // new client. Plus, tell the newly connected client about the\n // other players already connected.\n //\n //------------------------------------------------------------------\n function notifyConnect(socket, newPlayer) {\n for (let clientId in activeClients) {\n let client = activeClients[clientId];\n if (newPlayer.clientId !== clientId) {\n //\n // Tell existing about the newly connected player\n client.socket.emit('message', {\n type: 'connect-other',\n clientId: newPlayer.clientId,\n momentum: newPlayer.momentum,\n direction: newPlayer.direction,\n position: newPlayer.position,\n rotateRate: newPlayer.rotateRate,\n thrustRate: newPlayer.thrustRate,\n size: newPlayer.size\n });\n\n //\n // Tell the new player about the already connected player\n socket.emit('message', {\n type: 'connect-other',\n clientId: client.player.clientId,\n momentum: client.player.momentum,\n direction: client.player.direction,\n position: client.player.position,\n rotateRate: client.player.rotateRate,\n thrustRate: client.player.thrustRate,\n size: client.player.size\n });\n }\n }\n }\n\n //------------------------------------------------------------------\n //\n // Notifies the already connected clients about the disconnect of\n // another client.\n //\n //------------------------------------------------------------------\n function notifyDisconnect(playerId) {\n for (let clientId in activeClients) {\n let client = activeClients[clientId];\n if (playerId !== clientId) {\n client.socket.emit('message', {\n type: 'disconnect-other',\n clientId: playerId\n });\n }\n }\n }\n \n io.on('connection', function(socket) {\n console.log('Connection established: ', socket.id);\n // Create an entry in our list of connected clients\n let newPlayer = Player.create(missilesHandler,asteroidsHandler,ufosHandler,socket.id)\n newPlayer.clientId = socket.id;\n activeClients[socket.id] = {\n socket: socket,\n player: newPlayer\n };\n socket.emit('message', {\n type: 'connect-ack',\n momentum: newPlayer.momentum,\n direction: newPlayer.direction,\n position: newPlayer.position,\n size: newPlayer.size,\n rotateRate: newPlayer.rotateRate,\n thrustRate: newPlayer.thrustRate\n });\n\n socket.on('input', data => {\n inputQueue.push({\n clientId: socket.id,\n message: data,\n receiveTime: present()\n });\n });\n\n socket.on('disconnect', function() {\n delete activeClients[socket.id];\n notifyDisconnect(socket.id);\n });\n\n notifyConnect(socket, newPlayer);\n informNewClientAboutExistingAsteroids(socket);\n informNewClientAboutExistingUFOs(socket);\n informNewClientAboutExistingMissiles(socket);\n informNewClientAboutExistingPowerups(socket);\n });\n}", "function hostCreateNewGame() {\n // Create a unique Socket.IO Room\n var thisGameId = ( Math.random() * 100000 ) | 0;\n var gameObj = {playerCount: 0, gameId: thisGameId, readyCount: 0, hintGiver: 0};\n games.push(gameObj);\n // Return the Room ID (gameId) and the socket ID (mySocketId) to the browser client\n this.emit('newGameCreated', {gameId: thisGameId, mySocketId: this.id});\n //console.log(this.id.toString());\n //console.log(thisGameId.toString());\n // Join the Room and wait for the players\n this.join(thisGameId.toString());\n}", "function Messenger () {\n\n this.register = (listener) => {\n\n io = require('socket.io')(listener);\n\n io.on('connection', function(socket){\n logger.debug('user connected', socket.id);\n\n sockets[socket.id] = socket;\n _.assign(socket, {\n name: 'Anonymous',\n ready: false,\n loser: false,\n room: false\n });\n\n socket.on('disconnect', function(){\n\n socket.leave(socket.room);\n\n logger.debug('user disconnected', reduceSocketInfo(socket));\n sendUpdate(socket);\n });\n\n socket.on('join', function(data){\n\n if (socket.lastRoom) {\n socket.leave(socket.lastRoom);\n socket.lastRoom = null;\n }\n _.assign(socket, data);\n socket.join(socket.room);\n socket.lastRoom = socket.room;\n\n logger.debug(`${socket.name} joined ${socket.room}`);\n sendUpdate(socket);\n });\n\n socket.on('leave', function(data){\n\n socket.leave(socket.room);\n socket.ready = false;\n\n logger.debug(`${socket.name} left ${socket.room}`);\n sendUpdate(socket);\n });\n\n socket.on('ready', function(data){\n\n if (data.name && data.name !== 'Anonymous') {\n socket.name = data.name;\n }\n socket.ready = true;\n\n const allPlayers = socketsInRoom(socket.room);\n\n const readyPlayers = allPlayers.filter(i => i.ready);\n\n logger.debug(`${socket.name} in ${socket.room} is ready`);\n sendUpdate(socket);\n\n if (readyPlayers.length === allPlayers.length) {\n logger.debug(`${socket.room} is starting a game`);\n\n io.sockets.in(socket.room)\n .emit('start', 'YEAH');\n }\n });\n\n socket.on('loser', function(){\n logger.debug(`${socket.name} in ${socket.room} has lost`);\n\n socket.loser = true;\n socket.ready = false;\n checkWinner();\n });\n\n socket.on('play-again', function(){\n logger.debug(`${socket.name} in ${socket.room} is playing again`);\n\n _.assign(socket, {\n ready: false,\n loser: false\n });\n\n sendUpdate(socket);\n });\n\n function checkWinner() {\n const allPlayers = socketsInRoom(socket.room);\n const stillStanding = allPlayers.filter(i => !i.loser);\n\n logger.debug(`${stillStanding} in ${socket.room} are left`);\n\n if (stillStanding.length === 1) {\n const winner = reduceSocketInfo(stillStanding[0])[0];\n logger.debug(`${winner.name} in ${socket.room} has won`);\n io.sockets.in(socket.room)\n .emit('gameover', {\n winner: winner\n })\n } else if (stillStanding.length === 0) {\n io.sockets.in(socket.room)\n .emit('gameover', {\n draw: true\n })\n }\n _.each(allPlayers, i => i.ready = false)\n }\n\n\n });\n\n }\n\n}", "function initialize(io) { \n\n\t////////////////////////////////////////////////////////////\n\t// Connection received\n\t////////////////////////////////////////////////////////////\n\tio.on('connection', function(socket) {\n\n\t\t// First, create a player session for this connection.\n\t\tvar playerSession = new PlayerSession(socket);\n\n\t\t////////////////////////////////////////////////////////////\n\t\t// Attempt to connect to a map.\n\t\t////////////////////////////////////////////////////////////\n\t\tsocket.on('mapconnect', function(data) {\n\n\t\t\tconsole.log(data);\n\n\t\t\t// Let's see if there are any existing map servers for this map?\n\t\t\t// We don't spin up a map server until we need one, and we shut down map servers that are empty.\n\t\t\t// TODO: Actually shut down empty map servers.\n\t\t\tif (typeof mapServers[data.MapId] === 'undefined') {\n\n\t\t\t\t// Spin up a server if we don't already have one.\n\t\t\t\tmapServers[data.MapId] = new MapServer(data.MapId);\n\n\t\t\t}\n\n\t\t\t// Finish logging in the player.\n\t\t\tplayerSession.Login(data.Token);\n\n\t\t\t// Register this user with that map server.\n\t\t\tmapServers[data.MapId].RegisterPlayerSession(playerSession);\n\t\t});\n\n\t});\n\n}", "function netsetup(url)\n{\n\n username = window.prompt(\"Ingresa tu nombre\");\n\n socket = io();\n\n console.log(local);\n\n var sdata = {\n x: local.pos.x,\n y: local.pos.y,\n r: local.radius,\n cr: red(local.color),\n cg: green(local.color),\n cb: blue(local.color),\n name: username\n };\n\n\n socket.on(\"getdata\", function() {\n socket.emit(\"start\", sdata);\n });\n\n socket.on(\"heartbeat\", function(data) {\n players = data;\n });\n\n socket.on(\"createfood\", function(data) {\n food.push(new Food(data.x, data.y));\n });\n\n socket.on(\"removefood\", function(data) {\n console.log(\"Remove food \" + data.index + \" at \" + food[data.index].pos.x + \",\" + food[data.index].pos.y);\n food.splice(data.index, 1);\n });\n\n socket.on(\"clearfood\", function() {\n food = [];\n });\n\n socket.on(\"kill\", function() {\n alert(\"You died\");\n location.reload();\n socket.disconnect();\n });\n\n socket.on(\"setup\", function(data) {\n mapsize = data.mapsize;\n bounds.x = -mapsize;\n bounds.y = -mapsize;\n bounds.w = mapsize*2;\n bounds.h = mapsize*2;\n done = true;\n });\n\n socket.on(\"reload\", function() {\n location.reload();\n });\n}", "function socketIOinit(io)\n{\n console.log(\"running on port\");\n //python client connects\n io.on('connection',function(socket){\n // socketListeners\n // call this immediately on PC client\n socket.on('registerListener',function(data){\n console.log(\"uid: \" + data['UID']);\n var uuid = data['UID'];\n if (!socketListeners[uuid]) {\n socketListeners[uuid] = [];\n }\n socketListeners[uuid].push(socket);\n });\n\n socket.on('reqFiles',function(data){\n var client = data[\"client\"];\n var dir = data[\"dir\"];\n var file = data[\"file\"];\n console.log(\"req files\");\n requestFilesFromClient(file, dir, client, socket);\n });\n\n socket.on(\"reqEncrypt\",function(data){\n var client = data[\"client\"];\n console.log(\"req encrypt\");\n encrypt(client);\n });\n\n socket.on(\"reqDecrypt\",function(data){\n var client = data[\"client\"];\n console.log(\"req decrypt\");\n decrypt(client);\n });\n\n socket.on(\"reqKeylog\",function(data){\n var client = data[\"client\"];\n console.log(\"req keylog\");\n keylog(client,socket);\n });\n\n socket.on(\"reqWebcam\",function(data){\n var client = data[\"client\"];\n console.log(\"req webcam\");\n webcam(client,socket);\n });\n\n socket.on(\"reqScreenshot\",function(data){\n var client = data[\"client\"];\n console.log(\"req screenshot\");\n screenshot(client,socket);\n });\n\n socket.on(\"reqTTS\",function(data){\n var client = data[\"client\"];\n var text = data[\"text\"];\n console.log(\"req tts\");\n tts(client,text);\n });\n\n });\n}", "function initializeSocketIO(http) {\n\n io = require('socket.io')(http);\n\n function runCountdown() {\n var target_date = new Date().getTime() + (10*1000);\n var seconds, pastSeconds = 0;\n // update the tag with id \"countdown\" every 1 second\n var refresh = setInterval(function () {\n\n // find the amount of \"seconds\" between now and target\n var current_date = new Date().getTime();\n var seconds_left = (target_date - current_date + 1) / 1000;\n seconds = parseInt(seconds_left % 60);\n\n if (pastSeconds !== seconds) {\n io.emit('start game', seconds.toString());\n pastSeconds = seconds;\n }\n if (seconds === 0){\n io.emit('start game', 'countdown finished');\n clearInterval(refresh);\n reconnection = true;\n gameTime = 10 * 60;\n placePickups();\n livingPlayers = connections;\n gameInProgress = true;\n }\n }, 1000);\n }\n\n function notifyConnect(socket, newUser) {\n for (let clientId in activeUsers) {\n let client = activeUsers[clientId];\n if (newUser.userId !== clientId) {\n // Tell existing about the newly connected player\n client.socket.emit(NetworkIds.CONNECT_OTHER, {\n userId: newUser.userId,\n orientation: newUser.orientation,\n });\n\n // Tell the new player about the already connected player\n socket.emit(NetworkIds.CONNECT_OTHER, {\n userId: client.user.userId,\n orientation: client.user.orientation,\n });\n }\n }\n }\n\n function notifyReconnect(socket, newUser) {\n activeUsers[newUser.userId].socket.emit(NetworkIds.RECONNECT_SELF, {\n clientId: newUser.clientId,\n lastMessageId: activeUsers[newUser.userId].lastMessageId,\n orientation: activeUsers[newUser.userId].user.orientation,\n worldView: activeUsers[newUser.userId].user.worldView,\n userId: newUser.userId\n });\n\n for (let clientId in activeUsers) {\n let client = activeUsers[clientId];\n if (newUser.userId !== clientId) {\n // Tell existing about the newly connected player\n client.socket.emit(NetworkIds.RECONNECT_OTHER, {\n clientId: newUser.clientId,\n lastMessageId: newUser.lastMessageId,\n orientation: newUser.orientation,\n worldView: newUser.worldView,\n userId: newUser.userId\n });\n\n // Tell the new player about the already connected player\n socket.emit(NetworkIds.RECONNECT_OTHER, {\n clientId: clientId,\n lastMessageId: client.lastMessageId,\n orientation: client.user.orientation,\n worldView: client.user.worldView,\n userId: client.user.userId\n });\n }\n }\n }\n\n io.on('connection', function(socket){\n socket.on('join', function(data){\n //console.log(data.name + ' with id ' + socket.id + ' connected');\n if(reconnection) {\n if(typeof activeUsers[data.name] !== 'undefined') {\n activeUsers[data.name].dead = false;\n activeUsers[data.name].socket = socket;\n activeUsers[data.name].id = socket.id;\n activeUsers[data.name].user.clientId = socket.id;\n notifyReconnect(socket, activeUsers[data.name].user);\n io.sockets.sockets[socket.id].emit('start game', \"player reconnect\");\n io.emit('chat message',data.name + ' has rejoined the game.');\n } else {\n io.emit('chat message', \"Game already in progress.\")\n }\n } else {\n io.emit('chat message',data.name + ' has joined the game.');\n let newUser = User.makeplayer();\n newUser.clientId = socket.id;\n newUser.userId = data.name;\n activeUsers[data.name] = {\n id: socket.id,\n socket: socket,\n user: newUser\n };\n\n socket.emit(NetworkIds.CONNECT_ACK, {\n position: newUser.myPosition,\n view: newUser.view,\n userId: newUser.userId\n });\n\n notifyConnect(socket, newUser);\n\n connections++;\n if (connections >= TARGET_USERS_NUM) {\n if (!game_started) runCountdown();\n game_started = true;\n }\n }\n\n socket.on('chat message', function(msg){\n io.emit('chat message', data.name + \": \" + msg);\n });\n\n socket.on(NetworkIds.INPUT, keyInput => {\n inputQueue.enqueue({\n clientId: socket.id,\n message: keyInput\n });\n });\n\n socket.on('disconnect', function(){\n // notifyDisconnect(socket.id);\n //delete activeClients[socket.id];\n connections--;\n //console.log(data.name + ' with id ' + socket.id + ' disconnected');\n io.emit('chat message', data.name + ' has left the game');\n });\n\n });\n });\n}", "function StartSocket (socket, io) {\n\n socket.on('getBlocksAndTxns', () => {\n PushBlockInfo.getCacheData(socket, 'getBlocksAndTxns')\n })\n\n\n socket.on('getPrice', (req) => {\n ChartsPrice.Price(socket, req, 'getPrice')\n })\n\n socket.on('transaction', (req) => {\n Txns.List(socket, req, 'transaction')\n })\n \n socket.on('blocks', (req) => {\n Blocks.List(socket, req, 'blocks')\n })\n\n socket.on('transferDtil', (req) => {\n Txns.Dtil(socket, req, 'transferDtil')\n })\n socket.on('transferPage', (req) => {\n Txns.Page(socket, req, 'transferPage')\n })\n \n socket.on('txnsDexList', (req) => {\n TxnsDex.List(socket, req, 'txnsDexList')\n })\n socket.on('txnsDexDtil', (req) => {\n TxnsDex.Dtil(socket, req, 'txnsDexDtil')\n })\n socket.on('txnsDexPage', (req) => {\n TxnsDex.Page(socket, req, 'txnsDexPage')\n })\n\n socket.on('txnsPending', (req) => {\n TxnsPending.pendingList(socket, req, 'txnsPending')\n })\n socket.on('txnsPendingDtil', (req) => {\n TxnsPending.pendingDtil(socket, req, 'txnsPendingDtil')\n })\n socket.on('txnsPendingPage', (req) => {\n TxnsPending.pendingPage(socket, req, 'txnsPendingPage')\n })\n\n\n socket.on('getAvgData', (req) => {\n getAvgData.Avg(socket, req, 'getAvgData')\n })\n \n socket.on('blockNum', (req) => {\n Blocks.Dtil(socket, req, 'blockNum')\n })\n\n\n socket.on('getOrders', (req) => {\n Orders.List(socket, req, 'getOrders')\n })\n socket.on('OrdersPage', (req) => {\n Orders.List(socket, req, 'OrdersPage')\n })\n\n socket.on('topAccounts', (req) => {\n AccountOther.TopA(socket, req, 'topAccounts')\n })\n socket.on('getAccounts', (req) => {\n AccountOther.TopA(socket, req, 'getAccounts')\n })\n socket.on('accountTxn', (req) => {\n AccountOther.ATxn(socket, req, 'accountTxn')\n })\n socket.on('accountLiloTxn', (req) => {\n AccountOther.ATxn(socket, req, 'accountLiloTxn')\n })\n\n socket.on('transactionChart', (req) => {\n ChartsTxns(socket, req, 'transactionChart')\n })\n socket.on('addressChart', (req) => {\n ChartsAccount(socket, req, 'addressChart')\n })\n\n // socket.on('sendTxns', (req) => {\n // sendTxns.sendTxns(socket, req, 'sendTxns')\n // })\n}", "constructor(slot, enchants) {\n this.enchants = enchants;\n this.div = document.createElement(\"div\");\n this.div.style.height = \"2.2em\"; // so the text doesnt go right of the socket icons...\n \n this.slot = slot;\n this.selectedSocket = 0;\n this.sockets = [];\n this.listeners = [];\n }", "constructor(title, description, ownerSocket, io, adminNamespace) {\n this.title = title;\n this.description = description;\n this.questions = new Map();\n this.debateID = ++Debate.nb_debate;\n this.adminRoomName = SocketConfig.ADMIN_ROOM_PREFIX + this.debateID;\n this.adminRoom = adminNamespace.to(this.adminRoomName);\n this.admin = ownerSocket.username;\n //For local tests\n //this.admin = \"admin\";\n\n // Join the admin room\n ownerSocket.join(this.adminRoomName);\n\n // Create a new namespace for the debate\n this.userNamespace = io.of(SocketConfig.DEBATE_NAMESPACE_PREFIX + this.debateID);\n }", "joinRoom(roomId) {\n this.socket.emit('create or join', roomId)\n console.log(`joinRoom ${roomId}`)\n this.roomId = roomId\n }", "function getMockedContainer() {\n var modSockets = new Object();\n modSockets.listen = function(port) { return modSockets; } \n \n SocketsContainer.prototype._configureSocketIO = function(socketIO) { };\n \n return {\"factory\": new SocketsContainer(1338, modSockets),\n \"socketIo\": modSockets};\n}", "emitRoom() {\n\t\tvar data = [];\n\t\tthis.network.forEach(function(net, i, arr) {\n\t\t\tvar item = {};\n\t\t\titem.id = net.id;\n\t\t\titem.name = net.name;\n\t\t\titem.side = net.side;\n\t\t\titem.ready = net.ready;\n\t\t\tdata.push(item);\n\t\t});\n\t\temitRooms();\n\t\tio.to('room' + this.id).emit('updateRoom', data, this.id);\n\t}", "create() {\n\n //establish socket connection with server\n this.socket = io(this.serverURL, {reconnection: false});\n\n //initialize a group to later be used to store every player EXCEPT the one currently playing\n this.otherPlayers = this.add.group();\n\n this.pipes = this.add.group();\n this.pipes.setDepth(100);\n\n this.waitingText = this.add.text(225,150, \"WAITING FOR PLAYERS...\", { font: \"bold 32px Arial\", fill: \"#fff\", boundsAlignH: \"center\", boundsAlignV: \"middle\", stroke: '#000000', strokeThickness: 6});\n this.waitingText.alpha = 0.0;\n this.waitingText.setDepth(2);\n\n this.countDownText = this.add.text(225,150, \"\", { font: \"bold 32px Arial\", fill: \"#ff0000\", boundsAlignH: \"center\", boundsAlignV: \"middle\", stroke: '#000000', strokeThickness: 6});\n this.countDownText.alpha = 0.0;\n this.countDownText.setDepth(3);\n\n this.gameEndText = this.add.text(225,150, \"\", { font: \"bold 18px Arial\", fill: \"#f6f413\", boundsAlignH: \"center\", boundsAlignV: \"middle\", stroke: '#000000', strokeThickness: 4});\n this.gameEndText.alpha = 0.0;\n this.gameEndText.setDepth(3);\n\n this.highScoreText = this.add.text(750,10, \"\", { font: \"15px Arial\", fill: \"#ffffff\", stroke: '#000000', strokeThickness: 2});\n this.highScoreText.setDepth(4);\n\n this.highScoreAlertText = this.add.text(10, 10, \"\", { font: \"32px Arial\", fill: \"#ffffff\", stroke: '#000000', strokeThickness: 6});\n this.highScoreAlertText.alpha = 0.0;\n this.highScoreAlertText.setDepth(5);\n\n this.disconnectedText = this.add.text(225,400, \"You were disconnected from the server, please refresh page.\", { font: \"bold 20px Arial\", fill: \"#ff0000\", boundsAlignH: \"center\", boundsAlignV: \"middle\", stroke: '#000000', strokeThickness: 6});\n this.disconnectedText.alpha = 0.0;\n this.disconnectedText.setDepth(6);\n\n\n\n\n initializeSocketOnEvents(this);\n\n this.spacebar = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.SPACE);\n\n this.input.on('pointerdown', pointer => {\n if(this.player) {\n if(this.player.isActive) {\n this.player.setVelocity(0, -420);\n }\n }\n });\n }", "function init_socketio() {\n\n // on connection, server will emit channel_update and users_update events, making the app load users and channels\n socket = io();\n\n // process the new chat message once its received from the server\n socket.on('chat_message', (message) => {\n receiveMessage(message)\n });\n\n // update the locally stored channels once an update is received from the server\n socket.on('channel_update', (response) => {\n updateChannels(response.channels);\n });\n\n // update the locally stored users once an update is received from the server\n socket.on('users_update', (response) => {\n updateUsers(response.users);\n });\n}", "constructor() {\r\n\t\t\r\n\t\t// Initialise properties\r\n\t\tthis.rooms = [];\r\n\t\tthis.users = [];\r\n\t\t\r\n\t\t// Create a first room, which is the special ID 0 room in which users cannot send messages\r\n\t\tthis.newRoom(0);\r\n\t\t\r\n\t}", "componentDidMount() {\n /* initialize client socket connection */\n this.socket = io('http://localhost:3000');\n this.createUser();\n this.createRoom();\n this.renderMessage();\n this.RoomOccupancy();\n }", "init() {\n this.socket.emit('init', 'ooga');\n }", "initSocket() {\n const channels = this.get('channels');\n const pusher = this.get('pusher');\n const node = this.get('nodeId');\n const sensors = this.get('sensorMap').keys();\n\n for (const channel of channels) {\n pusher.unsubscribe(channel);\n }\n\n for (const sensor of sensors) {\n const channel = `private-${NETWORK};${node};${sensor}`;\n pusher.subscribe(channel, this.appendObservation.bind(this));\n channels.push(channel);\n }\n }", "function newSocket(socket) {\n var remoteAddress = socket.remoteAddress;\n\tsockets.push(socket);\n\tsocket.on('data', function(data) {\n\t\treceiveData(socket, data);\n\t})\n\n\n\n\tsocket.on('end', function(socket) {\n console.log('ending... ' + remoteAddress);\n delete servers[remoteAddress];\n // update list of servers in monitoring mode, client-side\n io.sockets.emit('updateservers', servers);\n\n\t\tcloseSocket(socket);\n\t})\n}", "function makeRoomSocket(name) {\n console.log(`Opening WebSocket server for room ${name}.`);\n\n const wss = new WebSocket.Server({ noServer: true });\n wss.on(\"connection\", (ws, request) => {\n const { userId } = querystring.parse(url.parse(request.url).query);\n\n socketActions.connect(wss, null, { roomName: name, userId });\n\n /* eslint-disable no-param-reassign */\n ws.userId = userId;\n ws.isAlive = true;\n ws.on(\"pong\", () => {\n console.log(`User with id ${userId} ponged room ${name}.`);\n ws.isAlive = true;\n });\n\n ws.on(\"close\", () => {\n console.log(`User with id ${userId} left room ${name}.`);\n socketActions.disconnect(wss, null, { roomName: name, userId });\n });\n\n ws.on(\"message\", (msg) => {\n if (isJSON(msg)) {\n const message = JSON.parse(msg);\n const args = { roomName: name, userId };\n if (message.type && message.type in socketActions) {\n console.log(\n `Sending socket message associated with type \"${message.type}\"`\n );\n socketActions[message.type](wss, message, args);\n } else {\n console.log(`\"${message.type}\" is not a valid socket message type.`);\n }\n } else {\n console.log(`${msg} is not valid JSON.`);\n }\n });\n });\n\n let inactivePings = 0;\n\n wss.interval = setInterval(() => {\n console.log(`Pinging clients of room ${name}...`);\n let hasActive = false;\n wss.clients.forEach((ws) => {\n if (ws.isAlive === false) {\n console.log(`User with id ${ws.userId} dropped from room ${name}.`);\n return ws.terminate();\n }\n hasActive = true;\n ws.isAlive = false;\n return ws.ping(() => {});\n });\n if (hasActive) {\n inactivePings = 0;\n } else {\n console.log(`Room ${name} has no active users.`);\n inactivePings += 1;\n }\n if (inactivePings >= MAX_INACTIVE_PINGS) {\n console.log(`Room ${name} has had no active users for too long.`);\n wss.close();\n }\n }, PING_INTERVAL);\n\n wss.on(\"close\", () => {\n console.log(`Closing WebSocket server and deleting room ${name}.`);\n wss.clients.forEach((ws) => ws.terminate());\n Rooms.deleteRoom(name);\n delete socketServers[name];\n return clearInterval(wss.interval);\n });\n\n return wss;\n}", "function bindEvents(socket){\n\tsocket.on(\"sendUserJoinEvent\", function (formInfoObj){\n\t\tsendUserJoinEvent(formInfoObj);\t\t\n\t});\n\n\tsocket.on(\"sendWhiteboardDrawEvent\", function (formInfoObj){\n\t\tsendWhiteboardDrawEvent(formInfoObj);\t\t\n\t});\n\n\tsocket.on(\"sendWhiteboardUpdShapeEvent\", function (formInfoObj){\n\t\tsendWhiteboardUpdShapeEvent(formInfoObj);\t\t\n\t});\n\n\tsocket.on(\"createMeeting\", function (formInfoObj){\n\t\tcreateMeeting(formInfoObj);\t\t\n\t});\n\n\tsocket.on(\"sendJSON\", function (formInfoObj){\n\t\tsendJSON(formInfoObj);\t\t\n\t});\n\n\n}", "bindSocketListeners() {\n //Remove listeners that were used for connecting\n this.netClient.removeAllListeners('connect');\n this.netClient.removeAllListeners('timeout');\n // The socket is expected to be open at this point\n this.isSocketOpen = true;\n this.netClient.on('close', () => {\n this.log('info', `Connection to ${this.endpointFriendlyName} closed`);\n this.isSocketOpen = false;\n const wasConnected = this.connected;\n this.close();\n if (wasConnected) {\n // Emit only when it was closed unexpectedly\n this.emit('socketClose');\n }\n });\n\n this.protocol = new streams.Protocol({ objectMode: true });\n this.parser = new streams.Parser({ objectMode: true }, this.encoder);\n const resultEmitter = new streams.ResultEmitter({objectMode: true});\n resultEmitter.on('result', this.handleResult.bind(this));\n resultEmitter.on('row', this.handleRow.bind(this));\n resultEmitter.on('frameEnded', this.freeStreamId.bind(this));\n resultEmitter.on('nodeEvent', this.handleNodeEvent.bind(this));\n\n this.netClient\n .pipe(this.protocol)\n .pipe(this.parser)\n .pipe(resultEmitter);\n\n this.writeQueue = new WriteQueue(this.netClient, this.encoder, this.options);\n }", "setupDoorbellSocket() {\n let socket = new net.Socket({ readable: true, writable: true });\n socket.on('end', function () {\n console.log('Doorbell socket ended');\n });\n socket.on('close', function () {\n console.log('Doorbell socket closed');\n clearInterval(this._keepAliveTimer);\n });\n socket.on('data', this.receive.bind(this));\n socket.on('error', function (e) {\n console.error('Doorbell socket error', e);\n this.doorbellSocket.destroy(); // destroy the socket\n this.mqttClient.end(true); // End the mqtt connection right away.\n clearInterval(this._keepAliveTimer); // Stop sending keepalive requests\n this.start(); // Start over again.\n });\n this.doorbellSocket = socket.connect({ port: 5000, host: this.dahua_host });\n }", "function createSocketIODriver(url) {\n const socket = io(url);\n\n function get(eventName) {\n return Rx.Observable.create(observer => {\n const sub = socket.on(eventName, function (message) {\n observer.onNext(message);\n });\n return function dispose() {\n sub.dispose();\n };\n });\n }\n\n function publish(messageType, message) {\n socket.emit(messageType, message);\n }\n\n return function socketIODriver(events$) {\n events$.forEach(event => publish(event.messageType, event.message));\n return {\n get,\n dispose: socket.destroy.bind(socket)\n }\n };\n}", "initSockets() {\n this.relay.on('requests satisfied', (data) => {\n const sockets = this.channel('relay');\n\n if (!sockets)\n return;\n\n this.to('relay', 'relay requests satisfied', data);\n });\n }", "function init(p) {\n port = p;\n io = io.listen(port);\n io.sockets.on('connection', acceptConnection);\n}", "function initializeSockets({currentUser, currentChannel}){\n\n let sessionInfo = {currentUser, currentChannel};\n\n const socket = io();\n const socketManager = new window.SocketManager({socket});\n const messageSocketSender = new MessageSocketSender(socketManager);\n\n const messageDomHandler = new MessageDomHandler({\n messageSocketSender,\n socketManager,\n sessionInfo\n });\n\n const socketListenner = new MessageSocketListenner({\n socket: socket,\n domHandler: messageDomHandler,\n });\n\n messageDomHandler.initEvents();\n\n messageDomHandler.joinRoom();\n}", "constructor() {\n this.socketEventList = [];\n this.asyncExtensionList = [];\n this.extensions = {};\n this.setupSocket();\n }", "function MySocket (socket, identifier) {\r\n\tthis.socket = socket;\r\n\tthis.identifier = identifier;\r\n\tthis.player = new Player(identifier, this );\r\n\tthis.emit = function (instruction, msg) {\r\n\t\t\tthis.socket.emit(identifier, { instruction:instruction, msg:msg });\r\n\t\t};\r\n}", "constructor(socket, cleanup) {\n this.socket = null;\n this.cleanup = null;\n this.authenticationTimeout = null;\n this.handshake = null;\n\n this.handshake = crypto.randomBytes(16).toString('base64')\n\n this.socket = socket;\n this.cleanup = cleanup;\n\n // client gets 500 ms to authenticate\n this.authenticationTimeout = setTimeout(() => { this.destroy(); }, 500);\n\n // here we ensure only our SSE servers will connect to this socket before sending data.\n this.socket.emit(protocolTopics.authenticationRequest, this.handshake, (reply) => {\n if (this.authenticate(reply) === false) { this.destroy(); return; }\n clearTimeout(this.authenticationTimeout);\n\n // add to the list of sockets that can process SSE's\n this.socket.join(EVENT_ROOM_NAME, (err) => {\n if (err) { return this.destroy(); }\n });\n\n // check if an accesstoken is valid.\n this.socket.on(protocolTopics.requestForAccessTokenCheck, (token, callback) => {\n this.handleAccessTokenRequest(token, callback);\n })\n // check if an accesstoken is valid.\n this.socket.on(protocolTopics.requestForOauthTokenCheck, (token, callback) => {\n this.handleOauthTokenRequest(token, callback);\n })\n });\n\n this.socket.on(\"disconnect\", () => { this.destroy(); });\n }", "function CreateSIOServer()\n{\n \n sio = io.listen(server);\n sio.configure(function (){\n\t\tsio.set('transports', ['websocket']);\n sio.set('log level', 0);\n sio.set('authorization', function (handshakeData, callback){\n callback(null , true);\n });\n });\n\n wrap_server = new game_server();\n wrap_server.initServer(current_experiment);\n}", "function configureSocketIO(io) {\n io.use(function (socket, next) {\n sessionMiddleware(socket.request, {}, next);\n }).on(\"connection\", socket => {\n let passportJSON = socket.request.session.passport;\n if (connectionsEnabled && passportJSON && passportJSON.user) {\n console.log(\"passportJSON:\", passportJSON);\n const user = User_1.getUserById(passportJSON.user);\n socket.emit(\"user\", user.toJSON());\n user.appendClient(new todoListClientSocketIO_1.TodoListClientSocketIO(socket));\n }\n else {\n if (connectionsEnabled) {\n console.log(\"Closing socket.io connection: no passport information.\");\n }\n else {\n console.log(\"Closing connection to simulate offline mode\");\n }\n socket.disconnect();\n }\n });\n}", "constructor() {\n this.eventPool = {}\n }", "function Socket(socket) {\r\n _super.call(this);\r\n this.socket = socket;\r\n this.eureca = {};\r\n this.request = socket.request;\r\n this.id = socket.id;\r\n //FIXME : with nodejs 0.10.0 remoteAddress of nodejs clients is undefined (this seems to be a engine.io issue) \r\n this.remoteAddress = socket.address;\r\n //this.registerEvents(['open', 'message', 'error', 'close', 'reconnecting']);\r\n this.bindEvents();\r\n }", "startSocketHandling() {\n this.userNamespace.on('connection', (socket) => {\n logger.debug(`New socket connected to namespace ${this.userNamespace.name} + ${socket.id}`);\n\n // Register socket functions\n socket.on('getQuestions', this.getQuestions(socket));\n socket.on('answerQuestion', this.answerQuestion(socket));\n socket.on('answerOpenQuestion', this.answerOpenQuestion(socket));\n });\n }", "constructor (intPort, objController) {\n this.port = intPort || 8080;\n this.io = io(this.port);\n this.objController = objController;\n console.log('Socket server listening on port', this.port);\n this._setAuthorization();\n this._setDefaultListeners();\n }", "function ClientSocket(io, socket){\n this.io = io;\n this.socketId = socket.id;\n\n var _this = this;\n socket.on('playerMove', function(move){\n console.log('playerMove');\n _this.emit('playerMove', move);\n });\n\n socket.on('disconnect', function () {\n _this.emit('disconnect');\n });\n\n socket.on('registerAs', function (role, secret){\n console.log('registerAs');\n _this.emit('registerAs', role, secret);\n });\n\n socket.on('error', function (error) {\n console.error('error on socket.io server:', error);\n });\n}", "initialize() {\n debug(\"Initializing ChatServer\");\n const io = this.io;\n io.use(this._userMiddleware());\n io.on(events.connection, (socket) => {\n this._handleNewUser(socket);\n socket.on(events.disconnect, this._handleDisconnect(socket));\n socket.on(events.messageSent, this._handleMessageSent(socket));\n });\n }", "function SocketService ($rootScope) {\n let socket = io.connect();\n this.on = (eventName, callback) => {\n socket.on(eventName, function () {\n let args = arguments;\n $rootScope.$apply(function () {\n callback.apply(socket, args);\n });\n });\n };\n\n this.emit = (eventName, data, callback) => {\n socket.emit(eventName, data, function () {\n let args = arguments;\n $rootScope.$apply(() => {\n if (callback) {\n callback.apply(socket, args);\n }\n });\n });\n };\n}", "function connect(){\n const socket = io(server);\n socket.on('connect', ()=>{\n console.log('connected')\n })\n\n emissionObject ={\n currentName:user.userName,\n currentImg:user.imgUrl,\n date:new Date().getTime,\n message:\"hello world\"\n }\n socket.on(room, (message)=>{\n console.log(`${user.username}: ${user.imgUrl}: ${message}`)\n let textLine = document.createElement(\"li\")\n let image = createImage(user.imgUrl);\n textLine.innerText = `${user.userName}: ${message}`\n textLine.appendChild(image);\n chatbox.appendChild(textLine);\n\n \n }) ;\n\n return socket;\n}", "createEvents() {\n let connection = this;\n let socket = connection.socket;\n let server = connection.server;\n let player = connection.player;\n\n socket.on('disconnect', function () {\n server.onDisconnected(connection);\n });\n\n socket.on('joinGame', function () {\n server.onAttemptToJoinGame(connection);\n });\n\n socket.on('fireBullet', function (data) {\n connection.lobby.onFireBullet(connection, data);\n });\n\n socket.on('collisionDestroy', function (data) {\n connection.lobby.onCollisionDestroy(connection, data);\n });\n\n socket.on('updatePosition', function (data) {\n player.position.x = String(data.position.x);\n player.position.y = String(data.position.y);\n player.position.z = String(data.position.z);\n\n socket.broadcast.to(connection.lobby.id).emit('updatePosition', player);\n });\n\n socket.on('updateRotation', function (data) {\n player.rotation = String(data.rotation);\n player.barrelRotation = String(data.barrelRotation);\n \n socket.broadcast.to(connection.lobby.id).emit('updateRotation', player);\n });\n }", "constructor() {\n this.rooms = GameRooms.getInstance();\n this.factory = new GameFactory();\n this.usvc=new UserService();\n this.createGame.bind(this);\n this.joinSomeGame.bind(this);\n }", "function initPlayer(socket) {\r\n\tconsole.log('New connection, %s clients connected', connectedClients);\r\n\tvar newP = new Player(socket);\r\n\tplayers.push(newP);\r\n\tsocket.emit('update_settings', settings);\r\n\tsocket.emit('update_settings', settingTypes);\r\n\tsocket.emit('game_event', {\r\n\t\ttype: 'teams',\r\n\t\tteams: teams\r\n\t});\r\n\tsocket.emit('game_event', {\r\n\t\ttype: 'set_gun',\r\n\t\tgun: Guns[settings.defaultGun]\r\n\t});\r\n\tif (state == 'game') {\r\n\t\tsocket.emit('game_event', {\r\n\t\t\ttype: 'set_state',\r\n\t\t\tstate: 'spectator'\r\n\t\t})\r\n\t}\r\n}", "function createOrAddToRoom(){\n\n if(!socketClients[clientId]){\n\n //if user does not exist\n return getUserData( msg.cookie ).then(function(userObject,error){//what if cookie is invalid\n if (error) return sendError('invalid cookie')\n socketClients[clientId] = {user:{id:userObject.id, username:userObject.username}, socket:ws}\n\n createOrAddToRoom()\n })\n\n \n }\n\n //also broadcast on join and leave and also joined member\n // console.log(clientId,'creating room or adding:'+roomLabel)\n function createRoom(){\n roomToken = random()\n roomsRegistry[roomLabel].notFull[roomToken] = {clients:[],limit:roomLimit}\n roomsRegistry[roomLabel].notFull[roomToken].clients.push(clientId)\n }\n\n if (!roomsRegistry[roomLabel]){ //room not constructed \n roomsRegistry[roomLabel] = { full:{},notFull:{} }\n createRoom()\n }else{\n\n if ( Object.keys(roomsRegistry[roomLabel].notFull).length === 0 ) {\n createRoom()\n }else{\n\n roomToken = Object.keys(roomsRegistry[roomLabel].notFull)[0]\n roomsRegistry[roomLabel].notFull[roomToken].clients.push(clientId)\n broadcast(roomToken,socketClients[clientId].user,'onjoin',roomLabel)\n\n let notFullRoomLimit = roomsRegistry[roomLabel].notFull[roomToken].limit\n let membersCountOfNotFull = roomsRegistry[roomLabel].notFull[roomToken].clients.length\n\n \n\n // if(membersCountOfNotFull > notFullRoomLimit) console.log('limit exceeded', membersCountOfNotFull, notFullRoomLimit)\n\n if(membersCountOfNotFull === notFullRoomLimit){\n roomsRegistry[roomLabel].full[roomToken] = roomsRegistry[roomLabel].notFull[roomToken]\n roomsRegistry[roomLabel].notFull = removeKey(roomsRegistry[roomLabel].notFull,roomToken)\n }\n\n }\n\n }\n\n broadcast(roomToken,null,'onopen',roomLabel)\n\n }", "constructor() {\n this.rooms = {}\n }", "constructor(config) {\n // Primary map for active streamer instance. key=uuid\n this._spawns = new Map();\n // Array of available spawn websocket ports\n this._spawnPorts = [];\n /** Will contain active gpu counts per gpu-index which are [0, config.ssrGpuCount) */\n this._gpuCounts = [];\n this._config = config;\n // Setup the port arrays\n for (let i = config.spawnWebsocketPortsBegin + config.spawnMaxSpawnCount - 1; i >= config.spawnWebsocketPortsBegin; --i) {\n this._spawnPorts.push(i);\n }\n // Setup Gpu indexes. This should only be done when ssrGpuCount is set and >0\n if (this._config.ssrGpuCount) {\n this._gpuCounts.length = this._config.ssrGpuCount;\n this._gpuCounts.fill(0);\n }\n // Kick-off the timer that periodically does spawn lifetime maintenance\n setInterval(this._doSpawnMaintenance.bind(this), 1000);\n }", "function createMock() {\n return {\n id: Math.floor(Math.random() * 9000000000) + 1000,\n on: () => {\n // Do nothing, as we only have to mock the socket for its id, not its functionality\n }\n }\n}", "static onSocketInit(socket, URLhash) {\n let roomID = '';\n\n if (!rooms.isRoomExists(URLhash) || rooms.getRoomPlayersCount(URLhash) >= 2) {\n roomID = (URLhash && !rooms.isRoomExists(URLhash)) ? URLhash : socket.id;\n const room = new Room(roomID);\n room.addPlayer(socket.id);\n\n rooms.addRoom(room);\n } else {\n roomID = URLhash;\n rooms.getRoom(roomID).addPlayer(socket.id);\n }\n\n return roomID;\n }", "constructor(socket) {\n super(socket);\n }", "constructor(blockchain, transactionPool) {\n this.blockchain = blockchain;\n this.transactionPool = transactionPool;\n // the sockets all into the array []\n this.sockets = [];\n }", "function setSocketIoConnectionListener() {\n io.on('connection', function (client) {\n setSocketIoListeners(client);\n });\n}", "setSocket (state, io) {\n Vue.set(state, 'io', io)\n }", "function addSocket(socket){\n\n //al.info('adding Socket');\n //console.log(this);\n //var foo = handleQuickJoin.bind(this);\n //var bar = handleCancelQuickJoin.bind(this)\n //socket.removeAllListeners('quick-join');\n //socket.removeAllListeners('cancel-quick-join');\n //socket.on('cancel-quick-join', () => this.handleCancelQuickJoin(socket));\n\n socket.on('quick-join',(msg) => { this.handleQuickJoin(socket,msg)});\n\n}", "function Room(id, name){\n this.room_id=id;\n this.name=name;\n /* person who about to enter this room */\n this.self=null;\n /* topic object to control topic representation */ \n this.topic=new Topic(\"\");\n /* and mates */\n this.mates=new Mates([]);\n /* same for messages */\n this.messages=new Messages();\n /* true when user leaves pages open while visiting other pages. */\n this.hidden=false;\n /* number of message posted when window blurred */\n this.counter=0;\n this.network_controller=new NetworkController(this);\n this.controlsInit();\n this.networkInit();\n}" ]
[ "0.69521755", "0.6355749", "0.6265657", "0.6171448", "0.59839207", "0.5929215", "0.5885986", "0.5880528", "0.57616717", "0.5724911", "0.5722843", "0.5722817", "0.56957006", "0.56906736", "0.5675947", "0.5657708", "0.565391", "0.5651382", "0.5636755", "0.56223243", "0.5620404", "0.56127805", "0.56075644", "0.5592196", "0.55701286", "0.5561378", "0.55517507", "0.5510411", "0.549578", "0.54924315", "0.5475455", "0.54750806", "0.5466807", "0.54666996", "0.5451651", "0.54476184", "0.5441097", "0.5421543", "0.5389725", "0.5383298", "0.5382017", "0.53719944", "0.53659683", "0.53651357", "0.5360545", "0.53495187", "0.53081614", "0.5302907", "0.5292315", "0.5285484", "0.52716225", "0.5268022", "0.52677816", "0.52630234", "0.525943", "0.5259231", "0.52536315", "0.5251849", "0.52511644", "0.5242287", "0.52381384", "0.5235042", "0.5225553", "0.5222355", "0.5209564", "0.52063745", "0.5201348", "0.52008444", "0.51984537", "0.519224", "0.5189", "0.51842326", "0.51835763", "0.51798594", "0.51734304", "0.51679945", "0.516141", "0.5159218", "0.5152573", "0.51485646", "0.51475614", "0.514574", "0.5142259", "0.5134764", "0.51344615", "0.51330245", "0.51271385", "0.5108554", "0.51056033", "0.5095796", "0.50908154", "0.50847983", "0.508093", "0.50760514", "0.5049572", "0.5046615", "0.5045579", "0.5044615", "0.50316656", "0.50298685" ]
0.6916228
1
PRIVATE METHODS Attempts to add a player identified by the given username and socket to the room identified by the given room code. Returns true if successful, false if unsuccessful.
_addPlayerToRoom(socket, username, roomCode) { if (!this.roomExists(roomCode)) { return false; } return this.rooms[roomCode].addPlayer(socket, username); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addPlayer(socket, username) {\n if (this.playerMap.getPlayerCount() >= MAX_PLAYERS) {\n return false;\n }\n\n if (!this.playerMap.containsUsername(username) && !this.gameServer.isInGame()) {\n this.playerMap.putPlayer(new Player(socket, username));\n\n if (this.hostSocket === undefined) {\n this.setHostSocketAndNotify(socket);\n }\n this.gameServer.activateListenersForSocket(socket);\n return true;\n } else if (this.playerMap.containsUsername(username) && this.gameServer.isInGame() &&\n !this.playerMap.isUsernameActive(username)) {\n this.playerMap.updatePlayerSocket(username, socket);\n this.gameServer.activateListenersForSocket(socket);\n return true;\n }\n\n return false;\n }", "addPlayerToRoomByID(player, roomID) {\n // Conditional that checks whether a room exists\n if (Room.roomExists(roomID)) {\n // Find the room by its ID and add the player to it\n Room.findByID(roomID).addPlayer(player);\n player.setRoom(Room.findByID(roomID));\n return true;\n }\n // Emit a message saying that joining the room has failed\n player.emitter.emit('roomJoinFailed', {});\n return false;\n }", "addUser(socket, name) {\n if (!this.playerExists(name) && this.gameState === LOBBY) {\n this.players[name] = new Player(socket.id);\n this.linkSocketToPlayer(socket, name);\n return this.clientsUpdate();\n }\n else if (this.playerExists(name) && this.gameState !== LOBBY &&\n this.playerIsEmpty(name)) {\n this.linkSocketToPlayer(socket, name);\n return this.clientsUpdate();\n }\n return false;\n }", "function joinOrCreateRoom(roomCode) {\n socket.join(roomCode, () => {\n // Sets the socket's room code\n socket.roomCode = roomCode\n // Sends room code to client\n socket.emit('room_joined', roomCode)\n // Updates GM's player list\n updateGMRoomMembers()\n })\n }", "function introducePlayerToRoom(player) {\n\n var sessionID = player.sessionID;\n\n io.sockets.sockets[sessionID].broadcast.to(player.params.map).emit('addPlayer', player);\n}", "addPlayer(roomId, player) {\n this.getRoom(roomId).players.push(player);\n\n return player;\n }", "function createRoom(e) {\n e.preventDefault();\n if (username()) {\n // $.ajax({\n // url: '/createRoom',\n // type: 'POST',\n // beforeSend: function (xhr) {\n // if (localStorage.getItem(appName)) {\n // xhr.setRequestHeader('Authorization', localStorage.getItem(appName));\n // }\n // },\n // data: {\n // username: userName\n // },\n // success: function (token) {\n // console.log(token);\n // localStorage.setItem(appName, token.token);\n // },\n // error: function () {},\n // });\n\n // TODO: Use this params to send token to server on new connection\n // check if socket is valid and within time limit\n socket.io.opts.query = {\n token: alreadyPlayed(),\n };\n socket.open();\n // FIXME: Delet Test emit\n socket.emit(\"newMessage\", \"lol\", function (err, message) {\n if (err) {\n return console.error(err);\n }\n console.log(message);\n });\n socket.on(\"newMessage\", function (data) {\n console.log(data);\n });\n\n // Asking to create a new room\n socket.emit(\"createRoom\", { username: userName });\n // socket replies back with created room name (which should be sent to other user who wants to play together)\n socket.on(\"roomNameIs\", function (roomName) {\n // console.log(roomName);\n document.getElementById(\"createdRoomName\").innerHTML =\n \"Room name : \" + roomName;\n $(\"#createdRoomName\").show();\n currentRoom = roomName;\n $(\".joinRoom\").hide();\n $(\".createRoom\").hide();\n $(\".generatRoomLink\").hide();\n $(\".singleplayerMode\").hide();\n showStartGameButton();\n currentlyPlaying = true;\n });\n console.log(socket);\n }\n}", "addPlayer(sock) {\n const socket = sock;\n\n // prevent adding the player twice\n if (socket.player.curRoom === this.hash) {\n return;\n }\n\n if (this.players.p1 === undefined) {\n this.players.p1 = socket;\n } else if (this.players.p2 === undefined) {\n this.players.p2 = socket;\n }\n\n socket.leave('lobby');\n socket.join(this.hash);\n socket.player.curRoom = this.hash;\n socket.player.reset();\n\n if (this.players.p1 !== undefined && this.players.p2 !== undefined) {\n this.state = 'preparing';\n this.setupTimer = 0;\n\n this.players.p1.emit('matchPreparing', new Message('matchPreparing', {\n maxTime: this.maxSetupTimer,\n p1: this.players.p1.player,\n p2: this.players.p2.player,\n }));\n\n this.players.p2.emit('matchPreparing', new Message('matchPreparing', {\n maxTime: this.maxSetupTimer,\n p1: this.players.p1.player,\n p2: this.players.p2.player,\n }));\n } else {\n socket.emit('matchWaiting', new Message('waitStart', new Date().getTime()));\n }\n }", "add_user(name, side, socket) {\r\n if (!this.is_game(name) || !this.is_side_free(name, side)) return false;\r\n\r\n this.inner[name][side] = socket;\r\n socket.chess_name = name;\r\n socket.chess_side = side;\r\n return true;\r\n }", "function addPlayer(socketId) {\n //Create new player \n numPlayers++;\n var player = {};\n player.socketId = socketId;\n player.username = generateUsername();\n \n //Assign game pience ('X' or 'O')\n if(numPlayers === 1) {\n player.gamePiece = 'X'; \n } else if(numPlayers === 2) {\n if(players[0].gamePiece === 'O') {\n player.gamePiece = 'X';\n } else {\n player.gamePiece = 'O';\n }\n }\n \n players.push(player);\n \n io.sockets.connected[socketId].emit('playerInfo', player);\n io.sockets.emit('user', numPlayers);\n \n return player; \n}", "function playerJoinGame(data) {\n //console.log('Player ' + data.playerName + 'attempting to join game: ' + data.gameId );\n\n // A reference to the player's Socket.IO socket object\n var sock = this;\n\n // Look up the room ID in the Socket.IO manager object.\n var room = io.sockets.adapter.rooms[data.gameId];\n //If the room exists...\n if( room != undefined ){\n // attach the socket id to the data object.\n\n // Join the room\n //console.log('Player ' + data.playerName + ' joining game: ' + data.gameId );\n this.join(data.gameId);\n data.socketId = this.id;\n // Emit an event notifying the clients that the player has joined the room.\n //console.log(data);\n io.in(data.gameId).emit('playerJoinedRoom', data);\n\n } else {\n // Otherwise, send an error message back to the player.\n io.emit('error',{message: \"This room does not exist.\"} );\n }\n}", "joinLobby(playerId, playerSocket) {\n\t\tlet playerIndex = this.lobbyPlayers.findIndex(player => player.pid == playerId);\n\n\t\t// Player is not in lobby yet; add them\n\t\tif (playerIndex == -1) {\n\t\t\tthis.lobbyPlayers.push({ pid: playerId, socket: playerSocket, status: \"In Lobby\", type: \"Human\" });\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "addUser (user) {\n if (this.players.length < this.maxPlayers) {\n if (this.players.findIndex(player => player.name === user.name) === -1) {\n this.players.push(user)\n user.join(this.name)\n user.room = this\n console.log('user ' + user.name + ' joined room ' + this.name)\n return true\n } else {\n console.log('user ' + user.name + ' tried to join room ' + this.name + ' but a player in that room already had that name')\n return false\n }\n } else {\n return false\n }\n }", "function roomExists(code) {\r\n try {\r\n console.log(\"checking if room with code: \" + code + \" exists\");\r\n console.log(rooms[code]);\r\n if(code == null || code == undefined || typeof code != 'string' || !rooms[code]) {\r\n console.log(\"it's bad\");\r\n return false;\r\n }\r\n console.log(\"it's good\");\r\n return true;\r\n } catch(e) {\r\n console.error(e);\r\n return false;\r\n }\r\n}", "function validateUser(socket, room, username, roomUsers){\n return (room \n && roomUsers[room] && socket.id in roomUsers[room] \n && roomUsers[room][socket.id] == username\n && socket.store && socket.store.data \n && socket.store.data.nickname == username\n && socket.store.data.room == room);\n}", "function joinRoom(socket, roomName){\n if (getRoomPlayersNumber(roomName) < playersPerRoom){\n socket.join(roomName);\n socket.room = roomName;\n return true;\n }\n return false\n }", "function playerJoinGame(data) {\n //console.log('Player ' + data.playerName + 'attempting to join game: ' + data.gameId );\n\n // A reference to the player's Socket.IO socket object\n var sock = this;\n\n // Look up the room ID in the Socket.IO manager object.\n var room = gameSocket.adapter.rooms[data.gameId];\n\n // If the room exists...\n if( room != undefined ){\n // attach the socket id to the data object.\n data.mySocketId = sock.id;\n\n // Join the room\n sock.join(data.gameId);\n game.mySocketId = sock.id;\n game.players[this.id] = {\n gameId: data.gameId,\n mySocketId: this.id,\n playerName: data.playerName,\n totalHp: 1000,\n hp: 1000,\n totalMana: 100,\n mana: 100,\n summons: [],\n buffs: [],\n cooldowns: {},\n baseCooldowns: {},\n };\n\n\n //console.log(gameSocket.adapter.rooms);\n //console.log('Player ' + data.playerName + ' joining game: ' + data.gameId );\n\n // Emit an event notifying the clients that the player has joined the room.\n io.sockets.in(data.gameId).emit('playerJoinedRoom', game);\n\n } else {\n // Otherwise, send an error message back to the player.\n this.emit('error',{message: \"This room does not exist.\"} );\n }\n}", "function handleJoin() {\r\n\tlet username = document.getElementById(\"username\").value.trim();\r\n\tlet roomCode = document.getElementById(\"room\").value.trim();\r\n\t\r\n\t/* If username and roomCode are unique and valid, then send\r\n\totherwise, give alert */\r\n\tconsole.log(Object.keys(roomState));\r\n\tconsole.log(Object.keys(roomState).indexOf(roomCode));\r\n\tif (Object.keys(roomState).indexOf(roomCode) != -1){\r\n\t\tlet existing = Object.keys(roomState[roomCode][\"players\"]);\r\n\t\tconsole.log(username.length > 0 && existing.indexOf(username) == -1);\r\n\t\tif (username.length > 0 && existing.indexOf(username) == -1) {\r\n\t\t\tsocket.emit(\"toJoin\", [username, roomCode]);\r\n\t\t\tshowChat(username);\r\n\t\t}\r\n\t\telse {\r\n\t\t\talert(\"Entered username is invalid, please try again!\");\r\n\t\t}\r\n\t}\r\n\telse {\r\n\t\talert(\"Entered game ID is invalid, please try again!\");\r\n\t}\r\n}", "function createOrAddToRoom(){\n\n if(!socketClients[clientId]){\n\n //if user does not exist\n return getUserData( msg.cookie ).then(function(userObject,error){//what if cookie is invalid\n if (error) return sendError('invalid cookie')\n socketClients[clientId] = {user:{id:userObject.id, username:userObject.username}, socket:ws}\n\n createOrAddToRoom()\n })\n\n \n }\n\n //also broadcast on join and leave and also joined member\n // console.log(clientId,'creating room or adding:'+roomLabel)\n function createRoom(){\n roomToken = random()\n roomsRegistry[roomLabel].notFull[roomToken] = {clients:[],limit:roomLimit}\n roomsRegistry[roomLabel].notFull[roomToken].clients.push(clientId)\n }\n\n if (!roomsRegistry[roomLabel]){ //room not constructed \n roomsRegistry[roomLabel] = { full:{},notFull:{} }\n createRoom()\n }else{\n\n if ( Object.keys(roomsRegistry[roomLabel].notFull).length === 0 ) {\n createRoom()\n }else{\n\n roomToken = Object.keys(roomsRegistry[roomLabel].notFull)[0]\n roomsRegistry[roomLabel].notFull[roomToken].clients.push(clientId)\n broadcast(roomToken,socketClients[clientId].user,'onjoin',roomLabel)\n\n let notFullRoomLimit = roomsRegistry[roomLabel].notFull[roomToken].limit\n let membersCountOfNotFull = roomsRegistry[roomLabel].notFull[roomToken].clients.length\n\n \n\n // if(membersCountOfNotFull > notFullRoomLimit) console.log('limit exceeded', membersCountOfNotFull, notFullRoomLimit)\n\n if(membersCountOfNotFull === notFullRoomLimit){\n roomsRegistry[roomLabel].full[roomToken] = roomsRegistry[roomLabel].notFull[roomToken]\n roomsRegistry[roomLabel].notFull = removeKey(roomsRegistry[roomLabel].notFull,roomToken)\n }\n\n }\n\n }\n\n broadcast(roomToken,null,'onopen',roomLabel)\n\n }", "function onConnect(socket) {\n\tconst connectBy = socket.handshake.headers.host\n\n\tconst clientId = socket.id\n\tplayers[clientId] = {socket: socket}\n\n\tconsole.log('Player', clientId, 'connected from', connectBy)\n\tsocket.on('disconnect', () => {\n\t\tconsole.log('Client', clientId, 'has been disconnected from', connectBy)\n\t\tif(players[clientId].room) {\n\t\t\trmPlayerFromRoom(players[clientId].room, clientId)\n\t\t}\n\t\tdelete players[clientId]\n\t})\n\n\t/**\n\t * room: str\n\t * type: str\n\t */\n\tsocket.on('create', (params, response) => {\n\t\tif(!params.room.match(ROOM_CODE_REGEXP)) {\n\t\t\tresponse({status: 'ko', err: 'Invalid room Id (\\'' + params.room + '\\' does not respect '+ ROOM_CODE_FORMAT + ')'})\n\t\t} else if(params.room in rooms) {\n\t\t\tresponse({status: 'ko', err: 'Room \\'' + params.room + '\\' already exists'})\n\t\t} else if(!(params.type in config.httpFolders)) {\n\t\t\tresponse({status: 'ko', err: 'Type of room \\'' + params.type + '\\' does not exist'})\n\t\t} else {\n\t\t\trooms[params.room] = {activity: params.type, host: null, roles:{all: []}}\n\t\t\tresponse({status: 'ok'})\n\t\t}\n\t})\n\n\t/**\n\t * room: str\n\t */\n\tsocket.on('join', (params, response) => {\n\t\tif(!(params.room in rooms)) {\n\t\t\tresponse({status: 'ko', err: 'Room \\'' + params.room + '\\' does not exists'})\n\t\t} else if(players[clientId].room) {\n\t\t\tresponse({status: 'ko', err: 'Already joined the room'})\n\t\t} else {\n\t\t\taddPlayerRoles(params.room, clientId, ['all'])\n\t\t\tio.to(params.room + '/all').emit('connected', clientId, {player: clientId, room: getRoomDescription(params.room)})\n\t\t\tresponse({status: 'ok'})\n\t\t}\n\t})\n\n\t/**\n\t * no parameters\n\t */\n\tsocket.on('leave', (params, response) => {\n\t\tif(!players[clientId].room) {\n\t\t\tresponse({status: 'ko', err: 'You are not a member of any room'})\n\t\t} else {\n\t\t\trmPlayerFromRoom(players[clientId].room, clientId)\n\t\t\tresponse({status: 'ok'})\n\t\t}\n\t})\n\n\t/**\n\t * player: str\n\t * roles: [role1, role2, ...]\n\t */\n\tsocket.on('addRoles', (params, response) => {\n\t\tconst roomId = players[clientId].room\n\t\tif(!roomId) {\n\t\t\tresponse({status: 'ko', err: 'You are not a member of any room'})\n\t\t} else if(rooms[roomId].host !== clientId) {\n\t\t\tresponse.status(401).send({err: 'Admin role required'})\n\t\t} else if(!(params.player in players) || players[params.player].room !== roomId) {\n\t\t\tresponse({status: 'ko', err: 'Player \\'' + params.player + '\\' is not in room \\'' + roomId + '\\''})\n\t\t} else {\n\t\t\taddPlayerRoles(roomId, params.player, params.roles)\n\t\t\tio.to(roomId + '/all').emit('connected', clientId, {player: params.player, room: getRoomDescription(roomId)})\n\t\t\tresponse({status: 'ok'})\n\t\t}\n\t})\n\n\t/**\n\t * player: str\n\t * roles: [role1, role2, ...]\n\t */\n\tsocket.on('rmRoles', (params, response) => {\n\t\tconst roomId = players[clientId].room\n\t\tif(!roomId) {\n\t\t\tresponse({status: 'ko', err: 'You are not a member of any room'})\n\t\t} else if(rooms[roomId].host !== clientId) {\n\t\t\tresponse.status(401).send({err: 'Admin role required'})\n\t\t} else if(!(params.player in players) || players[params.player].room !== roomId) {\n\t\t\tresponse({status: 'ko', err: 'Player \\'' + params.player + '\\' is not in room \\'' + roomId + '\\''})\n\t\t} else if('host' in params.roles || 'all' in params.roles) {\n\t\t\tresponse({status: 'ko', err: 'Cannot remove host and all rôles'})\n\t\t} else {\n\t\t\trmPlayerRoles(roomId, params.player, params.roles)\n\t\t\tio.to(roomId + '/all').emit('connected', clientId, {player: params.player, room: getRoomDescription(roomId)})\n\t\t\tresponse({status: 'ok'})\n\t\t}\n\t})\n\n\t/**\n\t * to: str (playerId)\n\t * cmd: str (command code)\n\t * content: <any>\n\t *\n\t * Will send to specified user, command id \"private/<cmd>\" with given content\n\t */\n\tsocket.on('tell', (params, response) => {\n\t\tconst roomId = players[clientId].room\n\t\tif(!roomId) {\n\t\t\tresponse({status: 'ko', err: 'You are not a member of any room'})\n\t\t} else if(!(params.to in players) || players[params.to].room !== roomId) {\n\t\t\tresponse({status: 'ko', err: 'Cannot find player \\'' + params.to + '\\' in room \\'' + roomId + '\\''})\n\t\t} else {\n\t\t\tplayers[params.to].socket.emit('private/' + params.cmd, clientId, params.content)\n\t\t\tresponse({status: 'ok'})\n\t\t}\n\t})\n\n\t/**\n\t * to: str (role)\n\t * cmd: str (command code)\n\t * content: <any>\n\t *\n\t * Will send to all users having the 'to' role in the room, command id \"<to>/<cmd>\" with given content\n\t */\n\tsocket.on('comm', (params, response) => {\n\t\tconst roomId = players[clientId].room\n\t\tif(!roomId) {\n\t\t\tresponse({status: 'ko', err: 'You are not a member of any room'})\n\t\t} else if(!(params.to === 'host' || params.to === 'all' || params.to in rooms[roomId].roles)) {\n\t\t\tresponse({status: 'ko', err: 'Role \\'' + params.to + '\\' does not exists'})\n\t\t} else {\n\t\t\tio.to(roomId + '/' + params.to).emit(params.to + '/' + params.cmd, clientId, params.content)\n\t\t\tresponse({status: 'ok'})\n\t\t}\n\t})\n\n\t/**\n\t * room: str\n\t *\n\t * Get information about a room\n\t */\n\tsocket.on('info', (params, response) => {\n\t\tif(!params.room || !ROOM_CODE_REGEXP.test(params.room)) {\n\t\t\tresponse({status: 'ko', err: 'Wrong room id \\'' + params.room + '\\''})\n\t\t} else if(params.room in rooms) {\n\t\t\tresponse({status: 'ok', room: getRoomDescription(params.room)})\n\t\t} else {\n\t\t\tresponse({status: 'ok', room: null})\n\t\t}\n\t})\n}", "_addUserToRoom(userId, room) {\n\t\tlet roomId = String(room.id);\n\n\t\t// add the room if it does not exist jet\n\t\tif (this._rooms[roomId] === undefined) {\n\t\t\tthis._rooms[roomId] = {\n\t\t\t\t'obj'\t: room,\n\t\t\t\t'users'\t: []\n\t\t\t};\n\t\t}\n\n\t\t// add the user to the room\n\t\tthis._rooms[roomId].users.push(userId);\n\n\t\t// add the room to the user\n\t\tthis._users[userId].rooms.push(roomId);\n\t}", "function hostGame(data) {\n \n if (data != \"\" || data.toLowerCase() != \"local\") {\n if (data in gameRoomDict) {\n console.log(data + \" is already a game room.\"); \n }\n else {\n roomAdjust();\n room = data;\n clients.sock = data;\n gameRoomDict[data] = [socket.id]; \n var stuff = [data, \"host\"]\n io.to(socket.id).emit('connectedH', stuff);\n }\n }\n }", "addRoom(name, author, author_id) {\n\n \t// check is the room name is't exist\n \tvar x = this.getRoomByName(name);\n \tif (x) {\n \t\treturn false ;\n \t}\n var id = uniqid();\n var room = {\n id : uniqid(),\n author : author,\n name : name,\n author_id: author_id\n };\n this.rooms.push(room);\n return true;\n }", "function joinRoom() {\n const code = document.getElementById(\"roomCodeInput\").value;\n socket.emit(\"joinRoom\", code);\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 connection(socket) {\n var player;\n var game; // current game. Allow only one game per session for now.\n /**\n * checks the client's authKey cookie\n * @param data\n */\n function setAuthKey(data) {\n var authKey = data.authKey;\n // does the player exist in memory?\n player = players.get(authKey);\n if (player) {\n // is he currently in a session?\n if (player.socket) {\n publish('auth.response', {\n type: 'error',\n error: \"You're already connected to a game.\"\n });\n } else {\n playerSetData();\n }\n } else {\n publish('auth.response', {\n type: 'new_user'\n });\n }\n // when the client disconnects, we check if the game is empty,\n // then remove the game from the list.\n subscribe('disconnect', function() {\n player.disconnect();\n if (game) {\n if (game.connectedPlayers() === 0) {\n games.remove(game);\n } else {\n game.userDisconnect();\n }\n }\n });\n subscribe('player.set.name', setName);\n }\n\n function playerSetData() {\n player.connect(socket);\n subscribe('game.find', findGame);\n publish('auth.response', {\n type: 'connected',\n id: player.id,\n name: player.name,\n authKey: player.authKey,\n expiresIn: player.expiresIn,\n expires: player.expires\n });\n }\n /**\n * Sets the name of the player from the client.\n * @param data\n */\n function setName(data) {\n if (!player) {\n player = new Player();\n player.name = data.name;\n players.add(player);\n playerSetData();\n } else {\n player.name = data.name;\n }\n publish('player.set.name', { name: player.name });\n \n //console.log( \"| player \" , player);\n }\n /**\n * Registers the current player to the room.\n * @param game\n * @return {*}\n */\n function joinGame(game, team) {\n var gameID = game.id;\n // reason why we're using a collection method is that so\n // we can update the vacant games in the list.\n games.occupy(game, player, team);\n // this will tell the client what happened in the game.\n // which is useful for watching replays.\n game.backlogs(function(name, data){\n publish(name, data);\n });\n // when the player's assets are loaded\n subscribe('ready', playerReady);\n // subscribe the user to the game list.\n socket.join(gameID);\n // Tell the client, he's subscribed to a game.\n publish('game.join', { id: gameID });\n \n //console.log( \"joinGame \" , game);\n return game;\n }\n /**\n * Fins a game to join. If none exists, it'll create one.\n */\n function findGame(parameters) {\n var team = parameters.team;\n var mode = parameters.mode;\n if (game === undefined) {\n switch (mode) {\n case 'tutorial':\n game = joinGame(createGame(1), team);\n break;\n default:\n game = joinGame(games.available() || createGame(), team);\n break;\n }\n }\n }\n /**\n * Creates a new game object.\n * @return {*}\n */\n function createGame(maxPlayers) {\n maxPlayers || (maxPlayers = 2);\n var game = new Game({ maxPlayers: maxPlayers });\n var gameID = game.id;\n game.on('log', function(event) {\n io.sockets.in(gameID).emit(event.name, event.data);\n console.log(\n \"| createGame Game (\" + game.id + \"): \",\n event.name, '->',\n JSON.stringify(event.data)\n );\n });\n games.add(game);\n \n //console.log( \"| Game \" , JSON.stringify(games) );\n return game;\n }\n /**\n * When the player has successfully loaded the assets in the game.\n */\n function playerReady() {\n if (game) {\n game.playerReady(player);\n // all the game events\n subscribe('unit.move', unitMove);\n subscribe('unit.attack', unitAttack);\n subscribe('unit.skip', unitSkip);\n console.log( \"playerReady\" );\n }\n }\n\n function unitAttack(parameters) {\n var tile;\n // check if there's a current game.\n if (game && game.winner === null) {\n // check if the current active unit is from the players.\n if (game.activeUnit && game.activeUnit.playerId === player.id) {\n tile = game.grid.get(parameters.x, parameters.y);\n if (tile) {\n game.actUnit(game.activeUnit, tile);\n //console.log( \"| activeUnit \" , JSON.stringify(game.activeUnit) );\n }\n }\n }\n }\n\n function unitSkip(unitId) {\n var activeUnit = game.activeUnit;\n if (game.winner === null) {\n if (activeUnit.playerId === player.id) {\n if (activeUnit.id === unitId ){\n game.skip(unitId);\n //console.log( \"| skip \" , unitId );\n \n }\n }\n }\n }\n\n function unitMove(data) {\n var tile;\n var activeUnit = game.activeUnit;\n // if the game isn't finished yet\n if (game.winner === null) {\n if (activeUnit && activeUnit.playerId === player.id) {\n if (tile = game.grid.get(data.x, data.y)) {\n game.move(activeUnit, tile);\n }\n }\n }\n }\n\n function publish(topic, data) {\n socket.emit(topic, data);\n }\n\n function subscribe(topic, callback) {\n socket.on(topic, callback);\n }\n\n // Listen to only one event first which is the authentication\n // before proceeding to anything else.\n subscribe('auth', setAuthKey);\n }", "function playerCreateNewGame(data) {\n // Create a unique Socket.IO Room\n var thisGameId = ( Math.random() * 100000 ) | 0;\n\n // Return the Room ID (gameId) and the socket ID (mySocketId) to the browser client\n game.gameId = thisGameId;\n game.mySocketId = this.id;\n game.players[this.id] = {\n gameId: thisGameId,\n mySocketId: this.id,\n playerName: data.playerName,\n totalHp: 1000,\n hp: 1000,\n totalMana: 100,\n mana: 100,\n summons: [],\n buffs: [],\n cooldowns: {},\n baseCooldowns: {},\n };\n game.players[1] = {\n gameId: thisGameId,\n mySocketId: 1,\n playerName: 'Test Bot',\n totalHp: 1000,\n hp: 1000,\n totalMana: 100,\n mana: 100,\n summons: [],\n buffs: [],\n cooldowns: {},\n baseCooldowns: {},\n };\n this.emit('newGameCreated', game);\n //console.log(thisGameId+\" # \"+this.id);\n\n // Join the Room and wait for the players\n this.join(thisGameId.toString());\n //console.log(gameSocket.adapter.rooms);\n}", "function joinGame(data) {\n \n //Check if room exists\n if (data in gameRoomDict) {\n if (gameRoomDict[data].length < 2) {\n io.to(gameRoomDict[data][0]).emit('p2Joined');\n room = data;\n clients.sock = data;\n console.log(\"You have joined the lobby named: \" + data);\n gameRoomDict.data = gameRoomDict[data].push(socket.id);\n var stuff = [data, \"join\"]\n io.to(socket.id).emit('connectedG', stuff);\n console.log(gameRoomDict[data]);\n }\n else {\n console.log(\"Sorry this room is full\");\n }\n }\n else {\n console.log(data + \" does not exist in the list of current lobbies.\");\n }\n }", "function enterRoom(player)\n{\n\tconsole.log(\"joining a room\");\n\tvar key = Object.keys(rooms);\n\t\n\tfor(var i = 0;i<key.length;i++)\n\t{\n\t\tconsole.log(\"looking into room \"+rooms[key[i]].name);\n\t\tif(Object.keys(rooms[key[i]].players).length < 2)\n\t\t{\n\t\t\tconsole.log(\"joining existing room \" +rooms[key[i]]);\n\t\t\t\n\t\t\tplayer.socket.join(rooms[key[i]].name);\n\t\t\tplayer.socket.room = rooms[key[i]].name;\n\t\t\trooms[key[i]].players[player.id] = player;\n\t\t\t\n\t\t\tvar opponent = findOpponent(player, player.socket);\n\t\t\t\n\t\t\tif(opponent)\n\t\t\t{\n\t\t\t\tvar playerStats = \n\t\t\t\t{\n\t\t\t\t\tnumCards: Object.keys(player.cardsInHand).length,\n\t\t\t\t\tnumDeck: Object.keys(player.deck).length,\n\t\t\t\t\tgrave: player.grave,\n\t\t\t\t\tboard: boards[player.socket.room],\n\t\t\t\t\tfield: player.field\n\t\t\t\t};\n\t\t\t\t\n\t\t\t\tvar opponentStats = \n\t\t\t\t{\n\t\t\t\t\tnumCards: Object.keys(opponent.cardsInHand).length,\n\t\t\t\t\tnumDeck: Object.keys(opponent.deck).length,\n\t\t\t\t\tgrave: opponent.grave,\n\t\t\t\t\tboard: boards[player.socket.room],\n\t\t\t\t\tfield: opponent.field\n\t\t\t\t};\n\t\t\t\t\n\t\t\t\topponent.socket.emit(\"playerConnected\", playerStats);\n\t\t\t\tplayer.socket.emit(\"playerConnected\", opponentStats);\n\t\t\t\tconsole.log();\n\t\t\t\t\n\t\t\t\tfor(var i = 0;i<3;i++)\n\t\t\t\t{\n\t\t\t\t\tdrawCard(player);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(opponent.cardsInHand.length == 0)\n\t\t\t\t{\n\t\t\t\t\tfor(var i = 0;i<3;i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tdrawCard(opponent);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//console.log(\"current players \");\n\t\t\t\t//console.dir(rooms[key[i]].players);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tconsole.log(\"finished looking into room \"+rooms[key[i]]);\n\t}\n\t\n\tvar roomName = \"room\"+roomNum;\n\t\n\tplayer.socket.join(roomName);\n\tplayer.socket.room = roomName;\n\tplayers[player.id] = player;\n\t\n\tvar room = \n\t{\n\t\tname: roomName,\n\t\tplayers: []\n\t};\n\t\n\tvar board = new Array(7);\n\tfor(var x = 0; x < 7; x++)\n\t{\n\t\tboard[x] = new Array(5);\n\t}\n\tconsole.dir(board);\n\tboards[roomName] = board;\n\t\n\trooms[roomName] = room;\n\trooms[roomName].players[player.id] = player;\n\t\n\troomNum++;\n\tconsole.log(\"joined \"+roomName);\n\t//console.dir(rooms);\n}", "function joinroom(data) {\n\tvar tmproom = data;\n\tif (player != \"\" && passcode != \"\" && tmproom >= 0) {\n\n\t\tvar geturl = \"/sanaruudukko/rest/sr/process?func=joinroom&player=\" + player + \"&passcode=\" + passcode + \"&room=\" + tmproom;\n\t\t$.ajax({\n\t\t\tcache: false,\n\t\t\tdataType : 'xml',\n\t\t\ttype : 'GET',\n\t\t\turl : geturl,\n\t\t\tsuccess : function(data) {\n\t\t\t\tstartRoom(data);\n\t\t\t},\n\t\t});\n\t}\n}", "function addPlayer(player) {\n ws.send(JSON.stringify({\n type: \"addPlayer\",\n player: player\n }));\n\n view.clearPlayer();\n }", "function addRoom() {\n\tvar roomName = $('#add-room-name').val();\n\tvar posting = $.post(roomsAddURI, {\n\t\tname : roomName\n\t});\n\tposting.done(function(data) {\n\t\t//Add room via rest api then join it\n\t\tvar room = JSON.parse(JSON.stringify(data));\n\t\tjoinRoom(room.roomId, true);\n\t});\n}", "function joinRoom(e, roomAlreadyCreated) {\n e.preventDefault();\n if (roomAlreadyCreated) {\n if (!document.getElementById(\"username_shareableRoom\").value.length < 1) {\n userName = document.getElementById(\"username_shareableRoom\").value;\n socket.open();\n var enteredRoomName = document.getElementById(\"roomToJoin\").value;\n userName = document.getElementById(\"username_shareableRoom\").value;\n socket.emit(\"joinRoom\", enteredRoomName, userName);\n currentRoom = enteredRoomName;\n MicroModal.close(\"shareableRoomCreatedModal\");\n // showStartGameButton();\n } else {\n document.getElementById(\"username_shareableRoom\").style.border =\n \"2px solid red\";\n setTimeout(function () {\n document.getElementById(\"username_shareableRoom\").style.border =\n \"2px solid black\";\n }, 3000);\n }\n } else {\n if (username()) {\n socket.open();\n var enteredRoomName = document.getElementById(\"enteredRoomName\").value;\n userName = document.getElementById(\"userName\").value;\n socket.emit(\"joinRoom\", enteredRoomName, userName);\n currentRoom = enteredRoomName;\n }\n }\n}", "function validateDriver(socket, room, username, roomDrivers, roomUsers){\n return validateUser(socket, room, username, roomUsers)\n && roomDrivers[room] && roomDrivers[room] == socket.id;\n}", "function joinChatRoom(player) {\n\n var sessionID = player.sessionID;\n var room = player.params.map;\n\n io.sockets.sockets[sessionID].join(room);\n console.log(getTime() + ' ' + player.params.name + '[' + player.playerID + '] ENTERED ' + room);\n}", "function addRoom(sockets, device) {\n return new Promise((resolve) => {\n // Check if the device room already exists\n const deviceRoom = getRoomName(device.device_id);\n const roomExists = sockets.adapter.rooms.has(deviceRoom);\n\n // If the device room does't exist and we haven't seen this device before\n if (!roomExists && !recentDeviceRooms.includes(deviceRoom)) {\n // Save this device room so we don't have to check again\n recentDeviceRooms.push(deviceRoom);\n\n // Find out who is the owner of the device (based on the API key)\n usr.getUserByField('api_key', device.api_key).then((queryRes) => {\n // Add a new device room to every socket used by the owner\n for (let socket of sockets.sockets.values()) {\n if (socket.userId === queryRes.rows[0].user_id) {\n socket.join(getRoomName(device.device_id), () => {\n resolve();\n });\n }\n }\n });\n } else {\n resolve();\n }\n });\n}", "function addConnection (user, socket) {\n\tif(!userIsConnected(user)) {\n\t\tconnections.push({user: user, socket: socket });\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "playerAttemptLeaveRoom(socket, data) {\n Logger.logInfo('socket ' + socket.id + ' disconnecting...');\n var roomCode = this._getRoomCodeFromSocket(socket);\n\n if (this.roomExists(roomCode)) {\n this.getRoom(roomCode).disconnectPlayer(socket);\n socket.leave(roomCode, () => {\n socket.emit('playerLeaveRoomSuccess', {});\n });\n this.getRoom(roomCode).playerMap.emitCustomToAll('updateLobby', (socket) => {\n return this.getRoom(roomCode).getLobbyData(socket);\n });\n } else {\n socket.emit('playerLeaveRoomFailure', {\n reason: 'Room does not exist'\n });\n return;\n }\n\n if (this.getRoom(roomCode).socketsEmpty()) {\n this.removeRoom(roomCode);\n }\n }", "function addPersonToRoom (room_name, id, person_name) {\n \t// we store the person name in the socket session as people of the current room\n\t// e.g. { socket.id: nameOfThePerson }\n \tfor (var i=0; i<chatRooms.length; i++) {\n \t\tif (chatRooms[i]['roomname'] === room_name) {\n \t\t\tchatRooms[i].people[id] = person_name;\n \t\t}\n \t}\n }", "function joinRoom() {\n const roomId = this.id.substr(5, this.id.length-5)\n player.updatePlayer1(false);\n //player.setPlayerType(false);\n socket.emit('joinGame', { name: player.name, room: this.id });\n\n //player = new Player(player.name, P2);\n }", "function addPlayer(player) {\n ws.send(JSON.stringify({\n action: \"addPlayer\",\n player: player\n }));\n\n view.clearPlayer();\n }", "roomExists(roomCode) {\n return this.rooms.hasOwnProperty(roomCode);\n }", "function addUser(data, socket){\n console.log(\"netId: \" + data.netid);\n clients[data.netid] = {\n socket: socket.id\n };\n}", "function joinGame() {\n let userName = gameNameInput.value;\n if (checkUserName(userName)) {\n if (userName === \"\") {\n userName = \"$guest\";\n }\n const code = gameCodeInput.value;\n if (code == \"\") {\n sock.emit('newGame', userName);\n } else {\n sock.emit('joinGame', code, userName);\n }\n } else {\n gameNameInput.value = \"\";\n }\n}", "function join(socket, roomCode, callback) {\n if (socket && socket.join) {\n socket.join(roomCode, callback);\n }\n}", "function attachPlayerToRoom(request, player)\n {\n roomCount[player.diff_lvl]++;\n request.io.join(player.diff_lvl);\n console.log('JOIN [' + player.diff_lvl + '] (' + player.player_tag + '): roomCount=', roomCount[player.diff_lvl]);\n\n request.io.room('' + player.diff_lvl).broadcast('gamer_entered_room', { player_tag: player.player_tag, points: player.points } );\n console.log('BROADCAST [' + player.diff_lvl + ']: gamer_entered_room -- ' + player.player_tag ); \n }", "function addPlayer(playerName,playerLocation,card1,card2,card3) {\n\t//check to see if 'playerName' already exists in a list of players; if it does not, add it\n\tif(players.indexOf(playerName)===-1) {\n\t\tplayers.push(playerName);\n\t\tplayersLocations.push(playerLocation);\n\t\tcards1.push(card1);\n\t\tcards2.push(card2);\n\t\tcards3.push(card3);\n\t} else {\n\t\tconsole.log(playerName+\" already exists!\");\n\t}\n}", "function addPlayerToGame() {\n\tconst listItem = document.createElement('li')\n\tconst name = addPlayersInput.value\n\tlistItem.innerText = name\n\n\t// If there already exists a player with this name, get mad!\n\tif (players.some(player => player.name === name)) {\n\t\talert(`Player with the name \"${name}\" already exists`)\n\t\treturn\n\t} else if (name.length === 0) {\n\t\talert('Name may not be empty')\n\t\treturn\n\t}\n\n\taddPlayersList.appendChild(listItem)\n\taddPlayersInput.value = ''\n\n\tplayers.push(new Player(name))\n}", "function peer_register(socket, msg)\n{\n\tlet id = jwk2id(msg.jwk);\n\tlet name = words(\"0x\" + id);\n\n\t// sanitize the room name to only be normal characters\n\tconst room = msg.room;\n\tif ((/[^-\\w]/.test(room))) {\n\t\tconsole.log(name + \": invalid room name\", room);\n\t\treturn;\n\t}\n\n\tif (socket.key)\n\t{\n\t\t// disconnect the old key (and update the room if\n\t\t// the room has changed)\n\t\tpeer_disconnect(socket, room != socket.room);\n\t}\n\n\tsocket.join(room);\n\tsocket.room = room;\n\tsocket.name = name;\n\tsocket.key = msg.jwk;\n\n\tif (!(room in peers))\n\t\tpeers[room] = {};\n\n\tpeers[room][name] = msg.jwk;\n\n\tconsole.log(room + ': register', name);\n\n\tio.to(room).emit('peers', Object.values(peers[room]));\n\tconsole.log(room + ': peers', Object.keys(peers[room]));\n}", "function onNewPlayer(data) {\n // Create a new player\n //var newPlayer = new Player(data.x, data.y);\n //newPlayer.id = this.id;\n\n // Broadcast new player to connected socket clients\n this.broadcast.to(data.roomId).emit(\"new player\", data.gameData);\n\n // send existing player to new player\n if (socket.sockets.clients(data.roomId).length == 2)\n this.emit(\"new player\", {gameData: players[socket.sockets.clients(data.roomId)[1].id]});\n\n // console.log(\"Hello. New player connected: \"+data.id);\n // urlString = \"battle.html?id=\" + data.id;\n //document.getElementById(\"linkPlaceholder\").innerHTML = \"Invite your friend to <a href=\" +urlString + \">\" + urlString\n // + \"</a>\";\n //rooms[this.id] = new Room(this.id);\n //this.emit(\"new room\", {id: this.id});\n // Send existing players to the new player\n /* var i, existingPlayer;\n /for (i = 0; i < players.length; i++) {\n existingPlayer = players[i];\n this.emit(\"new player\", {id: existingPlayer.id, x: existingPlayer.getX(), y: existingPlayer.getY()});\n };*/\n\n // Add new player to the players array\n players[this.id] = data.gameData;\n}", "function check_username(socket, type, username){\n\n var rID = roomID(type);\n var dfd = new $.Deferred();\n\n //Get the list of users in the room\n //and check if any of them conflict\n //with username\n socket.emit('get_users', {room: rID});\n socket.once('send_users', function(data){\n var users = data.usernames;\n for(var user in users){\n if(users[user] == username){\n dfd.resolve( true );\n }\n }\n dfd.resolve( false );\n });\n return dfd.promise();\n}", "function loginPlayer(username, socketid) {\n /* Make sure user is not already logged in */\n for (player of players)\n if (player.username == username) disconnectPlayer(player.socketid);\n\n sendChat(username + \" \" + joinedMessages[Math.floor(Math.random() * joinedMessages.length)], \"#f4d742\", \"Server\");\n\n var player = {\n inventory: [],\n outfit: {},\n position: {},\n id: 0,\n walking: false,\n flipped: false,\n username: username,\n socketid: socketid,\n blinking: 0\n }\n\n con.query(\"SELECT * FROM `users` WHERE upper(username) = \" + sanitize.escape(username).toUpperCase(), (error, result) => {\n if (!error) {\n res = result[0];\n player.position.x = res.position_x;\n player.position.y = res.position_y;\n player.username = res.username; // ensure capital letters are correct\n player.id = res.id;\n player.outfit = JSON.parse(res.outfit);\n if (res.inventory == \"\") player.inventory = [];\n else player.inventory = JSON.parse(res.inventory);\n\n players.push(player);\n io.to(player.socketid).emit(\"game\", {\n map: map,\n items: items,\n player: player,\n chat: chat,\n droppedItems: droppedItems\n })\n }\n })\n }", "function handlePlayerJoin(username, socket) {\n // Calculate a random position for the player\n const posX = Math.floor(Math.random() * 2800) + 100;\n const posY = Math.floor(Math.random() * 1800) + 100; \n \n const state = {\n id: socket.id, \n username: username, \n pos: {x: posX, y: posY}, \n vel: {x: 0, y: 0},\n aimAngle: 0,\n canShoot: true, \n hp: 100, \n points: 0\n };\n\n // Set the player state and emit state to all players\n players[socket.id] = state;\n socket.emit(\"clientState\", state);\n socket.broadcast.emit(\"playerStates\", players);\n\n // If this is the first player in the game, start interval to emit states\n if (Object.keys(players).length === 1) {\n sendStates();\n }\n}", "function sendToGame(rooms) {\r\n\tconsole.log(rooms);\r\n\troomState = rooms[0];\r\n\troomCode = rooms[1];\r\n\t\r\n\tupdateStatList(rooms);\r\n\t\r\n\tif (Object.keys(roomState[roomCode][\"players\"]).length == 1) {\r\n\t\tsocket.emit('requestGame', roomCode);\r\n\t}\r\n\telse {\r\n\t\twhile (roomState[roomCode]['test'].length === 0){\r\n\t\t\tconsole.log('Player waiting');\r\n\t\t}\r\n\t\tdisplayGame(roomCode);\r\n\t}\r\n}", "addPlayer (id, name, home) {\n // create entry for player in 'this._players' list\n this._players[id] = new Player(name, home)\n console.log('new player added ---')\n console.log(this._players[id])\n\n this.updateTurns(id, home)\n }", "function onNewPlayer (data) {\n\n var newPlayer;\n // Create a new player\n if(playerById(this.id)){\n newPlayer = playerById(this.id);\n } else {\n newPlayer = new Player(this.id)\n }\n\n if(pcByPlayerName(data.name) == false){\n //newPlayer.PC = pcByPlayerName('TEMPDEFAULT');\n //console.log('USING TEMPDEFAULT USER ' + newPlayer.PC.name);\n console.log('USER ' + this.id + ' NEEDS TO CREATE NEW CHARACTER');\n\n socket.to(this.id).emit('create new character', {id: newPlayer.id});\n return;\n } else {\n //newPlayer.PC = pcByPlayerName(data.name);\n //players.push(newPlayer)\n //newPlayer.PC = pcByPlayerName(data.name);\n socket.to(this.id).emit('start mud', {id: this.id}); //Goes to onPlayerStarted\n\n }\nreturn;\n}", "function addUser ({id, name, room}) {\n //1. simply remove white space and make of the letters lowercase\n name = name.trim().toLowerCase();\n room = room.trim().toLowerCase();\n\n //2. going through the users array (LINE 2), and checking if the user's name already exists for that specific room.\n const existingUser = users.find(user => user.room === room && user.name === name );\n \n //3,. if existing user is found, send an error statement\n if(existingUser) {\n return {error: \"Username is taken!\"}\n }\n\n //4. if there is no user with particular name in that particular room, then create an object with the necessary details of the user \n const user = {id, name, room};\n //push the object inside of the users array \n users.push(user);\n return {user}\n}", "function requestCreateRoom() {\r\n if (inputRoomName.value()) {\r\n socket.emit(\"createRoomRequest\", inputRoomName.value(), (response) => {\r\n if(!response){\r\n errorNameUsed(inputRoomName.value());\r\n } else{\r\n createUserRoom(inputRoomName.value());\r\n }\r\n });\r\n currentRoom = inputRoomName.value();\r\n }\r\n}", "function joinRoom() {\n var u = document.getElementById(\"username\").value;\n if(u === \"\") {\n setJoinError(\"Please choose a username\");\n return;\n }\n var r = document.getElementById(\"room\").value;\n if(r === \"\") {\n setJoinError(\"Please enter a room\");\n return;\n }\n var c = document.getElementById(\"color\").value;\n if(c === \"\") {\n setJoinError(\"Please choose a color\");\n return;\n }\n r = r.replace(/\\s+/g, ''); // Remove whitespace from room name\n r = r.toLowerCase();\n var join_message = {username: u, room: r, color: c};\n Game = new MultiplayerGame(u, r);\n socket.emit('join', join_message)\n}", "function connectGameRoom() {\r\n\tgameSocketUdp.connect(gameSocks.socketId, MAIN_SERVER_ADDRESS, GAME_PORT, connectGameSocketComplete);\r\n}", "function _registerPlay(player) {\n\t\t// We are going to register the current player play with the server.\n\t\t// There can be 4 possible status' returned:\n\t\t// 1. win - player has won!\n\t\t// 2. continue - not won but has more plays left today\n\t\t// 3. lose - player has lost\n\t\t// 4. error - player not found or play not registered\n\t\t$.getJSON( \"/v5/gameapi.php?action=registerPlay\", { player: player } )\n\t\t\t.done( function( json ) {\n\t\t\t\tlog('API: _registerPlay returned: player: '+json.player+' , status: '+json.status);\n\t\t\t\tlog( \"API: Raise event: playRegistered\" );\n\t\t\t\t$.event.trigger({\n\t\t\t\t\ttype: \"playRegistered\",\n\t\t\t\t\tplayer: json.player,\n\t\t\t\t\tstatus: json.status\n\t\t\t\t});\n\t\t\t})\n\t\t\t.fail( function( jqxhr, textStatus, error ) {\n\t\t\t\tvar err = textStatus + ', ' + error;\n\t\t\t\tlog( \"API: _registerPlay Request Failed: \" + err);\n\t\t\t});\n\t}", "function validateAdmin(socket, room, username, roomAdmins, roomUsers){\n return validateUser(socket, room, username, roomUsers) \n && roomAdmins[room] && roomAdmins[room] == socket.id;\n}", "checkForPlayer(authCode) {\n\t\tif (authCode in this.auth)\n\t\t\treturn this.auth[authCode];\n\t\telse\n\t\t\treturn false;\n\t}", "async function addPlayer(client, gameKey, playerName) {\n function validationFn(game) {\n if (game.players.length >= 5) {\n throw new Error(`Game ${gameKey} has enough players`);\n }\n if (game.state != \"OPEN\") {\n throw new Error(`Game ${gameKey} does no longer accept new players`);\n }\n }\n\n let newPlayer;\n // Create and append new player to game\n function transformationFn(game) {\n newPlayer = _.cloneDeep(PLAYER_MODEL);\n newPlayer.key = _.uniqueId(\"player_\");\n newPlayer.name = playerName;\n game.players.push(newPlayer);\n return game;\n }\n\n await apiUtils.editGame(client, gameKey, validationFn, transformationFn);\n\n return newPlayer;\n}", "function joinGame(socket) {\n let players, unmatched;\n return new Promise(async (resolve, reject) => {\n client.hgetall(\"key\", (err, value) => {\n if (!value) {\n client.hmset(\"key\", \"unmatched\", \"\", \"players\", JSON.stringify({}));\n players = {};\n unmatched = \"\";\n } else {\n players = JSON.parse(value.players);\n unmatched = value.unmatched;\n }\n\n players[socket.id] = {\n opponent: unmatched,\n id: socket.id,\n symbol: \"X\",\n };\n if (unmatched && unmatched != \"\") {\n players[socket.id].symbol = \"O\";\n players[unmatched].opponent = socket.id;\n unmatched = \"\";\n } else {\n unmatched = socket.id;\n }\n client.hmset(\n \"key\",\n \"unmatched\",\n unmatched,\n \"players\",\n JSON.stringify(players)\n );\n\n return resolve(true);\n });\n });\n}", "function addFriendToGroup(room) {\n Comm.addFriendToGroup(room).then(()=> {\n });\n }", "function GameSocketServer(io, debug) {\n io.on('connection', socket => {\n\n if (debug) console.log(`Client joined! id: ${socket.id}`)\n\n // Triggered on room creation or joining\n socket.on('room', (username, userType, roomCode) => {\n\n // Set socket info\n socket.username = username\n socket.userType = userType\n\n const rooms = io.sockets.adapter.rooms\n\n if (socket.userType === 'player') {\n if (debug) console.log(`Player ${socket.username} wants to join a room.`)\n\n if (rooms[roomCode]) {\n // If the room exists\n if (debug) console.log(`Player ${socket.username} joined a room. code: ${roomCode}`)\n joinOrCreateRoom(roomCode)\n } else {\n // If the room does not exist\n if (debug) console.log(`Player ${socket.username} requested a non-existent room.`)\n socket.emit('no_room', 'Room does not exist.')\n }\n } else if (socket.userType === 'gm') {\n if (debug) console.log(`GM ${socket.username} requested a room.`)\n if (!rooms[roomCode]) {\n // If the room does not exist already, generate a new code\n // This prevents GMs from setting their own room code\n roomCode = genRoomCode()\n if (debug) console.log(`GM ${socket.username} created a room. code: ${roomCode}`)\n } else {\n // If the room exists already, don't set a new code, so they just join the room\n if (debug) console.log(`GM ${socket.username} joined a room. code: ${roomCode}`)\n }\n joinOrCreateRoom(roomCode)\n } else {\n // If anything other than the right user types were set\n socket.userType = 'player'\n socket.emit('error', 'Invalid user type.')\n }\n })\n\n // Short hand callback for broadcasting new stores\n socket.on('broadcast_stores', broadcastStores)\n\n // Short hand callback for broadcasting clear stores message\n socket.on('clear_stores', clearStores)\n\n // Sometimes the socket is undefined on improper disconnection\n socket.on('disconnect', reason => {\n if (socket) {\n updateGMRoomMembers()\n }\n const name = socket.username || \"Someone\"\n if (debug) console.log(`${name} disconnected: ${reason}`)\n })\n\n // Sends room members in a callback\n function getRoomMembers(cb) {\n // Get all room members\n io.of('/').in(socket.roomCode).clients((error, clients) => {\n if (error) throw error\n // Create empty room\n const roomPkg = [],\n connected = io.sockets.connected\n for (let id of clients) {\n // Get each socket by id\n const client = connected[id]\n // Push the socket info into the room\n roomPkg.push({\n id: id,\n username: client.username,\n userType: client.userType\n })\n }\n cb(roomPkg)\n })\n }\n\n // Sends a GM the current room member information\n function updateGMRoomMembers() {\n getRoomMembers(members => {\n for (let member of members) {\n // Find the GM\n if (member.userType === 'gm') {\n // Send them the members\n io.to(member.id).emit('room_members', members)\n return\n }\n }\n })\n }\n\n // Sends store information to all selected recipients\n function broadcastStores(stores, recipients) {\n if (debug) {\n console.log(\"Sending stores:\")\n console.log(stores)\n console.log(\"To:\")\n console.log(recipients)\n }\n for (var i = 0; i < recipients.length; i++) {\n io.to(recipients[i]).emit('new_stores', stores)\n }\n }\n\n // Sends a clear stores message to selected recipients\n // If none are provided, it sends the message to whole room\n function clearStores(recipients) {\n if (!recipients.length) {\n getRoomMembers(members => {\n sendClearStoresMessage(members)\n })\n } else {\n sendClearStoresMessage(recipients)\n }\n }\n\n // Helper function\n function sendClearStoresMessage(recipients) {\n for (var i = 0; i < recipients.length; i++) {\n io.to(recipients[i].id).emit('clear_stores')\n }\n }\n\n // Adds the socket to a room if it exists, or creates and then adds if it doesn't\n function joinOrCreateRoom(roomCode) {\n socket.join(roomCode, () => {\n // Sets the socket's room code\n socket.roomCode = roomCode\n // Sends room code to client\n socket.emit('room_joined', roomCode)\n // Updates GM's player list\n updateGMRoomMembers()\n })\n }\n\n // Generates a 5 character room code\n function genRoomCode() {\n const roomSeed = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',\n rooms = io.sockets.adapter.rooms;\n let code\n do {\n code = ''\n for (var i = 0; i < 5; i++) {\n code += roomSeed[getRandomInt(roomSeed.length)]\n }\n // Keep generating new codes if the code is already in use\n } while (rooms[code])\n return code\n }\n\n // Helper function\n function getRandomInt(upperBound) {\n return Math.floor(Math.random() * upperBound)\n }\n\n })\n}", "function inside(socket, room) {\n return !!socket.manager.roomClients[socket.id][room];\n }", "addPlayer(aPlayer) {\n let _this = this;\n this.players.push(aPlayer);\n\n _this.sendWelcomeMessageData(aPlayer, _this);\n _this.handleOnPlayerMessage(aPlayer);\n\n // handle player closing\n aPlayer.socket.onclose = function () {\n _this.removeAllPlayer();\n\n let _data = {\n messageType: MESSAGE_TYPE.CLIENT_LOGOUT,\n content: aPlayer.name\n };\n _this.sendToPlayer(_data);\n }\n }", "function joinRoom(socket, room) {\n //Each socket is related to each individual user\n //join user into a room\n\n socket.join(room);\n currentRoom[socket.id] = room;\n //Tell the users they are joined into a specific room\n socket.emit('joinResult', {room: room});\n\n //Tell to averyone in a room that a new user has joined\n socket.broadcast.to(room).emit('message', {\n text: nickNames[socket.id] + ' has joined ' + room + '.'\n });\n\n //Get all of other users in a room\n //var usersInRoom = io.sockets.clients(room); //does not work anymore\n var usersInRoom = io.sockets.adapter.rooms[room];\n\n if(usersInRoom.length > 1) { //If there was somebody\n //Summarizer which users are in the room\n var usersInRoomSummary = \"Users currently in \" + room + \": \";\n //Loop through all users in a room\n for (var userId in usersInRoom.sockets) {\n //To everyone else but the proper user, summarize them\n if (userId != socket.id ) {\n usersInRoomSummary += nickNames[userId] + \" \";\n }\n }\n\n //finish the summarization\n usersInRoomSummary += '.';\n //Tell to everyone who are joined to a room\n socket.emit('message', {text:usersInRoomSummary});\n }\n}", "function onNewPlayer(data) {\n\tutil.log(\"'\" + data.name +\"' has connected id : \" + this.id + \" coord : x : \" + data.x + \" y : \" + data.y);\n\t// Create a new player\n\tvar newPlayer = new Player(data.name, data.x, data.y);\n\tnewPlayer.id = this.id;\n\n\t// Broadcast new player to connected socket clients\n\tthis.broadcast.emit(\"new player\", {id: newPlayer.id, name : data.name, x: newPlayer.getX(), y: newPlayer.getY()});\n\n\t// Send existing players to the new player\n\tvar i, existingPlayer;\n\tfor (i = 0; i < players.length; i++) {\n\t\texistingPlayer = players[i];\n\t\tthis.emit(\"new player\", {id: existingPlayer.id, x: existingPlayer.getX(), y: existingPlayer.getY()});\n\t};\n\t\t\n\t// Add new player to the players array\n\tplayers.push(newPlayer);\n}", "function createNewRoom() {\r\n // Generate room id.\r\n const newID = uuidv4().substring(0, 8);\r\n\r\n // Join room\r\n socket.join(newID);\r\n\r\n // Update corressponding object in usersArray\r\n updateUserRoom(socket, newID);\r\n\r\n // Send room data to socket\r\n io.to(socket.id).emit(\"roomData\", {\r\n roomId: newID,\r\n });\r\n }", "removePlayer(socket) {\n const isPlayer = this.players[socket.id] !== undefined\n const isSpectator = this.spectators[socket.id] !== undefined\n const isHost = this.host.data.id === socket.data.id;\n if (isPlayer) { // we might need to swap people in\n delete this.players[socket.id]\n const newPlayer = this.upgradeSpectator()\n // if ingame, then let's see how to modify the player\n if (this.state === ROOM_INGAME) {\n // if we have a player, then let's swap them\n if (newPlayer !== undefined) {\n this.game.swapPlayers(socket, newPlayer)\n } else { // else, just remove and let game use AI\n this.game.removePlayer(socket)\n }\n }\n // if host is leaving, we need to fix that too\n if (isHost) {\n this.upgradeHost();\n }\n } else if (isSpectator) { // don't care about these guys\n delete this.spectators[socket.id]\n }\n socket.leave(this.uniqueName)\n socket.join('lobby')\n delete socket.data.room\n delete socket.data.timeJoinedRoom\n // tell everyone else that room has changed\n socket.to(this.uniqueName).emit('room_player_update', this.playerInfo())\n io.to('lobby').emit('lobby_room_update', this.basicInfo())\n return Object.keys(this.players).length === 0\n }", "function add_private_room(creator, name, password){\n const room = {creator, name, password};\n // save room info to room list\n private_rooms.push(room);\n}", "function _joinRoom() {\n roomId = rooms[0].id;\n // Join the room\n socketInstance.post('/room/' + roomId + '/onlineUsers', { id: myChatId });\n }", "function addNewPlayer(id, username, x, y, direction, spawnPoint) {\r\n var roomID = 0,\r\n newPlayer = new dto.Player(x, y, direction, spawnPoint);\r\n newPlayer.setSocketID(id);\r\n newPlayer.setUsername(username);\r\n newPlayer.setID(createUUID());\r\n if (typeof require !== 'undefined' && typeof exports !== 'undefined') {\r\n allSession = allSession;\r\n var remotePlayers = allSession[allSession.length - 1].getRemotePlayers();\r\n roomID = allSession[allSession.length - 1].getRoomID();\r\n } else {\r\n //WHY remotePlayers CHANGE, THIS IS A QUICK PATCH, NEED TO LOOK INTO IT\r\n //theres already remoteplayer up top, but i need to get it again here\r\n remotePlayers = session.getRemotePlayers();\r\n }\r\n remotePlayers.push(newPlayer);\r\n return {newPlayer: remotePlayers[remotePlayers.indexOf(newPlayer)], roomID: roomID};\r\n}", "addOneRoomAll ({socket, room}) {\n\t\t\tsocket.server.sockets.emit('roomAdded', room);\n\t\t}", "function onPlayerReady(event) {\n socket.emit('playerReady', {player: player,\n \t \t\t\t\t\t\t\troom: roomID});\n }", "function addPlayer() {\n \t\tvar p = $(\"#add\").val();\n \t\tif (p) {\n \t\t\tmodel.addPlayer(p);\n \t\t} else {\n \t\t\talert(\"The player field is required\");\n \t\t}\n \t}", "function addRoom(id, type) {\n\tif(type == \"battle\") {\n\t\tROOMS[id] = new BattleRoom(id, send);\n\t\treturn ROOMS[id];\n\t} else {\n\t\tlogger.error(\"Unkown room type: \" + type);\n\t}\n}", "function joinRoom(roomId) {\r\n player.roomId = roomId;\r\n ROOMS[roomId].addMember(player);\r\n socket.emit('roomJoined', {\r\n roomId,\r\n members: ROOMS[roomId].getMembers()\r\n });\r\n }", "addUser(connection, room) {\n const user = { id: connection.id, room, joined: new Date(), lastAction: new Date() };\n this.users[room] = this.users[room] || [];\n this.users[room].push(user);\n this.emit(EVENTS.UPDATE_USERS, room, this.users[room]);\n }", "async function startGame(io, socket, userId, roomId) {\n try {\n // check that the calling user socket can actually start the game\n let room = await Room.findOne({_id: roomId});\n\n if (userId.toString() !== room.HostId.toString())\n return;\n \n \n let newGame = new Game({\n RoomId: roomId,\n CurrentRound: 1,\n TotalRounds: room.Rounds,\n Timer: room.Timer,\n CurrentTurn: room.HostId,\n RoundWord: \"\",\n RoundWordDifficulty: 1,\n Players: room.UserIds.map((i) => {\n return {\n _id: i._id,\n SocketId: i.SocketId\n }\n })\n });\n\n await newGame.save();\n io.to(roomId).emit('game start');\n\n switchTurns(io, socket.id, userId, roomId);\n\n }\n catch (err) {\n console.log(err);\n }\n}", "addPlayer(player){\n\t\tthis.addSquare(player);\n\t\tthis.players[player.id] = player;\n\t}", "onPlayerConnected(socket) {\n var that = this;\n\n console.log('Client connected');\n\n // save player\n this.connectedPlayers[socket.id] = socket;\n var playerId = socket.playerId = ++this.gameEngine.world.playerCount;\n socket.lastHandledInput = null;\n\n console.log(\"Client Connected\", socket.id);\n\n this.gameEngine.emit('server__playerJoined', {\n playerId: playerId\n });\n\n socket.emit('playerJoined', {\n playerId: playerId\n });\n\n socket.on('disconnect', function() {\n that.onPlayerDisconnected(socket.id, playerId);\n that.gameEngine.emit('server__playerDisconnected', {\n playerId: playerId\n });\n });\n\n // todo rename, use number instead of name\n socket.on('move', function(data) {\n that.onReceivedInput(data, socket);\n });\n\n // we got a packet of trace data, write it out to a side-file\n socket.on('trace', function(traceData) {\n traceData = JSON.parse(traceData);\n let traceString = '';\n traceData.forEach(t => { traceString += `[${t.time}]${t.step}>${t.data}\\n`; });\n fs.appendFile(`client.${playerId}.trace`, traceString, err => { if (err) throw err; });\n });\n\n this.networkMonitor.registerPlayerOnServer(socket);\n }", "function register(){\n\t\tif(websocket){\n\t\t\twebsocket.send(\"game.inbound.GameRegistrationMessage\",{\n\t\t\t\t\t\ttransactionId:new Date().getTime(),\n\t\t\t\t\t\tuserSessionId:SESSION_ID,\n\t\t\t\t\t\tuserType:\"USER_TYPE_PLAYER\"\n\t\t\t\t\t});\n\t\t}\n\t}", "function addRoom(id, type) {\n\tif(ROOMS[id]) return ROOMS[id];\n\tif(type == \"battle\") {\n\t\tROOMS[id] = new BattleRoom(id, send);\n\t\treturn ROOMS[id];\n\t} else {\n\t\tlogger.error(\"Unkown room type: \" + type);\n\t}\n}", "function handleCreate() {\r\n\tlet username = document.getElementById(\"username\").value.trim();\r\n\t\r\n\t/* If username is valid, then send to server to create \r\n\tnew room */\r\n\tif (username.length > 0) {\r\n\t\tsocket.emit('toCreate', username);\r\n\t\tshowChat(username);\r\n\t}\r\n\telse {\r\n\t\talert(\"Entered username is invalid, please try again!\");\r\n\t}\r\n}", "function addRoom(room){\n $outer.append(Mustache.render(roomTemplate, room));\n }", "add(room) {\n\tthis._rooms[room.identifier] = room;\n\treturn room;\n }", "_createRoom(){\n let roomCode = (Math.floor(Math.random() * 10000) + 100000).toString().substring(2);\n // Works on both iOS and Android\n let username = this.state.username;\n\n Alert.alert(\n username + '\\'s Room Number',\n 'Your room number : ' + roomCode + '\\n\\n' + 'Please share to your friend to play together!',\n [\n {text: 'OK', onPress: () => console.log('OK Pressed')},\n ],\n { cancelable: false }\n )\n\n this.setState({\n isLoading: true,\n playerNum: 1,\n createCode: roomCode,\n gameCode: roomCode,\n })\n\n this.state.socket.emit(\"create room\", roomCode);\n }", "function check_for_multiplayergame() {\n // Receiver of the game runs this function\n window.gid = window.location.hash;\n var url = window.location.href;\n window.socket = new EasyWebSocket(url);\n window.socket.onopen = function(){\n window.socket.send(window.uid+':LoggedIn');\n }\n window.socket.onmessage = function(event){\n console.log(\"received \"+ event.data);\n var message = event.data.split(':');\n var uid = message[0];\n var status = message[1];\n if (uid != window.uid && window.opponentUid == undefined) {\n // If another user has send the message, check it out\n if (status == 'LoggedIn') {\n // add user as opponent, usually not needed, this function run only when being second player\n window.opponentUid = uid;\n } else if (status == 'Settings') {\n console.log('receiving settings:', message);\n window.opponentUid = uid;\n var opponent_loc = message[2].split(',');\n var own_loc = message[3].split(',');\n window.startPos = new google.maps.LatLng(own_loc[0], own_loc[1]);\n window.goalPosition = new google.maps.LatLng(opponent_loc[0], opponent_loc[1]);\n window.opponentPos = new google.maps.LatLng(opponent_loc[0], opponent_loc[1]);\n set_difficulty(parseInt(message[4]));\n // setup game\n // start game, and send 'Ready' if ready\n startMultiPlayerGame();\n }\n } else if (uid == window.opponentUid) {\n if (status == 'Location') {\n var loc = message[2].split(',');\n window.opponentPos = new google.maps.LatLng(loc[0], loc[1]);\n window.opponentDist = loc[2];\n opponentMoved();\n } else if (status == 'Finish') {\n //finish game, you've probably lost it\n $('pano_canvas').grab(new Element('div.notice', {\n id: 'gameover',\n html: 'Aww!!<br/>You Lost! Your opponent has captured your flag!<br/>Refresh to play again!',\n }));\n $('gameover').highlight('#f88', '#fff');\n }\n }\n }\n}", "function connectToRoom(joinCode) {\n return function(dispatch, getStore, client) {\n console.log(`connectToRoom(joinCode=${joinCode})`);\n client.emit(\"request_join\", joinCode, function(joined, playerID) {\n console.log(\"connectToRoom() succeeded: \" + joined);\n if(joined) {\n dispatch(setStatus(Status.CONNECTED, \"You're in!\"));\n dispatch(updatePlayer(playerID));\n dispatch(getRoomData(joinCode));\n } else {\n dispatch(setStatus(Status.ERROR, \"Couldn't join game: \" + playerID));\n }\n });\n };\n}", "function joinRoom(socket, room) {\n socket.join(room);\n // Count the number of connected users to the room\n var active_connections = io.sockets.manager.rooms['/' + room].length;\n io.sockets.in(room).emit(\"user:connect\", active_connections);\n}", "async registerPlayer(channel, username, userId, name) {\n\t\tlet world = await sql.getWorld(channel);\n\t\tlet now = new Date().getTime();\n\t\tthis.addHeat(world, 10);\n\t\tlet player = {\n\t\t\tname: name,\n\t\t\tusername: username,\n\t\t\tuserId: userId,\n\t\t\tchannel: channel,\n\t\t\tglory: 0,\n\t\t\tlevel: this.newPowerLevel(world.heat),\n\t\t\tlastActive: now,\n\t\t\tlastFought: now,\n\t\t\tgardenTime: now - hour,\n\t\t\tgardenLevel: 0,\n\t\t\tactionTime: now - hour,\n\t\t\tactionLevel: 0,\n\t\t\tfusionId: null,\n\t\t\tnemesisFlag: false,\n\t\t\tfusionFlag: false,\n\t\t\twishFlag: false,\n\t\t\tconfig: {\n\t\t\t\talwaysPrivate: false,\n\t\t\t\tping: false,\n\t\t\t\tpronoun: 'they'\n\t\t\t}\n\t\t};\n\t\tawait sql.addPlayer(player);\n\t\tconsole.log(`Registered ${username} as ${name}`);\n\t}", "function addRoom(r){\n\tdb.run(`insert into rooms (name, type, access) values (?, ?, ?)`, [r.name, r.type, r.access], () => {\n\t\t_.each(r.ressources, (ressource_name) => addRoomResource(r.name, ressource_name));\n\t\t_.each(r.softwares, (software_name) => addRoomSoftware(r.name, software_name));\n\t\t_.each(r.timeslots, (ts) => addRoomTimeslot(r.name, ts));\n\t});\n}", "function on_connection (p_socket, p_data) {\n\n\t//var ip = p_socket.handshake.address.address;\n\t//players[ip] = true;\n\t\n\tp_socket.cli_id = p_data ? p_data : p_socket.id;\n\tio.sockets.emit('new', [p_socket.cli_id, players]);\n\tplayers[p_socket.cli_id] = true;\n\tconsole.log('--- player ' + p_socket.cli_id + ' is connected ---');\n}", "add_player(player, row, column) {\n if(arguments.length === 1) {\n const [row, column] = this.battleMap.get_an_untaken_position()\n this.battleMap.player_take_position(player, row, column)\n } else {\n this.battleMap.player_take_position(player, row, column)\n }\n }", "function join_game(userinfo, game_id, is_owner, fn){\n var sql = \"INSERT INTO account_in_game (game_id, account_id, is_owner) VALUES (\" + game_id + \", \" + userinfo.db_id + \", \" + is_owner + \")\";\n db.execute(sql, GAME_ADD_SUCCESS, GAME_ADD_FAIL, function(result){\n var feedback;\n if (result.code == GAME_ADD_FAIL){\n feedback = {\n \"code\": GAME_ADD_FAIL\n };\n }else{\n feedback = {\n \"code\": GAME_ADD_SUCCESS,\n \"is_owner\": is_owner\n };\n //send_notification_to_all(userinfo, userinfo.username + \" joined the game.\");\n }\n //sys_send_to_sock(userinfo.ws, JSON.stringify(feedback));\n return fn(feedback);\n });\n}", "async playerJoin(client, playerId, gameId)\n {\n const host = this._getHost(gameId);\n\n if (!(await host.canPlayerJoin(client, playerId))) {\n throw new Error('cannot join when allowJoin is false');\n }\n\n this.log.info('player %s joining game %s', playerId, gameId);\n\n // tell gamelist we've a new player\n await this.net.sendCommand('gamelist', 'playerJoined', {gameId, playerId});\n\n // master list\n this.clients.push({client, playerId, gameId});\n\n // let the host do its thang\n host.addClient(client, playerId);\n }" ]
[ "0.7259357", "0.6986688", "0.65623856", "0.6164955", "0.616157", "0.60117674", "0.58439666", "0.5842452", "0.58084244", "0.5745237", "0.57409793", "0.57213867", "0.5685096", "0.5671052", "0.56618416", "0.5655997", "0.56455445", "0.5608213", "0.55980283", "0.5526065", "0.5514053", "0.5503278", "0.54653937", "0.5457243", "0.5428105", "0.5407918", "0.5390006", "0.5364029", "0.53138214", "0.5301062", "0.5300897", "0.5296131", "0.5289809", "0.52864313", "0.5277318", "0.5258808", "0.5253093", "0.5245715", "0.5235804", "0.52337307", "0.5232821", "0.52163845", "0.5207314", "0.5206267", "0.52042824", "0.52023953", "0.51948273", "0.5192428", "0.51833296", "0.5177957", "0.51634365", "0.5134464", "0.5131101", "0.5128557", "0.5114488", "0.5107714", "0.5074726", "0.50657713", "0.50558853", "0.50457543", "0.50432044", "0.50382066", "0.5022076", "0.50147307", "0.49853063", "0.49808425", "0.49711925", "0.4971182", "0.49686953", "0.4968693", "0.49637473", "0.49545866", "0.49431798", "0.49303588", "0.4927985", "0.49264887", "0.49263844", "0.4916912", "0.49148062", "0.49101043", "0.48935196", "0.4891758", "0.48772517", "0.48709953", "0.4860292", "0.48585057", "0.48492908", "0.48412997", "0.4835336", "0.48350975", "0.48114213", "0.48095977", "0.47956425", "0.47895458", "0.47840512", "0.478247", "0.4781586", "0.47800928", "0.47798792", "0.47774714" ]
0.902076
0
Returns the room code associated with the given socket. Returns undefined if none exists.
_getRoomCodeFromSocket(socket) { if (socket && socket.rooms) { return socket.rooms[Object.keys(socket.rooms)[1]]; } return undefined; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getRoomInfo(socket, game) {\n if(socket && game) {\n const room = Array.from(socket.rooms)[1];\n const existingGame = game.map(game => game.roomId).indexOf(room);\n return existingGame;\n }\n else {\n return -1;\n }\n}", "function GetRoomHost(RequestingSocket, RoomName, LobbyInfo) {\n\tvar clients = io.sockets.adapter.rooms[RoomName].sockets; \n\n\tif(clients) {\n\t\tfor (var clientId in clients ) {\n\t\t\tvar clientSocket = io.sockets.connected[clientId];\n\t\t\tif(clientSocket.id == GetSocketFromPlayer(LobbyInfo.HOST_ID)) {\n\t\t\t\treturn clientSocket.id;\n\t\t\t}\n\t\t}\n\t}\n\treturn -1;\n}", "function getSocketId() {\n const socketId = socket ? socket.id : 'none';\n\n return socketId || 'none';\n}", "static onSocketInit(socket, URLhash) {\n let roomID = '';\n\n if (!rooms.isRoomExists(URLhash) || rooms.getRoomPlayersCount(URLhash) >= 2) {\n roomID = (URLhash && !rooms.isRoomExists(URLhash)) ? URLhash : socket.id;\n const room = new Room(roomID);\n room.addPlayer(socket.id);\n\n rooms.addRoom(room);\n } else {\n roomID = URLhash;\n rooms.getRoom(roomID).addPlayer(socket.id);\n }\n\n return roomID;\n }", "getRoom (socketOrId) {\n\t\t\tif (typeof socketOrId == \"object\") {\n\t\t\t\treturn this.getByToken(socketOrId);\n\t\t\t} else if (typeof socketOrId == \"string\") {\n\t\t\t\treturn this.getById(socketOrId);\n\t\t\t}\n\t\t}", "function genRoomCode() {\n const roomSeed = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',\n rooms = io.sockets.adapter.rooms;\n let code\n do {\n code = ''\n for (var i = 0; i < 5; i++) {\n code += roomSeed[getRandomInt(roomSeed.length)]\n }\n // Keep generating new codes if the code is already in use\n } while (rooms[code])\n return code\n }", "function joinRoom() {\n const code = document.getElementById(\"roomCodeInput\").value;\n socket.emit(\"joinRoom\", code);\n}", "getRoom(roomCode) {\n return this.rooms[roomCode];\n }", "function GetPlayerIDFromSocket(SocketID) {\n\tfor(var i=0; i<PlayerToSocketMap.length; i++) {\n\t\tif(PlayerToSocketMap[i].value == SocketID) {\n\t\t\treturn PlayerToSocketMap[i].key;\n\t\t}\n\t}\n}", "function getOpponent (socket) {\n if (!players[socket.id].opponent) {\n return;\n }\n\n return players[\n players[socket.id].opponent\n ].socket;\n}", "getNameFromSocket(socket) {\n return this.socketNames[socket.id];\n }", "function getOpponent(socket) {\n if (players[socket.id] && players[socket.id].opponent) {\n const opponentID = players[socket.id].opponent;\n return clientSockets[opponentID];\n }\n return;\n}", "SOCKET_GET_ROOM_INFO(state, message) {\n // eslint-disable-next-line\n console.log(\"%c socket_get_room_info\", \"color:green\");\n state.room = message;\n }", "function findOpponent(currPlayer, socket)\n{\n\tconsole.log(\"socket room \" +socket.room);\n\tvar room = io.sockets.adapter.rooms[socket.room];\n\tconsole.log(\"opponent room \");\n\t//console.dir(rooms[socket.room].players);\n\tvar key = Object.keys(rooms[socket.room].players);\n\tconsole.log(\"got the key\");\n\t\n\tfor(var i = 0;i<key.length;i++)\n\t{\n\t\tif(rooms[socket.room].players[key[i]] && rooms[socket.room].players[key[i]].id != currPlayer.id)\n\t\t{\n\t\t\tconsole.log(\"curr player id \" + currPlayer.id + \" player id \" + rooms[socket.room].players[key[i]].id);\n\t\t\treturn rooms[socket.room].players[key[i]];\n\t\t}\n\t}\n\t\n\tconsole.log(\"No opponent found\");\n}", "_GetSocket(UUID)\n {\n const index = this._Sockets.findIndex(s => s._UUID == UUID);\n if(index != -1)\n {\n return this._Sockets[index];\n }\n else\n {\n return false;\n } \n }", "function RoomSocket(io, roomId){\n this.roomId = roomId;\n this.io = io;\n}", "getPlayerFromSocket(socket) {\n return this.players[this.getNameFromSocket(socket)];\n }", "function stateUpdate(socket) {\n let gameCode = Array.from(socket.rooms)[1]\n if(Object.keys(gameData).includes(gameCode)){\n io.in(gameCode).emit(\"stateUpdate\", gameData[gameCode].gamestate)\n }\n}", "async function generateInterrGameCode(socket) {\n const pattern = '^[0-9][A-Z0-9]{5}';\n let found = true;\n let gameCode;\n\n /* generate code here */\n while(found){\n gameCode = randexp(pattern); \n sql_code_dupe = `SELECT * FROM ${process.env.DATABASE_PLATFORM}.interupted_instances WHERE GameCode = \"${gameCode}\";`;\n\n /* Check if code exists, if yes, generate again */\n try {\n let results = await query_platform(sql_code_dupe);\n\n if(!results.length) {\n found = false;\n }\n }\n catch(err) {\n socket.emit('errorMenu', { 'message' : 'Unable to access the database. #8', 'error': err });\n return;\n }\n }\n return gameCode;\n}", "function roomID(type){\n var matchRoomRequest;\n //urls for express sessions and normal sessions \n //are not the same \n if(type==\"workspace\"){\n matchRoomRequest = /.*\\/workspace\\/(.+)/;\n }\n else{\n matchRoomRequest = /.*\\/express\\/(.{32})/;\n }\n var match = matchRoomRequest.exec(document.URL);\n\n if(match){\n return match[1];\n }\n}", "function join(socket, roomCode, callback) {\n if (socket && socket.join) {\n socket.join(roomCode, callback);\n }\n}", "async function getGameState(socket, roomId) {\n\n let game = await Game.findOne({RoomId: roomId});\n if (game) {\n socket.emit('game in progress', {\n round: game.Round,\n });\n }\n\n}", "getMemAddr(room) {\n let memRoomAddr;\n if (room == this.roomName) {\n return this.memoryAddr;\n } else {\n let remoteRoom = this.remoteRooms[room];\n if (remoteRoom) {\n memRoomAddr = this.memoryAddr.remoteRooms[room];\n } else {\n // throw error: this is not a room in my domain\n return;\n }\n }\n return memRoomAddr;\n }", "function getRoom(){\n\tvar chatName = document.getElementById(\"chatName\");\n\tif(!chatName)\n\t\treturn null;\n\treturn chatName.innerText;\n}", "function getSession(socket) {\n let session = cookie.parse(socket.request.headers.cookie).session;\n return(decode(session).SID);\n}", "function getRoom()\n {\n\n // console.log(\".. . .. . .. . \" + room);\n\n // if(room == undefined) ///eller === \n // {\n // return \"Sök sal...\";\n // }\n // else\n // {\n // return room; // eller toString(room);\n // }\n }", "function getRoom(roomCode) {\n var ref = firebase.database().ref(\"Rooms/\" + roomCode);\n var room = $firebaseObject(ref);\n \n return room;\n }", "getRoom() {\n const id = this.roomName;\n\n if (!activeRooms.hasOwnProperty(id)) {\n throw new Error('Room requested does not exist: ' + id);\n }\n\n return activeRooms[id];\n }", "function inside(socket, room) {\n return !!socket.manager.roomClients[socket.id][room];\n }", "get roomId() {\n\t\treturn browser.element('.messages-container.flex-tab-main-content').getAttribute('id').replace('chat-window-', '');\n\t}", "getClientNum(socketID){\n for(var i = 0; i < this.clientSocketID.length; i++){\n if(this.clientSocketID[i] === socketID){\n return i;\n }\n }\n }", "function getUserTokenBySocket(socket) {\n return new Promise((resolve, reject) => {\n for (let key in clients.clientList) {\n if (clients.clientList[key] === socket) {\n resolve(key);\n }\n }\n reject(new Error(\"Can't find client's user token\"));\n });\n}", "function getSocketCountInRoom(roomName) {\n var roomInfo;\n var output;\n\n if (roomName) {\n roomInfo = io.sockets.adapter.rooms[roomName];\n if (roomInfo && roomInfo.length) {\n output = roomInfo.length;\n }\n }\n\n if (typeof output == 'undefined') {\n output = 0;\n }\n\n return output;\n}", "getRoom() {\n var query = location.search && location.search.split(\"?\")[1];\n\n if (query) {\n return (location.search && decodeURIComponent(query.split(\"=\")[1]));\n }\n\n return \"no-id\"\n }", "function getSocketLabel(uuid) {\n var label = null;\n\n if(uuid == LIGHT_ID_UUID) {\n label = 'light_code:raspi';\n }\n else if(uuid == IMU_SERVICE_UUID) {\n label = 'ay:raspi';\n }\n // }\n\n return label;\n}", "playerAttemptLeaveRoom(socket, data) {\n Logger.logInfo('socket ' + socket.id + ' disconnecting...');\n var roomCode = this._getRoomCodeFromSocket(socket);\n\n if (this.roomExists(roomCode)) {\n this.getRoom(roomCode).disconnectPlayer(socket);\n socket.leave(roomCode, () => {\n socket.emit('playerLeaveRoomSuccess', {});\n });\n this.getRoom(roomCode).playerMap.emitCustomToAll('updateLobby', (socket) => {\n return this.getRoom(roomCode).getLobbyData(socket);\n });\n } else {\n socket.emit('playerLeaveRoomFailure', {\n reason: 'Room does not exist'\n });\n return;\n }\n\n if (this.getRoom(roomCode).socketsEmpty()) {\n this.removeRoom(roomCode);\n }\n }", "hostAttemptEndGame(socket, data) {\n Logger.logInfo('Socket ' + socket.id + ' attempting to end game');\n var roomCode = this._getRoomCodeFromSocket(socket);\n\n if (this.roomExists(roomCode)) {\n var room = this.getRoom(roomCode);\n if (room.attemptEndGame(socket)) {\n Logger.logInfo('Game at room ' + roomCode + ' ended');\n room.playerMap.emitCustomToAll('hostEndGameSuccess', (socket) => {\n return {\n thisClientIsHost: room.socketIsHost(socket)\n }\n });\n room.playerMap.emitCustomToAll('updateLobby', (socket) => {\n return room.getLobbyData(socket);\n });\n } else {\n Logger.logWarning('Socket ' + socket.id + ' failed to end game');\n socket.emit('hostEndGameFailure', {\n reason: 'room.attemptEndGame() failed'\n });\n }\n } else {\n Logger.logWarning('Socket ' + socket.id + ' failed to end game');\n socket.emit('hostEndGameFailure', {\n reason: 'Room does not exist'\n });\n }\n }", "function getRoomId() {\n var roomId = window.location.href.split('#')[1];\n if(!roomId) {\n roomId = Math.floor(Math.random() * 1000000);\n window.location.href += '#' + roomId;\n }\n return roomId;\n}", "function getUserIndex(currentGame, socket) {\n if(currentGame && socket) {\n const userIndex = currentGame.users.map(user => user.userId).indexOf(socket.id);\n return userIndex;\n }\n else {\n return -1;\n }\n}", "getRoom(roomId) {\r\n\t\treturn typeof this.rooms[roomId] === \"object\" ? this.rooms[roomId] : null;\r\n\t}", "pollForGameNumber(socket) {\n socket.emit('poll for game number')\n }", "reserveNewRoom() {\n var newRoomCode;\n\n do {\n newRoomCode = Hasher.genHash(ROOM_CODE_LENGTH);\n } while(this.roomExists(newRoomCode));\n\n this.rooms[newRoomCode] = new Room(newRoomCode);\n return newRoomCode;\n }", "getLobbyData(socket) {\n return {\n players: this.playerMap.getUsernameList(),\n roomCode: this.roomCode,\n isInGame: this.gameServer.isInGame(),\n thisClientIsHost: this.socketIsHost(socket)\n };\n }", "listenTimer(cb,room) {\n socket.on('timer', function (data) {\n if(data.room === room){\n cb(data)\n }\n })\n }", "static onSocketReady(socket) {\n Object.keys(socket.rooms).forEach(room => {\n if (rooms.isRoomExists(room)) {\n if (rooms.getRoomPlayersCount(room) > 1) {\n rooms.getRoom(room).setPlayerReady(socket.id);\n\n let readyPlayers = 0;\n\n rooms.getRoom(room).getPlayers().forEach(player => {\n if (player.ready) {\n readyPlayers++;\n }\n })\n\n if (readyPlayers === 2) {\n rooms.getRoom(room).resetPlayersActions();\n rooms.getRoom(room).resetPlayersReady();\n\n io.to(room).emit('startGame', {\n id: rooms.getRoom(room).getID(),\n winner: rooms.getRoom(room).getWinner(),\n players: rooms.getRoom(room).getPlayers()\n });\n }\n }\n }\n })\n }", "getCurrentName(socket_id) {\n return this.p_name[this.p_sid.indexOf(socket_id)];\n }", "function getSocket(name) {\n\tfor (var i = 0; i < connections.length; i++) {\n\t\tif (connections[i].Name == name) {return connections[i].Socket;}\n\t}\n\treturn false;\n}", "function newRoom() {\n socket.emit(\"newRoom\");\n}", "function GetPlayerBySocketID(_SocketID) {\r\n var _Player = _mData.Players.find(function(_Player){\r\n return _Player.SocketID === _SocketID;\r\n });\r\n\r\n return _Player;\r\n}", "_joinRoom(){\n this.state.socket.emit(\"join\", this.state.joinCode);\n this.setState({\n playerNum: 2,\n gameCode: this.state.joinCode\n });\n }", "function getObjectForRoom(currentRoom) {\n var objectInRoomIndex = -1;\n if (currentRoom === 0) {\n return objectInRoomIndex;\n }\n\n for (var i = 0; i < itemLocationRoomNumbers.length ; i++) {\n if (itemLocationRoomNumbers[i] == currentRoom) {\n objectInRoomIndex = i;\n break;\n }\n }\n return objectInRoomIndex;\n }", "retrieve(room) {\n if (this._rooms[room]) {\n return this._rooms[room];\n } else {\n throw 'It appears you have made a mistake.';\n }\n }", "function getOtherSockType(type){\n switch(type){\n case \"rep\":\n return \"req\";\n break;\n case \"pub\":\n return \"sub\";\n break;\n default:\n return \"invalid\";\n break;\n }\n}", "function generateRoomIdentifier() {\n // make a list of legal characters\n // we're intentionally excluding 0, O, I, and 1 for readability\n var chars = 'ABCDEFGHJKLMNPQRSTUVWXYZ23456789';\n\n var result = '';\n for (var i = 0; i < 6; i++)\n result += chars.charAt(Math.floor(Math.random() * chars.length));\n\n return result;\n}", "ActiveRoom(){\r\n\t\tif(this.roomsMgr.RoomExists(this.activeRoom)){\r\n\t\t\treturn this.roomsMgr.Room(this.activeRoom);\r\n\t\t}\r\n\t\treturn this.roomsMgr.Room(SERVER_CH);\r\n\t}", "function generateRoomId(){\n let roomId = \"\";\n for(let i = 0; i < 4; i++){\n roomId += String.fromCharCode(_.random(65,90));\n }\n return roomId;\n }", "amIGameOwner(socket) {\n return this.players[0].socket === socket;\n }", "function makeRoomCode(length) {\n var result = '';\n var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';\n var charactersLength = characters.length;\n for ( var i = 0; i < length; i++ ) {\n result += characters.charAt(Math.floor(Math.random() * charactersLength));\n }\n return result;\n }", "function findRoom(msg) {\n var room = msg.envelope.room;\n\n if(_.isUndefined(room)) {\n room = msg.envelope.user.reply_to;\n }\n\n return room;\n }", "function getRoomNameFromId(roomcode) {\n var sResult = \"\";\n // Loop trough each room and check if we found an id that is equals to param roomcode\n $.each(rooms, function (i, room) {\n if (room.id === roomcode) {\n sResult = room.name; // Store the rooms name in sResult if we found its id that's equal to roomcode\n }\n });\n return sResult;\n}", "function getController(room) {\n return room.controller;\n}", "getRoomState(room) {\r\n\t\t//get stuff from db\r\n\t\t//(this will also create a new room if it doesnt exist yet)\r\n\t\treturn db.getState(room).then(data => {\r\n\t\t\tif (data && data.value && data.value.state) {\r\n\t\t\t\tif (data.value.state.chat && data.value.state.chat.messages) {\r\n\t\t\t\t\tfor (let [idx, msg] of data.value.state.chat.messages.entries()) {\r\n\t\t\t\t\t\tmsg.id = idx;\r\n\t\t\t\t\t\tmsg.history = true; //flag messages as being history\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn data.value.state;\r\n\t\t\t} else {\r\n\t\t\t\treturn {\r\n\t\t\t\t\tchat: {}\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t}).then(state => {\r\n\t\t\tstate.chat.users = this.getSocketsInRoom(room).map((s, i) => {\r\n\t\t\t\treturn {\r\n\t\t\t\t\tid: i,\r\n\t\t\t\t\tnick: s.nick\r\n\t\t\t\t};\r\n\t\t\t});\r\n\t\t\tstate.name = room;\r\n\t\t\treturn state;\r\n\t\t});\r\n\t}", "generateRoomId() {\n\t\treturn `r${Date.now()}`;\n\t}", "_createRoom(socketId, topic) {\n return {\n id: UUID(),\n users: [socketId],\n topic\n }\n }", "function getUserFromSocket(socket, callback) {\r\n var wait = false;\r\n try {\r\n if (socket.conn.request.sessionID) {\r\n wait = true;\r\n store.get(socket.conn.request.sessionID, function (err, obj) {\r\n if (err) {\r\n console.log(err);\r\n }\r\n if (obj && obj.passport && obj.passport.user) {\r\n if (callback) {\r\n callback(null, obj.passport.user ? 'system.user.' + obj.passport.user : '');\r\n }\r\n return;\r\n }\r\n });\r\n }\r\n } catch (e) {\r\n\r\n }\r\n if (!wait && callback) {\r\n callback('Cannot detect user');\r\n }\r\n}", "_createRoom(){\n let roomCode = (Math.floor(Math.random() * 10000) + 100000).toString().substring(2);\n // Works on both iOS and Android\n let username = this.state.username;\n\n Alert.alert(\n username + '\\'s Room Number',\n 'Your room number : ' + roomCode + '\\n\\n' + 'Please share to your friend to play together!',\n [\n {text: 'OK', onPress: () => console.log('OK Pressed')},\n ],\n { cancelable: false }\n )\n\n this.setState({\n isLoading: true,\n playerNum: 1,\n createCode: roomCode,\n gameCode: roomCode,\n })\n\n this.state.socket.emit(\"create room\", roomCode);\n }", "function socketCallback(socket) {\n\n /////////////////////////////////////////////////////////////////////////////\n // place client in a room, removing them from all other rooms\n // note: client can only join a room they are authorized to be in\n // requires:\n // payload.roomId : the room to join\n // emits to socket:\n // \"joinResponse\" of either `joined room ${payload.roomId}` or \"failed\"\n /////////////////////////////////////////////////////////////////////////////\n socket.on(\"join\", function(payload) {\n let rooms = Object.keys(socket.rooms);\n rooms.forEach( room => {\n if(room.match(/room \\d+/)) {\n socket.leave(room);\n }\n });\n verifyAuthCookie(socket, userId => {\n UserRoom.UserRoom.findAll({where: {userId: userId, roomId: payload.roomId}})\n .then( userRooms => {\n if(userRooms.length > 0) {\n socket.join(`room ${payload.roomId}`);\n socket.emit(\"joinResponse\",`joined room ${payload.roomId}`);\n } else {\n socket.emit(\"joinResponse\",\"failed\");\n }\n }).catch( () => socket.emit(\"joinResponse\",\"failed\") );\n });\n });\n\n /////////////////////////////////////////////////////////////////////////////\n // remove client from a room\n // requires:\n // payload.roomId : the room to leave\n // emits: nothing\n /////////////////////////////////////////////////////////////////////////////\n socket.on(\"leave\", function(payload) {\n socket.leave(`room ${payload.roomId}`);\n });\n\n\n /////////////////////////////////////////////////////////////////////////////\n // check whether client is logged in - this should only be fired\n // AFTER a successful reconnection\n // emits:\n // \"loggedInResponse\" either \"logged in\" or \"not logged in\"\n /////////////////////////////////////////////////////////////////////////////\n socket.on(\"loggedInReconnectEvent\",function(payload) {\n verifyAuthCookie(socket,\n () => socket.emit(\"loggedInReconnectEventResponse\",\"logged in\"),\n () => socket.emit(\"loggedInReconnectEventResponse\",\"not logged in\")\n );\n });\n\n /////////////////////////////////////////////////////////////////////////////\n // user requests a lock on furniture item (no authorization here, for speed,\n // but note that furniture ID is a uuid hence effectively impossible to guess,\n // and even if guessed, all you obtain is a lock, not creation, deletion or update).\n // payload:\n // payload.furnishingId: the ID (uuid) of furnishing to lock\n // emits to socket:\n // \"lockResponse\" of either \"approved\" or \"denied\"\n /////////////////////////////////////////////////////////////////////////////\n socket.on(\"lockRequest\", function(payload) {\n verifyAuthCookie(socket, (userId,username) => {\n if(username === \"dummy\") {\n socket.emit(\"lockResponse\",\"approved\");\n } else {\n redis.get(payload.furnishingId)\n .then( result => {\n if(!result) {\n redis.set(payload.furnishingId, userId, 'PX', 2500);\n socket.emit(\"lockResponse\",\"approved\");\n } else {\n socket.emit(\"lockResponse\",\"denied\");\n }\n }).catch( () => socket.emit(\"lockResponse\",\"denied\") );\n }\n }, () => {\n socket.emit(\"lockResponse\",\"denied\");\n });\n });\n\n /////////////////////////////////////////////////////////////////////////////\n // notify every client to push the room to the undo stack\n // emits to room:\n // \"pushRoomToUndoStack\" passing on the payload\n /////////////////////////////////////////////////////////////////////////////\n socket.on(\"pushRoomToUndoStack\",function(payload) {\n verifyAuthCookie(socket, userId => {\n let rooms = Object.keys(socket.rooms);\n let roomStr = rooms.find( room => room.match(/room \\d+/))\n if(roomStr) {\n let roomId = parseInt(roomStr.split(\" \")[1])\n socket.to(`room ${roomId}`).emit(\"pushRoomToUndoStack\",payload);\n }\n });\n });\n\n /////////////////////////////////////////////////////////////////////////////\n // notify every client to push the room to the redo stack\n // emits to room:\n // \"pushRoomToRedoStack\" passing on the payload\n /////////////////////////////////////////////////////////////////////////////\n socket.on(\"pushRoomToRedoStack\",function(payload) {\n verifyAuthCookie(socket, userId => {\n let rooms = Object.keys(socket.rooms);\n let roomStr = rooms.find( room => room.match(/room \\d+/))\n if(roomStr) {\n let roomId = parseInt(roomStr.split(\" \")[1])\n socket.to(`room ${roomId}`).emit(\"pushRoomToRedoStack\",payload);\n }\n });\n });\n\n /////////////////////////////////////////////////////////////////////////////\n // notify every client to undo and persist payload to the room in DB\n // payload:\n // payload.room: the new room in object representation to persist to DB\n // emits to room:\n // \"undo\" passing on the payload\n /////////////////////////////////////////////////////////////////////////////\n socket.on(\"undo\",function(payload) {\n verifyAuthCookie(socket, userId => {\n let rooms = Object.keys(socket.rooms);\n let roomStr = rooms.find( room => room.match(/room \\d+/))\n if(roomStr) {\n let roomId = parseInt(roomStr.split(\" \")[1]);\n Furnishing.Furnishing.findAll({\n where: { roomId: roomId }\n }).then( furnishings => {\n let furnishingIds = furnishings.map(furnishing => furnishing.id);\n redis.mget(furnishingIds)\n .then( result => {\n if(!result.find( val => !!val ) ) {\n persistRoom(roomId,payload.room);\n socket.to(`room ${roomId}`).emit(\"undo\",payload);\n socket.emit(\"undo\",payload);\n }\n }).catch( () => { } );\n }).catch( () => {} );\n }\n });\n });\n\n /////////////////////////////////////////////////////////////////////////////\n // notify every client to redo and persist payload to the room in DB\n // payload:\n // payload.room: the new room in object representation to persist to DB\n // emits to room:\n // \"redo\" passing on the payload\n /////////////////////////////////////////////////////////////////////////////\n socket.on(\"redo\",function(payload) {\n verifyAuthCookie(socket, userId => {\n let rooms = Object.keys(socket.rooms);\n let roomStr = rooms.find( room => room.match(/room \\d+/))\n if(roomStr) {\n let roomId = parseInt(roomStr.split(\" \")[1]);\n Furnishing.Furnishing.findAll({\n where: { roomId: roomId }\n }).then( furnishings => {\n let furnishingIds = furnishings.map(furnishing => furnishing.id);\n redis.mget(furnishingIds)\n .then( result => {\n if(!result.find( val => !!val ) ) {\n persistRoom(roomId,payload.room);\n socket.to(`room ${roomId}`).emit(\"redo\",payload);\n socket.emit(\"redo\",payload);\n }\n }).catch( () => { } );\n }).catch( () => {} );\n }\n });\n });\n\n\n /////////////////////////////////////////////////////////////////////////////\n // notify every client to clear the undo stack\n // emits to room:\n // \"clearUndoStack\" passing on the payload\n /////////////////////////////////////////////////////////////////////////////\n socket.on(\"clearUndoStack\",function(payload) {\n verifyAuthCookie(socket, userId => {\n let rooms = Object.keys(socket.rooms);\n let roomStr = rooms.find( room => room.match(/room \\d+/))\n if(roomStr) {\n let roomId = parseInt(roomStr.split(\" \")[1])\n socket.to(`room ${roomId}`).emit(\"clearUndoStack\",payload);\n }\n });\n });\n\n /////////////////////////////////////////////////////////////////////////////\n // notify every client to clear the redo stack\n // emits to room:\n // \"clearRedoStack\" passing on the payload\n /////////////////////////////////////////////////////////////////////////////\n socket.on(\"clearRedoStack\",function(payload) {\n verifyAuthCookie(socket, userId => {\n let rooms = Object.keys(socket.rooms);\n let roomStr = rooms.find( room => room.match(/room \\d+/))\n if(roomStr) {\n let roomId = parseInt(roomStr.split(\" \")[1])\n socket.to(`room ${roomId}`).emit(\"clearRedoStack\",payload);\n }\n });\n });\n\n\n /////////////////////////////////////////////////////////////////////////////\n // user moves mouse while locked onto furniture item (does not persist!)\n // emits to room:\n // \"mouseMoved\" event passing the payload along.\n /////////////////////////////////////////////////////////////////////////////\n socket.on(\"mouseMoved\", function(payload) {\n verifyAuthCookie(socket, userId => {\n let rooms = Object.keys(socket.rooms);\n let roomStr = rooms.find( room => room.match(/room \\d+/))\n if(roomStr) {\n let roomId = parseInt(roomStr.split(\" \")[1])\n socket.to(`room ${roomId}`).emit(\"mouseMoved\",payload);\n }\n });\n });\n\n /////////////////////////////////////////////////////////////////////////////\n // user refreshes timestamp on lock\n // emits to socket:\n // \"lockRefreshResponse\" of either \"approved\" or \"denied\"\n /////////////////////////////////////////////////////////////////////////////\n socket.on(\"lockRefresh\", function(payload) {\n verifyAuthCookie(socket, (userId,username) => {\n if(username === \"dummy\") {\n socket.emit(\"lockRefreshResponse\",\"approved\");\n } else {\n redis.get(payload.furnishingId)\n .then( result => {\n if(parseInt(result) === parseInt(userId)) {\n redis.set(payload.furnishingId, userId, 'PX', 2500);\n socket.emit(\"lockRefreshResponse\",\"approved\");\n } else {\n socket.emit(\"lockRefreshResponse\",\"denied\");\n }\n }).catch( () => socket.emit(\"lockRefreshResponse\",\"denied\") );\n }\n });\n });\n\n /////////////////////////////////////////////////////////////////////////////\n // user releases lock on furniture item\n // payload:\n // payload.furnishing : new furnishing properties\n // emits to room:\n // \"update\" passing the payload along\n /////////////////////////////////////////////////////////////////////////////\n socket.on(\"lockRelease\", function(payload) {\n verifyAuthCookie(socket, userId => {\n if(payload && payload.furnishing) {\n redis.del(payload.furnishing.id);\n let rooms = Object.keys(socket.rooms);\n let roomStr = rooms.find( room => room.match(/room \\d+/))\n if(roomStr) {\n let roomId = parseInt(roomStr.split(\" \")[1])\n Furnishing.Furnishing.update({...payload.furnishing, roomId: roomId},\n {where: {id:payload.furnishing.id,roomId:roomId} });\n socket.to(`room ${roomId}`).emit(\"update\",payload);\n }\n }\n });\n });\n\n /////////////////////////////////////////////////////////////////////////////\n // user update color of furniture item -- update the DB and notify other users\n // payload:\n // payload.furnishingId : the ID (uuid) of the furnishing to update\n // payload.colorName : the new color name from the Color table\n // emits to room:\n // \"colorUpdate\" passing the payload along\n /////////////////////////////////////////////////////////////////////////////\n socket.on(\"updateColor\", function(payload) {\n verifyAuthCookie(socket, userId => {\n if(payload && payload.furnishingId && payload.colorName) {\n let rooms = Object.keys(socket.rooms);\n let roomStr = rooms.find( room => room.match(/room \\d+/))\n if(roomStr) {\n let roomId = parseInt(roomStr.split(\" \")[1])\n redis.get(payload.furnishingId)\n .then( result => {\n if(!result) {\n Furnishing.Furnishing.update({colorName:payload.colorName},\n {where:{id:payload.furnishingId, roomId:roomId}} );\n socket.to(`room ${roomId}`).emit(\"colorUpdate\",payload);\n socket.emit(\"colorUpdate\",payload);\n }\n }).catch(() => { } );\n }\n }\n });\n });\n\n /////////////////////////////////////////////////////////////////////////////\n // room is deleted by the owner, signal other clients (does nothing to DB)\n // emits to room:\n // \"roomDeleted\"\n /////////////////////////////////////////////////////////////////////////////\n socket.on(\"roomDeleted\",function() {\n verifyAuthCookie(socket, userId => {\n let rooms = Object.keys(socket.rooms);\n let roomStr = rooms.find( room => room.match(/room \\d+/))\n if(roomStr) {\n let roomId = parseInt(roomStr.split(\" \")[1])\n socket.to(`room ${roomId}`).emit(\"roomDeleted\");\n }\n });\n });\n\n /////////////////////////////////////////////////////////////////////////////\n // return client's available rooms to view\n // emits to socket:\n // \"availableRooms\" an object {availableRooms: rooms}\n /////////////////////////////////////////////////////////////////////////////\n socket.on(\"getAvailableRooms\",function(payload) {\n verifyAuthCookie(socket, userId => {\n User.User.findAll({where:{id:userId}})\n .then( users => {\n if(users.length > 0) {\n var user = users[0];\n user.getRooms().then( rooms => {\n socket.emit(\"availableRooms\",{availableRooms:rooms})\n })\n .catch( () => { } );\n }\n })\n .catch( () => { } );\n });\n });\n\n /////////////////////////////////////////////////////////////////////////////\n // user creates a furniture item -- persist the item to DB and notify other users\n // payload:\n // payload.furnishing an object representation of the new furnishing\n // emits to room:\n // \"create\" passing payload along\n /////////////////////////////////////////////////////////////////////////////\n socket.on(\"createFurnishing\", function(payload) {\n verifyAuthCookie(socket, userId => {\n if(payload && payload.furnishing) {\n let rooms = Object.keys(socket.rooms);\n let roomStr = rooms.find( room => room.match(/room \\d+/))\n if(roomStr) {\n let roomId = parseInt(roomStr.split(\" \")[1])\n Furnishing.Furnishing.create( {...payload.furnishing,roomId:roomId} )\n socket.to(`room ${roomId}`).emit(\"create\",payload);\n }\n }\n });\n });\n\n /////////////////////////////////////////////////////////////////////////////\n // remove client from all rooms\n /////////////////////////////////////////////////////////////////////////////\n socket.on(\"removeFromAllRooms\", function(payload) {\n let rooms = Object.keys(socket.rooms);\n rooms.forEach( room => {\n if(room.match(/room \\d+/)) {\n socket.leave(room);\n }\n });\n });\n\n\n /////////////////////////////////////////////////////////////////////////////\n // user deletes a furniture item -- delete from the database and notify other users\n // payload:\n // payload.furnishingId\n // emits to room:\n // \"delete\" passing along the payload\n /////////////////////////////////////////////////////////////////////////////\n socket.on(\"deleteFurnishing\", function(payload) {\n verifyAuthCookie(socket, userId => {\n if(payload && payload.furnishingId) {\n let rooms = Object.keys(socket.rooms);\n let roomStr = rooms.find( room => room.match(/room \\d+/))\n if(roomStr) {\n let roomId = parseInt(roomStr.split(\" \")[1])\n\n redis.get(payload.furnishingId)\n .then( result => {\n if(!result) {\n Furnishing.Furnishing.findAll( { where: { id: payload.furnishingId, roomId: roomId } } )\n .then( furnishings => {\n if(furnishings.length > 0) {\n let furnishing = furnishings[0];\n furnishing.destroy({force:true})\n }\n }).catch( () => { } )\n socket.to(`room ${roomId}`).emit(\"delete\",payload);\n socket.emit(\"delete\",payload);\n }\n }).catch( () => { } );\n }\n }\n });\n });\n}", "static onSocketDisconnect(socket) {\n Object.keys(socket.rooms).forEach(room => {\n try {\n if (rooms.isRoomExists(room)) {\n if (rooms.getRoomPlayersCount(room) === 1) {\n rooms.removeRoom(room);\n } else {\n rooms.getRoom(room).removePlayer(socket.id);\n rooms.getRoom(room).resetPlayersActions();\n rooms.getRoom(room).resetWinner();\n }\n }\n } catch (error) {\n console.log('' + error);\n }\n\n io.to(room).emit('opponentLeave');\n })\n }", "function updateRoomCode(event) {\r\n setRoomCode(event.target.value);\r\n }", "privateMessageSocket (socket, ConnectedSockets){\n return function(msg) {\n var sender = msg.sender;\n var receiver = msg.receiver;\n var status = msg.emergency_status;\n msg[\"timestamp\"] = Date.now();\n msg[\"EmergencyStatus\"] = status;\n if (ConnectedSockets.hasOwnProperty(receiver)) {\n ConnectedSockets[receiver].emit(\"PrivateChat\", msg);\n //emit update notification of unread\n //emit count of all unread msg(public + private)\n let dboper = new PrivateChatDBOper(sender, receiver, url);\n //emit individual count of unread msg(private)\n dboper.GetCount_IndividualUnreadMsg(function (statuscode, results) {\n if (statuscode == success_statuscode) ConnectedSockets[receiver].emit(\"IndividualPrivateUnreadMsgCnt\", results);\n });\n }\n };\n }", "function findPlayer(socketID) {\n for(var i = 0; i < gameState.players.length; i++) {\n if (socketID.indexOf(gameState.players[i].id) !== 1) {\n return gameState.players[i];\n }\n }\n}", "function makeRoomCode(){\n return Math.floor(Math.random() * 900000) + 100000;\n}", "function on_socket_get(message) {\"use strict\"; }", "function dial (room){\n if (room !== '') {\n socket.emit('create or join', room);\n console.log('Attempted to create or join room', room);\n }\n}", "_onClientConnection(socket) {\n\t\tlogger.debug(\"Socketio connection\");\n\n\t\tsocket.emit('your_id');\n\n\t\t//socket.on('pincodeGenerated', _.bind(this.onCodeGenerated, this, socket))\n\t\tsocket.on(\"pincodeHeard\", this._onClientCodeHeard.bind(this, socket));\n\n\t\tsocket.on(\"idmobile\", this._onClientIdMobile.bind(this, socket));\n\n\t\tsocket.on(\"okToClose\", function () {\n\t\t\tsocket.disconnect();\n\t\t});\n\n\t\t//socket.on('disconnect', this.onDisconnect.bind(this, socket));\n\n\t}", "function switchRoom(room){\n\t\tsocket.emit('switchRoom', room);\n\t}", "function getConnectionBySocket (socket) {\n\tfor(var i=0; i<connections.length; i++) {\n\t\tif(connections[i].socket === socket) return connections[i];\n\t}\n\treturn false;\n}", "function joinOrCreateRoom(roomCode) {\n socket.join(roomCode, () => {\n // Sets the socket's room code\n socket.roomCode = roomCode\n // Sends room code to client\n socket.emit('room_joined', roomCode)\n // Updates GM's player list\n updateGMRoomMembers()\n })\n }", "function on_socket_get(message){}", "getNonPersonalRooms(socket) {\n const rooms = Object.keys(socket.rooms);\n const ownRoomIndex = rooms.indexOf(socket.id);\n rooms.splice(ownRoomIndex, 1);\n\n return rooms;\n }", "constructor(roomCode) {\n this.roomCode = roomCode; // Room code (e.g. 'abcd' or 'foo1')\n this.playerMap = new PlayerMap(); // PlayerMap of the room\n this.hostSocket = undefined; // Reference to host socket\n this.gameServer = // Game server that will handle game interactions\n new GameServer(this.playerMap);\n }", "function createRoomCode() {\n var code = \"\";\n for(var i = 0; i < 4; i++) {\n var letter = String.fromCharCode(Math.random() * (26) + 65);\n code += letter;\n }\n //- console.log(code);\n return code;\n}", "function GetSocketFromPlayer(PlayerID) {\n\tfor(var i=0; i<PlayerToSocketMap.length; i++) {\n\t\tif(PlayerToSocketMap[i].key == PlayerID) {\n\t\t\treturn PlayerToSocketMap[i].value;\n\t\t}\n\t}\n}", "function joinRandomRoom() {\r\n socket.emit(\"joinRandomRoom\");\r\n}", "function startTheGame(){\n socket.emit('begin_chat', \"joined\");\n socketid = socket.id\n}", "function getOid(oid, callback) {\n if( !getSession() )\n {\n // send back the matched \"whatever\" to the chat\n bot.sendMessage(chatId, \"You have not established a connection. Use /session <address> before.\");\n }\n else\n {\n getSession().get (oid, function (error, varbinds) {\n if (error) {\n console.error (error);\n } else {\n for (var i = 0; i < varbinds.length; i++)\n if (snmp.isVarbindError (varbinds[i])) {\n console.error (snmp.varbindError (varbinds[i]));\n bot.sendMessage(chatId, \"An error occurred:\\n \"+snmp.varbindError (varbinds[i]));\n } else {\n callback(varbinds[i].value);\n }\n }\n });\n }\n}", "function getRoom(name=\"default\") {\n\tif (!rooms[name]) {\n\t\trooms[name] = {\n\t\t\tname: name,\n\t\t\tclients: {},\n\t\t}\n\t}\n\treturn rooms[name]\n}", "function roomExists(code) {\r\n try {\r\n console.log(\"checking if room with code: \" + code + \" exists\");\r\n console.log(rooms[code]);\r\n if(code == null || code == undefined || typeof code != 'string' || !rooms[code]) {\r\n console.log(\"it's bad\");\r\n return false;\r\n }\r\n console.log(\"it's good\");\r\n return true;\r\n } catch(e) {\r\n console.error(e);\r\n return false;\r\n }\r\n}", "function hostGame(data) {\n \n if (data != \"\" || data.toLowerCase() != \"local\") {\n if (data in gameRoomDict) {\n console.log(data + \" is already a game room.\"); \n }\n else {\n roomAdjust();\n room = data;\n clients.sock = data;\n gameRoomDict[data] = [socket.id]; \n var stuff = [data, \"host\"]\n io.to(socket.id).emit('connectedH', stuff);\n }\n }\n }", "getName(socket_id) {\n return this.p_sid.includes(socket_id) ?\n this.retSuccess(this.p_name[this.p_sid.indexOf(socket_id)]):\n this.retError();\n }", "function getRoom(room)\r\n{\r\n if (!(room in roomObj))\r\n {\r\n roomObj[room] = roomData.length;\r\n roomData.push([]);\r\n console.log(\"===> Room \" + room + \" created on \" + new Date());\r\n console.log(\"Current rooms:\" );\r\n console.log(roomObj);\r\n }\r\n return roomData[roomObj[room]];\r\n}", "getRoomId() {\n return this.roomId;\n }", "function updateChatRoom(socket, message) {\n // socket.broadcast.to(socket.room).emit('updateChat', 'SERVER', socket.username + ' has ' + message);\n}", "function findPeerForLoneSocket(socket) {\n if (queue.length) {\n let peer = queue.pop();\n let room = socket.id + '#' + peer.id;\n let isFirstPlayer = true;\n peer.join(room);\n socket.join(room);\n rooms[peer.id] = room;\n rooms[socket.id] = room;\n peer.emit('start game', isFirstPlayer);\n socket.emit('start game', !isFirstPlayer);\n } else {\n queue.push(socket);\n }\n}", "function YCellular_get_cellIdentifier()\n {\n var res; // string;\n if (this._cacheExpiration <= YAPI.GetTickCount()) {\n if (this.load(YAPI.defaultCacheValidity) != YAPI_SUCCESS) {\n return Y_CELLIDENTIFIER_INVALID;\n }\n }\n res = this._cellIdentifier;\n return res;\n }", "function ClientNumberFromString(to, s) {\n\tvar id;\n\n\t// Numeric values are just slot numbers.\n\tid = parseInt(s, 10);\n\tif (!isNaN(id)) {\n\t\tif (id < 0 || id >= level.maxclients) {\n\t\t\tSV.SendServerCommand(to.s.number, 'print', 'Bad client slot: ' + id);\n\t\t\treturn -1;\n\t\t}\n\n\t\tvar cl = level.clients[id];\n\t\tif (cl.pers.connected !== CON.CONNECTED ) {\n\t\t\tSV.SendServerCommand(to.s.number, 'print', 'Client ' + id + ' is not active');\n\t\t\treturn -1;\n\t\t}\n\n\t\treturn id;\n\t}\n\n\t// Check for a name match\n\tfor (id = 0; id < level.maxclients; id++) {\n\t\tvar cl = level.clients[id];\n\t\tif (cl.pers.connected !== CON.CONNECTED) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tvar cleanName = QS.StripColors(cl.pers.name);\n\n\t\tif (cleanName === s) {\n\t\t\treturn id;\n\t\t}\n\t}\n\n\tSV.SendServerCommand(to.s.number, 'print', 'User ' + s + ' is not on the server');\n\treturn -1;\n}", "function getSocketUrl(urlParts, loc) {\n var auth = urlParts.auth,\n query = urlParts.query;\n var hostname = urlParts.hostname,\n protocol = urlParts.protocol,\n port = urlParts.port;\n\n if (!port || port === '0') {\n port = loc.port;\n } // check ipv4 and ipv6 `all hostname`\n // why do we need this check?\n // hostname n/a for file protocol (example, when using electron, ionic)\n // see: https://github.com/webpack/webpack-dev-server/pull/384\n\n\n if ((hostname === '0.0.0.0' || hostname === '::') && loc.hostname && loc.protocol.indexOf('http') === 0) {\n hostname = loc.hostname;\n } // `hostname` can be empty when the script path is relative. In that case, specifying\n // a protocol would result in an invalid URL.\n // When https is used in the app, secure websockets are always necessary\n // because the browser doesn't accept non-secure websockets.\n\n\n if (hostname && hostname !== '127.0.0.1' && (loc.protocol === 'https:' || urlParts.hostname === '0.0.0.0')) {\n protocol = loc.protocol;\n } // all of these sock url params are optionally passed in through\n // resourceQuery, so we need to fall back to the default if\n // they are not provided\n\n\n var sockHost = query.sockHost || hostname;\n var sockPath = query.sockPath || '/sockjs-node';\n var sockPort = query.sockPort || port;\n\n if (sockPort === 'location') {\n sockPort = loc.port;\n }\n\n return url.format({\n protocol: protocol,\n auth: auth,\n hostname: sockHost,\n port: sockPort,\n // If sockPath is provided it'll be passed in via the resourceQuery as a\n // query param so it has to be parsed out of the querystring in order for the\n // client to open the socket to the correct location.\n pathname: sockPath\n });\n}", "function getSocketUrl(urlParts, loc) {\n var auth = urlParts.auth,\n query = urlParts.query;\n var hostname = urlParts.hostname,\n protocol = urlParts.protocol,\n port = urlParts.port;\n\n if (!port || port === '0') {\n port = loc.port;\n } // check ipv4 and ipv6 `all hostname`\n // why do we need this check?\n // hostname n/a for file protocol (example, when using electron, ionic)\n // see: https://github.com/webpack/webpack-dev-server/pull/384\n\n\n if ((hostname === '0.0.0.0' || hostname === '::') && loc.hostname && loc.protocol.indexOf('http') === 0) {\n hostname = loc.hostname;\n } // `hostname` can be empty when the script path is relative. In that case, specifying\n // a protocol would result in an invalid URL.\n // When https is used in the app, secure websockets are always necessary\n // because the browser doesn't accept non-secure websockets.\n\n\n if (hostname && hostname !== '127.0.0.1' && (loc.protocol === 'https:' || urlParts.hostname === '0.0.0.0')) {\n protocol = loc.protocol;\n } // all of these sock url params are optionally passed in through\n // resourceQuery, so we need to fall back to the default if\n // they are not provided\n\n\n var sockHost = query.sockHost || hostname;\n var sockPath = query.sockPath || '/sockjs-node';\n var sockPort = query.sockPort || port;\n\n if (sockPort === 'location') {\n sockPort = loc.port;\n }\n\n return url.format({\n protocol: protocol,\n auth: auth,\n hostname: sockHost,\n port: sockPort,\n // If sockPath is provided it'll be passed in via the resourceQuery as a\n // query param so it has to be parsed out of the querystring in order for the\n // client to open the socket to the correct location.\n pathname: sockPath\n });\n}", "function getSocketUrl(urlParts, loc) {\n var auth = urlParts.auth,\n query = urlParts.query;\n var hostname = urlParts.hostname,\n protocol = urlParts.protocol,\n port = urlParts.port;\n\n if (!port || port === '0') {\n port = loc.port;\n } // check ipv4 and ipv6 `all hostname`\n // why do we need this check?\n // hostname n/a for file protocol (example, when using electron, ionic)\n // see: https://github.com/webpack/webpack-dev-server/pull/384\n\n\n if ((hostname === '0.0.0.0' || hostname === '::') && loc.hostname && loc.protocol.indexOf('http') === 0) {\n hostname = loc.hostname;\n } // `hostname` can be empty when the script path is relative. In that case, specifying\n // a protocol would result in an invalid URL.\n // When https is used in the app, secure websockets are always necessary\n // because the browser doesn't accept non-secure websockets.\n\n\n if (hostname && hostname !== '127.0.0.1' && (loc.protocol === 'https:' || urlParts.hostname === '0.0.0.0')) {\n protocol = loc.protocol;\n } // all of these sock url params are optionally passed in through\n // resourceQuery, so we need to fall back to the default if\n // they are not provided\n\n\n var sockHost = query.sockHost || hostname;\n var sockPath = query.sockPath || '/sockjs-node';\n var sockPort = query.sockPort || port;\n\n if (sockPort === 'location') {\n sockPort = loc.port;\n }\n\n return url.format({\n protocol: protocol,\n auth: auth,\n hostname: sockHost,\n port: sockPort,\n // If sockPath is provided it'll be passed in via the resourceQuery as a\n // query param so it has to be parsed out of the querystring in order for the\n // client to open the socket to the correct location.\n pathname: sockPath\n });\n}", "function getSocketUrl(urlParts, loc) {\n var auth = urlParts.auth,\n query = urlParts.query;\n var hostname = urlParts.hostname,\n protocol = urlParts.protocol,\n port = urlParts.port;\n\n if (!port || port === '0') {\n port = loc.port;\n } // check ipv4 and ipv6 `all hostname`\n // why do we need this check?\n // hostname n/a for file protocol (example, when using electron, ionic)\n // see: https://github.com/webpack/webpack-dev-server/pull/384\n\n\n if ((hostname === '0.0.0.0' || hostname === '::') && loc.hostname && loc.protocol.indexOf('http') === 0) {\n hostname = loc.hostname;\n } // `hostname` can be empty when the script path is relative. In that case, specifying\n // a protocol would result in an invalid URL.\n // When https is used in the app, secure websockets are always necessary\n // because the browser doesn't accept non-secure websockets.\n\n\n if (hostname && hostname !== '127.0.0.1' && (loc.protocol === 'https:' || urlParts.hostname === '0.0.0.0')) {\n protocol = loc.protocol;\n } // all of these sock url params are optionally passed in through\n // resourceQuery, so we need to fall back to the default if\n // they are not provided\n\n\n var sockHost = query.sockHost || hostname;\n var sockPath = query.sockPath || '/sockjs-node';\n var sockPort = query.sockPort || port;\n\n if (sockPort === 'location') {\n sockPort = loc.port;\n }\n\n return url.format({\n protocol: protocol,\n auth: auth,\n hostname: sockHost,\n port: sockPort,\n // If sockPath is provided it'll be passed in via the resourceQuery as a\n // query param so it has to be parsed out of the querystring in order for the\n // client to open the socket to the correct location.\n pathname: sockPath\n });\n}" ]
[ "0.677028", "0.64517397", "0.6379158", "0.63646704", "0.6343907", "0.6165044", "0.6035847", "0.60143197", "0.5894607", "0.5782973", "0.576276", "0.56828135", "0.55689883", "0.54989797", "0.5497969", "0.5470038", "0.54437405", "0.54031354", "0.54011744", "0.5392365", "0.53735644", "0.53442943", "0.53393155", "0.53349537", "0.5323241", "0.53183335", "0.5304917", "0.5289702", "0.52624595", "0.52246267", "0.5222956", "0.52130127", "0.51932645", "0.5163084", "0.5162769", "0.5153905", "0.5141212", "0.51333153", "0.51252407", "0.50995356", "0.50840205", "0.5075754", "0.5071286", "0.5063163", "0.50339067", "0.50279146", "0.49986658", "0.4994312", "0.4977249", "0.496833", "0.49547753", "0.49496046", "0.49472457", "0.49451944", "0.4938805", "0.4936112", "0.4928694", "0.49261078", "0.49024796", "0.48883465", "0.4864323", "0.485651", "0.48551366", "0.48510522", "0.483848", "0.4832976", "0.48290172", "0.48229864", "0.48162094", "0.48131552", "0.4810644", "0.48100486", "0.4804221", "0.48018304", "0.48010755", "0.47796512", "0.47792834", "0.47791156", "0.4770027", "0.47687775", "0.4761121", "0.47581267", "0.47551697", "0.47501138", "0.4742143", "0.47407806", "0.47370908", "0.47303748", "0.47275048", "0.4726988", "0.47242844", "0.47198552", "0.47160217", "0.4702814", "0.46965304", "0.46771884", "0.46741876", "0.46741876", "0.46741876", "0.46741876" ]
0.89912665
0
Returns the sanitized username from the given data object. Returns empty string if unsuccessful.
_getSanitizedUsername(data) { if (!data || !data.username) { return ""; } return StringSanitizer.getHtmlSanitized(data.username).substring(0, MAX_USERNAME_LENGTH); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getUserName(authData) {\n switch (authData.provider) {\n // case 'password':\n // return authData.password.email.replace(/@.*/, '');\n case 'twitter':\n return authData.twitter.username;\n // case 'facebook':\n // return authData.facebook.displayName;\n }\n }", "function safeUsername() {\n return os.userInfo().username.replace(/[^\\w+=,.@-]/g, '@');\n}", "username (value) {\n // min length 1\n if (!value || value.length < 1) {\n return 'You must provide a username.';\n }\n // max length 40\n else if (value.length > 40) {\n return 'Username can only be 40 characters long.';\n }\n return null;\n }", "username(user){\n if(!user){\n return 'User name cannot be empty';\n }else if(user.length>32){\n return 'The length of user name is 32';\n }else if(!/^\\w{4,32}$/.test(user)){\n return 'Wrong format';\n }else{\n return null; // no error\n }\n }", "validateUsername () {\n\t\tif (!this.attributes.username) { return; }\n\t\tlet error = this.userValidator.validateUsername(this.attributes.username);\n\t\tif (error) {\n\t\t\treturn { username: error };\n\t\t}\n\t}", "function parse_username(str) {\n\tstr = str.replace(/[^\\w]/g,\"\").toLowerCase();\n\tif (!str)\n\t\tstr = \"user\"; // nothing? we'll give you something boring.\n\treturn str.slice(0,9);\n}", "function CreateUserName(divID) {\n var name = Sanitize($(`${divID}`).val());\n name = name.toLowerCase();\n\n if (name.match(/^(https?:\\/\\/)?[a-z0-9]+\\./ig) || name.match(/^@/ig)) {\n name = name.match(/@[a-z0-9-]{3,16}[^\\/]/ig)[0].substring(1);\n }\n\n return name;\n }", "name(userId) {\n if (userId) {\n // find user from user id\n let user = Meteor.users.findOne(userId, {fields: {'username': 1}});\n // return username\n return user ? `@${user.username}`: '';\n }\n }", "function renderUser(name, data, parameters={}, options={}) {\n\n var html = `<span>${data.username}</span>`;\n\n if (data.first_name && data.last_name) {\n html += ` - <i>${data.first_name} ${data.last_name}</i>`;\n }\n\n return html;\n}", "function get_logged_in_username(domain) {\n var adcls = pii_vault.aggregate_data.current_loggedin_state;\n\n if (domain in adcls && adcls[domain].state == \"logged-in\") {\n\tvar username_identifier = adcls[domain].username;\n\tvar rc = get_idenfier_value(username_identifier);\n\tvar username_length = rc[0];\n\treturn [username_identifier, username_length];\n }\n var username = \"\";\n var username_identifier = get_username_identifier(\"\", true);\n var username_length = username.length;\n\n return [username_identifier, username_length];\n}", "function usernameConverter(inputValue) {\n const value = inputValue.trim().toLowerCase();\n // Twitch username format. Only accepts alphanumeric and _, also between 4 and 25 characters\n if (/^[a-z0-9_]{4,25}$/.test(value)) {\n return value;\n }\n throw new Error(`'${inputValue}' is not in a valid Twitch username format`);\n}", "function getUsername(elt) {\n // Extract the username from the given element,\n // To find a username, we look for a text node that follows\n // a <a class=\"timeline\"> element.\n // We exclude usernames containing \"@\" because we want actual\n // usernames, not a \"Full Name <email@...>\" that trac can sometimes\n // generate.\n var raw = $('.timeline', elt)[0].nextSibling.data.trim();\n if (raw && raw.substring(0, 3) === 'by ' && raw.indexOf('@') < 0) {\n return raw.substring(3);\n }\n else {\n return '';\n }\n }", "function findUser() {\n\t\tvar myUser;\n\n\t\t// Get the username value from the form and cleanup the @ if needed\n\t\tif (document.tweetfinder.user.value[0] == \"@\") {\n\t\t\tmyUser = document.tweetfinder.user.value.substring(1,20); //get rid of the @\n\t\t}\n\t\telse { myUser = document.tweetfinder.user.value };\n\n\t\t// Validate length of username\n\t\tif (myUser.length > 16) { // TODO: if true, return error msg and don't continue\n\t\t\t$('#error').html(\"This doesn't seem to be a username. Too long.\");\n\t\t\treturn \"usernameistoolong\";\n\t\t}\n\t\telse {\n\t\t\treturn myUser;\n\t\t}\n}", "function parseUsername(user) {\n let username = '';\n //split to have the image name\n const firstSplit = user.split('/');\n //split to have only the username\n const secondSplit = firstSplit[firstSplit.length - 1].split('.');\n\n if (secondSplit.length > 0) {\n let usernameAux = secondSplit[0];\n username = usernameAux[0].toUpperCase();\n\n for (let i = 1; i < usernameAux.length; i++)\n username += usernameAux[i];\n }\n\n return username;\n}", "function getUsername (){\n let username = document.querySelector(\"#username\").value;\n return JSON.stringify(username);\n }", "get usernameEmptyText() {\n return \"\";\n }", "function getUsername(req) {\n const user = _decodeJWT(req)\n if (!user) return null\n\n return user.username\n}", "function getDisplayName(authData) {\n switch (authData.provider) {\n case 'password':\n return authData.password.email.replace(/@.*/, '');\n case 'twitter':\n return authData.twitter.displayName;\n case 'facebook':\n return authData.facebook.displayName;\n }\n }", "function on_get_username(data, sender, sendResponse) {\n sendResponse({\n 'username': find_username(),\n });\n }", "function getName(authData) {\n switch (authData.provider) {\n case 'password':\n return authData.password.email.replace(/@.*/, '');\n case 'twitter':\n return authData.twitter.displayName;\n case 'facebook':\n return authData.facebook.displayName;\n }\n }", "validateUsername (value, definition/*, options*/) {\n\t\tdefinition = definition || this.attributeDefinitions.username;\n\t\tif (typeof value !== 'string' || value.length === 0) {\n\t\t\treturn 'must be a string';\n\t\t}\n\t\tif (!UsernameValidator.validate(value, definition.lowercaseOnly)) {\n\t\t\treturn 'can only contain alphanumerics, hyphen, period, and underscore';\n\t\t}\n\t}", "function getUserName() {\n // check the url and store it in a variable so we can search it\n var url = $(location).attr('href'),\n urlComponents,\n username;\n // split the url into searchable components\n urlComponents = url.split('?')\n // search the match data for the passed username and return it\n for (var i = 0; i < urlComponents.length; i++){\n // split the string again to compare value pairs\n compComponents = urlComponents[i].split('=');\n if (compComponents[0] === 'username') {\n return compComponents[1];\n }\n }\n}", "function lookUpUserName(data, type, row, meta) {\n let name = null;\n abp.ajax({\n type: 'GET',\n async: false,\n url: '/api/identity/users/' + data, //here is GUID data\n }).done(function (result) {\n name = result.name\n });\n return name \n }", "function getName(authData) {\n switch (authData.provider) {\n case 'password':\n return authData.password.email.replace(/@.*/, '');\n }\n }", "function getUserName() {\n // check the url and store it in a variable so we can search it\n var url = $(location)attr.('href'),\n urlComponents,\n username;\n // split the url into searchable components\n urlComponents = url.split('?')\n // search the match data for the passed username and return it\n for (var i = 0; i < urlComponents.length; i++){\n // split the string again to compare value pairs\n compComponents = urlComponents[i].split('=');\n if (compComponents[0] === 'username') {\n return compComponents[1];\n }\n }\n\n}", "function getUserByName(username) {\n}", "function userName(accounts) {\n for (let i = 0; i < accounts.length; i++) {\n let userParts = accounts[i].owner.toLowerCase().split(\" \");\n let firstLetters = \"\";\n\n for (let j = 0; j < userParts.length; j++) {\n firstLetters += userParts[j][0];\n }\n accounts[i].username = firstLetters;\n }\n return accounts;\n}", "function displayUserName(data) {\n\t$('.welcome_message').html(`Welcome ${data.currentUser.username}, you are now logged into`)\n}", "function obtenerUserName(loginName) {\n userName = loginName;\n\n array = userName.split(\"|\");\n if (array.length == 3) {\n userName = array[2];\n }\n\n array = userName.split(\"\\\\\");\n if (array.length == 2) {\n userName = array[1];\n }\n\n return userName;\n}", "function getUserName(){\n let userName = document.getElementById(\"userNameText\").value;\n userName = userName.toLowerCase();\n let userNameFirstLetter = userName[0];\n userNameFirstLetter = userNameFirstLetter.toUpperCase();\n userName = userName.substring(1);\n validatedUserName = userNameFirstLetter + userName;\n playerScores.innerText = validatedUserName;\n}", "get userName() {\n return this._data.user_login;\n }", "get userName() {\n return this._data.user_login;\n }", "function getUserName() {\n\t$.ajax({\n\t\turl : 'rest/user/names',\n\t\ttype : \"GET\",\n\t\tdataType : \"text\"\n\t}).always(function(data) {\n\t\tif (typeof data != 'undefined') {\n\t\t\t$(\".welcome-greeting\").css(\"display\", \"inline\");\n\t\t\t$(\"#user-holder\").text(data);\n\t\t}\n\t});\n}", "avatarInitial(username) {\n let parts = (username == null) || (username == undefined) ? ['Not', '/', 'Available'] : username.split(/[ -]/)\n let initials = ''\n\n for (var i = 0; i < parts.length; i++) {\n initials += parts[i].charAt(0)\n }\n\n if (initials.length > 3 && initials.search(/[A-Z]/) !== -1) {\n initials = initials.replace(/[a-z]+/g, '')\n }\n\n initials = initials.substr(0, 3).toUpperCase()\n\n return initials\n }", "function getUserName() {\n return _userInformation.UserName;\n }", "function getName(authData)\n{\n\tswitch(authData.provider) {\n\t\tcase 'password':\n\t\t\treturn authData.password.email.replace(/@.*/, '');\n\t\tcase 'twitter':\n\t\t\treturn authData.twitter.displayName;\n\t\tcase 'facebook':\n\t\t\treturn authData.facebook.displayName;\n\t\tcase 'google':\n\t\t\treturn authData.google.displayName;\n\t}\n}", "function getName(authData) {\n \t\tswitch(authData.provider) {\n \t\t\tcase 'password':\n \t\t\treturn authData.password.email.replace(/@.*/, '');\n \t\t\tcase 'twitter':\n \t\t\treturn authData.twitter.displayName;\n \t\t\tcase 'facebook':\n \t\t\treturn authData.facebook.displayName;\n \t\t}\n \t}", "function playerName(){\n if(loggedIn()){\n return firebase.auth().currentUser.email.split(\"@\")[0].substring(0,20).capitalize();\n }\n return \"\";\n}", "get username() {\n return this.getStringAttribute('username');\n }", "function createUserName ( email ){\n const user = email;\n const iend = user.indexOf(\"@\");\n const userName = user.substring(0 , iend);\n console.log( userName ); \n return userName;\n }", "function fx_Lower(data)\n{\n\t//if the data is a valid string lower case it\n\treturn !String_IsNullOrWhiteSpace(data) ? (\"\" + data).toLowerCase() : \"\";\n}", "function GetAddressUsername(address) {\n address = GetAddress(address);\n var at = address.indexOf(\"@\");\n return (at == -1) ? address : address.substr(0, at);\n}", "function getCurrentUserName() {\n return page.evaluate((selector) => {\n let el = document.querySelector(selector);\n\n return el ? el.innerText : '';\n }, selector.user_name);\n }", "function userGet(data) {\n data = data.split(\"Logged in user name: \").pop();\n data = data.substr(0, data.indexOf('\\n'));\n data = data.substr(0, data.indexOf('\\r'));\n console.log('Got username on startup')\n console.log(data)\n if(data !== undefined){\n encrypt(data);\n messaging(setup,'userSet', true, '')\n } else {\n messaging(setup,'userSet', false, '')\n }\n return\n}", "function validateUserName(){\n\tvar input = jQuery('#username').val();\n\tvar retval = validUserName(input);\n\tif(!retval) {\n\t\tmsg = 'You must enter a Username at least 8 characters long.';\n\t\trequiredAction('#username', retval, msg);\n\t\treturn retval;\n\t}\n\treturn jQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: fc_data_check_url,\n\t\tdata: { \"action\" : 'usernametest', \"username\" : encodeVal(input) },\n\t\tsuccess: function(data) {\n\t\t\tif(!data.success){\n\t\t\t\tmsg = data.message;\n\t\t\t}else{\n\t\t\t\tmsg = '';\n\t\t\t}\n\t\t\trequiredAction('#username', data.success, msg);\n\t\t\tconsole.log('username', data.success);\n\t\t\treturn data.success;\n\t\t},\n\t\terror: function(data){\n\t\t\tlogError(data);\n\t\t\talert(\"System Error. Please try again.\");\n\t\t\treturn false;\n\t\t}\n\t});\n}", "function getTitle(data) {\n\t\tvar title = \"\";\n\t\tif(data.title){\n\t\t\ttitle = data.title;\n\t\t}else if( data.username ){\n\t\t\ttitle = data.username;\n\t\t}else if( data.message_details ){\n\t\t\ttitle = data.message_details;\n\t\t}else if( data.details ){\n\t\t\ttitle = data.details;\n\t\t}else if( data.fullname ){\n\t\t\ttitle = data.fullname;\n\t\t}\n\t\t\n\t\treturn title;\n\t}", "function validateUsername(fields, data, errors) {\n if (!(/^[a-zA-Z0-9]{5,}$/.test(data[\"username\"].value))) {\n errors.push(\"Le nom d’utilisateur inclut des lettres sans accents et chiffres\" +\n \" uniquement. Minimum 5 caractères.\");\n }\n}", "function UserNameReplace() {\n if (typeof(disableUsernameReplace) != 'undefined' && disableUsernameReplace || wgUserName == null) return;\n $(\"span.insertusername\").text(wgUserName);\n}", "function UserNameReplace() {\n if(typeof(disableUsernameReplace) != 'undefined' && disableUsernameReplace || wgUserName == null) return;\n $(\"span.insertusername\").text(wgUserName);\n }", "get username() { // get uinique username. In your api use ${utils.username}\n return new Date().getTime().toString();\n }", "function clear_username() {\r\n \tself.user.username = '';\r\n }", "function validarUserName(username){\n username = username.toLowerCase();\n if (!/^[a-zA-Z0-9_-]+$/.test(username)) {\n return true;\n }\n if(username.length == 0) \n return true;\n if(username.length < 6) \n return true;\n if(!isNaN(username[0])) \n return true;\n return false;\n\n }", "function UserNameReplace() {\n if(typeof(disableUsernameReplace) != 'undefined' && disableUsernameReplace || wgUserName == null) return;\n $('.insertusername').html(wgUserName); }", "function getUsername(id) {\n\tconst record = db.run('SELECT * FROM Users WHERE id = ?', [id]).next();\n\t// [\"id\", \"username\", \"password\"]\n\t// 0 1 2\n\treturn record.value[1];\n}", "function validateUsername(value, formstate, form) {\n if (value === rff.getInitialValue(formstate, 'username')) {\n return; // This sets username synclyValid. It's an edge case for the usernameSynclyValid option.\n }\n if (/^[0-9]/.test(value)) {\n return 'Usernames cannot start with a number';\n }\n if (!/^[a-zA-Z0-9]+$/.test(value) || value.indexOf(' ') !== -1) {\n return 'Usernames must be alphanumeric and cannot contain whitespace.';\n }\n return form.usernameSynclyValid ? null : rff.setNotValidated(formstate, 'username'); // No feedback until async finishes.\n}", "function getUsername() {\n return $rootScope.currentUsername || \"\";\n }", "function getUserDataByKey(key) {\n if(!can.isEmptyObject(userData)) {\n return userData[key];\n }\n return \"\";\n}", "function UserNameReplace() {\n if(typeof(disableUsernameReplace) != 'undefined' && disableUsernameReplace || wgUserName == null) return;\n $(\"span.insertusername\").html(wgUserName);\n }", "error () {\n return this.username.trim().length < 7 ? 'Please enter a longer username' : ''\n }", "function sanitizeUserInput(userInput) {\n return $(\"<div/>\").html(userInput.trim()).text();\n}", "async checkUsernameUnique () {\n\t\tif (this.dontCheckUsername) {\n\t\t\treturn;\n\t\t}\n\t\tconst username = this.data.username || this.user.get('username');\n\t\tif (!username) {\n\t\t\treturn;\n\t\t}\n\t\t// we check against each team the user is on, it must be unique in all teams\n\t\tconst teamIds = this.user.get('teamIds') || [];\n\t\tconst usernameChecker = new UsernameChecker({\n\t\t\tdata: this.request.data,\n\t\t\tusername: username,\n\t\t\tuserId: this.user.id,\n\t\t\tteamIds: teamIds\n\t\t});\n\t\tconst isUnique = await usernameChecker.checkUsernameUnique();\n\t\tif (!isUnique) {\n\t\t\tthrow this.request.errorHandler.error('usernameNotUnique', {\n\t\t\t\tinfo: {\n\t\t\t\t\tusername: username,\n\t\t\t\t\tteamIds: usernameChecker.notUniqueTeamIds\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}", "function sanitizeUsernames(group) {\n\t\tfor (var i=0; i<group.length; i++) {\n\t\t\tgroup[i]['username'].replace(/&/g, '&amp;')\n\t\t\t\t\t\t\t\t.replace(/>/g, '&gt;')\n\t\t\t\t\t\t\t\t.replace(/</g, '&lt;')\n\t\t\t\t\t\t\t\t.replace(/\"/g, '&quot;');\n\t\t}\n\t}", "username(){\n return Meteor.user().username;\n }", "function req_read_user_name(env) {\n var data = http.req_body(env).user;\n set_user_name(\n env,\n data.user_name_title,\n data.user_name_first,\n data.user_name_initial,\n data.user_name_last\n )\n}", "function get_user(data,username=true){\n\tif (username){\n\t\tlet user = db('users').where({\n\t\t\tusername:data,\n\t\t}).select('*');\n\t\treturn user\n\t} else{\n\t\tlet user = db('users').where({\n\t\t\temail:data,\n\t\t}).select('*')\n\t\treturn user\n\t};\n}", "function replaceName(userName) {\n // var name;\n if (userName !== \"\") {\n return userName;\n } else {\n return \"Dave\";\n }\n}", "static getUserName(config, account, enableEmail) {\n if (account && account.name) {\n return account.name;\n } else if (account && account.username) {\n return account.username;\n } else if (enableEmail && account && account.email) {\n return account.email;\n } else if (config && config.user &&\n config.user.anonymous_coward_name !== 'Anonymous Coward') {\n return config.user.anonymous_coward_name;\n }\n\n return ANONYMOUS_NAME;\n }", "function getUserNameValue(){\n\tvar cookieValue = getRememberMe();\n\tif (cookieValue != \"\") {\n\t\tvar cookiePairs = cookieValue.split(\"~\");\n\t\tvar cookiePair = \"\";\n\t\tvar cookiePairContent = \"\";\n\t\tfor(i=0;i<cookiePairs.length;i++){\t\n\t\t\tcookiePair = cookiePairs[i];\n\t\t\tif (cookiePair != \"\") {\n\t\t\t\tcookiePairContent = cookiePair.split(\":\");\n\t\t\t\tif(cookiePairContent.length > 1){\n\t\t\t\t\tif(cookiePairContent[0]==\"userName\"){\n\t\t\t\t\t\treturn cookiePairContent[1];\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\treturn \"\";\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t}\n\t}\n\treturn \"\";\n}", "function getUserName() {\n context.load(user);\n context.executeQueryAsync(onGetUserNameSuccess, onGetUserNameFail);\n }", "function getUserName() {\n context.load(user);\n context.executeQueryAsync(onGetUserNameSuccess, onGetUserNameFail);\n }", "function getUserName() {\n context.load(user);\n context.executeQueryAsync(onGetUserNameSuccess, onGetUserNameFail);\n }", "function getUserName() {\n context.load(user);\n context.executeQueryAsync(onGetUserNameSuccess, onGetUserNameFail);\n }", "function transform(data) {\n\treturn data || \"\";\n}", "function transform(data) {\n\treturn data || \"\";\n}", "function transform(data) {\n\treturn data || \"\";\n}", "processUsername() {\n let regex = new RegExp('^[A-Za-z0-9_-]*$')\n\n if (this.username.value === '') {\n\n this.username.err = true\n this.usernameErr.seen = true\n this.usernameErr.text = \"نام کاربری نمی تواند خالی باشد\"\n this.valid = false\n\n } else if (!regex.test(this.username.value)) {\n this.username.err = true\n this.usernameErr.seen = true\n this.usernameErr.text = \"کاراکتر غیر مجاز\"\n this.valid = false\n } else {\n // resetting the styles to no error\n this.username.err = false\n this.usernameErr.seen = false\n }\n }", "function parseUser(token) {\n let name;\n jwt.verify(token, env.access_token_secret, (err, username) => {\n if (!err) {\n name = username;\n }\n });\n return name;\n}", "getDisplayName() {\r\n var name = this.auth.currentUser.displayName;\r\n var nameArr = name.split(\" \");\r\n return nameArr[0];\r\n }", "function checkUsername (strng) {\n\tvar error = \"\";\n\tif (strng == \"\") {\n\t\terror = \"You didn't enter a username.\\n\";\n\t}\n\n var illegalChars = /\\W/; // allow letters, numbers, and underscores\n if ((strng.length < 4) || (strng.length > 10)) {\n error = \"The username is the wrong length.\\n\";\n } else if (illegalChars.test(strng)) {\n \terror = \"The username contains illegal characters.\\n\";\n }\n\treturn error;\n}", "function validateSignupInput(data, otherValidation){\n let { errors } = otherValidation(data);\n const { username } = data;\n\n return User.findOne({username: username}).then(user => {\n if(user){\n if (user.username === username){\n errors.username = \"There is user with this username!\";\n }\n }\n return {\n errors,\n isValid: isEmpty(errors)\n }\n })\n}", "function getSummonerName(){\n\tvar name = $('#summoner-name-input').val();\n\treturn cleanName(name);\n}", "function getUname(email) {\n var username = \"\";\n for (var i = 1; i < email.length; i++) {\n if (email[i] != \"@\") {\n username += email[i - 1]\n } else {\n username += email[i - 1]\n break;\n }\n }\n return username;\n }", "get username() {\n return this._username || User.defaults.username;\n }", "function getFullUserName(nick, user, host) {\n return nick + \"!\" + user + \"@\" + host;\n }", "getUserName() {\n return this.userData.name;\n }", "function getUserName(){\n\t\tuserName = $cookies.get('userName');\n\t\treturn userName;\n\t}", "extractUsername(namespaceName: string): ?string {\n const ns: string = cleanNS(namespaceName);\n if (!ns.startsWith('/')) return null; \n \n // assert: namespaceName[0] === '/'\n const candidate = ns.slice(1);\n \n if (! this.looksLikeUsername(candidate)) return null; \n \n return candidate;\n\n /**\n * Takes the last field of the NS path\n * \n * @param {*} namespace \n */\n function cleanNS(namespace: string): string {\n let cleaned = '' + namespace;\n // remove eventual trailing \"/\"\n if (cleaned.slice(-1) === '/') cleaned = cleaned.slice(0, -1);\n // get last element of path\n const s = cleaned.lastIndexOf('/');\n if (s > 0) {\n cleaned = cleaned.slice(s);\n }\n return cleaned;\n }\n }", "function renderUsername(value, p, r){\r\n return String.format('<b><font color=\"' + getColor(r.data['username']) + '\">{0}&nbsp;({1}):</b></font>', r.data['username'], r.data['time']);\r\n}", "function get_username(){\n var url = window.location.href;\n\n var urlSplit = url.split(\"/\");\n\n var user = urlSplit[3];\n var username = urlSplit[4];\n\n\n if(user.trim() == \"user\"){\n return username.trim();\n }\n\n return false;\n\n}", "get username_field() {return browser.element('#user_name')}", "function validateUsername(field)\n{\n //Make sure field is not blank\n if(field == \"\") return \"Please specify a username.\\n\";\n //Return an error if invalid input\n if(!/^[a-zA-Z0-9]+$/.test(field)) return \"Invalid characters in username.\\n\";\n return \"\";\n}", "function sanitise(name){\n\treturn name.replace(/[^a-zA-Z0-9\\.\\-]/g, '_');\n}", "function copyUsername(event) {\n\tvar hostname = event.target.parentNode.parentNode.firstChild.innerHTML;\n\tvar hypertext = event.target.parentNode.parentNode.childNodes[1].innerHTML;\n\tvar indexOfTerminator = hypertext.indexOf(\">\");\n\tvar username = hypertext.slice(indexOfTerminator + 2);\n\t\n\tif(username) {\n\t\tclipboardHelper.copyString(username);\n\t\tvar args = [username, hostname];\n\t\ttoast(stringBundle.formatStringFromName(\"usernameCopiedToast\", args, args.length));\n\t} else {\n\t\ttoast(stringBundle.GetStringFromName(\"emptyUsernameToast\"));\n\t}\n}", "function getUsername() {\n var url = window.location.search.substring(1);\n var parseURL = url.split('&');\n var uname = []; // uname[1] is the username\n for (var x = 0; x < parseURL.length; x++) {\n var temp = [];\n temp = parseURL[x].split('=');\n if (temp[0] === 'uname') {\n uname.push(temp[0]);\n uname.push(temp[1]);\n }\n }\n // var username = uname[1];\n return uname[1];\n }", "function getDisplayTextOfUser() {\n if (_userInformation.DisplayName != null) {\n return _userInformation.DisplayName;\n }\n return _userInformation.UserName;\n }", "function get_user_name() {\n switch (event_type) {\n case \"user\":\n var nameurl = \"https://api.line.me/v2/bot/profile/\" + user_id;\n break;\n case \"group\":\n var groupid = msg.events[0].source.groupId;\n var nameurl = \"https://api.line.me/v2/bot/group/\" + groupid + \"/member/\" + user_id;\n break;\n }\n\n try {\n // call LINE User Info API, get user name\n var response = UrlFetchApp.fetch(nameurl, {\n \"method\": \"GET\",\n \"headers\": {\n \"Authorization\": \"Bearer \" + CHANNEL_ACCESS_TOKEN,\n \"Content-Type\": \"application/json\"\n },\n });\n var namedata = JSON.parse(response);\n var reserve_name = namedata.displayName;\n }\n catch {\n reserve_name = \"not avaliable\";\n }\n return String(reserve_name)\n }", "function isValidName(data) {\n var re = /^[a-zA-Z0-9_\\- ]*$/;\n\n return re.test(data);\n }", "function getInvalidUsernameResponse(username) {\n return 'Invalid username: ' + username + '. Should match: min-length=3 max-length=20 no-whitespace';\n}", "function isValidUsername(username){\n return username.length > 0;\n}", "function validate_username(username) {\n\treturn (username != \"\");\n}" ]
[ "0.6556607", "0.6441322", "0.6351614", "0.62824726", "0.62534326", "0.6222458", "0.62051564", "0.593441", "0.58392864", "0.57818395", "0.5737936", "0.5735899", "0.57323736", "0.5671924", "0.567183", "0.5656397", "0.5636011", "0.560751", "0.560013", "0.5596617", "0.55797195", "0.55708313", "0.5560543", "0.5551707", "0.5524257", "0.55183965", "0.5517536", "0.55156076", "0.55119216", "0.5507997", "0.55039424", "0.55039424", "0.55038625", "0.54820347", "0.5473774", "0.54710484", "0.546854", "0.5457077", "0.54529923", "0.5427825", "0.5426638", "0.5416956", "0.5415001", "0.54007506", "0.539528", "0.53834236", "0.53670996", "0.53629726", "0.53435117", "0.53375256", "0.5334984", "0.532474", "0.5308493", "0.5298551", "0.52908003", "0.5288839", "0.5283577", "0.52810144", "0.5246952", "0.5235418", "0.5225525", "0.522504", "0.5221614", "0.5210466", "0.5201636", "0.5200128", "0.52000237", "0.51971775", "0.5195372", "0.5195372", "0.5195372", "0.5195372", "0.5190622", "0.5190622", "0.5190622", "0.51889527", "0.51838624", "0.51743954", "0.51610863", "0.51577795", "0.5154262", "0.5152941", "0.5152315", "0.51512545", "0.5151249", "0.51499623", "0.5145545", "0.51341486", "0.5133841", "0.5127702", "0.5113117", "0.5112094", "0.5110824", "0.5108297", "0.5100675", "0.5091824", "0.5090131", "0.5089078", "0.5078232", "0.50778997" ]
0.8672377
0
PUBLIC METHODS Returns the number of active rooms within the RoomPool.
getNumRooms() { return Object.keys(this.rooms).length; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static numActiveGames() {\n return Rooms.getAll()\n .filter(({isActive}) => isActive)\n .length;\n }", "static totalNumPlayers() {\n return Rooms.getAll()\n .filter(({isActive}) => isActive)\n .reduce((count, {players}) => {\n return count + players.filter(x => x.isConnected && !x.isBot).length;\n }, 0);\n }", "getRoomCount() {\n return new Promise((res, rej) => {\n this.#database.count({}, (err, count) => {\n if (err) rej(err);\n res(count);\n });\n });\n }", "function getSocketCountInRoom(roomName) {\n var roomInfo;\n var output;\n\n if (roomName) {\n roomInfo = io.sockets.adapter.rooms[roomName];\n if (roomInfo && roomInfo.length) {\n output = roomInfo.length;\n }\n }\n\n if (typeof output == 'undefined') {\n output = 0;\n }\n\n return output;\n}", "function getNumberUsersInRoom(room) {\n var room = io.sockets.adapter.rooms[room];\n\n if (room !== undefined) {\n console.log('room length ' + room.length);\n return room.length;\n }\n else {\n return 0;\n }\n\n}", "function getRoomPlayersNumber( roomName ){\n let room = io.sockets.adapter.rooms[roomName];\n return (room === undefined)? 0 : room.length;\n }", "itemCount() {\n return this.__roomItems.length;\n }", "static numGames() {\n return Rooms.getAll().length;\n }", "function countPioneerAssignments(room, sourceId) {\n var pioneers = room.find(FIND_MY_CREEPS, {\n filter: function(obj) {\n return (obj.memory.role == Static.ROLE_PIONEER);\n }\n });\n \n var count = 0;\n for (var i in pioneers) {\n var pioneer = pioneers[i];\n if (pioneer.memory.assignedToSourceId == sourceId) {\n count++;\n }\n }\n\n return count;\n}", "getActiveServersCount() {\n var w = this;\n var c = 0;\n for (var s in w.servers) {\n if (w.servers[s].isBound()) c++;\n }\n return c;\n }", "function getNumberOfViewers (room) {\n\t\tif(room && io.sockets.adapter.rooms[room]) {\n\t\t\treturn Math.max(Object.keys(io.sockets.adapter.rooms[room]).length, 1);\n\t\t} else {\n\t\t\treturn 1;\n\t\t}\n\t}", "function totalAvailability(chainOfHotels) {\n\t//console.table(chainOfHotels);\n\t//console.log(chainOfHotels[0].rooms);\n\tvar roomsAvailable = 0;\n\tvar i;\n\tfor (i = 0; i < chainOfHotels.length; i++) {\n\t\troomsAvailable = roomsAvailable + (chainOfHotels[i].rooms - chainOfHotels[i].booked);\n\t\t//console.log(chainOfHotels[i].booked);\n\t\t//console.log(roomsAvailable);\n\t\t//console.log(roomsAvailable);\n\t}\n\t//return the number of rooms available across all of the hotels in the chain\n\t//console.log(totalRoomAvailable);\n\treturn roomsAvailable;\n}", "getAvailableSeatCount () {\n return (this.capacity - this.passengerList.length);\n }", "function creepsInRoom(room) {\n \"use strict\";\n\n const creepsInRoom = room.find(FIND_MY_CREEPS);\n const count = {}\n for (let role of roles) {\n count[role] = _.sum(creepsInRoom, c => c.memory.role == role);\n }\n return count;\n}", "roomCoursesNumber(examRoom) {\n let st = this.roomCourse(examRoom)\n return st.size;\n }", "function getRooms() {\n var availableRooms = [];\n var rooms = io.sockets.adapter.rooms;\n if (rooms) {\n for (var room in rooms) {\n if (!rooms[room].hasOwnProperty(room) && room.includes('room:')) {\n var data = {}\n data.roomName = room.split(\"room:\").pop();\n data.numberOfUsers = rooms[room].length;\n availableRooms.push(data);\n }\n }\n }\n return availableRooms;\n}", "function countActiveJobs () {\r\n return state.jobs.reduce((count, job) => {\r\n if (job.state === 'active') {\r\n count++;\r\n }\r\n return count;\r\n }, 0);\r\n}", "function getActiveChatCount() {\r\n\tvar count = 0;\r\n\tfor(var id in enabledTabsMap) {\r\n if (enabledTabsMap[id] == true) {\r\n \tcount++;\r\n }\r\n\t} \r\n return count;\r\n}", "function numberOfOpenGames(){\n var num = 0;\n for (var i = 0; i < game_list.length; i++) {\n if (game_list[i].number_slots > 0) num++;\n }\n return num;\n}", "function connCount() {\n var connCount = []\n for (var pixelid = 0; pixelid < 50; pixelid++) {\n connCount.push(null)\n var room = mobilesock.adapter.rooms[pixelid]\n if (room) {\n phones = pixelid\n connCount[pixelid] = room.length\n } else {\n connCount[pixelid] = 0\n }\n }\n panelsock.emit('connCount', connCount)\n\n}", "function getOfflineCoursesCount(){\n\tcoursesDb.find({}, function(err, docs){\n\t\tsyncCourses(docs.length)\n\t})\n}", "ActiveRoom(){\r\n\t\tif(this.roomsMgr.RoomExists(this.activeRoom)){\r\n\t\t\treturn this.roomsMgr.Room(this.activeRoom);\r\n\t\t}\r\n\t\treturn this.roomsMgr.Room(SERVER_CH);\r\n\t}", "function connCount(){\n var connCount = []\n for(var pixelid=0;pixelid<15;pixelid++){\n connCount.push(null)\n var room = mobilesock.adapter.rooms[pixelid]\n if(room){\n connCount[pixelid] = room.length\n }else{\n connCount[pixelid] = 0\n }\n }\n panelsock.emit('connCount',connCount)\n console.log(connCount)\n}", "function numWorkers() { return workerIds().length }", "getRoom() {\n const id = this.roomName;\n\n if (!activeRooms.hasOwnProperty(id)) {\n throw new Error('Room requested does not exist: ' + id);\n }\n\n return activeRooms[id];\n }", "function getAllRooms(){\r\n roomsService.getAllRooms(\"now\").then(rooms => {\r\n vm.rooms = rooms;\r\n });\r\n }", "function remainingEnemy() {\n\n var noOfEnemy = 0;\n\n for (var i = 0; i < enemyList.length; i++) {\n if (enemyList[i].active) {\n noOfEnemy++;\n }\n }\n\n return noOfEnemy\n }", "function getAllRooms() {\n if (promisedRooms.data.success) {\n $scope.rooms = promisedRooms.data.rooms;\n } else {\n $scope.noRoomMessage = \"No rooms available. Create one.\";\n }\n }", "function countActiveNeighbours(game, cell) {\n var total = 0;\n iterateArray(neighbouringCells(cell), function countActiveNeighboursIterator(cell) {\n var id = cellId(cell);\n if (game.hasOwnProperty(id) && isActive(game[id])) {\n total += 1;\n }\n });\n return total;\n }", "async function getLodgingsCount() {\n const [ results ] = await mysqlPool.query(\n \"SELECT COUNT(*) AS count FROM lodgings\");\n console.log(\" -- results:\", results);\n return results[0].count;\n}", "function countLaunchers(){\n\tvar n=0;\n\tfor (var i =0; i<launchers.length;i++){\n\t\tif(!launchers[i].destroyed){\n\t\t\tn++;\n\t\t}\n\t}\n\treturn n;\n}", "function getAvailableRooms(rooms){\n\tvar availableRooms = [];\n\t$.each(rooms , function(index, room){\n\t\tif(room.isAvailable == true){\n\t\t\tavailableRooms.push(room);\n\t\t}\n\t});\n\treturn availableRooms;\n}", "getExistingClientsNumber(roomId) {\n return new Promise((resolve, reject) => {\n this._io.in(roomId).clients((err, clients) => {\n if (!err && _.isArray(clients)) {\n resolve(clients.length);\n } else {\n resolve(0);\n }\n }) \n });\n }", "getNumberOfOpenTiles() {\n const { gameState } = this.state;\n const openTiles = gameState.filter((tile) => tile.status == 1);\n return openTiles.length;\n }", "get instancePoolsToUseCountInput() {\n return this._instancePoolsToUseCount;\n }", "function numberOfTanksAlive() {\n var count = 0;\n for (i=0; i<arrayOfPlayers.length; i++) {\n if (arrayOfPlayers[i].active) count++;\n }\n console.log(\"Number of tanks left: \" + count);\n return count;\n}", "async function availableroom(){\n const roomCollections = await rooms();\n const targets = await roomCollections.find({ available: true }).toArray();\n if(targets.length === 0) throw 'No room available!';\n return targets;\n}", "async count(criteria = {}) {\n\t\tconst count = await this.model.count(criteria)\n\t\treturn count\n\t}", "function countObstacles(){\n\t\tobstacles.find({scored:{$ne:false}}).then((obstacles) => {\n\t\t\tvar obstacleCount = JSON.stringify(obstacles.length)\n\t\t\tprocess.env.totalObstacleCount = obstacleCount\n\t\t\t\t console.log(`There are: ${process.env.totalObstacleCount} obstacles.`)\n\t\t}, (e) => {\n\t console.log('trouble with obstacle count calculation')\n\t });\n\t}", "_activeRiddleCount () {\n return this._activeQueue.filter(r => r.active && !(this._config.get('alwaysAutoquiz') && r.quizzerId === this._clientId)).length\n }", "function getRemainingEnemies() {\n return enemyShipList.length + bossList.length;\n}", "function connectionCount() {\n return connections.length;\n}", "function getOnlineUsersCount() {\n\treturn bot.users.filter(function(user) {\n\t\tif (user.presence.status != \"offline\") return true;\n\t}).size;\n}", "function countAvailableNodes() {\r\n\tvar availableNodes = 0;\r\n\tif (nodesPayload != null) {\r\n\t\tfor (var i = 0; i < nodesPayload.length; i++) {\r\n\t\t\tif (nodesPayload[i].isAvailable) {\r\n\t\t\t\tavailableNodes++;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn availableNodes;\r\n}", "function getNumPlayers () {\n return state.numPlayers;\n}", "get count() {\n return this.ranges.length;\n }", "getRooms() {\n return new Promise((resolve, reject) => {\n this.collection.find({}).toArray((err, rooms) => {\n if (err) {\n logger.error(err);\n return reject(err);\n } else {\n return resolve(rooms);\n }\n });\n });\n }", "function getBusinessesCount(mysqlPool) {\n return new Promise((resolve, reject) => {\n mysqlPool.query('SELECT COUNT(*) AS count FROM businesses', function (err, results) {\n if (err) {\n reject(err);\n } else {\n resolve(results[0].count);\n }\n });\n });\n}", "function Rooms() {\n rooms = [];\n}", "function retrieveRoleRecordCount() {\n\tvar baseUrl = getClientStore().baseURL;\n\tvar cellName = sessionStorage.selectedcell;\n\tvar accessor = objCommon.initializeAccessor(baseUrl, cellName);\n\tvar objRoleManager = new _pc.RoleManager(accessor);\n\tvar uri = objRoleManager.getUrl();\n\turi = uri + \"?$top=0&$inlinecount=allpages\";\n\tvar restAdapter = new _pc.RestAdapterFactory.create(accessor);\n\tvar response = restAdapter.get(uri, \"application/json\");\n\tvar json = response.bodyAsJson().d;\n\tvar count = json.__count;\n\treturn count;\n}", "function checkGuests() {\r\n\ttempRe = 0;\r\n\tfor (i = 0; i < gameRoom.length; i++) {\r\n\t\tif (gameRoom[i].roomGuest != null) tempRe++;\r\n\t}\r\n\treturn(tempRe);\r\n}", "is_available()\n\t{\n\t\treturn _.isObject(this.room)\n\t}", "function minimalAmountOfRoom(input){\r\n let rooms = {};\r\n for(let i = 0; i < input.length; i++){\r\n let currentMeeting = input[i];\r\n for(let j = 0; j < rooms.length; j++){\r\n if(fitInRoom(input[i], room[j])){\r\n room[j] = input[i];\r\n break;\r\n }\r\n }\r\n room[rooms.length] = input[i];\r\n }\r\n\r\n return rooms.length;\r\n}", "get count() {\r\n return this._subscriptions.length;\r\n }", "availableAgentCount(agentLabel) {\n\t\tvar count = 0;\n\t\tfor (let i = 0; i < this.agents.length; i++) {\n\t\t\tlet agent = this.agents[i];\n\t\t\t// if agent for this label\n\t\t\tif (agent.config.agentLabel === agentLabel) {\n\t\t\t\t// if there is a max but the max hasn't been reached yet\n\t\t\t\tif (!agent.maxWindowsPerAgent || agent.windows.length < agent.maxWindowsPerAgent) {\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn count;\n\t}", "function cellsALiveCount(){\n let newCells = createCells();\n let cellsAlive = 0\n for (let y = 0; y < resolution; y++){\n for (let x = 0; x < resolution; x++){\n const neighbours = getNeightbourCount(x,y);\n if (cells[x][y] && neighbours >= 2 && neighbours <= 3) \n newCells[x][y] = true;\n else if (!cells[x][y] && neighbours === 3) \n newCells[x][y] = true;\n cellsAlive += cells[x][y] ? 1 : 0 \n }\n }\n return cellsAlive;\n}", "function getNumberOfObjs() {\n\t\treturn this.list.length;\n\t}", "updateRooms() {\n\t\tmapVals(this._clients).forEach(client => client.updateRooms(this._roomInfo()))\n\t}", "async function getUsersCount() {\n const [ results ] = await mysqlPool.query(\n 'SELECT COUNT(*) AS count FROM users'\n );\n return results[0].count;\n }", "getNumberOfProcesses() {\n\t return tslib_es6.__awaiter(this, void 0, void 0, function* () {\n\t const result = yield this.rawQuery({\n\t sqlQuery: 'select count(distinct(upid)) from thread;',\n\t });\n\t return +result.columns[0].longValues[0];\n\t });\n\t }", "async function checkRooms(){\n\tconsole.log('Checking the rooms')\n\tawait db.getRooms().then((rooms) => {\n\t\tconsole.log(rooms);\n\t})\n}", "calculateGameObjectCount() {\n\t\tlet area = window.innerWidth * window.innerHeight;\n\t\tthis.gameObjectCount = Math.floor(area * this.resCoefficient);\n\t\tconsole.log('game object count: ' + this.gameObjectCount);\n\t}", "function countContinents() {\n \treturn this.player.continents.length;\n }", "count() {\n let c = 0;\n\n if (this.players.p1 !== undefined) {\n c++;\n }\n if (this.players.p2 !== undefined) {\n c++;\n }\n\n return c;\n }", "function numWorkers() { return Object.keys(cluster.workers).length; }", "bookingCount() {\n var s1 = Bookings_Live.find({ 'screenID': Session.get(\"SCREEN_ID\"), 'code': Session.get(\"UserLogged\").code }).count();\n var s2 = Bookings_Authorization.find({ 'screenID': Session.get(\"SCREEN_ID\"), 'code': Session.get(\"UserLogged\").code }).count();\n return s1 + s2;\n }", "countRoads(){\n return this.roads.length\n }", "function increaseRoomCount(roomId) {\n var room = $('#room-' + roomId);\n var numUsers = parseInt(room.attr('data-users'), 10);\n numUsers++;\n room.attr('data-users', numUsers);\n room.html(room.attr('data-name') + ' (' + numUsers + ')');\n}", "getNumInstances(props) {\n props = props || this.props;\n\n // First Check if app has provided an explicit value\n if (props.numInstances !== undefined) {\n return props.numInstances;\n }\n\n // Second check if the layer has set its own value\n if (this.state && this.state.numInstances !== undefined) {\n return this.state.numInstances;\n }\n\n // Use container library to get a count for any ES6 container or object\n return count(props.data);\n }", "function size() {\r\n var counter = 0;\r\n for (var i = 0; i < this.PriorityQueueContents.length; i++) {\r\n counter += this.PriorityQueueContents[i].ids.length;\r\n }\r\n return counter;\r\n }", "get count() {\n\t\t\treturn this.items\n\t\t\t\t.map(item => item.qty)\n\t\t\t\t.reduce((total, qty) => total += qty, 0);\n\t\t}", "async fetchRooms() {\n\t\t//let chatRoomsRef = firebase.database().ref(`private-rooms`);\n const db = firebase.firestore()\n let chatRoomsRef = await db.collection('chat-rooms')\n\n\t\tchatRoomsRef.onSnapshot(snapshot => {\n\t\t\tlet list = []\n\t\t\tsnapshot.forEach((item) => {\n let data = {\n ...item.data(),\n key: list.length\n };\n if (!data.status) { //only want to display rooms that need an admin\n if (data.last_question) {\n data.last_question = new Date(data.last_question.seconds * 1000).toString()\n }\n list.push(data);\n }\n })\n\t\t\tthis.setState({chat_rooms: list})\n })\n\n // //TODO: fetch the room that the admin is in here\n // let user = firebase.auth().currentUser\n // const adminUsersRef = await db.collection('admin-users').doc(user.uid)\n\n // if (adminUsersRef.get().exists) {\n // var room = adminUsersRef.data().joined_room\n // this.adminJoinRoom(room)\n // }\n\t}", "async loadCount()\n {\n const qParams = this._cache.queryParams;\n if (!qParams)\n {\n throw new Meteor.Error('Calling .loadCount() while query params are not ready');\n }\n\n return this.getEntity().getCount(qParams.filter || {});\n }", "function numberOFEnemiesRemainingToFight() {\n var NumOfEnemiesRemaining = 0;\n\n for (var i = 0; i < characters.length; i++) {\n if (characters[i].id != humanPlayer.id) {\n if (characters[i].isAlive) {\n NumOfEnemiesRemaining++;\n }\n }\n }\n\n return NumOfEnemiesRemaining;\n}", "count() {\n return Object.keys(this.getAll()).length;\n }", "function getTotalUsers (room){\n\n\n \n room = room.trim().toLowerCase()\n let usersInRoom= users.filter((u)=>{return u.room===room});\n\n \n return usersInRoom;\n}", "getRunnerCount() {\r\n\t\treturn new Promise(function(resolve, reject) {\r\n\t\t\tdb.runner.findAndCountAll({\r\n\t\t\t\twhere: { button_id: { $ne: null } }\r\n\t\t\t}).\r\n\t\t\tthen(runners => {\r\n\t\t\t\tresolve(runners.count);\r\n\t\t\t}).\r\n\t\t\tcatch(err => {\r\n\t\t\t\treject(err);\r\n\t\t\t});\r\n\t\t});\r\n\t}", "async count() {\n // Call internally stored DB API to return the amount of models matching self query\n return await this._db.count(this._Model, this);\n }", "function getSongCount() {\n return getActiveSongs().length;\n}", "function countAdalabers() {\n const howMany = adalabers.length;\n return howMany;\n\n}", "function getUsersWaiting() {\n\n // get the count of users waiting\n var users_waiting = 0;\n for (socket.id in users_pool) {\n\n if (users_pool[socket.id] == 0) {\n\n users_waiting++;\n }\n }\n\n return users_waiting;\n }", "getNumberOfPlayers() {\n return Object.keys(this.players).length;\n }", "function itemsLength() {\n connection.query(\"SELECT * FROM products\", function (err, results) {\n if (err) throw err;\n var itemsLengthArray = [];\n for (let i = 0; i < results.length; i++) {\n itemsLengthArray.push(results[i].department_id)\n }\n itemsNumber = itemsLengthArray.length;\n });\n return itemsNumber\n}", "count() {\n let sum = this.items.length;\n return sum;\n }", "function GetNumTiles() {\n var tileCount = 0;\n\n for (var key in ScrabbleTiles) {\n tileCount += ScrabbleTiles[key].number_remaining;\n }\n\n return tileCount;\n}", "calcArea() {\n /** \n Defensive programming: \n Does the house have rooms? While a house without rooms would\n be quite odd in the real world, it is common in programming \n world.\n */\n if (!this.rooms) {\n return \"This house has no rooms! What kind of crazy person lives here?!\"\n }\n\n /**\n Itterate through each room in the house and return the square footage.\n This does not take in to account hallways and other access ways.\n */\n let totalArea = 0;\n for (let i = 0; i < this.rooms.length; i++) {\n if (this.rooms[i].squareFootage) {\n totalArea += this.rooms[i].squareFootage\n }\n }\n \n return totalArea;\n }", "engineRooms() {\n\n }", "get numTotalChoices() {\n // Iterates over all of the items in the collection.\n // Probably a bit slower than modifying a property directly when adding / removing items,\n // But a lot easier to maintain.\n return Array.from(this.choices.values(), (value) => value.totalNumber)\n .reduce((acc, cur) => acc + cur, 0)\n }", "get count() {\n return this._subscriptions.length;\n }", "constructor() {\n this.rooms = {}\n }", "get availableChannels() {\n return this.db.groups.filteredSortedList(Application.filterRooms);\n }", "function retreiveTotalUsers () {\n\t\t//Vars\n\t\tlet serverID = client.guilds.get(message.guild.id);\n\n\t\t//Number of Users in a Server\n\t\treturn serverID.members.size;\n\t}", "getIntervalCount(){\n return this.root ? this.root.getIntervalCount() : 0;\n }", "function canEquipItemCount() {\n var stats = (0, _templateString.$stats)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral([\"Muscle, Mysticality, Moxie\"]))).map(stat => Math.min((0, _kolmafia.myBasestat)(stat), 300));\n\n if (stats.every((value, index) => value === cachedStats[index])) {\n return cachedCanEquipItemCount;\n }\n\n cachedStats = stats;\n cachedCanEquipItemCount = Item.all().filter(item => (0, _kolmafia.canEquip)(item)).length;\n return cachedCanEquipItemCount;\n}", "async function getAllAvailableRooms(req, res, next) {\n try {\n const availableRooms = await searchAvailableRooms.search(req.body.beginning, req.body.end);\n res.send(availableRooms);\n } catch (e) {\n next(e);\n }\n}", "function getRoom(room)\r\n{\r\n if (!(room in roomObj))\r\n {\r\n roomObj[room] = roomData.length;\r\n roomData.push([]);\r\n console.log(\"===> Room \" + room + \" created on \" + new Date());\r\n console.log(\"Current rooms:\" );\r\n console.log(roomObj);\r\n }\r\n return roomData[roomObj[room]];\r\n}", "size() {\n\t\tvar runner = this.head;\n\t\tvar counter = 0;\n\n\t\twhile (runner != null) {\n\t\t\tcounter += 1;\n\t\t\trunner = runner.next;\n\t\t}\n\t\treturn counter;\n\t}", "size() {\n\t\tvar runner = this.head;\n\t\tvar counter = 0;\n\n\t\twhile (runner != null) {\n\t\t\tcounter += 1;\n\t\t\trunner = runner.next;\n\t\t}\n\t\treturn counter;\n\t}", "get size() {\n return this._pool.size;\n }", "fetchRooms(context) {\n return getRooms().then(function(res) {\n context.commit('addRooms', res);\n });\n }" ]
[ "0.7090985", "0.6865184", "0.6586705", "0.65550524", "0.6523901", "0.6487544", "0.6442403", "0.63598233", "0.63311267", "0.6260583", "0.6251814", "0.61382014", "0.59974605", "0.598827", "0.59823996", "0.5964406", "0.59638923", "0.5648914", "0.5622821", "0.5615856", "0.5610976", "0.55607826", "0.5536519", "0.552736", "0.54480416", "0.54335296", "0.540742", "0.5392266", "0.5382688", "0.53546244", "0.53543925", "0.53343177", "0.53143793", "0.530211", "0.5278077", "0.5275416", "0.5274859", "0.52511835", "0.524825", "0.52367383", "0.52191067", "0.5217561", "0.52047724", "0.5194008", "0.5191362", "0.5186857", "0.5176709", "0.5174053", "0.51457983", "0.51176924", "0.51049054", "0.5095091", "0.5089189", "0.5089024", "0.50796497", "0.5075491", "0.5073676", "0.50730735", "0.5067454", "0.5067304", "0.5064403", "0.50478756", "0.50417995", "0.5034833", "0.5033196", "0.5032422", "0.5029745", "0.50223285", "0.5016621", "0.5016105", "0.5011826", "0.50106937", "0.5003517", "0.49919903", "0.49796507", "0.49795082", "0.49772048", "0.49767292", "0.49624056", "0.49584988", "0.49560866", "0.49557164", "0.4954915", "0.49548692", "0.4948759", "0.49468416", "0.4943113", "0.49376395", "0.49364364", "0.49034783", "0.48952383", "0.48943776", "0.4893666", "0.48904625", "0.48837018", "0.48830876", "0.4880823", "0.4880823", "0.48381147", "0.4836728" ]
0.73321277
0
Returns the room associated with the given room code.
getRoom(roomCode) { return this.rooms[roomCode]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getRoom(roomCode) {\n var ref = firebase.database().ref(\"Rooms/\" + roomCode);\n var room = $firebaseObject(ref);\n \n return room;\n }", "getRoom() {\n const id = this.roomName;\n\n if (!activeRooms.hasOwnProperty(id)) {\n throw new Error('Room requested does not exist: ' + id);\n }\n\n return activeRooms[id];\n }", "function getRoomNameFromId(roomcode) {\n var sResult = \"\";\n // Loop trough each room and check if we found an id that is equals to param roomcode\n $.each(rooms, function (i, room) {\n if (room.id === roomcode) {\n sResult = room.name; // Store the rooms name in sResult if we found its id that's equal to roomcode\n }\n });\n return sResult;\n}", "getRoom(roomId) {\r\n\t\treturn typeof this.rooms[roomId] === \"object\" ? this.rooms[roomId] : null;\r\n\t}", "_getRoomCodeFromSocket(socket) {\n if (socket && socket.rooms) {\n return socket.rooms[Object.keys(socket.rooms)[1]];\n }\n\n return undefined;\n }", "retrieve(room) {\n if (this._rooms[room]) {\n return this._rooms[room];\n } else {\n throw 'It appears you have made a mistake.';\n }\n }", "function getRoom(id){\n\tfor (var i=0; i<activeRooms.length;i++){\n\t\tif (activeRooms[i].num == id){\n\t\t\trm = {};\n\t\t\trm.room = activeRooms[i];\n\t\t\trm.index = i;\n\t\t\treturn rm;\n\t\t}\n\t}\n}", "function getRoom()\n {\n\n // console.log(\".. . .. . .. . \" + room);\n\n // if(room == undefined) ///eller === \n // {\n // return \"Sök sal...\";\n // }\n // else\n // {\n // return room; // eller toString(room);\n // }\n }", "function getRoom(slug) {\n\n const tempItem = [...data.rooms];\n\n const room = tempItem.find((room) => room.slug === slug);\n\n return room;\n\n }", "removeRoom(roomCode) {\n Logger.logInfo('Removing room: ' + roomCode);\n this.rooms[roomCode].forceEndGame();\n delete this.rooms[roomCode];\n }", "function getRoom(name=\"default\") {\n\tif (!rooms[name]) {\n\t\trooms[name] = {\n\t\t\tname: name,\n\t\t\tclients: {},\n\t\t}\n\t}\n\treturn rooms[name]\n}", "function getRoomById(id) {\n for (let i = 0; i < rooms.length; i++) {\n const room = rooms[i];\n if (room.id == id) {\n return room;\n }\n }\n return null;\n}", "ActiveRoom(){\r\n\t\tif(this.roomsMgr.RoomExists(this.activeRoom)){\r\n\t\t\treturn this.roomsMgr.Room(this.activeRoom);\r\n\t\t}\r\n\t\treturn this.roomsMgr.Room(SERVER_CH);\r\n\t}", "function joinOrCreateRoom(roomCode) {\n socket.join(roomCode, () => {\n // Sets the socket's room code\n socket.roomCode = roomCode\n // Sends room code to client\n socket.emit('room_joined', roomCode)\n // Updates GM's player list\n updateGMRoomMembers()\n })\n }", "static get(roomName) {\n\t\tif (!ROOMS.has(roomName)) {\n\t\t\tROOMS.set(roomName, new Room(roomName));\n\t\t}\n\n\t\treturn ROOMS.get(roomName);\n\t}", "function findGame(code) {\n\treturn games.filter((game)=>{return game.getCode() == code})[0]\n}", "getRoom() {\n var query = location.search && location.search.split(\"?\")[1];\n\n if (query) {\n return (location.search && decodeURIComponent(query.split(\"=\")[1]));\n }\n\n return \"no-id\"\n }", "function findRoom(msg) {\n var room = msg.envelope.room;\n\n if(_.isUndefined(room)) {\n room = msg.envelope.user.reply_to;\n }\n\n return room;\n }", "function deleteRoom(roomCode){\n let room = rooms[roomCode];\n if(room){\n let players = room.players;\n for(let i = 0; i < players.length; i++){\n let player = players[i];\n delete socks[player].room;\n }\n delete rooms[roomCode];\n }\n}", "getRoom (socketOrId) {\n\t\t\tif (typeof socketOrId == \"object\") {\n\t\t\t\treturn this.getByToken(socketOrId);\n\t\t\t} else if (typeof socketOrId == \"string\") {\n\t\t\t\treturn this.getById(socketOrId);\n\t\t\t}\n\t\t}", "function getRoom(room)\r\n{\r\n if (!(room in roomObj))\r\n {\r\n roomObj[room] = roomData.length;\r\n roomData.push([]);\r\n console.log(\"===> Room \" + room + \" created on \" + new Date());\r\n console.log(\"Current rooms:\" );\r\n console.log(roomObj);\r\n }\r\n return roomData[roomObj[room]];\r\n}", "function roomExists(code) {\r\n try {\r\n console.log(\"checking if room with code: \" + code + \" exists\");\r\n console.log(rooms[code]);\r\n if(code == null || code == undefined || typeof code != 'string' || !rooms[code]) {\r\n console.log(\"it's bad\");\r\n return false;\r\n }\r\n console.log(\"it's good\");\r\n return true;\r\n } catch(e) {\r\n console.error(e);\r\n return false;\r\n }\r\n}", "async function getRoom(req, res, next) {\n try {\n const room = await models.room.findById(req.params.roomId, {\n include: [models.instrument],\n });\n res.send(room);\n } catch (e) {\n next(e);\n }\n}", "getRoomId() {\n return this.roomId;\n }", "function getRoom(){\n\tvar chatName = document.getElementById(\"chatName\");\n\tif(!chatName)\n\t\treturn null;\n\treturn chatName.innerText;\n}", "function roomById (id) {\n var i;\n for (i = 0; i < rooms.length; i++) {\n if (rooms[i].roomid === id) {\n return rooms[i]\n }\n }\n\n return false\n}", "reserveNewRoom() {\n var newRoomCode;\n\n do {\n newRoomCode = Hasher.genHash(ROOM_CODE_LENGTH);\n } while(this.roomExists(newRoomCode));\n\n this.rooms[newRoomCode] = new Room(newRoomCode);\n return newRoomCode;\n }", "function genRoomCode() {\n const roomSeed = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',\n rooms = io.sockets.adapter.rooms;\n let code\n do {\n code = ''\n for (var i = 0; i < 5; i++) {\n code += roomSeed[getRandomInt(roomSeed.length)]\n }\n // Keep generating new codes if the code is already in use\n } while (rooms[code])\n return code\n }", "function getObjectForRoom(currentRoom) {\n var objectInRoomIndex = -1;\n if (currentRoom === 0) {\n return objectInRoomIndex;\n }\n\n for (var i = 0; i < itemLocationRoomNumbers.length ; i++) {\n if (itemLocationRoomNumbers[i] == currentRoom) {\n objectInRoomIndex = i;\n break;\n }\n }\n return objectInRoomIndex;\n }", "function getRoom(request, response) {\n let roomName = request.params.roomName;\n // Chatroom.find({chatroom_name: roomName}, function (err, docs) {\n // if (err) {\n // console.log(err);\n // } else {\n // let roomId;\n // // If a chatroom with that name exists get it, else create one\n // if (docs.length > 0) {\n // roomId = docs[0].chatroom_id;\n // } else {\n // roomId = roomGenerator.roomIdGenerator()\n // const newChatroom = new Chatroom ({\n // chatroom_id: roomId,\n // chatroom_name: roomName\n // });\n\n // newChatroom\n // .save()\n // .then(item => console.log(item))\n // .catch(err => console.log(err));\n // }\n\n // TODO: Get the messages and submit to room.hbs\n Messages.find({ chatroom_name: roomName })\n .lean()\n .then((items) => {\n response.render(\"room\", {\n title: \"chatroom\",\n roomName,\n messages: items,\n isAvailable: true,\n // newRoomId: roomId\n });\n });\n}", "function GetGameByRoomName(_RoomName) {\r\n if(_RoomName === LOBBYROOMNAME) return;\r\n\r\n var _Game = _mData.Games.find(function(_Game){\r\n return _Game.RoomName === _RoomName;\r\n });\r\n\r\n return _Game;\r\n}", "function findRoomDetailByUsageId(usageId){\n\tvar roomDetail = null;\n\t$.each(currentReservations, function(index, rsvDetail){\n\t\tif(rsvDetail.usageId == usageId){\n\t\t\troomDetail = rsvDetail;\n\t\t}\n\t});\n\treturn roomDetail;\n}", "getRoomId() {\n return this.roomId;\n }", "function isRoomToBeShown(roomcode) {\n var sValue = false;\n // If device don't have room, it's returning \"0\" or undefined\n if ((roomcode === \"0\") || (roomcode === undefined)) {\n // then we get the true / false value from showroomless devices\n sValue = showRoomLess;\n } else {\n // else, we check if that room is checkedor not\n sValue = appData.values[\"settings-room-\" + roomcode];\n }\n\n return sValue;\n}", "function Room(room = {}, action) {\n switch (action.type) {\n case SET_ROOM:\n return action.room;\n default:\n return room;\n }\n}", "async function getOrCreateRoom({ roomId, consumerReplicas })\n{\n\tlet room = rooms.get(roomId);\n\n\t// If the Room does not exist create a new one.\n\tif (!room)\n\t{\n\t\tlogger.info('creating a new Room [roomId:%s]', roomId);\n\n\t\tconst mediasoupWorker = getMediasoupWorker();\n\n\t\troom = await Room.create({ mediasoupWorker, roomId, consumerReplicas });\n\n\t\trooms.set(roomId, room);\n\t\troom.on('close', () => rooms.delete(roomId));\n\t}\n\n\treturn room;\n}", "add(room) {\n\tthis._rooms[room.identifier] = room;\n\treturn room;\n }", "findRoom() {\n return _.find(this.props.queryTree, { id: this.state.currentRoomID });\n }", "roomExists(roomCode) {\n return this.rooms.hasOwnProperty(roomCode);\n }", "function pols_get_parent_room(){\r\n\r\n\tif (this.mapParent){\r\n\t\treturn apiFindObject(this.mapParent).pols_get_parent_room();\r\n\t}\r\n\r\n\treturn this;\r\n}", "getMemAddr(room) {\n let memRoomAddr;\n if (room == this.roomName) {\n return this.memoryAddr;\n } else {\n let remoteRoom = this.remoteRooms[room];\n if (remoteRoom) {\n memRoomAddr = this.memoryAddr.remoteRooms[room];\n } else {\n // throw error: this is not a room in my domain\n return;\n }\n }\n return memRoomAddr;\n }", "model(code) {\n if (typeof code !== 'string' || !code) return null;\n return this[models][code] || null;\n }", "function room(roomLetter,schedule)\n{\n this.letter = roomLetter;\n this.id=randomString(window.config.numberOfDigitsForRandomStrings,'aA#')+\"|room:\"+roomLetter;\n //store a reference to the schedule object in the room object so given any part of the turnoment hierarchy you can transverse to the top.\n this.schedule = schedule;\n this.rounds = [];\n}", "function lookupForAMeetingRoom(agent) {\n\n return searchARoom('[email protected]', agent, agent.parameters)\n\n\n }", "function updateRoomCode(event) {\r\n setRoomCode(event.target.value);\r\n }", "function partingFromRoom( room ) {\n}", "async function getOrCreateRoom({ roomId })\n{\n let room = rooms.get(roomId);\n\n // If the Room does not exist create a new one.\n if (!room)\n {\n room = await Room.create({ roomId });\n\n rooms.set(roomId, room);\n room.on('close', () => rooms.delete(roomId));\n }\n\n return room;\n}", "get roomId() {\n\t\treturn browser.element('.messages-container.flex-tab-main-content').getAttribute('id').replace('chat-window-', '');\n\t}", "createRoom() {\n return new Room();\n }", "in(room) {\r\n return this.to(room);\r\n }", "function getRoomURL() {\n\treturn location.protocol + \"//\" + location.host + (location.pathname || \"\") + \"?room=\" + getRoom();\n}", "function getMenuItem(code) {\n var category = code[0];\n MenuService.getMenuItems(category).then(\n function (response) {\n for (const item of response.menu_items) {\n if (item.short_name == code) {\n vm.menuItem = item;\n break;\n }\n }\n }\n )\n }", "function getQuestions(roomCode) {\n var ref = firebase.database().ref(\"Rooms/\" + roomCode + \"/Questions\");\n var questions = $firebaseArray(ref);\n \n return questions;\n }", "function removeRoom(room) {\n\n // Get the room's ID\n var id = room.id || room;\n $('#room-' + id).remove();\n}", "inRoom(idPlayer){\n return bdConf.searchRoomWithPlayer(idPlayer)\n }", "function getController(room) {\n return room.controller;\n}", "function getNodeFromRoomRef(roomref){\n\tfor (index in GJSONUnOrdered){\n\t\tif (GJSONUnOrdered[index].properties.RoomRef == roomref){\n\t\t\treturn GJSONUnOrdered[index];\n\t\t}\n\t}\n\talert( \"did not find : \"+roomref);\n\treturn false;\n}", "find() {\n return GameRooms.find({_id: roomId});\n }", "getByRoomId(id) {\n\t\t\tif (id !== undefined) {\n\t\t\t\tfor (let i = 0; i < this.list.length; i++) {\n\t\t\t\t\tif (this.list[i].id === id) {\n\t\t\t\t\t\treturn this.list[i];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "getRoomInfo() { return {}; }", "function addRoom(id, type) {\n\tif(type == \"battle\") {\n\t\tROOMS[id] = new BattleRoom(id, send);\n\t\treturn ROOMS[id];\n\t} else {\n\t\tlogger.error(\"Unkown room type: \" + type);\n\t}\n}", "function addRoom(id, type) {\n\tif(ROOMS[id]) return ROOMS[id];\n\tif(type == \"battle\") {\n\t\tROOMS[id] = new BattleRoom(id, send);\n\t\treturn ROOMS[id];\n\t} else {\n\t\tlogger.error(\"Unkown room type: \" + type);\n\t}\n}", "function getJoinedRoom(name)\n{\n var room_count = room.rooms.length\n for (var i = 0; i < room_count ; i++)\n {\n var r = room.getRoomById(room.rooms[i].id)\n if (r)\n {\n var p = r.isWaiting(name)\n if (p) // le joueur est inscrit dans cette room\n {\n return r.id\n }\n }\n }\n return null\n}", "room({id, title}) {\n return $('<a class=\"xmpp-room\">')\n .attr({\n title: id,\n href: '#' + id,\n 'data-room': id,\n })\n .text(title || id)\n .addClass((id == xmpp.room.current) && 'xmpp-room-current');\n }", "function roomID(type){\n var matchRoomRequest;\n //urls for express sessions and normal sessions \n //are not the same \n if(type==\"workspace\"){\n matchRoomRequest = /.*\\/workspace\\/(.+)/;\n }\n else{\n matchRoomRequest = /.*\\/express\\/(.{32})/;\n }\n var match = matchRoomRequest.exec(document.URL);\n\n if(match){\n return match[1];\n }\n}", "function getDatabase(code)\r\n\t{\r\n\t\tcode = code.toLowerCase();\r\n\t\tif (code.contains('item') || code.contains('itm'))\r\n\t\t\treturn $dataItems;\r\n\t\tif (code.contains('armor'))\r\n\t\t\treturn $dataArmors;\r\n\t\tif (code.contains('weapon') || code.contains('wpn'))\r\n\t\t\treturn $dataWeapons;\r\n\t\tif (code.contains('gold'))\r\n\t\t\treturn 'gold';\r\n\r\n\t\tthrow new Error('getDatabase('+ code + ') ERROR: invalid code.');\r\n\t}", "function getRoomInfo(roomType) {\n let priceList = [\n {roomType: \"Queen\", maxOccupancy: 5, highSeasonRate: 250, lowSeasonRate: 150},\n {roomType: \"King\", maxOccupancy: 2, highSeasonRate: 250, lowSeasonRate: 150},\n {roomType: \"King Suite\", maxOccupancy: 4, highSeasonRate: 310, lowSeasonRate: 190},\n {roomType: \"2-Bedroom Suite\", maxOccupancy: 6, highSeasonRate: 350, lowSeasonRate: 210}\n ];\n\n let obj;\n for (let i = 0; i < priceList.length; i++)\n {\n if (priceList[i].roomType == roomType)\n {\n obj = priceList[i];\n break;\n }\n }\n return obj;\n}", "function getPersonsInRoom (room_name) {\n \tfor (var i=0; i<chatRooms.length; i++) {\n \t\tif (chatRooms[i]['roomname'] === room_name) {\n \t\t\treturn chatRooms[i].people;\n \t\t}\n \t}\n }", "viewRoomNbr(number) {\n return this.httpGet(\"/room/view/id/\" + number);\n }", "function joinRoom() {\n const code = document.getElementById(\"roomCodeInput\").value;\n socket.emit(\"joinRoom\", code);\n}", "function to(current_room_name, dest_room_name) {\n\tif (current_room_name in map) {\n\t\tif (dest_room_name in map[current_room_name]) {\n\t\t\treturn map[current_room_name][dest_room_name];\n\t\t} else {\n\t\t\treturn map[current_room_name][\"Default\"];\n\t\t}\n\t} else {\n\t\tconsole.log('using fallback');\n\t\treturn PeristyleWorkshopDoor; // fallback\n\t}\n}", "async function getClassroomCode(name) {\n var code = \"\";\n await db.collection(\"classroom\").doc(name).get().then((doc) => {\n code = doc.data()[\"code\"];\n });\n return code;\n}", "function connectToRoom(joinCode) {\n return function(dispatch, getStore, client) {\n console.log(`connectToRoom(joinCode=${joinCode})`);\n client.emit(\"request_join\", joinCode, function(joined, playerID) {\n console.log(\"connectToRoom() succeeded: \" + joined);\n if(joined) {\n dispatch(setStatus(Status.CONNECTED, \"You're in!\"));\n dispatch(updatePlayer(playerID));\n dispatch(getRoomData(joinCode));\n } else {\n dispatch(setStatus(Status.ERROR, \"Couldn't join game: \" + playerID));\n }\n });\n };\n}", "constructor(roomCode) {\n this.roomCode = roomCode; // Room code (e.g. 'abcd' or 'foo1')\n this.playerMap = new PlayerMap(); // PlayerMap of the room\n this.hostSocket = undefined; // Reference to host socket\n this.gameServer = // Game server that will handle game interactions\n new GameServer(this.playerMap);\n }", "function getRoomId() {\n var roomId = window.location.href.split('#')[1];\n if(!roomId) {\n roomId = Math.floor(Math.random() * 1000000);\n window.location.href += '#' + roomId;\n }\n return roomId;\n}", "function selectRoomByName(name){\n\t\tfor(var i = 0; i < $scope.rooms.length; i++){\n\t\t\tif(name === $scope.rooms[i].roomName){\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t}", "function clickRoom(room) {\n\tvar elem = document.getElementById(ROOM_ID_PREFIX + room);\n\t// var item = findRoomById(room);\n\t// var btn = document.getElementById(room + \"_button\");\n\n\tpage_1.style.display = \"none\";\n\tpage_2.style.display = \"block\";\n\t// room_header_2.innerHTML = item.name;\n\tregister(loggedInUser, room);\n\twindow.history.replaceState('test', '', \"?room=\" + room);\n\t// TODO\n\tmapInit();\n}", "getRoomURL() {\n return location.protocol + \"//\" + location.host + (location.path || \"\") + \"?room=\" + this.getRoom();\n }", "findBestRoom() {\n var bestRoom;\n\n for (var room of this.rooms) {\n if (room.players.length < MAX_PLAYER_SIZE) {\n bestRoom = room;\n break;\n }\n }\n\n if (bestRoom) {\n\n // We found a room, return it\n return bestRoom;\n } else {\n\n // All rooms are full, make a new room\n return this.addRoom();\n }\n }", "findCourse(courseCode) {\n for (let i = 0; i < this.courses.length; i++) {\n if (this.courses[i].data.courseCode.contains(courseCode)) {\n return this.courses[i];\n }\n }\n }", "function joinedRoom( room ) {\n}", "function getStandupsForRoom(room) {\n return _.where(getStandups(), {room: room});\n }", "function changeRoom() {\n if (currentRoom !== undefined) {\n var desired_room = rotateRoom(currentRoom, this.id);\n\n initialState();\n setMqttRoom(desired_room);\n get_backend(room_list[desired_room]);\n\n }\n}", "function createRoomCode() {\n var code = \"\";\n for(var i = 0; i < 4; i++) {\n var letter = String.fromCharCode(Math.random() * (26) + 65);\n code += letter;\n }\n //- console.log(code);\n return code;\n}", "newRoom(roomId) {\r\n\t\tlet room = new ServerRoom(roomId);\r\n\t\tthis.rooms[room.id] = room;\r\n\t\treturn room;\r\n\t}", "function joinRoom() {\n var roomCode = document.getElementById('joinRoom').value;\n if (roomCode != \"\") {\n var docRef = db.collection('webBuzzer').doc(roomCode)\n docRef.get().then(function(doc) {\n if (doc.exists) {\n console.log(\"Document data:\", doc.data());\n data = doc.data()\n //firebase.database().ref('webBuzzer/' + roomCode).once('value', function(data) {\n if (data.name) {\n window.open('room.html?id=' + roomCode, '_self')\n } else {\n alert('The room code you entered isn\\'t valid.')\n }\n } else {\n alert('A 5 digit room code is required.')\n }\n }).catch(function(error) {\n console.log(\"Error getting document:\", error);\n });\n } else {\n // doc.data() will be undefined in this case\n console.log(\"No such document!\");\n }\n}", "function GetRooms(FloorName,Floors)\n {\n for(var i=0;i<Floors.length;i++)\n {\n if(Floors[i].floorName===FloorName)\n {\n return Floors[i].rooms;\n }\n }\n }", "generateRoomId() {\n\t\treturn `r${Date.now()}`;\n\t}", "find(gameRoom) {\n return SecretInfo.find({\n // Note that by using `this.userId`, we ensure that\n // this information is only accessible to the logged in\n // user. No other players' role information is ever\n // sent from the server to this user.\n uniqueId: secretInfoUniqueId(this.userId, gameRoom._id)\n });\n }", "function findById(id) {\n return restrooms.find(function (restroom) {\n return restroom.id === id;\n });\n}", "getRoomState(room) {\r\n\t\t//get stuff from db\r\n\t\t//(this will also create a new room if it doesnt exist yet)\r\n\t\treturn db.getState(room).then(data => {\r\n\t\t\tif (data && data.value && data.value.state) {\r\n\t\t\t\tif (data.value.state.chat && data.value.state.chat.messages) {\r\n\t\t\t\t\tfor (let [idx, msg] of data.value.state.chat.messages.entries()) {\r\n\t\t\t\t\t\tmsg.id = idx;\r\n\t\t\t\t\t\tmsg.history = true; //flag messages as being history\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn data.value.state;\r\n\t\t\t} else {\r\n\t\t\t\treturn {\r\n\t\t\t\t\tchat: {}\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t}).then(state => {\r\n\t\t\tstate.chat.users = this.getSocketsInRoom(room).map((s, i) => {\r\n\t\t\t\treturn {\r\n\t\t\t\t\tid: i,\r\n\t\t\t\t\tnick: s.nick\r\n\t\t\t\t};\r\n\t\t\t});\r\n\t\t\tstate.name = room;\r\n\t\t\treturn state;\r\n\t\t});\r\n\t}", "getPlayer(playerId) {\n // Find the player's room\n var room = this.rooms.filter((room) => {\n return room.players.filter((player) => player.id === playerId)[0];\n })[0];\n\n if (!room) return undefined;\n\n // Select the players\n var players = this.getPlayers(room.id);\n\n // Select the player from this room\n var cur = players.filter((user) => user.id === playerId)[0];\n\n return cur;\n }", "function getRoomInfo(socket, game) {\n if(socket && game) {\n const room = Array.from(socket.rooms)[1];\n const existingGame = game.map(game => game.roomId).indexOf(room);\n return existingGame;\n }\n else {\n return -1;\n }\n}", "function setRoom(room : GameObject) {\n\t\tcurrentRoom = room;\n\t}", "function generateRoomIdentifier() {\n // make a list of legal characters\n // we're intentionally excluding 0, O, I, and 1 for readability\n var chars = 'ABCDEFGHJKLMNPQRSTUVWXYZ23456789';\n\n var result = '';\n for (var i = 0; i < 6; i++)\n result += chars.charAt(Math.floor(Math.random() * chars.length));\n\n return result;\n}", "function Room(id, name){\n this.room_id=id;\n this.name=name;\n /* person who about to enter this room */\n this.self=null;\n /* topic object to control topic representation */ \n this.topic=new Topic(\"\");\n /* and mates */\n this.mates=new Mates([]);\n /* same for messages */\n this.messages=new Messages();\n /* true when user leaves pages open while visiting other pages. */\n this.hidden=false;\n /* number of message posted when window blurred */\n this.counter=0;\n this.network_controller=new NetworkController(this);\n this.controlsInit();\n this.networkInit();\n}", "findMessageWithCode(code) {\n var message = null;\n // Search for the index of the message\n var index = this.messages_received.findIndex((m) => {\n return (m.code === code);\n });\n // If message exist\n if (index >= 0) {\n // get and remove the message from the list\n message = this.messages_received.splice(index, 1)[0];\n }\n // Return the message\n return (message);\n }", "function addRoom(roomObj){\n var ref = firebase.database().ref(\"Rooms/\");\n ref.child(roomObj.code).set(roomObj);\n }", "function GetRoomHost(RequestingSocket, RoomName, LobbyInfo) {\n\tvar clients = io.sockets.adapter.rooms[RoomName].sockets; \n\n\tif(clients) {\n\t\tfor (var clientId in clients ) {\n\t\t\tvar clientSocket = io.sockets.connected[clientId];\n\t\t\tif(clientSocket.id == GetSocketFromPlayer(LobbyInfo.HOST_ID)) {\n\t\t\t\treturn clientSocket.id;\n\t\t\t}\n\t\t}\n\t}\n\treturn -1;\n}", "function generateRoomId(){\n let roomId = \"\";\n for(let i = 0; i < 4; i++){\n roomId += String.fromCharCode(_.random(65,90));\n }\n return roomId;\n }" ]
[ "0.81037015", "0.6867597", "0.68174833", "0.65568066", "0.6457666", "0.6432544", "0.63360745", "0.62797904", "0.62742895", "0.62188333", "0.6176027", "0.6173807", "0.61285734", "0.60923064", "0.60649204", "0.59586626", "0.59307027", "0.59038717", "0.58686805", "0.5835802", "0.5829127", "0.5779683", "0.5775277", "0.5754234", "0.5746747", "0.57307124", "0.56910527", "0.56763846", "0.56565875", "0.5649476", "0.56194234", "0.5610051", "0.55859613", "0.5575996", "0.54782134", "0.5477084", "0.54604447", "0.54488975", "0.5446852", "0.5437857", "0.54216576", "0.54119927", "0.54029095", "0.53623444", "0.53530157", "0.53513455", "0.532424", "0.53206545", "0.5290589", "0.5276496", "0.5275946", "0.5254039", "0.5228393", "0.5228131", "0.5219936", "0.5219268", "0.52120876", "0.5205346", "0.5193033", "0.51543474", "0.5152182", "0.5124107", "0.5119578", "0.5085388", "0.5056342", "0.50560373", "0.5049718", "0.5035976", "0.5003096", "0.5002352", "0.49932253", "0.4967761", "0.4958207", "0.49501824", "0.49239466", "0.4923359", "0.49227807", "0.4919405", "0.49074996", "0.49065462", "0.4901256", "0.48952293", "0.48784998", "0.48702225", "0.48656058", "0.48384273", "0.48235112", "0.48146352", "0.47850612", "0.47750422", "0.47704726", "0.47465765", "0.47394186", "0.4735194", "0.47250462", "0.47118425", "0.47073781", "0.4692459", "0.4690886", "0.46845105" ]
0.83012074
0
Removes the Room associated with the given room code from the pool.
removeRoom(roomCode) { Logger.logInfo('Removing room: ' + roomCode); this.rooms[roomCode].forceEndGame(); delete this.rooms[roomCode]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteRoom(roomCode){\n let room = rooms[roomCode];\n if(room){\n let players = room.players;\n for(let i = 0; i < players.length; i++){\n let player = players[i];\n delete socks[player].room;\n }\n delete rooms[roomCode];\n }\n}", "function removeRoom(room) {\n\n // Get the room's ID\n var id = room.id || room;\n $('#room-' + id).remove();\n}", "leave(room) {\n \tdelete this.room[room];\n\t}", "function removeFromBuilding(kind,label,uniqueKeyOfRoom){\n roomsRegistry[label][kind][uniqueKeyOfRoom].clients = removeKey(roomsRegistry[label][kind][uniqueKeyOfRoom].clients,clientId)\n\n kind === 'full'? removeRoomFromFullAddToNotFull(label,uniqueKeyOfRoom) : leftRoom(uniqueKeyOfRoom,label)\n }", "leaveRoom()\n {\n this.setRoom(null);\n }", "function removeRoom(id) {\n\tvar room = ROOMS[id];\n\tif(room) {\n\t\tdelete ROOMS[id];\n\t\treturn true;\n\t}\n\treturn false;\n}", "function removeRoom(id) {\n\tvar room = ROOMS[id];\n\tif(room) {\n\t\tdelete ROOMS[id];\n\t\treturn true;\n\t}\n\treturn false;\n}", "getRoom(roomCode) {\n return this.rooms[roomCode];\n }", "async function delroom(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/room.delroom)'\n }\n }\n\n const roomCollections = await rooms();\n target = await this.getbyid(id);\n\n const delinfo = await roomCollections.removeOne({ _id: id });\n if(delinfo.deletedCount === 0) throw 'Can not delete id: ' + id;\n\n return target;\n}", "function removeQuestion(roomCode, question_id) {\n var ref = firebase.database().ref(\"Rooms/\" + roomCode + \"/Questions\");\n ref.child(question_id).remove();\n }", "function removeRoom(element){\n\n\t//Parse the room name out of the trash can span element.\n\tvar elementParts = element.id.split(':');\n\tvar elementName = elementParts[1];\n\t\n\t//Do not allow user to delete selected room.\n\tif(elementName == selectedRoom)\n\t\treturn;\n\t\t\n\t//Find the room list item and the br list item.\n\tvar listItem = document.getElementById(elementName);\n\tvar brItem = document.getElementById(\"br:\" + elementName);\n\t\n\t//Remove the trash can span, room list item, and br item associated with that room.\n\telement.parentNode.removeChild(element);\n\tlistItem.parentNode.removeChild(listItem);\n\tbrItem.parentNode.removeChild(brItem);\n\t\n\t//Delete the room from the rooms array.\n\tfor (i = 0; i < roomsArray.length; i++) {\n\n\t\tif(roomsArray[i] == elementName){\n\t\t\tdelete roomsArray[i];\n\t\t\treturn;\n\t\t}\n\t\n\t}\n}", "function deleteRoomList(data) {\r\n let n = roomsName.indexOf(data);\r\n roomsName.splice(n, 1);\r\n rooms.splice(n, 1);\r\n console.log(rooms);\r\n let room = select(`#${data}`);\r\n room.remove();\r\n}", "function removeRoom(){\n for (var roomNum=1; roomNum<=localStorage.getItem(\"roomNum\");roomNum++) {\n localStorage.removeItem(\"name\" + roomNum);\n localStorage.removeItem(\"roomType\" + roomNum);\n localStorage.removeItem(\"bathroomAccess\" + roomNum);\n localStorage.removeItem(\"bedType\" + roomNum);\n localStorage.removeItem(\"feature\" + roomNum);\n localStorage.removeItem(\"date\" + roomNum);\n localStorage.removeItem(\"minStay\" + roomNum);\n localStorage.removeItem(\"amount\" + roomNum);\n localStorage.removeItem(\"bond\" + roomNum);\n localStorage.removeItem(\"bills\" + roomNum);\n }\n localStorage.removeItem(\"roomNum\");\n\n }", "removeRoom(roomname, playerIDs, reason, roomType) {\n if (roomType === \"play\" || roomType === \"game_end\") {\n delete this.playrooms[roomname];\n delete this.map[roomname];\n }\n else if (roomType === \"wait\"){\n delete this.waitrooms[roomname];\n delete this.map[roomname];\n }\n delete this.cameras[roomname];\n playerIDs.forEach((playerID, index) => {\n this.sockets[playerID].emit(Constants.MSG_TYPES.GAME_OVER, reason[index]);\n this.removePlayer(this.sockets[playerID]);\n });\n }", "function RemoveGame(_RoomName) {\r\n //Update the Games array by filtering out the unwanted Game...\r\n _mData.Games = _mData.Games.filter(function(_Game){\r\n return _Game.RoomName !== _RoomName;\r\n });\r\n}", "reserveNewRoom() {\n var newRoomCode;\n\n do {\n newRoomCode = Hasher.genHash(ROOM_CODE_LENGTH);\n } while(this.roomExists(newRoomCode));\n\n this.rooms[newRoomCode] = new Room(newRoomCode);\n return newRoomCode;\n }", "function deletePersonFromRoom (room_name, id) {\n \tfor (var i=0; i<chatRooms.length; i++) {\n \t\tif (chatRooms[i]['roomname'] === room_name) {\n \t\t\tdelete chatRooms[i].people[id];\n \t\t}\n \t}\n }", "async unsubscribe (room) {\n await this.connecting()\n this.connection.client.send(JSON.stringify({\n action: 'UNSUBSCRIBE',\n room\n }))\n this.connection.subscriptions = this.connection.subscriptions.filter(s => s.room !== room)\n }", "function removeRoomFromFullAddToNotFull(label,uniqueKeyOfRoom){\n roomsRegistry[label].notFull[uniqueKeyOfRoom] = roomsRegistry[label].full[uniqueKeyOfRoom]\n roomsRegistry[label].full = removeKey(roomsRegistry[label].full,uniqueKeyOfRoom)\n leftRoom(uniqueKeyOfRoom,label)\n }", "clearRoomCode() {\r\n this.setState({\r\n roomCode: null\r\n });\r\n }", "function joinOrCreateRoom(roomCode) {\n socket.join(roomCode, () => {\n // Sets the socket's room code\n socket.roomCode = roomCode\n // Sends room code to client\n socket.emit('room_joined', roomCode)\n // Updates GM's player list\n updateGMRoomMembers()\n })\n }", "clearRoomCode() {\r\n this.setState({\r\n roomCode: null,\r\n });\r\n }", "socketsLeave(room) {\r\n this.adapter.delSockets({\r\n rooms: this.rooms,\r\n except: this.exceptRooms,\r\n }, Array.isArray(room) ? room : [room]);\r\n }", "remove(paladinID) {\n const palList = STATE.PaladinList.get();\n const index = palList.findIndex(pID => { return pID === paladinID; });\n if (index !== -1) {\n palList.splice(index, 1);\n STATE.PaladinList.set(palList);\n // // Remove the token's character's paladin abilities\n // const tokenObj = STATE.get('TokenList', paladinID) as TokenObj | undefined;\n // if (tokenObj !== undefined && tokenObj.characterID !== undefined) {\n // const abilities = findObjs({\n // _type: 'ability',\n // _characterid: paladinID,\n // }) as Ability[];\n // const abilitiesToRemove = abilities.filter(a => {\n // return Paladin.paladinAbilities().some(b => { return b[0] === a.get('name'); });\n // });\n // abilitiesToRemove.forEach(a => {\n // a.remove();\n // });\n // }\n }\n }", "function destroy(msg)\r\n{\r\n var thisData = getRoom(msg[\"room\"]);\r\n while (thisData.length) {\r\n\t\t thisData.pop();\r\n\t }\r\n delete roomObj[msg[\"room\"]];\r\n web.io.emit(\"servermessage\", {\r\n \"room\": msg[\"room\"],\r\n \"command\": \"destroy\"\r\n });\r\n}", "function getRoom(roomCode) {\n var ref = firebase.database().ref(\"Rooms/\" + roomCode);\n var room = $firebaseObject(ref);\n \n return room;\n }", "function detachPlayerFromRoom(request)\n {\n var diff_lvl = request.session.player.diff_lvl;\n var tag = request.session.player.player_tag;\n\n roomCount[diff_lvl]--;\n request.io.leave(diff_lvl);\n console.log('LEAVE [' + diff_lvl + '] (' + tag + '): roomCount=' + roomCount[diff_lvl] );\n \n if (roomCount[diff_lvl] > 0)\n {\n var player = { player_tag: tag };\n request.io.room('' + diff_lvl).broadcast('gamer_exited_room', player );\n console.log(\"BROADCAST [\" + diff_lvl + \"]: gamer_exited_room (\" + tag + \")\");\n }\n else\n {\n console.log(\"...not BROADCASTing, since room [\" + diff_lvl + \"] is empty\");\n }\n }", "function delete_private_room(room_name) {\n // will return -1 when user name not found\n const target_index = private_rooms.findIndex(room => room.name === room_name); \n if (target_index !== -1){\n // will get user out of the array\n return private_rooms.splice(target_index, 1);\n }; \n}", "removeClient(uid, reasonCode, data) {\n this.clients = this.clients.filter((_client) => {\n return _client.uid !== uid;\n });\n delete this.pendingStates[uid];\n if (reasonCode !== null && !(isNaN(reasonCode))) {\n if (!(index_1.LEAVE_AREA_CODE_LOOKUP[reasonCode])) {\n throw 'Invalid reason code provided to removeClient';\n }\n this._sendClientDisconnect(uid, reasonCode, data);\n }\n }", "function leaveRoom() {\n localStorage.removeItem(\"currentRoom\");\n setCurrentRoom(\"\");\n\n }", "function leaveRoom() {\n // Call the server to leave the room\n socketInstance.delete('/room/' + roomId + '/onlineUsers', { id: myChatId });\n\n }", "async deleteRoom(req, res) {\n const db = await Database()\n const AdminRoomId = req.params.room\n const pass = req.body.password\n const adminPassword = await db.get(`SELECT * FROM admin`)\n const roomExist = await db.get(\n `SELECT id FROM rooms WHERE id = ${AdminRoomId}`\n )\n if (adminPassword.adminPassword == pass) {\n if (roomExist == undefined) {\n res.render('parts/alert-message', {\n message: `A sala ${AdminRoomId} não existe no Banco de Dados`,\n redirect: '/admin'\n })\n } else {\n await db.run(`DELETE FROM rooms WHERE id = ${AdminRoomId}`)\n await db.run(`DELETE FROM questions WHERE room = ${AdminRoomId}`)\n res.render('parts/alert-message', {\n message: `A sala ${AdminRoomId} foi excluída`,\n redirect: '/admin'\n })\n }\n } else {\n adminLogged = false\n res.render('parts/passincorrect', { roomId: '/admin' })\n }\n }", "removePlayer(playerId) {\n // Find the player's room\n var room = this.rooms.filter((room) => {\n return room.players.filter((player) => player.id === playerId)[0];\n })[0];\n\n // Select the players\n var players = this.getPlayers(room.id);\n\n // Select the player from this room\n var cur = players.filter((user) => user.id === playerId)[0];\n\n // If the player exists, remove it from the array\n if (cur) {\n room.players = room.players.filter((user) => user.id !== playerId);\n }\n\n // Return the removed player\n return cur;\n }", "function delete_public_room(room_name) {\n // will return -1 when user name not found\n const target_index = rooms.findIndex(room => room.name === room_name); \n if (target_index !== -1){\n // will get user out of the array\n return rooms.splice(target_index, 1);\n }; \n}", "removePlayer(socket, id) {\n const room = this.findById(id)\n if (!room) {\n return socket.emit(\n 'err',\n 'Could not leave requested room because it doesn not exist'\n )\n }\n const isEmpty = room.removePlayer(socket)\n\n if (isEmpty) {\n this.removeRoom(room.id)\n }\n }", "function removeRoom(socketId) {\n var room = roomList[socketGameMap[socketId]];\n\n if (typeof room === 'undefined') return;\n\n var players = room.game.getPlayers();\n\n delete roomList[socketGameMap[socketId]];\n\n // force all user in the room to disconnect\n for (var i = 0; i < players.length; i++) {\n var socket = players[i].socket;\n io.to(socket.id).emit('forceDisconnect');\n\n delete socketGameMap[socket.id];\n }\n\n notifyRoomListUpdated()\n }", "remove () {\n this.guild.remove('role', this.data.id)\n }", "function deleteFriendFromGroup(room) {\n Comm.deleteFriendFromGroup(room).then(()=> {\n });\n }", "function leaveRoom()\n {\n // Leave room\n $(this).removeClass(\"joined\");\n socket.send(JSON.stringify({\n \"command\": \"leave\", // determines which handler will be used (see chat/routing.py)\n \"room\": room_id\n }));\n }", "removeOneRoomAll ({socket, id}) {\n\t\t\tsocket.server.sockets.emit('roomRemoved', id);\n\t\t}", "deleteGame(room_id) {\n const sql = {\n text: `DELETE FROM rooms WHERE room_id = $1`,\n values: [room_id],\n };\n return db.query(sql);\n }", "function updateRoomCode(event) {\r\n setRoomCode(event.target.value);\r\n }", "remove(roomItem, keepInList) {\n keepInList = keepInList || false;\n if (!keepInList) {\n roomItem.destroy();\n Utils.removeValue(this.__roomItems, roomItem);\n }\n }", "removePlayer(sock) {\n const socket = sock;\n\n let which;\n\n if (this.players.p1 === socket) {\n which = 'p1';\n } else if (this.players.p2 === socket) {\n which = 'p2';\n }\n\n if (which !== undefined) {\n this.players[which] = undefined;\n\n socket.leave(this.hash);\n socket.join('lobby');\n socket.player.curRoom = undefined;\n }\n\n if (this.state === 'preparing' || this.state === 'inGame') {\n this.state = 'userLeftGame';\n }\n }", "function closeRoom(room){\n db.end(room);\n}", "delete() {\n for (var p of this.players) {\n p.connection.close();\n players[p.id] = undefined;\n }\n lobbies[this.lobbyCode] = undefined;\n }", "_removeUserFromRoom(userId, roomId) {\n\n\t\t// remove the user from the room\n\t\tlet userPos = this._rooms[roomId].users.indexOf(userId);\n\t\tif (userPos >= 0) {\n\t\t\tthis._rooms[roomId].users.splice(userPos, 1);\n\t\t}\n\n\t\t// remove the room if it is empty\n\t\tif (this._rooms[roomId].users.length == 0) {\n\t\t\tdelete this._rooms[roomId];\n\t\t}\n\n\t\t// remove the room from the user\n\t\tlet roomPos = this._users[userId].rooms.indexOf(roomId);\n\t\tif (roomPos >= 0) {\n\t\t\tthis._users[userId].rooms.splice(roomPos, 1);\n\t\t}\n\t}", "function deleteRoom(req, res) {\n const roomId = req.params._id;\n const deleteRoom = roomService.delete(roomId);\n const deleteRoomData = RoomDataService.DeleteRoomData(roomId);\n Promise.all([deleteRoom, deleteRoomData])\n .then(() => {\n res.sendStatus(200);\n })\n .catch((err) => {\n res.status(400).send(err);\n });\n}", "function rmcourse(el){\n\tcourses.splice(courses.indexOf(getcourse(el)), 1);\n\tel.remove();\n}", "function deleteRoom() {\n for (let i = 0; i < rooms.length; i++) {\n const room = rooms[i];\n if (room.id == document.getElementById(\"currentId\").innerHTML) {\n // resetRoomBookings(room);\n removeRoomFromUser(room.id);\n rooms.splice(i, 1);\n saveRooms();\n window.location.reload();\n }\n }\n}", "function removeRoomFromUser(roomId) {\n for (let i = 0; i < accounts.length; i++) {\n const account = accounts[i];\n console.log(account);\n console.log(\"Check against: \", roomId);\n // for (let j = 0; j < account.booked.length; j++) {\n for (let j = account.booked.length - 1; j >= 0 ; j--) {\n const booking = account.booked[j];\n console.log(\"Checking: \", booking.roomId);\n\n if (booking.roomId == roomId) {\n console.log(\"Removing: \", account.booked[j]);\n account.booked.splice(j, 1);\n console.log(account.booked);\n saveRooms();\n saveAcc();\n window.location.reload();\n }\n }\n }\n}", "function deleteFromPool(brwr){\n\n var data = $.param({\n loan_code: brwr.loan_code\n });\n dataservice.xdelete(EDIT_POOL+'?'+data, {loan_code: brwr.loan_code}, config).then(function(data, status) {\n if (data) {\n if (data.status) {\n for(var i in vm.createdpool){\n if(vm.createdpool[i].loan_code == brwr.loan_code){\n vm.createdpool.splice(i,1);\n borrowerData.push(brwr);\n vm.dtInstance.reloadData();\n }\n }\n }\n }\n\n }, function() {\n console.log('Create pool API error');\n });\n \n }", "function tryDeleteRoom(room, intervalId) {\n if (\n !room.presenter &&\n room.participants.length === 0 &&\n room.supervisors.length === 0\n ) {\n console.log(`Room ${room.roomId} being deleted.`);\n\n clearInterval(intervalId);\n delete rooms[room.roomId];\n }\n }", "function removeNick(nick, room) {\n let nickOcurrences = room._nickOcurrences;\n let players = room.players;\n\n let baseNick = nick.split('#')[0];\n let n = nickOcurrences[baseNick];\n n--;\n if(!n || n<=0) n = undefined;\n nickOcurrences[baseNick] = n;\n\n let index = players.indexOf(nick);\n if (index > -1) {\n players.splice(index, 1);\n }\n}", "disconnect() {\n if (this.room) {\n this.room.leave();\n this.room = null;\n }\n if (this.connection) {\n this.connection.disconnect();\n this.connection = null;\n }\n }", "function genRoomCode() {\n const roomSeed = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',\n rooms = io.sockets.adapter.rooms;\n let code\n do {\n code = ''\n for (var i = 0; i < 5; i++) {\n code += roomSeed[getRandomInt(roomSeed.length)]\n }\n // Keep generating new codes if the code is already in use\n } while (rooms[code])\n return code\n }", "remove(runnerId, raceId){\n\n return removerunner.delete({idRacer:raceId,idRunner: parseInt(runnerId)}, {})\n }", "setRoom(room)\n {\n // Don't do anything if the user is being set\n // to the room it's already in.\n if (this.room === room) return;\n\n // Remove the socket from the current room, if any.\n if (this.room)\n this.socket.leave(this.room.id);\n \n this.room = room;\n\n // If this user isn't being set to roomless, set the\n // socket to the new room.\n if (room)\n this.socket.join(room.id);\n }", "function LeaveRoom(room, username) {\n socket.leave(room);\n socket.broadcast.to(room).emit('ModRoomChangeReceive', { username: username, active: false });\n }", "function onitemremove (data) {\n\tvar removeItem; \n\tremoveItem = finditembyid(data.id);\n\n\tif (!removeItem) {\n\t\treturn;\n\t}\n\n\tland.splice(land.indexOf(removeItem), 1); \n\t\n\t//destroy the phaser object \n\tremoveItem.item.destroy(true, false);\n}", "function leaveRoom() {\n\tif (player != \"\") {\n\t\troundEnded();\n\t\tvar geturl = \"/sanaruudukko/rest/sr/process?func=leaveroom&player=\" + player + \"&passcode=\" + passcode;\n\t\t$.ajax({\n\t\t\tcache: false,\n\t\t\tdataType : 'xml',\n\t\t\ttype : 'GET',\n\t\t\turl : geturl,\n\t\t\tsuccess : function(data) {\n\t\t\t\tinitRoomList();\n\t\t\t},\n\t\t});\n\t}\n}", "remove(principalId, roleDefId) {\r\n return this.clone(RoleAssignments_1, `removeroleassignment(principalid=${principalId}, roledefid=${roleDefId})`).postCore();\r\n }", "leaveRoom() {\n debug('videoChat:leaveRoom');\n const localMedia = this.get('stream');\n if (localMedia) {\n (localMedia.getTracks() || []).forEach(t => t.stop());\n }\n get(this, 'webrtc').leaveRoom(this.get('roomId'));\n get(this, 'webrtc').disconnect();\n (get(this, 'webrtc.webrtc.localStreams') || []).forEach(stream => stream.getTracks().forEach(t => t.stop()));\n }", "function removeFromWaitingRoom(){\n\t \tmodel.help.remove({complaint_id:req.body.sendObj.compaintId},function(err,info){\n\t \t});\n\t \tres.send({message: msgInfo,balance:debitor.ewallet.available_amount});\n\t console.log(\"note deleted\"); \t\t \n\t }", "function getRoomNameFromId(roomcode) {\n var sResult = \"\";\n // Loop trough each room and check if we found an id that is equals to param roomcode\n $.each(rooms, function (i, room) {\n if (room.id === roomcode) {\n sResult = room.name; // Store the rooms name in sResult if we found its id that's equal to roomcode\n }\n });\n return sResult;\n}", "function destroy() {\n return client\n .delAsync(board);\n }", "removeNode(key) {\n const { nodes } = this;\n if (nodes.all[key]) {\n debug(\"Remove %s from the pool\", key);\n delete nodes.all[key];\n }\n delete nodes.master[key];\n delete nodes.slave[key];\n }", "function roomExists(code) {\r\n try {\r\n console.log(\"checking if room with code: \" + code + \" exists\");\r\n console.log(rooms[code]);\r\n if(code == null || code == undefined || typeof code != 'string' || !rooms[code]) {\r\n console.log(\"it's bad\");\r\n return false;\r\n }\r\n console.log(\"it's good\");\r\n return true;\r\n } catch(e) {\r\n console.error(e);\r\n return false;\r\n }\r\n}", "function deleteClassroom(classroomid) {\n\tif (classrooms[classroomid]) {\n\t\tdelete classrooms[classroomid];\n\t}\n}", "removePlayer(socket) {\n const isPlayer = this.players[socket.id] !== undefined\n const isSpectator = this.spectators[socket.id] !== undefined\n const isHost = this.host.data.id === socket.data.id;\n if (isPlayer) { // we might need to swap people in\n delete this.players[socket.id]\n const newPlayer = this.upgradeSpectator()\n // if ingame, then let's see how to modify the player\n if (this.state === ROOM_INGAME) {\n // if we have a player, then let's swap them\n if (newPlayer !== undefined) {\n this.game.swapPlayers(socket, newPlayer)\n } else { // else, just remove and let game use AI\n this.game.removePlayer(socket)\n }\n }\n // if host is leaving, we need to fix that too\n if (isHost) {\n this.upgradeHost();\n }\n } else if (isSpectator) { // don't care about these guys\n delete this.spectators[socket.id]\n }\n socket.leave(this.uniqueName)\n socket.join('lobby')\n delete socket.data.room\n delete socket.data.timeJoinedRoom\n // tell everyone else that room has changed\n socket.to(this.uniqueName).emit('room_player_update', this.playerInfo())\n io.to('lobby').emit('lobby_room_update', this.basicInfo())\n return Object.keys(this.players).length === 0\n }", "remove(principalId, roleDefId) {\n return __awaiter(this, void 0, void 0, function* () {\n yield spPost(this.clone(RoleAssignments, `removeroleassignment(principalid=${principalId}, roledefid=${roleDefId})`));\n });\n }", "remove(code) {\n this.setState({inCart: ! this.state.inCart});\n this.props.removeFromCart(code);\n }", "removePileArea () {\n if (!this.pileArea) { return; }\n\n fgmState.scene.remove(this.pileArea);\n this.pileArea = undefined;\n }", "function joinRoom() {\n const code = document.getElementById(\"roomCodeInput\").value;\n socket.emit(\"joinRoom\", code);\n}", "function leaveClassroom(id) {\n\tdelete clients[id].classroomid;\n\tdelete clients[id].permissions;\n}", "function findGame(code) {\n\treturn games.filter((game)=>{return game.getCode() == code})[0]\n}", "remove() {\n MessagingModule.removeMessage(this.conversation, this.uuid);\n }", "function removeUserFromRoom(room, user) {\n if (!user) throw new StatusError(400, 'User required');\n\n // TODO: consider whether this check is still necessary?\n if (room.oneToOne) throw new StatusError(400, 'This room does not support removing.');\n\n return removeUserIdFromRoom(room, user._id);\n}", "function room(roomLetter,schedule)\n{\n this.letter = roomLetter;\n this.id=randomString(window.config.numberOfDigitsForRandomStrings,'aA#')+\"|room:\"+roomLetter;\n //store a reference to the schedule object in the room object so given any part of the turnoment hierarchy you can transverse to the top.\n this.schedule = schedule;\n this.rounds = [];\n}", "function unwatch_room(room_name, ws) {\n // Gets watcher list\n var watchlist = Watchlist[room_name] || [];\n\n // Removes user from watcher list\n for (var i = 0; i < watchlist.length; ++i) {\n if (watchlist[i] === ws) {\n for (var j = i; j < watchlist.length - 1; ++j) {\n watchlist[j] = watchlist[j + 1];\n };\n return;\n }\n };\n}", "remove(guid) {\n this.registry.get(guid).willRemove();\n this.registry.delete(guid);\n }", "add(room) {\n\tthis._rooms[room.identifier] = room;\n\treturn room;\n }", "roomExists(roomCode) {\n return this.rooms.hasOwnProperty(roomCode);\n }", "removePlayer(player){\n this.roster.splice(roster.indexOf(player), roster.lastIndesOf(player));\n }", "function removeRole(){\n connection.query(queryList.roleList, function(err, res){\n if (err) throw err;\n let choices = []\n let list = res\n let roleList = res.map(role => role.title);\n choices.push(new q.queryAdd(\"delete\", \"Which role would you like to delete?\", roleList))\n inquirer\n .prompt(choices)\n .then(answer => {\n let id = list.filter(e => e.title === answer.delete).map(id => id.id).shift()\n connection.query(queryList.deleteEmployee,{role_id:id},\n function(err, res){if (err) throw err;\n console.log('employees deleted')\n connection.query(queryList.deleteRole,{id:id},\n function(err, res){\n if (err) throw err;\n console.log(\"Role deleted.\")\n startQ();\n });\n });\n })\n .catch(err => {\n if (err) throw err;\n });\n });\n}", "function resetTempRoom () {\n partialRoom = 0;\n partialId = 0;\n }", "function deleteBoard(){\n\tif(grid != null){\n \t\tdocument.body.removeChild(grid);\n \t}\n}", "async deleteRoomQuestions(req, res) {\n const db = await Database()\n const roomId = req.params.room\n const pass = req.body.password\n const adminPassword = await db.get('SELECT * FROM admin')\n const roomExist = await db.get(`SELECT id FROM rooms WHERE id = ${roomId}`)\n if (adminPassword.adminPassword == pass) {\n if (roomExist == undefined) {\n res.render('parts/alert-message', {\n message: `A sala ${roomId} não existe no Banco de Dados`,\n redirect: '/admin'\n })\n } else {\n await db.run(`DELETE FROM questions WHERE room = ${roomId}`)\n res.render('parts/alert-message', {\n message: `Todas questões da sala ${roomId} foram Excluídas`,\n redirect: '/admin'\n })\n }\n }\n }", "function participantDisconnected(participant, room) {\n // If the disconnected Participant was pinned as the active Participant, then\n // unpin it so that the active Participant can be updated.\n if (activeParticipant === participant && isActiveParticipantPinned) {\n isActiveParticipantPinned = false;\n setCurrentActiveParticipant(room);\n }\n\n // Remove the Participant's media container.\n $(`div#${participant.sid}`, $participants).remove();\n}", "function removeRole() {\n connection.query(\"SELECT * FROM role\", function (err, res) {\n if (err) throw err;\n inquirer.prompt([\n {\n type: \"list\",\n name: \"roleid\",\n message: \"Which role you would like to delete?\",\n choices: res.map(role => {\n return {\n name: role.title,\n value: role.id\n }\n })\n }\n ]).then(answers => {\n\n connection.query(\n \"DELETE FROM role WHERE ?\",\n {\n id: answers.roleid\n },\n function (err, res) {\n if (err) throw err;\n console.table(res);\n main();\n }\n );\n })\n })\n}", "quit_game(){\n this.room = DEFAULT_CHATROOM;\n this.socket.emit('game:stop', { chatroom: this.room });\n delete this.game;\n }", "_addPlayerToRoom(socket, username, roomCode) {\n if (!this.roomExists(roomCode)) {\n return false;\n }\n\n return this.rooms[roomCode].addPlayer(socket, username);\n }", "removeRole() {\n // collect role info\n inquirer.prompt([\n questions.functions.roleId\n ])\n // send results to delete role function\n .then((results) => {\n dbFunctions.deleteRole(results)\n console.log(`\\n Successfully deleted role! \\n`)\n startManagement()\n })\n }", "getRoom() {\n const id = this.roomName;\n\n if (!activeRooms.hasOwnProperty(id)) {\n throw new Error('Room requested does not exist: ' + id);\n }\n\n return activeRooms[id];\n }", "async function clearStaleRoom() {\n const roomsToBeDeleted = await retrieveStaleRooms(dayjs().add(-1, \"hour\"));\n if (roomsToBeDeleted) {\n roomsToBeDeleted.forEach(async (room) => {\n await deleteSongs(room._id);\n await deleteRoom(room._id);\n });\n }\n}", "remove(slug) {\n let item = this.getItem(slug);\n\n let itemIndex = this.items.indexOf(item);\n\n if (item) {\n this.items.splice(itemIndex, 1);\n this.update();\n }\n }", "remove(slug) {\n let item = this.getItem(slug);\n\n let itemIndex = this.items.indexOf(item);\n\n if (item) {\n this.items.splice(itemIndex, 1);\n this.update();\n }\n }", "function removeRole() {\n const sql = `SELECT title FROM role`;\n db.query(sql, (err, response) => {\n if (err) {\n throw err;\n return;\n }\n // Select Roles from Role Table and store into array\n let roleTitleArr = [];\n response.forEach((role) => {\n roleTitleArr.push(role.title);\n });\n // Prompt user to select role they want removed\n inquirer\n .prompt([\n {\n name: \"roleChoice\",\n type: \"list\",\n message: \"Please select the role you would like to remove:\",\n choices: roleTitleArr,\n },\n ])\n // Fetch corresponding Role record\n .then(({ roleChoice }) => {\n response.forEach((role) => {\n if (roleChoice === role.title) {\n deleteRoleRecord(roleChoice);\n }\n });\n });\n });\n}", "leaveRoom(id) {\n return __awaiter(this, void 0, void 0, function* () {\n if (this._state === exports.ClientState.ACTIVE) {\n id = this._toFreeIfModel(id);\n this.TxCmd(constants.FCTYPE.JOINCHAN, 0, id, constants.FCCHAN.PART);\n }\n // Else, if we don't have a connection then we weren't really in the\n // room in the first place. No real point to raising an exception here\n // so just exit silently instead.\n });\n }", "findMessageWithCode(code) {\n var message = null;\n // Search for the index of the message\n var index = this.messages_received.findIndex((m) => {\n return (m.code === code);\n });\n // If message exist\n if (index >= 0) {\n // get and remove the message from the list\n message = this.messages_received.splice(index, 1)[0];\n }\n // Return the message\n return (message);\n }" ]
[ "0.77561486", "0.68303543", "0.6174956", "0.5931559", "0.58749324", "0.58472323", "0.58472323", "0.57995254", "0.57529414", "0.57374996", "0.5692177", "0.5665478", "0.5627274", "0.5608368", "0.5488951", "0.54682386", "0.5447557", "0.5413424", "0.5396953", "0.5335224", "0.532391", "0.5317008", "0.53109443", "0.5309768", "0.5299999", "0.5254255", "0.5245356", "0.5228916", "0.5224259", "0.5199358", "0.5173283", "0.51427495", "0.51415986", "0.51247895", "0.5117159", "0.5056183", "0.5042104", "0.50308543", "0.5019795", "0.50144166", "0.4998771", "0.49709284", "0.49540827", "0.4946481", "0.49464613", "0.4942347", "0.49368483", "0.49232644", "0.49206355", "0.4886556", "0.48196664", "0.48143175", "0.479856", "0.47954565", "0.47713447", "0.4747254", "0.4725749", "0.47227305", "0.47212803", "0.47039074", "0.468951", "0.4681525", "0.46681598", "0.46648514", "0.46526167", "0.46450922", "0.4637043", "0.4629164", "0.4621486", "0.4617281", "0.4608047", "0.45997643", "0.45894486", "0.45858258", "0.4581523", "0.45795885", "0.45774236", "0.45737618", "0.45624205", "0.45598093", "0.4552215", "0.45362028", "0.45295224", "0.4521175", "0.4510401", "0.45087367", "0.4504901", "0.4502317", "0.44992208", "0.44951987", "0.448817", "0.44868496", "0.44866878", "0.44842666", "0.44789207", "0.44786322", "0.44786322", "0.44667792", "0.44604447", "0.44571573" ]
0.83133036
0
Reserves a new room with a new, random, and unused room code. Returns the new room code.
reserveNewRoom() { var newRoomCode; do { newRoomCode = Hasher.genHash(ROOM_CODE_LENGTH); } while(this.roomExists(newRoomCode)); this.rooms[newRoomCode] = new Room(newRoomCode); return newRoomCode; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function genRoomCode() {\n const roomSeed = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',\n rooms = io.sockets.adapter.rooms;\n let code\n do {\n code = ''\n for (var i = 0; i < 5; i++) {\n code += roomSeed[getRandomInt(roomSeed.length)]\n }\n // Keep generating new codes if the code is already in use\n } while (rooms[code])\n return code\n }", "function createRoom(){\n roomToken = random()\n roomsRegistry[roomLabel].notFull[roomToken] = {clients:[],limit:roomLimit}\n roomsRegistry[roomLabel].notFull[roomToken].clients.push(clientId)\n }", "function makeRoomCode(){\n return Math.floor(Math.random() * 900000) + 100000;\n}", "function createNewRoom() {\n console.log(nextRoomId);\n createRoomDOM(nextRoomId);\n signalRoomCreated(nextRoomId);\n\n nextRoomId++;\n}", "function makeRoom(rooms, bet) {\n var newRoom = randRoom();\n let type = \"\";\n if (bet === 0) type = false;\n else type = true;\n console.log(bet);\n while (rooms.has(newRoom)) {\n newRoom = randRoom();\n }\n rooms.set(newRoom, { roomId: newRoom, players: [], board: null, bet: type });\n return newRoom;\n}", "function generateNewRoom(name) {\n\t\n\t//send the request to the server\n\tvar posting = $.post(roomsURI + \"/add\", {\n\t\tname : name\n\t});\n\t\n\t//Send new room to server\n\tposting.done(function(data) {\n\t\tvar room = JSON.parse(JSON.stringify(data));\n\t\t//$(\"#chat-rooms-list\").children(\"li[room_id!=2]\").remove(); //remove the last room\n\t\t//$(\"#chat-rooms-list\").append(createRoomElement(room)); //add this in it's place\n\t\t$(\"#chat-rooms-dropdown-list\").append(createRoomElement(room));\n\t\troom_id_list.push(room.roomID);\n\t\tjoinRoom(room.roomID,true);\n\t});\n}", "function createRoomCode() {\n var code = \"\";\n for(var i = 0; i < 4; i++) {\n var letter = String.fromCharCode(Math.random() * (26) + 65);\n code += letter;\n }\n //- console.log(code);\n return code;\n}", "add(room) {\n\tthis._rooms[room.identifier] = room;\n\treturn room;\n }", "function createNewRoom() {\r\n // Generate room id.\r\n const newID = uuidv4().substring(0, 8);\r\n\r\n // Join room\r\n socket.join(newID);\r\n\r\n // Update corressponding object in usersArray\r\n updateUserRoom(socket, newID);\r\n\r\n // Send room data to socket\r\n io.to(socket.id).emit(\"roomData\", {\r\n roomId: newID,\r\n });\r\n }", "function joinOrCreateRoom(roomCode) {\n socket.join(roomCode, () => {\n // Sets the socket's room code\n socket.roomCode = roomCode\n // Sends room code to client\n socket.emit('room_joined', roomCode)\n // Updates GM's player list\n updateGMRoomMembers()\n })\n }", "function generateRoomIdentifier() {\n // make a list of legal characters\n // we're intentionally excluding 0, O, I, and 1 for readability\n var chars = 'ABCDEFGHJKLMNPQRSTUVWXYZ23456789';\n\n var result = '';\n for (var i = 0; i < 6; i++)\n result += chars.charAt(Math.floor(Math.random() * chars.length));\n\n return result;\n}", "function generateRoomId(){\n let roomId = \"\";\n for(let i = 0; i < 4; i++){\n roomId += String.fromCharCode(_.random(65,90));\n }\n return roomId;\n }", "function createRoom() {\n db.Room.create({\n room_id: req.body.room_id,\n property_id: req.body.property_id,\n price: req.body.price,\n roomType: req.body.roomType,\n aboutRoom: req.body.aboutRoom,\n status: req.body.status,\n closeDate: req.body.closeDate,\n HotelId: thisId\n })\n .then(function() {\n res.send(\"/choice/\" + lastSegment);\n })\n .catch(function(err) {\n console.log(err);\n res.json(err);\n });\n }", "function makeRoomCode(length) {\n var result = '';\n var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';\n var charactersLength = characters.length;\n for ( var i = 0; i < length; i++ ) {\n result += characters.charAt(Math.floor(Math.random() * charactersLength));\n }\n return result;\n }", "generateRoomId() {\n\t\treturn `r${Date.now()}`;\n\t}", "function room(roomLetter,schedule)\n{\n this.letter = roomLetter;\n this.id=randomString(window.config.numberOfDigitsForRandomStrings,'aA#')+\"|room:\"+roomLetter;\n //store a reference to the schedule object in the room object so given any part of the turnoment hierarchy you can transverse to the top.\n this.schedule = schedule;\n this.rounds = [];\n}", "function newroom() {\n\t$(\"#warning2\").html(\"\");\n\tvar tmproomname = document.roomform.roomname.value;\n\tif (tmproomname.search(/[^a-zA-Z0-9]/) != -1 || tmproomname.length > 16) {\n\t\t$(\"#warning2\").html(\"Viallinen huoneen nimi.\");\n\t\treturn;\n\t}\n\tvar roomname = tmproomname;\n\tif (player != \"\" && passcode != \"\" && roomname != \"\") {\n\n\t\tvar geturl = \"/sanaruudukko/rest/sr/process?func=newroom&player=\" + player + \"&passcode=\" + passcode + \"&roomname=\" + roomname;\n\t\t$.ajax({\n\t\t\tcache: false,\n\t\t\tdataType : 'xml',\n\t\t\ttype : 'GET',\n\t\t\turl : geturl,\n\t\t\tsuccess : function(data) {\n\t\t\t\tstartRoom(data);\n\t\t\t},\n\t\t});\n\t}\n}", "function updateRoomCode(event) {\r\n setRoomCode(event.target.value);\r\n }", "getRoom(roomCode) {\n return this.rooms[roomCode];\n }", "newRoom(roomId) {\r\n\t\tlet room = new ServerRoom(roomId);\r\n\t\tthis.rooms[room.id] = room;\r\n\t\treturn room;\r\n\t}", "function addRoom(r){\n\tdb.run(`insert into rooms (name, type, access) values (?, ?, ?)`, [r.name, r.type, r.access], () => {\n\t\t_.each(r.ressources, (ressource_name) => addRoomResource(r.name, ressource_name));\n\t\t_.each(r.softwares, (software_name) => addRoomSoftware(r.name, software_name));\n\t\t_.each(r.timeslots, (ts) => addRoomTimeslot(r.name, ts));\n\t});\n}", "function newRoom() {\n socket.emit(\"newRoom\");\n}", "function CreateRandomRoom()\n{\n\n var FinalXWidth;\n var FinalyHeight;\n\n var finalX;\n var finalY;\n\n var dimensionsSet = false;\n\n var FinalRoom;\n\n // we want to continue generating dimensions until we find an acceptable one\n while (!dimensionsSet)\n {\n\n // get the random location\n var x = Math.floor(Math.random()*(gridWidth - maxRoomSpace) + 1);\n\n var y = Math.floor(Math.random()*(gridHeight - maxRoomSpace) + 1);\n\n\n // we need to find out how far the room is away from the edge of the map, in both x and y directions,\n // as there has to be at least 1 tile between the walls of the room and the edge of the map\n\n var maxXValue = gridWidth - x - 1;\n var maxYValue = gridHeight - y - 1;\n\n // check if there is enough room in the x and y directions to spawn a room.\n // we also want to make sure \n if ( maxXValue >= minRoomSpace && maxYValue >= minRoomSpace)\n {\n // there is enough space here to make a 'legal' room\n // make sure we don't go above the maximum height/width of a room\n if (maxXValue > maxRoomSpace)\n {\n maxXValue = maxRoomSpace;\n }\n\n if (maxYValue > maxRoomSpace)\n {\n maxYValue = maxRoomSpace;\n }\n\n\n // determine width and height\n var width = Math.floor(Math.random()*(maxXValue - minRoomSpace + 1) + minRoomSpace);\n var height = Math.floor(Math.random()*(maxYValue - minRoomSpace + 1) + minRoomSpace);\n\n // create the room an break out of the loop\n FinalRoom = new Room(x,y,width,height);\n\n dimensionsSet = true;\n\n }\n\n\n \n\n }\n // return it!\n return FinalRoom;\n \n}", "function createRoom(name)\n\t{\n\t\tdocument.getElementsByClassName('dropdown-item selected')[0].className = 'dropdown-item'\n\n\t\tvar room = document.createElement('div')\n\t\troom.className = 'dropdown-item selected'\n\t\troom.innerText = name\n\t\tcreateDropdownClickMethod(room)\n\t\tget('create-room-name').value = ''\n\n\t\tdropdown.appendChild(room)\n\t\tdropdown.className = 'dropdown closed'\n\t}", "removeRoom(roomCode) {\n Logger.logInfo('Removing room: ' + roomCode);\n this.rooms[roomCode].forceEndGame();\n delete this.rooms[roomCode];\n }", "function requestCreateRoom() {\r\n if (inputRoomName.value()) {\r\n socket.emit(\"createRoomRequest\", inputRoomName.value(), (response) => {\r\n if(!response){\r\n errorNameUsed(inputRoomName.value());\r\n } else{\r\n createUserRoom(inputRoomName.value());\r\n }\r\n });\r\n currentRoom = inputRoomName.value();\r\n }\r\n}", "function addRoom(id, type) {\n\tif(ROOMS[id]) return ROOMS[id];\n\tif(type == \"battle\") {\n\t\tROOMS[id] = new BattleRoom(id, send);\n\t\treturn ROOMS[id];\n\t} else {\n\t\tlogger.error(\"Unkown room type: \" + type);\n\t}\n}", "function createOrAddToRoom(){\n\n if(!socketClients[clientId]){\n\n //if user does not exist\n return getUserData( msg.cookie ).then(function(userObject,error){//what if cookie is invalid\n if (error) return sendError('invalid cookie')\n socketClients[clientId] = {user:{id:userObject.id, username:userObject.username}, socket:ws}\n\n createOrAddToRoom()\n })\n\n \n }\n\n //also broadcast on join and leave and also joined member\n // console.log(clientId,'creating room or adding:'+roomLabel)\n function createRoom(){\n roomToken = random()\n roomsRegistry[roomLabel].notFull[roomToken] = {clients:[],limit:roomLimit}\n roomsRegistry[roomLabel].notFull[roomToken].clients.push(clientId)\n }\n\n if (!roomsRegistry[roomLabel]){ //room not constructed \n roomsRegistry[roomLabel] = { full:{},notFull:{} }\n createRoom()\n }else{\n\n if ( Object.keys(roomsRegistry[roomLabel].notFull).length === 0 ) {\n createRoom()\n }else{\n\n roomToken = Object.keys(roomsRegistry[roomLabel].notFull)[0]\n roomsRegistry[roomLabel].notFull[roomToken].clients.push(clientId)\n broadcast(roomToken,socketClients[clientId].user,'onjoin',roomLabel)\n\n let notFullRoomLimit = roomsRegistry[roomLabel].notFull[roomToken].limit\n let membersCountOfNotFull = roomsRegistry[roomLabel].notFull[roomToken].clients.length\n\n \n\n // if(membersCountOfNotFull > notFullRoomLimit) console.log('limit exceeded', membersCountOfNotFull, notFullRoomLimit)\n\n if(membersCountOfNotFull === notFullRoomLimit){\n roomsRegistry[roomLabel].full[roomToken] = roomsRegistry[roomLabel].notFull[roomToken]\n roomsRegistry[roomLabel].notFull = removeKey(roomsRegistry[roomLabel].notFull,roomToken)\n }\n\n }\n\n }\n\n broadcast(roomToken,null,'onopen',roomLabel)\n\n }", "function fillroom(what, arg) {\n var safe = 100;\n var x = rnd(MAXX - 2);\n var y = rnd(MAXY - 2);\n while (!itemAt(x, y).matches(OEMPTY)) {\n x += rnd(3) - 2;\n y += rnd(3) - 2;\n if (x > MAXX - 2) x = 1;\n if (x < 1) x = MAXX - 2;\n if (y > MAXY - 2) y = 1;\n if (y < 1) y = MAXY - 2;\n if (safe-- == 0) {\n debug(`fillroom: SAFETY!`);\n break;\n }\n }\n var newItem = createObject(what, arg);\n setItem(x, y, newItem);\n return newItem;\n //debug(`fillroom(): ${newItem}`);\n}", "function add_room(creator, name){\n const room = {creator, name};\n // save room info to room list\n rooms.push(room);\n}", "function addRoom(id, type) {\n\tif(type == \"battle\") {\n\t\tROOMS[id] = new BattleRoom(id, send);\n\t\treturn ROOMS[id];\n\t} else {\n\t\tlogger.error(\"Unkown room type: \" + type);\n\t}\n}", "function expandRoom(rm){\n\t\tlet xMin = randInt(-1,0);\n\t\tlet xMax = randInt(1,2);\n\t\tlet yMin = randInt(-1,0);\n\t\tlet yMax = randInt(1,2);\n\t\tfor (let n = xMin; n < xMax; n++){\n\t\t\tfor (let p = yMin; p<yMax;p++){\n\t\t\t\tdungeon[rm.x+n][rm.y+p] = roomNum;\n\t\t\t}\n\t\t}\n\t\troomNum++;\n\t}", "async function addroom(price){\n const roomCollections = await rooms();\n const data = {\n price: price,\n available: true\n }\n\n const insertinfo = await roomCollections.insertOne(data);\n if(insertinfo.insertedCount === 0) throw 'Insert fail!';\n\n return await this.getbyid(insertinfo.insertedId);\n}", "createRoom() {\n return new Room();\n }", "function makeReservation() {\n if (!isReadytoReserve(orderInfo)) {\n return;\n }\n\n const promise = sendReservationRequest(orderInfo);\n\n promise.then((response) => {\n history.push(`/success/${id}`);\n });\n\n promise.catch((response) => {\n alert(\"Algo deu errado. Tente novamente mais tarde.\");\n });\n }", "function createRoom(){\n var seconds = $('#secondsInput').val(); //The seconds per question we want\n var turns = $('#turnsInput').val(); //The question per game we want\n var difficulty = $(\"input[type=radio]:checked\").attr(\"dif\");\n //alert(\"Difficulty: \" + JSON.stringify(difficulty)); \n \n //New room name is a mix of users name, and a random number\n var roomName = name + \"-\" + (Math.floor((Math.random() * 1000) + 1));\n roomName = roomName.trim(); //No leading or trailing spaces in room name\n\n //Disable the create room button, so we cannot accidently create a room 2 times\n $(\"#createButton\").addClass(\"disabled\");\n $(\"#createButton\").attr(\"disabled\", \"disabled\");\n\n //Tell the server about the room we want to create\n socket.emit('createRoom', JSON.stringify({\n roomName: roomName,\n owner : name,\n seconds: seconds,\n turns : turns,\n difficulty: difficulty,\n type : \"gameroom\"\n })); \n}", "function roomCreated (id) {\n const room = { roomid: id, access: 0 /* 0 -> public, 1 -> private*/ }\n rooms.push(room)\n return room\n}", "function addRoom(room){\n $outer.append(Mustache.render(roomTemplate, room));\n }", "setroom(state, num) {\n state.room = num;\n }", "async function assignroom(id , rid , day){\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.assignroom)'\n }\n }\n\n const rtarget = await roomf.getbyid(rid).catch(e => { throw e });\n const reservationCollections = await reservations();\n const target = await this.getbyid(id);\n const data = {\n $set:{\n _id: id,\n patientid: target.patientid,\n doctorid: target.doctorid,\n date: target.date,\n roomid: rid,\n days: day,\n prescriptionid: target.prescriptionid,\n status: target.status\n }\n\n }\n\n const updateinfo = await reservationCollections.update( { _id: id } , data);\n if(updateinfo.modifiedCount === 0) throw 'Update fail!';\n\n return await this.getbyid(id);\n}", "addRoom(name, author, author_id) {\n\n \t// check is the room name is't exist\n \tvar x = this.getRoomByName(name);\n \tif (x) {\n \t\treturn false ;\n \t}\n var id = uniqid();\n var room = {\n id : uniqid(),\n author : author,\n name : name,\n author_id: author_id\n };\n this.rooms.push(room);\n return true;\n }", "function addRoom(room) {\n\n // Get a handle to the room list <select> element\n var select = $('#rooms-list');\n\n // Create a new <option> for the <select> with the new room's information\n //var users = room.users || [];\n //var numUsers = users.length;\n var option = $('<option id=\"' + \"room-\" + room.id + '\" data-name=\"' + room.Product.name + '\" value=\"' + room.id + '\" onClick=\"chooseRoom(' + room.id + ')\">' + room.Product.name + ' (' + room.LastMessage.message + ')</option>');\n\n // Add the new <option> element\n select.append(option);\n}", "addRoom(map=this._map){\n\n let canAdd = 0;\n while(canAdd < 200){\n let border = Utils.randRoom(this.width, this.height, this.min+2, this.max+2); // make a set of coordinates based on the map constraints\n // changed the above ^^ +2 not +1 because 2 borders!!\n let overlap = false;\n\n let coords = Utils.removeBorder(border, this.width, this.height); // trimmed room\n\n for (let i = 0; i < this._rooms.length; i++) {\n if(!overlap) { overlap = Utils.coordCheck(border, this._rooms[i]); } // so we don't lose a true\n }\n if(!overlap){\n for (let i = 0; i < coords.length; i++) {\n let cell = map[\"y\" + coords[i].y][\"x\" + coords[i].x];\n cell.type = \"room\";\n }\n this._rooms.push(coords);\n canAdd += 200;\n }\n canAdd ++;\n }\n }", "function addRoom() {\n\tvar roomName = $('#add-room-name').val();\n\tvar posting = $.post(roomsAddURI, {\n\t\tname : roomName\n\t});\n\tposting.done(function(data) {\n\t\t//Add room via rest api then join it\n\t\tvar room = JSON.parse(JSON.stringify(data));\n\t\tjoinRoom(room.roomId, true);\n\t});\n}", "function changeRooms(newRoom) {\n let roomTransitions = enterRooms[currentRoom].canChangeTo;\n if (roomLookUp[newRoom].locked === true) {\n console.log('The door is locked, move along!');\n } else if (roomTransitions.includes(newRoom)) {\n currentRoom = newRoom;\n let stateForTable = roomLookUp[currentRoom]\n console.log(stateForTable.desc);\n zombieHorde()\n console.log(\"You better hurry up they're getting closer!\" + player.encroachment);\n player.location = roomLookUp[currentRoom]\n } else {\n console.log('You can not make that move from' + currentRoom + 'to' + newRoom)\n }\n}", "function specialRooms () {\n if (r == 1 && note != \"seen\") {\n navajoRoom ();\n }\n if (r == 4 && comp != \"seen\") {\n khakiRoom ();\n }\n if (r == 11 && colouridtool != \"seen\") {\n peachpuffRoom ();\n }\n if (r == 13 && packageOne != \"seen\") {\n goldenrodRoom ();\n }\n if (r == 20 && lantern != \"seen\") {\n goldRoom ();\n }\n if (r == 23 && lanternActivated != true) {\n darkRoom ();\n }\n if (r == 26 && packageTwo != \"seen\") {\n honeydewRoom ();\n }\n if (r == 30 && packageFour != \"seen\") {\n packageFour = \"seen\";\n setTimeout(limeRoom, 10000);\n }\n if (r == 33 && roomsim != \"seen\") {\n lavenderRoom ();\n }\n if (r == 36) {\n end ();\n }\n}", "function addRoomSoftware(room_name, software_name){\n\tdb.run(`insert into room_software (idRoom, idSoftware)\n\tvalues((select idRoom from rooms where name = ?),\n\t(select idSoftware from softwares where name = ?))`,\n\t[room_name, software_name]);\n}", "function newRoom($id)\n{\n\tif(groupRooms == 0)\n\t{\n\t\tshowInfoBox(\"system\",\"220\",\"300\",\"200\",\"\",lang6);\n\t\treturn false;\t\t\t\n\t}\n\n\tif($id == '1')\n\t{\n\t\t// show create room\n\t\tdocument.getElementById(\"roomCreate\").style.visibility = 'visible';\n\t}\n\telse\n\t{\n\t\t// hide create room\n\t\tdocument.getElementById(\"roomCreate\").style.visibility = 'hidden';\n\t}\n return false;\n}", "async function getOrCreateRoom({ roomId, consumerReplicas })\n{\n\tlet room = rooms.get(roomId);\n\n\t// If the Room does not exist create a new one.\n\tif (!room)\n\t{\n\t\tlogger.info('creating a new Room [roomId:%s]', roomId);\n\n\t\tconst mediasoupWorker = getMediasoupWorker();\n\n\t\troom = await Room.create({ mediasoupWorker, roomId, consumerReplicas });\n\n\t\trooms.set(roomId, room);\n\t\troom.on('close', () => rooms.delete(roomId));\n\t}\n\n\treturn room;\n}", "function roomExists(code) {\r\n try {\r\n console.log(\"checking if room with code: \" + code + \" exists\");\r\n console.log(rooms[code]);\r\n if(code == null || code == undefined || typeof code != 'string' || !rooms[code]) {\r\n console.log(\"it's bad\");\r\n return false;\r\n }\r\n console.log(\"it's good\");\r\n return true;\r\n } catch(e) {\r\n console.error(e);\r\n return false;\r\n }\r\n}", "function randomizeRoomGuest (){\n\troomGuest = guestList[Math.floor(Math.random() * 10)];\n\tif (roomGuest === undefined){\n\t\troomGuest = \"no one\";\n\t}\n}", "function changeRoom(name, newRoom,atualRoom){\n clients.forEach(function(client){\n if(client.name == name){\n client.roomName = newRoom;\n rooms.push(newRoom)\n }\n })\n broadcast(colors.red(name) + \" Desconectou da sala(\"+ colors.yellow(atualRoom) +\").\\n\", name, atualRoom)\n }", "function getRoom(roomCode) {\n var ref = firebase.database().ref(\"Rooms/\" + roomCode);\n var room = $firebaseObject(ref);\n \n return room;\n }", "function createGame() {\n var gameCode;\n \n gameCode = new Array(5).fill().map(() => getNewLetter()).join().replace(/,/gi,\"\");\n \n firebase.database().ref('games/' + gameCode).set({\n board: createBoard(),\n currentUsers: null,\n messages: null,\n id: Math.floor(Math.random() * 100000000)\n });\n \n return gameCode;\n}", "function add_private_room(creator, name, password){\n const room = {creator, name, password};\n // save room info to room list\n private_rooms.push(room);\n}", "function GHOIB_generate_rooms_html($roomtype)\n{\n\tvar room = '';\n\tvar room_text = '';\n\t\n\tswitch($roomtype){\n\t\tcase 'single':{\troom='single'; room_text='Single'; break; }\n\t\tcase 'double':{ room='double'; room_text='Double'; break; }\n\t\tcase 'triple':{ room='triple'; room_text='Triple'; break; }\n\t}\n\n\tif(GHOB_inst('td#ghob_input_'+room+'_room_numbers').children().length != 0){\n\t\t//check if room is added or deleted\n\t\tvar room_number_entry_table = GHOB_inst('td#ghob_input_'+room+'_room_numbers table tr:nth-child(2) td');\n\t\tvar old_rooms_count = GHOB_inst('td#ghob_input_'+room+'_room_numbers table tr:nth-child(2) td span').children('input').length;\n\t\tvar new_rooms_count = parseInt(GHOB_inst(\"input[name='\"+room+\"bed_count']\").val());\n\t\tvar addition_field_html = '';\n\t\t\n\t\tif(old_rooms_count != new_rooms_count){\n\t\t\tif(old_rooms_count > new_rooms_count){\n\t\t\t\t//remove some room WITH CAUTION\n\t\t\t\t/*VIEW DEVELOPMENT NOTES: NOTE NO. 1*/\n\t\t\t\t/*this is done for temporary basis*/\n\t\t\t\tvar difference_room_count_up = old_rooms_count - new_rooms_count;\n\t\t\t\tfor(k = 0; k < difference_room_count_up*2; k++) { \n\t\t\t\t\tGHOB_inst('td#ghob_input_'+room+'_room_numbers table tr:nth-child(2) td span:last-child').remove();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(old_rooms_count < new_rooms_count){\n\t\t\t\t//add new rooms\n\t\t\t\tvar difference_room_count = new_rooms_count - old_rooms_count;\n\t\t\t\tfor(j = 0; j < difference_room_count; j++) { \n\t\t\t\t\taddition_field_html += '<span><input type=\"text\" name=\"'+room+'_bedrooms_numbers[]\" value=\"\" required/></span><span>&nbsp;</span>';\n\t\t\t\t}\n\t\t\t\troom_number_entry_table.append(addition_field_html);\n\t\t\t}\n\t\t}\n\t\t//if(addition no issues just append a new input span to existing table)\n\t\t//if (deletion of field)\n\t\t// |-> Check whether any room number is booked or not\n\t\t// |-> If booked don't allow to delete the room\n\t\t//\t |-> If no room is booked for section remove entries from last \n\t}else{\n\t\t//cell is empty\n\t\tvar field_html = '';\n\t\tfield_html += '<table><tr><td><strong>'+room_text+' Bed Rooms</strong><br/><hr/></td></tr>';\n\t\tfield_html += '<tr><td>';\n\t\tfor(i = 0; i < parseInt(GHOB_inst(\"input[name='\"+room+\"bed_count']\").val()); i++) { \n\t\t\tfield_html += '<span><input type=\"text\" name=\"'+room+'_bedrooms_numbers[]\" value=\"\" required/></span><span>&nbsp;</span>';\n\t\t}\n\t\tfield_html += '</td></tr>';\n\t\tfield_html += '</table>';\n\t\tGHOB_inst('td#ghob_input_'+room+'_room_numbers').html(field_html);\n\t}\n}", "static generateNewEnemy() {\n Battle.counter = 0;\n Battle.enemyPokemon(PokemonFactory.generateWildPokemon(player.route(), player.region));\n }", "function makeHotelrooms() {\n const rooms = [];\n const numberRooms = Math.random() * (20 - 7) + 7;\n for (let i = 1; i < numberRooms; i++) {\n const room = {\n _id: new mongoose.Types.ObjectId(),\n name: `${i}`,\n };\n rooms.push(room);\n }\n return rooms;\n}", "function makeBookingNow(idRoom, duration) {\n duration = Number(duration);\n let endDate;\n if (duration < 1) {\n endDate = new Date().addMinutes(duration * 60);\n } else {\n endDate = new Date().addHours(duration);\n }\n let booking = new Booking(new Date(), endDate);\n ajax(\"PUT\", \"/bookings?room=\" + idRoom, callbackMakeBookingNow, booking);\n}", "add1RoomToInventory(){\n let sceneToAdd = this.createSceneOfClass(this.availableSceneTypes[Phaser.Math.Between(0, this.availableSceneTypes.length - 1)]);\n this.addSceneToInventory(sceneToAdd);\n }", "async function createClassroom(name) {\n var code = Math.random().toString(36).substring(2, 5) + Math.random().toString(36).substring(2, 5);\n //await db.collection(\"classroom\").doc(name).collection(\"classes\").doc(classToAdd).set(classData);\n await db.collection(\"classroom\").doc(name).set({code: code});\n}", "addRoom(id,nodeLocation, chatLog){\r\n id = id.toUpperCase();\r\n var room = {id, nodeLocation,chatLog};\r\n this.rooms.push(room);\r\n return room;\r\n }", "function compileRooms(){\n let rom=[]\n for (var i=1; i<=localStorage.getItem(\"roomNum\");i++){\n rom.push(addRoom(i))\n\n }\n localStorage.setItem(\"rooms\",rom);\n }", "function resetTempRoom () {\n partialRoom = 0;\n partialId = 0;\n }", "function createEstablishmentCode() {\n let _lText = '';\n let _lPossible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n for (let _i = 0; _i < 9; _i++) {\n _lText += _lPossible.charAt(Math.floor(Math.random() * _lPossible.length));\n }\n return _lText;\n}", "function keyInteraction (currentRoom) {\n player.items.push(currentRoom.items[0])\n bedroom.description = 'spacious room with a large red canopy bed in the middle.'\n bedroom.repeatInteraction = true\n kitchen.lockedDoor = false\n}", "function createGameCode() {\n return String.fromCharCode(\n randomUpperChar(),\n randomUpperChar(),\n randomUpperChar(),\n randomUpperChar(),\n randomUpperChar(),\n randomUpperChar(),\n );\n}", "function joinRoom() {\n const code = document.getElementById(\"roomCodeInput\").value;\n socket.emit(\"joinRoom\", code);\n}", "async function changeRooms(newRoom) {\n //console.log(newRoom);\n let validTransitions = roomsInSchool[currentRoom].canChangeTo;\n if (validTransitions.includes(newRoom)) {\n newRoom = currentRoom;\n //console.log(this.description)\n play();\n } else {\n console.log(\"You can't go that way\\n>_\");\n //for some reason this is triggered no matter what room they enter (even if it's valid) after the actual room description \n play();\n }\n }", "function generate_new_game(player0_id, player1_id) {\n\tvar map_id_to_idx = {};\n\tmap_id_to_idx[player0_id] = 0;\n\tmap_id_to_idx[player1_id] = 1;\n\tvar game = {\n\t\tslots: [null,null,null,null,null,null,null,null],\n\t\tplayers: [generate_player_data(player0_id), generate_player_data(player1_id)],\n\t\tmap_id_to_idx: map_id_to_idx,\n\n\t\tget_opponent_id:function(player_id){\n\t\t\treturn this.players[1-this.map_id_to_idx[player_id]].id;\n\t\t},\n\t\tget_player_overview:function(idx){\n\t\t\treturn this.players[idx].get_overview();\n\t\t},\n\t\trequest_end:function(idx){\n\t\t\tthis.players[idx].requested_end = true;\n\t\t\treturn this.players[1-idx].requested_end;\n\t\t},\n\t\twithdraw_request_end:function(idx){\n\t\t\tthis.players[idx].requested_end = false;\n\t\t},\n\t\tsubmit_card:function(who, srcz){\n\t\t\tvar srcf = 0;\n\t\t\tif (srcz < 4) srcf = this.players[who].zones[srcz].length-1;\n\t\t\tvar card = this.players[who].get_card_value(srcz, srcf);\n\t\t\tconsole.log('submiting ('+srcz+','+srcf+'):'+card);\n\t\t\tvar i;\n\t\t\tfor (i=0; i<8; i++) {\n\t\t\t\tif (this.slots[i] != null) {\n\t\t\t\t\tif (card % 13 != 0 && this.slots[i]+1 == card) {\n\t\t\t\t\t\tthis.slots[i] = card;\n\t\t\t\t\t\tthis.players[who].score += 1;\n\t\t\t\t\t\tthis.players[who].abandon(srcz);\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if (card % 13 == 0) {\n\t\t\t\t\tthis.slots[i] = card;\n\t\t\t\t\tthis.players[who].score += 1;\n\t\t\t\t\tthis.players[who].abandon(srcz);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t},\n\t\tget_result_for: function(who) {\n\t\t\tvar mysc = this.players[who].score;\n\t\t\tvar opposc = this.players[1-who].score;\n\t\t\treturn {\n\t\t\t\tresult: (mysc == opposc)?0:(mysc > opposc)?1:-1,\n\t\t\t\tmyname: map_id_to_name[this.players[who].id],\n\t\t\t\tmyscore: mysc,\n\t\t\t\topponame: map_id_to_name[this.players[1-who].id],\n\t\t\t\topposcore: opposc,\n\t\t\t};\n\t\t},\n\t};\n\treturn game;\n}", "function addRoomResource(room_name, ressource_name){\n\tdb.run(`insert into room_ressource (idRoom, idRessource)\n\tvalues((select idRoom from rooms where name = ?),\n\t(select idRessource from ressources where name = ?))`,\n\t[room_name, ressource_name]);\n}", "function nextRoom() {\n clearInterval(timer);\n updateState(1);\n}", "onCreate(options) {\n this.targetRoom = options.targetRoom;\n this.targetRoomCode = enums_1.BattleRooms[options.targetRoom];\n this.setPatchRate(null);\n this.setSimulationInterval(() => __awaiter(this, void 0, void 0, function* () {\n try {\n const queue = this.manager.getRankedMap(this.targetRoomCode);\n for (let i = 1; i < queue.length; i = i + 2) {\n const room = yield colyseus_1.matchMaker.createRoom(this.targetRoom, {});\n for (let j = i - 1; j <= i; j++) {\n const p = queue[j];\n const seat = yield colyseus_1.matchMaker.reserveSeatFor(room, {\n player: p.player,\n team: p.team,\n });\n p.connection.send(\"seat\", seat);\n this.manager.removeClientBySessionId(queue[j].connection.sessionId);\n }\n }\n }\n catch (err) {\n throw err;\n }\n }), this.evaluateGroupInterval);\n }", "function createProgram(id, pubKey, code) {\n}", "function refreshRoom(room) {\n\n}", "EnterRoom(id, name, room, img){\n var roomName = {id, name, room, img}; //object disractury \n this.globalRoom.push(roomName);\n return roomName;\n }", "function deleteRoom(roomCode){\n let room = rooms[roomCode];\n if(room){\n let players = room.players;\n for(let i = 0; i < players.length; i++){\n let player = players[i];\n delete socks[player].room;\n }\n delete rooms[roomCode];\n }\n}", "function createAvailableRoom(category, number, floor, price, features){\n cy.get(CATEGORY).select(category)\n cy.get(NUMBER_TEXTFIELD).type(number)\n cy.get(FLOOR_TEXTFIELD).type(floor)\n cy.get(PRICE_TEXT_FIELD).type(price)\n cy.get(FEATURES).select(features)\n cy.get(AVAILABLE_CHECKBOX).click()\n cy.get(SAVE_BUTTON).click() \n}", "function joinRoom(room)\r\n{\r\n //TODO erase... Name must be known previously\r\n var name = '';\r\n while(name == '')\r\n {\r\n name = prompt(\"Wie heißt du?\");\r\n }\r\n\r\n socket.emit('requestRoom', room, name);\r\n document.getElementById(\"chooseRoom\").classList.add('hidden');\r\n \r\n //TODO: maybe show loading icon...\r\n}", "function genUnique() {\n function duplicated(num) {\n for (let i = 0; i < rooms.length; i++) {\n if (num === rooms[i].getNumber()) {\n return true;\n }\n }\n return false;\n }\n let num;\n do {\n let real = Math.random();\n num = Math.floor(real * 10000.0);\n } while (duplicated(num));\n return num;\n}", "function addRoom(roomObj){\n var ref = firebase.database().ref(\"Rooms/\");\n ref.child(roomObj.code).set(roomObj);\n }", "evolve() {\n let liveRoom = Game.rooms[this.room];\n let newBody = [];\n if (liveRoom.controller.level >= 6 && liveRoom.terminal) {\n //once the room has a terminal\n newBody= [\n //400 carry capacity\n CARRY, CARRY, CARRY, CARRY, CARRY, CARRY, CARRY, CARRY\n ]\n }\n if (liveRoom.controller.level == 8) {\n //800 carry capacity\n newBody = [\n CARRY, CARRY, CARRY, CARRY, CARRY, CARRY, CARRY, CARRY,\n CARRY, CARRY, CARRY, CARRY, CARRY, CARRY, CARRY, CARRY\n ]\n }\n\n if (newBody.length > this.memory.body.length) {\n this.memory.body = newBody;\n this.liveObj.suicide();\n }\n }", "getRoom() {\n const id = this.roomName;\n\n if (!activeRooms.hasOwnProperty(id)) {\n throw new Error('Room requested does not exist: ' + id);\n }\n\n return activeRooms[id];\n }", "function Spawning()\n{\n for (var name in Memory.creeps)\n {\n if (!Game.creeps[name])\n {\n delete Memory.creeps[name];\n }\n }\n\n var controllerLevel = 0;\n\n for (var name in Game.rooms)\n {\n controllerLevel = controllerLevel + Game.rooms[name].controller.level;\n }\n\n var harvesters = _.filter(Game.creeps, (creep) => creep.memory.role == 'harvester');\n\n if (harvesters.length < 4)\n {\n Game.spawns.Main.createCreep([WORK, WORK, CARRY, CARRY, MOVE], undefined, { role: 'harvester' });\n }\n\n var builders = _.filter(Game.creeps, (creep) => creep.memory.role == 'builder');\n\n if (builders.length < 3)\n {\n Game.spawns.Main.createCreep([WORK, WORK, CARRY, MOVE], undefined, { role: 'builder' });\n }\n\n var upgraders = _.filter(Game.creeps, (creep) => creep.memory.role == 'upgrader');\n\n if (upgraders.length < 2)\n {\n Game.spawns.Main.createCreep([WORK, CARRY, MOVE], undefined, { role: 'upgrader' });\n }\n\n var guards = _.filter(Game.creeps, (creep) => creep.memory.role == 'guard');\n\n if (guards.length < 6)\n {\n Game.spawns.Main.createCreep([MOVE, MOVE, ATTACK, TOUGH, TOUGH, TOUGH, TOUGH, TOUGH], undefined, { role: 'guard' });\n }\n}", "_createRoom(){\n let roomCode = (Math.floor(Math.random() * 10000) + 100000).toString().substring(2);\n // Works on both iOS and Android\n let username = this.state.username;\n\n Alert.alert(\n username + '\\'s Room Number',\n 'Your room number : ' + roomCode + '\\n\\n' + 'Please share to your friend to play together!',\n [\n {text: 'OK', onPress: () => console.log('OK Pressed')},\n ],\n { cancelable: false }\n )\n\n this.setState({\n isLoading: true,\n playerNum: 1,\n createCode: roomCode,\n gameCode: roomCode,\n })\n\n this.state.socket.emit(\"create room\", roomCode);\n }", "function spawnRock(lower, upper){\n console.log(\"SPAWNED\");\n var amount = Crafty.math.randomInt(lower,upper);\n asteroidCount+=1;\n Crafty.e(\"Actor, big, Collision, Asteroid\");\n }", "function setRoom(name) {\n\t$('#joinRoom').remove();\n\t$('h1').text('Room name : ' + name);\n\t$('body').append('<input type=\"hidden\" id=\"roomName\" value=\"'+name+'\"/>');\n\t$('body').addClass('active');\n}", "function getRoom()\n {\n\n // console.log(\".. . .. . .. . \" + room);\n\n // if(room == undefined) ///eller === \n // {\n // return \"Sök sal...\";\n // }\n // else\n // {\n // return room; // eller toString(room);\n // }\n }", "function newUuid() {\n return Math.floor(Math.random() * 100000).toString();\n }", "function getRoom(request, response) {\n let roomName = request.params.roomName;\n // Chatroom.find({chatroom_name: roomName}, function (err, docs) {\n // if (err) {\n // console.log(err);\n // } else {\n // let roomId;\n // // If a chatroom with that name exists get it, else create one\n // if (docs.length > 0) {\n // roomId = docs[0].chatroom_id;\n // } else {\n // roomId = roomGenerator.roomIdGenerator()\n // const newChatroom = new Chatroom ({\n // chatroom_id: roomId,\n // chatroom_name: roomName\n // });\n\n // newChatroom\n // .save()\n // .then(item => console.log(item))\n // .catch(err => console.log(err));\n // }\n\n // TODO: Get the messages and submit to room.hbs\n Messages.find({ chatroom_name: roomName })\n .lean()\n .then((items) => {\n response.render(\"room\", {\n title: \"chatroom\",\n roomName,\n messages: items,\n isAvailable: true,\n // newRoomId: roomId\n });\n });\n}", "function createRoomButtonPressed() {\n\t//if not spamming\n\tif (!create_room_blocker) {\n\t\tvar room_name = $(\"#chat-room-add-input\").val();\n\t\t//iff not empty room\n\t\tif (room_name !== \"\") {\n\t\t\tcreate_room_blocker = true;\n\t\t\troom_spam_timeout = setTimeout(function(){create_room_blocker = false;}, 3000);\n\t\t\tgenerateNewRoom(room_name);\n\t\t\t$(\"#chat-room-add-input\").val(\"\");\n\t\t} else {\n\t\t\t//Iff entered blank room, prompt them\n\t\t\t$(\"#chat-room-add-button\").attr(\"data-content\",\"Enter a room name\").popover(\"toggle\");\n\t\t\tsetTimeout(function(){\n\t\t\t\t$(\"#chat-room-add-button\").popover(\"toggle\");\n\t\t\t},1000);\n\t\t}\n\t} else {\n\t\t//Deal with spamming\n\t\tclearTimeout(room_spam_timeout);\n\t\t$(\"#chat-room-add-button\").attr(\"data-content\",\"You're making rooms too quickly\").popover(\"toggle\");\n\t\tsetTimeout(function(){\n\t\t\tcreate_room_blocker = false;\n\t\t\t$(\"#chat-room-add-button\").popover(\"toggle\");\n\t\t},10000);\n\t}\n}", "function miss(room) {\n if (!room.memory.factory) {\n room.memory.factory = {}\n }\n const memory = room.memory.factory\n const factory = room.factory\n if (!factory) {\n return\n }\n\n\n const terminal = room.terminal\n const mineType = (Game.terminal.roomMineralCache[room.name] || room.find(FIND_MINERALS)[0]).mineralType\n const produceType = produce[mineType]\n factory.store[mineType] = factory.store[mineType] || 0\n factory.store[produceType] = factory.store[produceType] || 0\n terminal.store[mineType] = terminal.store[mineType] || 0\n terminal.store[produceType] = terminal.store[produceType] || 0\n if (terminal.store.getUsedCapacity(mineType) > (memory.status === 'fill' ? 40e3 : 50e3) && factory.store.getUsedCapacity(mineType) < 10e3) {\n //矿太少了 terminal里正好矿多 压缩 填进factory 并且factory里不多余\n memory.status = 'fill'\n memory.fillType = mineType\n memory.thor = 5e3\n } else if (factory.store.getUsedCapacity(mineType) > 1.6e3 && terminal.store[mineType] < 25e3) {\n //矿太多了 factory解压出去 扔terminal里\n memory.status = 'get'\n memory.fillType = mineType\n memory.thor = 2e3\n } else if (factory.store.getUsedCapacity(produceType) > 30e3) {\n //bar 太多了 卖了 吐出去\n memory.status = 'get'\n memory.fillType = produce[mineType]\n memory.thor = 3000\n } else if (factory.store.getUsedCapacity(produce[mineType]) < 20e3 && terminal.store.getUsedCapacity(produce[mineType]) > 0) {\n //bar太少了 不卖了 拉回来\n memory.status = 'fill'\n memory.fillType = produce[mineType]\n memory.thor = 5e3\n } else {\n memory.status = ''\n memory.fillType = mineType\n memory.thor = 0\n }\n if (terminal.store[mineType] < 15e3 && factory.store[mineType] < 3e3 && factory.store[produce[mineType]] > 100) {\n memory.react = 'release'\n } else if (factory.store[mineType] > 3e3 || (factory.store[mineType] > 200 && terminal.store[mineType] > 40e3)) {\n memory.react = 'zip'\n } else {\n memory.react = 'no'\n }\n\n\n}", "function editRoomReady () {\n const temp = document.getElementById(\"editRoomTemp\").content;\n \n for (let i = 0; i < rooms.length; i++) {\n const room = rooms[i];\n const clone = temp.cloneNode(true);\n\n clone.getElementById(\"editRoomButton\").id = clone.getElementById(\"editRoomButton\").id + \"-\" + room.id;\n setElementId(clone, room.id);\n \n clone.getElementById(\"roomId-\" + room.id).innerHTML = \"Room ID: \" + room.id;\n clone.getElementById(\"roomImage-\" + room.id).src = room.image;\n clone.getElementById(\"roomName-\" + room.id).innerHTML = room.type + \" room\";\n clone.getElementById(\"capacityDisplay-\" + room.id).innerHTML = \"Capacity: \" + room.capacity + \" person(s)\"\n clone.getElementById(\"locationDisplay-\" + room.id).innerHTML = convertNewLine(room.location);\n clone.getElementById(\"descDisplay-\" + room.id).innerHTML = convertNewLine(room.description);\n // Display respective texts after checking if room is launched\n clone.getElementById(\"launchDisplay-\" + room.id).innerHTML = (room.launch) ? \"<b>Launched</b>\" : \"<b>Not launched</b>\";\n clone.getElementById(\"priceDisplay-\" + room.id).innerHTML = \"<b>$\" + room.price + \"</b>/hr\";\n clone.getElementById(\"editRoomButton-\" + room.id).addEventListener(\"click\", editButtonClicked);\n\n document.getElementById(\"roomList\").appendChild(clone);\n document.getElementById(\"roomList\").lastElementChild.id = room.id;\n \n }\n}", "function func_join_room() {\n var room_number = document.getElementById('input_text').value;\n var list_length = list_of_joined.length++;\n list_of_joined[list_length] = room_number;\n $(\"#div_body_joinedRoom\").append(create_room(room_number, 1));\n func_populate(room_number);\n func_close_join_room_pop();\n func_add_room_to_database(room_number);\n}", "function createUserRoom(data) {\r\n inputRoomName.value('');\r\n divHome.hide();\r\n divRoom.show();\r\n currentRoom = data;\r\n}", "function enterRoom(){\n\ttoggleHide(room);\n\ttoggleHide(roomChoice);\n\t// toggleHide(declarationOfMurder);\n\ttoggleHide(murderDiv);\n\trandomizeRoomGuest();\n\t//keeps track of how far along in the game you are and changes murderer behavior\n\tclickCount++;\n\tif (clickCount > 20 && clickCount < 30){\n\t\tsuspicious.classList.remove(\"hide\");\n\t} else if (clickCount >= 30){\n\t\tsuspicious.classList.add(\"hide\");\n\t\tstalker.classList.remove(\"hide\");\n\t}\n\n\t//determines which weapon goes into a room based on the roomsList and weaponsList arrays\n\tfor (i=0; i<roomsList.length; i++){\n\t\tif (roomsList[i] === currentRoom){\n\t\t\tcurrentWeapon = weaponsList[i];\n\t\t}\n\t}\n\t//if there is no weapon assigned to that room it assigns it to be nothing\n\tif (currentWeapon === \"q-w34095-340958-sdf0983f\" || currentWeapon === undefined){\n\t\tcurrentWeapon = \"nothing\";\n\t}\n\n\tfor (i=0; i<roomsList.length; i++){\n\t\tif (roomsList[i] === currentRoom && currentRoom === murderRoom){\n\t\t\tfloorStatus = \"There's blood on the floor! This must be where the murder happened!\";\n\t\t} else if (roomsList[i] === currentRoom && currentRoom !== murderRoom){\n\t\t\tfloorStatus = \"There is nothing on the floor.\";\n\t\t}\n\t}\n\n}", "function partingFromRoom( room ) {\n}", "async function getOrCreateRoom({ roomId })\n{\n let room = rooms.get(roomId);\n\n // If the Room does not exist create a new one.\n if (!room)\n {\n room = await Room.create({ roomId });\n\n rooms.set(roomId, room);\n room.on('close', () => rooms.delete(roomId));\n }\n\n return room;\n}", "function createRoomName() {\n return faker.PhoneNumber.phoneNumberFormat(6).split('-').splice(2).join('-');\n}", "function bookARoom(e) {\n let roomNumber = parseInt(e.target.id);\n let userID = customer.id;\n let onCustomerSuccess = () => {\n updateBookingData();\n }\n let onManagerSuccess = () => {\n updateAvaiableRooms()\n }\n checkWhatToBook(roomNumber, userID, onCustomerSuccess, onManagerSuccess)\n}" ]
[ "0.6878282", "0.65021133", "0.6363232", "0.63338953", "0.6167534", "0.6124831", "0.6070692", "0.59665966", "0.5927118", "0.590617", "0.5899809", "0.58489764", "0.5801537", "0.57892317", "0.5769441", "0.57183534", "0.57066935", "0.5628291", "0.55877244", "0.55680364", "0.5556477", "0.5538754", "0.55283713", "0.55170107", "0.55087054", "0.55022717", "0.54560024", "0.5450911", "0.54415774", "0.54366046", "0.54223186", "0.5394825", "0.53889114", "0.5358987", "0.53566504", "0.5342548", "0.53416", "0.53380036", "0.5310499", "0.5284402", "0.5257964", "0.52404916", "0.5216596", "0.5192036", "0.51750857", "0.51684135", "0.51679695", "0.51662105", "0.51637304", "0.5158305", "0.51469743", "0.51446813", "0.51225704", "0.5056687", "0.5053348", "0.50481385", "0.50362986", "0.50343347", "0.50240016", "0.50170726", "0.5012772", "0.5006944", "0.5006491", "0.4999651", "0.49903923", "0.49792507", "0.4974472", "0.49672586", "0.49663857", "0.49550202", "0.49527362", "0.49431112", "0.49406758", "0.49299306", "0.4921045", "0.49198648", "0.49093667", "0.48961425", "0.48928803", "0.4892827", "0.48826718", "0.48780504", "0.48638967", "0.48609525", "0.48609507", "0.48500103", "0.4846639", "0.4836386", "0.4829439", "0.48277918", "0.4819114", "0.4813901", "0.48072693", "0.48066485", "0.48042306", "0.4803256", "0.48025638", "0.4796371", "0.4796129", "0.47949326" ]
0.85030913
0
Returns whether a room exists for the given room code.
roomExists(roomCode) { return this.rooms.hasOwnProperty(roomCode); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function roomExists(code) {\r\n try {\r\n console.log(\"checking if room with code: \" + code + \" exists\");\r\n console.log(rooms[code]);\r\n if(code == null || code == undefined || typeof code != 'string' || !rooms[code]) {\r\n console.log(\"it's bad\");\r\n return false;\r\n }\r\n console.log(\"it's good\");\r\n return true;\r\n } catch(e) {\r\n console.error(e);\r\n return false;\r\n }\r\n}", "function roomExists(roomName){\r\n var result = true;\r\n return false; // temporary debugging\r\n /*Rooms.count(\r\n {\"roomName\":roomName},\r\n function(err,count){\r\n if(err) throw err\r\n result = (count > 0);\r\n }\r\n )\r\n return result;*/\r\n}", "function inRoom(roomId) {\n return $(\"#room-\" + roomId).length > 0;\n }", "function containsRoom (roomName) {\n \treturn _.contains(_.map(chatRooms, function(item) {\n\t\t\t\treturn item['roomname'];\n\t\t\t}), roomName);\n }", "function isRoomToBeShown(roomcode) {\n var sValue = false;\n // If device don't have room, it's returning \"0\" or undefined\n if ((roomcode === \"0\") || (roomcode === undefined)) {\n // then we get the true / false value from showroomless devices\n sValue = showRoomLess;\n } else {\n // else, we check if that room is checkedor not\n sValue = appData.values[\"settings-room-\" + roomcode];\n }\n\n return sValue;\n}", "getRoom(roomCode) {\n return this.rooms[roomCode];\n }", "function isRoomValid(data) {\n var room = data.message.text;\n var id = data.message.chat.id;\n var user = userExists(id);\n \n if (Object.getOwnPropertyNames(user).length === 0) {\n var sheet = SpreadsheetApp.openById(userSheetId).getSheetByName('Zones');\n \n var searchRange = sheet.getRange(1, 1, 405, 2);\n var rangeValues = searchRange.getValues();\n \n for (j = 0; j < 405; j++) {\n if (rangeValues[j][0] === room) {\n return true;\n }\n }\n }\n return false;\n }", "function objectExistsInRoomNumber(roomIndex) {\n // First thing first, check if this room even has an item\n var objectInRoomIndex = getObjectForRoom(roomIndex);\n if (objectInRoomIndex == -1) {\n return false;\n }\n\n // Now check in the item list that this number is not 999 (OUR EDGE case for items out of play).\n return itemLocationRoomNumbers[objectInRoomIndex] != 999;\n }", "function roomById (id) {\n var i;\n for (i = 0; i < rooms.length; i++) {\n if (rooms[i].roomid === id) {\n return rooms[i]\n }\n }\n\n return false\n}", "function joinOrCreateRoom(roomCode) {\n socket.join(roomCode, () => {\n // Sets the socket's room code\n socket.roomCode = roomCode\n // Sends room code to client\n socket.emit('room_joined', roomCode)\n // Updates GM's player list\n updateGMRoomMembers()\n })\n }", "async function existsRooms(){\n\tvar exists = false;\n\tawait Promise.resolve(axios.get(host)\n\t.then(async function(response){\n\t\tif(response.data>0){\n\t\t\texists = true;\n\t\t}\n\t}));\n\treturn exists;\n}", "function getRoom(roomCode) {\n var ref = firebase.database().ref(\"Rooms/\" + roomCode);\n var room = $firebaseObject(ref);\n \n return room;\n }", "_addPlayerToRoom(socket, username, roomCode) {\n if (!this.roomExists(roomCode)) {\n return false;\n }\n\n return this.rooms[roomCode].addPlayer(socket, username);\n }", "is_available()\n\t{\n\t\treturn _.isObject(this.room)\n\t}", "function checkRoom(room,res){\n\tconsole.log(\"checking room: \",room);\n const query = datastore.createQuery(room);//.filter('name','=','peer_ids');\n datastore.runQuery(query)\n .then((results) => {\n // console.log(\"checkRoom result: \",results[0]);\n\n if(results[0].length>0){\n\t\t\tconsole.log(\"room exist\");\n res.send(JSON.stringify({result:\"true\"}));}\n// console.log(\"true\");\n else{\n\t\t\tconsole.log(\"room doesn't exist\");\n res.send(JSON.stringify({result:\"false\"}));}\n// console.log(\"false\");\n\n })\n .catch((err) => {\n console.error('ERROR:', err);\n });\n}", "getRoom() {\n const id = this.roomName;\n\n if (!activeRooms.hasOwnProperty(id)) {\n throw new Error('Room requested does not exist: ' + id);\n }\n\n return activeRooms[id];\n }", "function getRoomNameFromId(roomcode) {\n var sResult = \"\";\n // Loop trough each room and check if we found an id that is equals to param roomcode\n $.each(rooms, function (i, room) {\n if (room.id === roomcode) {\n sResult = room.name; // Store the rooms name in sResult if we found its id that's equal to roomcode\n }\n });\n return sResult;\n}", "function inside(socket, room) {\n return !!socket.manager.roomClients[socket.id][room];\n }", "function ownsRoom(user) {\n lunchrooms.forEach(function(room) {\n if (room['creator'] === user) {\n return true;\n }\n });\n return false;\n}", "inRoom(idPlayer){\n return bdConf.searchRoomWithPlayer(idPlayer)\n }", "function my_rooms(s){\n return s && s.pos && tables.my_rooms().indexOf(s.pos.roomName) !== -1;\n}", "function isAddRoomValid(){\r\n return(RoomNumberField.isValid() && RoomValidFromField.isValid());\r\n }", "removeRoom(roomCode) {\n Logger.logInfo('Removing room: ' + roomCode);\n this.rooms[roomCode].forceEndGame();\n delete this.rooms[roomCode];\n }", "reserveNewRoom() {\n var newRoomCode;\n\n do {\n newRoomCode = Hasher.genHash(ROOM_CODE_LENGTH);\n } while(this.roomExists(newRoomCode));\n\n this.rooms[newRoomCode] = new Room(newRoomCode);\n return newRoomCode;\n }", "addRoom(name, author, author_id) {\n\n \t// check is the room name is't exist\n \tvar x = this.getRoomByName(name);\n \tif (x) {\n \t\treturn false ;\n \t}\n var id = uniqid();\n var room = {\n id : uniqid(),\n author : author,\n name : name,\n author_id: author_id\n };\n this.rooms.push(room);\n return true;\n }", "ActiveRoom(){\r\n\t\tif(this.roomsMgr.RoomExists(this.activeRoom)){\r\n\t\t\treturn this.roomsMgr.Room(this.activeRoom);\r\n\t\t}\r\n\t\treturn this.roomsMgr.Room(SERVER_CH);\r\n\t}", "function removeRoom(id) {\n\tvar room = ROOMS[id];\n\tif(room) {\n\t\tdelete ROOMS[id];\n\t\treturn true;\n\t}\n\treturn false;\n}", "function removeRoom(id) {\n\tvar room = ROOMS[id];\n\tif(room) {\n\t\tdelete ROOMS[id];\n\t\treturn true;\n\t}\n\treturn false;\n}", "function getRoom()\n {\n\n // console.log(\".. . .. . .. . \" + room);\n\n // if(room == undefined) ///eller === \n // {\n // return \"Sök sal...\";\n // }\n // else\n // {\n // return room; // eller toString(room);\n // }\n }", "isRoomEnterable() {\n\n const isSelfInRoom = () => {\n\n if (this.selfSkylinkId === null) return false;\n\n for (let user of this.props.users)\n {\n if (user.skylinkId == this.selfSkylinkId) return true;\n }\n\n return false;\n };\n\n return !(this.props.room.status == Constants.RoomState.LOCKED)\n || isSelfInRoom();\n }", "function getJoinedRoom(name)\n{\n var room_count = room.rooms.length\n for (var i = 0; i < room_count ; i++)\n {\n var r = room.getRoomById(room.rooms[i].id)\n if (r)\n {\n var p = r.isWaiting(name)\n if (p) // le joueur est inscrit dans cette room\n {\n return r.id\n }\n }\n }\n return null\n}", "function hasLeft(room) {\n var time = getRelativeTime(room, -4);\n if (time['nh'] > time['h']) {\n return true;\n } else if (time['nh'] === time['h'] && time['nm']> time['m']) {\n return true;\n }\n return false;\n}", "getRoom(roomId) {\r\n\t\treturn typeof this.rooms[roomId] === \"object\" ? this.rooms[roomId] : null;\r\n\t}", "addPlayerToRoomByID(player, roomID) {\n // Conditional that checks whether a room exists\n if (Room.roomExists(roomID)) {\n // Find the room by its ID and add the player to it\n Room.findByID(roomID).addPlayer(player);\n player.setRoom(Room.findByID(roomID));\n return true;\n }\n // Emit a message saying that joining the room has failed\n player.emitter.emit('roomJoinFailed', {});\n return false;\n }", "function deleteRoom(roomCode){\n let room = rooms[roomCode];\n if(room){\n let players = room.players;\n for(let i = 0; i < players.length; i++){\n let player = players[i];\n delete socks[player].room;\n }\n delete rooms[roomCode];\n }\n}", "function getRoomById(id) {\n for (let i = 0; i < rooms.length; i++) {\n const room = rooms[i];\n if (room.id == id) {\n return room;\n }\n }\n return null;\n}", "function getRoom(slug) {\n\n const tempItem = [...data.rooms];\n\n const room = tempItem.find((room) => room.slug === slug);\n\n return room;\n\n }", "async function getOrCreateRoom({ roomId, consumerReplicas })\n{\n\tlet room = rooms.get(roomId);\n\n\t// If the Room does not exist create a new one.\n\tif (!room)\n\t{\n\t\tlogger.info('creating a new Room [roomId:%s]', roomId);\n\n\t\tconst mediasoupWorker = getMediasoupWorker();\n\n\t\troom = await Room.create({ mediasoupWorker, roomId, consumerReplicas });\n\n\t\trooms.set(roomId, room);\n\t\troom.on('close', () => rooms.delete(roomId));\n\t}\n\n\treturn room;\n}", "function genRoomCode() {\n const roomSeed = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',\n rooms = io.sockets.adapter.rooms;\n let code\n do {\n code = ''\n for (var i = 0; i < 5; i++) {\n code += roomSeed[getRandomInt(roomSeed.length)]\n }\n // Keep generating new codes if the code is already in use\n } while (rooms[code])\n return code\n }", "async function getOrCreateRoom({ roomId })\n{\n let room = rooms.get(roomId);\n\n // If the Room does not exist create a new one.\n if (!room)\n {\n room = await Room.create({ roomId });\n\n rooms.set(roomId, room);\n room.on('close', () => rooms.delete(roomId));\n }\n\n return room;\n}", "async exists(identifier) {\n const component = await this.findComponent(identifier);\n return !!component;\n }", "function joinedRoom( room ) {\n}", "getRoom() {\n var query = location.search && location.search.split(\"?\")[1];\n\n if (query) {\n return (location.search && decodeURIComponent(query.split(\"=\")[1]));\n }\n\n return \"no-id\"\n }", "_getRoomCodeFromSocket(socket) {\n if (socket && socket.rooms) {\n return socket.rooms[Object.keys(socket.rooms)[1]];\n }\n\n return undefined;\n }", "function getRoom(id){\n\tfor (var i=0; i<activeRooms.length;i++){\n\t\tif (activeRooms[i].num == id){\n\t\t\trm = {};\n\t\t\trm.room = activeRooms[i];\n\t\t\trm.index = i;\n\t\t\treturn rm;\n\t\t}\n\t}\n}", "function in_room (object) {\n return object.position === Mobs[game.player].position;\n}", "function isValidRoom(pos, bounds, dir){\n if (isInBounds(pos, bounds)){\n if (\n bounds.maxx - bounds.minx + 1 < ROOMSIZE_MIN || \n bounds.maxy - bounds.miny + 1 < ROOMSIZE_MIN\n ){\n //console.log(\"Invalid Room: Not large enough.\")\n //console.log(bounds)\n return false;\n }\n \n if (dir % 2 == 0){\n if (pos.x > bounds.minx && pos.x < bounds.maxx){\n return true;\n }else{\n //console.log(\"Invalid Room: Door is not in the middle of a wall (x).\");\n }\n }else{\n if (pos.y > bounds.miny && pos.y < bounds.maxy){\n return true;\n }else{\n //console.log(\"Invalid Room: Door is not in the middle of a wall (y).\");\n }\n }\n }else{\n //console.log(\"Invalid Room: door is not within the bounds.\")\n return false\n }\n}", "function joinroom(data) {\n\tvar tmproom = data;\n\tif (player != \"\" && passcode != \"\" && tmproom >= 0) {\n\n\t\tvar geturl = \"/sanaruudukko/rest/sr/process?func=joinroom&player=\" + player + \"&passcode=\" + passcode + \"&room=\" + tmproom;\n\t\t$.ajax({\n\t\t\tcache: false,\n\t\t\tdataType : 'xml',\n\t\t\ttype : 'GET',\n\t\t\turl : geturl,\n\t\t\tsuccess : function(data) {\n\t\t\t\tstartRoom(data);\n\t\t\t},\n\t\t});\n\t}\n}", "function getRoom(room)\r\n{\r\n if (!(room in roomObj))\r\n {\r\n roomObj[room] = roomData.length;\r\n roomData.push([]);\r\n console.log(\"===> Room \" + room + \" created on \" + new Date());\r\n console.log(\"Current rooms:\" );\r\n console.log(roomObj);\r\n }\r\n return roomData[roomObj[room]];\r\n}", "static exist(id) {\n return Screens.screens.has(id);\n }", "async function does_this_code_exist(verification_code_str, database)\n {\n const COLLECTION_NAME_FOR_STORED_CODES = \"codes\";\n \n let database_results_array =\n await database.collection(COLLECTION_NAME_FOR_STORED_CODES).\n find( {verification_code : verification_code_str} ).toArray();\n \n // IF THE CODE EXISTS ALREADY FOR VERIFICATION PURPOSES\n if(database_results_array.length > 0)\n return true;\n\n // CONTINUE SEARCH\n database_results_array =\n await database.collection(COLLECTION_NAME_FOR_STORED_CODES).\n find( {reset_code : verification_code_str} ).toArray();\n\n // IF THE CODE EXISTS ALREADY FOR PASSWORD RESET PURPOSES\n if(database_results_array.length > 0)\n return true;\n\n // AT THIS POINT, WE CAN ASSUME THAT THE CODE DOES NOT EXIST IN ANY CAPACITY\n return false;\n }", "function getNodeFromRoomRef(roomref){\n\tfor (index in GJSONUnOrdered){\n\t\tif (GJSONUnOrdered[index].properties.RoomRef == roomref){\n\t\t\treturn GJSONUnOrdered[index];\n\t\t}\n\t}\n\talert( \"did not find : \"+roomref);\n\treturn false;\n}", "function isPlaying(name)\n{\n return getCurrentRoom(name) != null\n}", "checkForPlayer(authCode) {\n\t\tif (authCode in this.auth)\n\t\t\treturn this.auth[authCode];\n\t\telse\n\t\t\treturn false;\n\t}", "function screeningExists(movie, day, time) {\n\t\tvar validScreening = false;\n\n\t\t$.each(movies[activeMovie].screenings, function(d, t) {\n\t\t\tif (day === d && time === t) {\n\t\t\t\tvalidScreening = true;\n\t\t\t}\n\t\t});\n\t\treturn validScreening;\n\t}", "function existsApplication(id) {\n var k;\n for (k in apps)\n if (k == id)\n return true;\n return false;\n }", "function getRoom(name=\"default\") {\n\tif (!rooms[name]) {\n\t\trooms[name] = {\n\t\t\tname: name,\n\t\t\tclients: {},\n\t\t}\n\t}\n\treturn rooms[name]\n}", "exists() {\n return this._id !== undefined;\n }", "function joinGame(data) {\n \n //Check if room exists\n if (data in gameRoomDict) {\n if (gameRoomDict[data].length < 2) {\n io.to(gameRoomDict[data][0]).emit('p2Joined');\n room = data;\n clients.sock = data;\n console.log(\"You have joined the lobby named: \" + data);\n gameRoomDict.data = gameRoomDict[data].push(socket.id);\n var stuff = [data, \"join\"]\n io.to(socket.id).emit('connectedG', stuff);\n console.log(gameRoomDict[data]);\n }\n else {\n console.log(\"Sorry this room is full\");\n }\n }\n else {\n console.log(data + \" does not exist in the list of current lobbies.\");\n }\n }", "checkIfRoombaIsHere() {\n if (this.stringify(this.state.id) === this.stringify(this.props.roomba)) {\n this.setState({dirt: false, roomba: true})\n }\n }", "function isEditRoomValid(){\r\n return(ERoomNumberField.isValid() && ERoomValidFromField.isValid() && ERoomValidToField.isValid());\r\n }", "function isExpired(room) {\n var time = getRelativeTime(room, -4);\n if (time['nh'] > time['h']) {\n if (time['nh'] > time['h']) {\n if (time['nh'] > time['h'] + 1) {\n return true;\n } else if (time['nm'] + 60 - time['m'] > 30) {\n return true;\n }\n }\n } else if (time['nh'] == time['h']) {\n if (time['nm'] > time['m'] + 30) {\n return true;\n }\n }\n return false;\n}", "function checkEnterRoom(e){\n\t\n\tvar key = e.keyCode ? e.keyCode : e.which;\n\t\n\tif(key == 13) {\n\t\tvar newRoomString = alphanumericUnderDashSpace(roomSearchInput.value);\n\t\tvar room;\n\t\t\n\t\troomSearchInput.blur();\n\t\tif(roomsArray.indexOf(newRoomString) > -1){\n\t\t\troom = document.getElementById(newRoomString);\n\t\t\tselectRoom(room);\n\t\t\troomSearchInput.value = \"\";\n\t\t\tmessageTextarea.focus();\n\t\t\treturn;\n\t\t}\n\t\t\n\t\troomsArray.push(newRoomString);\n\t\t\n\t\troom = addRoomToList(newRoomString);\n\t\tselectRoom(room);\n\t\troomSearchInput.value = \"\";\n\t\tmessageTextarea.focus();\n\t}\n}", "function isRoleBoxExist() {\n\tvar selectedAccountName = getSelectedAccount();\n\tvar baseUrl = getClientStore().baseURL; \n\tvar accessor = objCommon.initializeAccessor(baseUrl, cellName);\n\tvar context = objCommon.initializeAbstractDataContext(accessor);\n\tvar objLinkManager = objCommon.initializeLinkManager(accessor, context);\n\tvar mainBoxValue = getUiProps().MSG0039;\n\tif(boxName == mainBoxValue) {\n\t\tboxName = null;\n\t}\n\tvar response = objLinkManager.retrieveAccountRoleLinks(context, SOURCE, DESTINATION, selectedAccountName, boxName, roleName);\n\tif(response.getStatusCode() == 200) {\n\t\tvar responseBody = response.bodyAsJson();\n\t\tvar json = responseBody.d.results;\n\t\tfor(var count = 0; count < json.length; count++) {\n\t\t\tvar jsonBody = json[count];\n\t\t\tvar listRoleName = objCommon.getRoleNameFromURI(jsonBody.uri);\n\t\t\tvar listBoxName = objCommon.getBoxNameFromURI(jsonBody.uri);\n\t\t\tif(listBoxName == \"null\") {\n\t\t\t\tlistBoxName = null;\n\t\t\t}\n\t\t\tif(roleName == listRoleName && boxName == listBoxName) {\n\t\t\t\tisAvailable = true;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n}", "function isFull(roomName){\n return getRoomPlayersNumber(roomName) === playersPerRoom;\n }", "function addRoom(id, type) {\n\tif(type == \"battle\") {\n\t\tROOMS[id] = new BattleRoom(id, send);\n\t\treturn ROOMS[id];\n\t} else {\n\t\tlogger.error(\"Unkown room type: \" + type);\n\t}\n}", "function joinRoom() {\n const code = document.getElementById(\"roomCodeInput\").value;\n socket.emit(\"joinRoom\", code);\n}", "function GetGameByRoomName(_RoomName) {\r\n if(_RoomName === LOBBYROOMNAME) return;\r\n\r\n var _Game = _mData.Games.find(function(_Game){\r\n return _Game.RoomName === _RoomName;\r\n });\r\n\r\n return _Game;\r\n}", "retrieve(room) {\n if (this._rooms[room]) {\n return this._rooms[room];\n } else {\n throw 'It appears you have made a mistake.';\n }\n }", "function partingFromRoom( room ) {\n}", "function validateUser(socket, room, username, roomUsers){\n return (room \n && roomUsers[room] && socket.id in roomUsers[room] \n && roomUsers[room][socket.id] == username\n && socket.store && socket.store.data \n && socket.store.data.nickname == username\n && socket.store.data.room == room);\n}", "function findRoom(req, res, next) {\n if (req.query.Name == null) res.redirect(\"/rooms\");\n else {\n room\n .findOne({ Name: req.query.Name })\n .populate({\n path: \"Detail\",\n populate: {\n path: \"Reserve\",\n match: {\n $or: [\n { DateIn: { $gt: req.query.from, $lt: req.query.to } },\n { DateOut: { $gt: req.query.from, $lt: req.query.to } }\n ]\n }\n }\n })\n .exec(function(err, Room) {\n if (err) console.error(err);\n var counter = 0;\n for (var i = 0; i < Room.Detail.length; i++) {\n if (Room.Detail[i].Reserve.length == 0) {\n counter++;\n req.session.ReserveInfo = Room.Detail[i];\n req.session.RoomInfo = Room;\n break;\n }\n }\n if (counter == 0) {\n console.log(\"No room left\");\n res.redirect(\"/rooms/\" + req.query.Name, {\n info: { message: \"No Room Left\" }\n });\n } else {\n return next();\n }\n });\n }\n}", "function existsPath(route) {\n return fs.existsSync(route);\n}", "function getObjectForRoom(currentRoom) {\n var objectInRoomIndex = -1;\n if (currentRoom === 0) {\n return objectInRoomIndex;\n }\n\n for (var i = 0; i < itemLocationRoomNumbers.length ; i++) {\n if (itemLocationRoomNumbers[i] == currentRoom) {\n objectInRoomIndex = i;\n break;\n }\n }\n return objectInRoomIndex;\n }", "function lookupForAMeetingRoom(agent) {\n\n return searchARoom('[email protected]', agent, agent.parameters)\n\n\n }", "function addRoom(id, type) {\n\tif(ROOMS[id]) return ROOMS[id];\n\tif(type == \"battle\") {\n\t\tROOMS[id] = new BattleRoom(id, send);\n\t\treturn ROOMS[id];\n\t} else {\n\t\tlogger.error(\"Unkown room type: \" + type);\n\t}\n}", "function joinRoom() {\n var roomCode = document.getElementById('joinRoom').value;\n if (roomCode != \"\") {\n var docRef = db.collection('webBuzzer').doc(roomCode)\n docRef.get().then(function(doc) {\n if (doc.exists) {\n console.log(\"Document data:\", doc.data());\n data = doc.data()\n //firebase.database().ref('webBuzzer/' + roomCode).once('value', function(data) {\n if (data.name) {\n window.open('room.html?id=' + roomCode, '_self')\n } else {\n alert('The room code you entered isn\\'t valid.')\n }\n } else {\n alert('A 5 digit room code is required.')\n }\n }).catch(function(error) {\n console.log(\"Error getting document:\", error);\n });\n } else {\n // doc.data() will be undefined in this case\n console.log(\"No such document!\");\n }\n}", "static get(roomName) {\n\t\tif (!ROOMS.has(roomName)) {\n\t\t\tROOMS.set(roomName, new Room(roomName));\n\t\t}\n\n\t\treturn ROOMS.get(roomName);\n\t}", "function joinRoom(id)\n{\n console.log('Request joinRoom: ' + id);\n if (inRoom == false)\n {\n _warpclient.joinRoom(id);\n } else {\n console.warn('Already in another room: ' + roomId);\n }\n}", "function roomLoop(array, item){\n\tfor (var i = 0; i < array.length; i++) {\n\t\tif(array[i][0] == item){\n\t\t\treturn array[i][1];\n\t\t}\n\t}\n\treturn false;\n}", "function exists(ssn){\n return arr.indexOf(ssn) !== -1;\n }", "_atRoomCorner(room) {\n if (room.isCornerPoint(this.x, this.y)) {\n return true\n }\n if (room.isCornerPoint((this.x+this.width)-1, this.y)) {\n return true\n }\n if (room.isCornerPoint(this.x, (this.y+this.height)-1)) {\n return true\n }\n if (room.isCornerPoint((this.x+this.width)-1, (this.y+this.height)-1)) {\n return true\n }\n return false\n }", "function isUserRoomPairAbsent(data){\n var dataName = JSON.stringify(data.name);\n var dataRoom = JSON.stringify(data.room);\n var flag = true;\n users.forEach(element => {\n var elementName = JSON.stringify(element.username);\n var elementRoom = JSON.stringify(element.room);\n if( elementName === dataName && dataRoom === elementRoom){\n flag = false;\n }\n });\n return flag;\n}", "function validateRoom(room) {\n var numRegex = /^[0-9]*$/;\n if (!room.name || !room.price) {\n alert(\"名称和价格均不能为空!\");\n return false;\n } else if (!numRegex.test(room.price)) {\n alert('价格必须为整数字!');\n return false;\n }\n return true;\n}", "add(room) {\n\tthis._rooms[room.identifier] = room;\n\treturn room;\n }", "function join(socket, roomCode, callback) {\n if (socket && socket.join) {\n socket.join(roomCode, callback);\n }\n}", "function findGame(code) {\n\treturn games.filter((game)=>{return game.getCode() == code})[0]\n}", "function isAssignedClassroom(id) {\n\treturn clients[id].classroomid != undefined;\n}", "function joinRoom(socket, roomName){\n if (getRoomPlayersNumber(roomName) < playersPerRoom){\n socket.join(roomName);\n socket.room = roomName;\n return true;\n }\n return false\n }", "function checkForGuest(toGuest) {\r\n\ttempRe = false;\r\n\tfor (i = 0; i < gameRoom.length; i++) {\r\n\t\tif (gameRoom[i].roomGuest != null) {\r\n\t\t\tif (gameRoom[i].roomGuest.guestId == toGuest) tempRe = true;\r\n\t\t}\r\n\t}\r\n\treturn(tempRe);\r\n}", "function findRoomDetailByUsageId(usageId){\n\tvar roomDetail = null;\n\t$.each(currentReservations, function(index, rsvDetail){\n\t\tif(rsvDetail.usageId == usageId){\n\t\t\troomDetail = rsvDetail;\n\t\t}\n\t});\n\treturn roomDetail;\n}", "exists() {\n return Boolean(this.id());\n }", "_findOrCreateRoom(socketId, topic) {\n let selectedRoom;\n\n // Iterate over the rooms\n Object.keys(this.topics[topic]).some(roomId => {\n let room = this.topics[topic][roomId];\n if (room.users.length < MAX_USERS) {\n selectedRoom = room;\n return true;\n } else {\n return false;\n }\n }, this);\n\n if (selectedRoom) {\n selectedRoom.users.push(socketId);\n } else {\n // All rooms are full\n selectedRoom = this._createRoom(socketId, topic);\n // Add it to the first position of the array. It will be easier for add new people to it\n this.topics[topic].unshift(selectedRoom);\n }\n\n // Return the room\n return selectedRoom;\n }", "function roomNameTaken(array, val) {\n\tfor (var i = array.length - 1; i >= 0; i--) {\n if (array[i].toLowerCase() == val.toLowerCase()) {\n return true;\n }\n }\n return false;\n}", "exists() {\n return File.exists(this.path);\n }", "function sessionExists(id) {\n\treturn getSessionSeq(id) !== undefined;\n}", "function is_room_id(str) {\n return (/^[a-z]{5}$/.test(str + \"\"));\n}", "function findRoom(msg) {\n var room = msg.envelope.room;\n\n if(_.isUndefined(room)) {\n room = msg.envelope.user.reply_to;\n }\n\n return room;\n }", "doesStudentExist(id) {\n\t\t\n\t\treturn this.data.hasOwnProperty(id);\n\t\t\n\t}", "function room(roomLetter,schedule)\n{\n this.letter = roomLetter;\n this.id=randomString(window.config.numberOfDigitsForRandomStrings,'aA#')+\"|room:\"+roomLetter;\n //store a reference to the schedule object in the room object so given any part of the turnoment hierarchy you can transverse to the top.\n this.schedule = schedule;\n this.rounds = [];\n}" ]
[ "0.8155792", "0.6707367", "0.66065294", "0.6592731", "0.6389099", "0.6184209", "0.61693615", "0.61344033", "0.59396476", "0.58948386", "0.58383", "0.57602453", "0.57387096", "0.56388247", "0.5636944", "0.5549528", "0.5495908", "0.5493824", "0.54198974", "0.53347903", "0.5325483", "0.5303944", "0.5302856", "0.5302638", "0.52656937", "0.5258293", "0.51645404", "0.51645404", "0.5105315", "0.50894266", "0.5083212", "0.5045806", "0.5025704", "0.50039583", "0.49978334", "0.4985154", "0.49468172", "0.49437514", "0.49322298", "0.4884794", "0.4871262", "0.48698336", "0.48656383", "0.4849649", "0.4836913", "0.48336053", "0.48212105", "0.47810745", "0.47807342", "0.47593307", "0.47590634", "0.47430763", "0.47209045", "0.47131106", "0.47128367", "0.46949056", "0.46891344", "0.4686483", "0.46840024", "0.46696797", "0.46636066", "0.4655066", "0.46534294", "0.46530378", "0.46244028", "0.46218273", "0.46183094", "0.46093574", "0.46049967", "0.46042544", "0.46009213", "0.4600662", "0.45988438", "0.45773593", "0.45669776", "0.4564095", "0.45579413", "0.45564604", "0.45472786", "0.45433608", "0.45357573", "0.45306134", "0.45290333", "0.45226395", "0.45109472", "0.45104468", "0.45077506", "0.4506186", "0.44992206", "0.44866857", "0.44721967", "0.44662607", "0.44622833", "0.44526803", "0.44437292", "0.44433007", "0.44427976", "0.4439519", "0.4434164", "0.4422989" ]
0.8139524
1
SOCKET LISTENERS Attempts to end a game for the Room associated with the given socket.
hostAttemptEndGame(socket, data) { Logger.logInfo('Socket ' + socket.id + ' attempting to end game'); var roomCode = this._getRoomCodeFromSocket(socket); if (this.roomExists(roomCode)) { var room = this.getRoom(roomCode); if (room.attemptEndGame(socket)) { Logger.logInfo('Game at room ' + roomCode + ' ended'); room.playerMap.emitCustomToAll('hostEndGameSuccess', (socket) => { return { thisClientIsHost: room.socketIsHost(socket) } }); room.playerMap.emitCustomToAll('updateLobby', (socket) => { return room.getLobbyData(socket); }); } else { Logger.logWarning('Socket ' + socket.id + ' failed to end game'); socket.emit('hostEndGameFailure', { reason: 'room.attemptEndGame() failed' }); } } else { Logger.logWarning('Socket ' + socket.id + ' failed to end game'); socket.emit('hostEndGameFailure', { reason: 'Room does not exist' }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static onSocketDisconnect(socket) {\n Object.keys(socket.rooms).forEach(room => {\n try {\n if (rooms.isRoomExists(room)) {\n if (rooms.getRoomPlayersCount(room) === 1) {\n rooms.removeRoom(room);\n } else {\n rooms.getRoom(room).removePlayer(socket.id);\n rooms.getRoom(room).resetPlayersActions();\n rooms.getRoom(room).resetWinner();\n }\n }\n } catch (error) {\n console.log('' + error);\n }\n\n io.to(room).emit('opponentLeave');\n })\n }", "socketsLeave(room) {\r\n this.adapter.delSockets({\r\n rooms: this.rooms,\r\n except: this.exceptRooms,\r\n }, Array.isArray(room) ? room : [room]);\r\n }", "playerAttemptLeaveRoom(socket, data) {\n Logger.logInfo('socket ' + socket.id + ' disconnecting...');\n var roomCode = this._getRoomCodeFromSocket(socket);\n\n if (this.roomExists(roomCode)) {\n this.getRoom(roomCode).disconnectPlayer(socket);\n socket.leave(roomCode, () => {\n socket.emit('playerLeaveRoomSuccess', {});\n });\n this.getRoom(roomCode).playerMap.emitCustomToAll('updateLobby', (socket) => {\n return this.getRoom(roomCode).getLobbyData(socket);\n });\n } else {\n socket.emit('playerLeaveRoomFailure', {\n reason: 'Room does not exist'\n });\n return;\n }\n\n if (this.getRoom(roomCode).socketsEmpty()) {\n this.removeRoom(roomCode);\n }\n }", "function leaveGames(socket) {\r\n var player = players[socket.id];\r\n for (var [gameId, game] of games) {\r\n game.removePlayer(player);\r\n // Remove the player from the room.\r\n if (socket) socket.leave('game ' + game.id);\r\n\r\n if (game.numPlayers() === 0 || socket.id === game.id) {\r\n games.delete(socket.id);\r\n }\r\n }\r\n}", "endGame(socket) {\n if (this.socketIsHost(socket) && this.gameState > LOBBY) {\n this.resetPlayers();\n this.gameState = LOBBY;\n return this.clientsUpdate();\n }\n return false;\n }", "attemptEndGame(socket) {\n if (this.socketIsHost(socket) && this.gameServer.isInGame()) {\n this.gameServer.endGame();\n return true;\n }\n\n return false;\n }", "finishgame(myId, roomId) {\n this.socket.emit(\"finishgame\", myId, roomId);\n }", "listenEndGame(op,room){\n socket.on(\"end-GamePb\",function (data) {\n if(data.room===room){\n op();\n }\n })\n }", "endForOnePlayer(player, room){\n socket.emit(\"end-pb-player\", {player : player, room : room});\n }", "socketsJoin(room) {\r\n this.adapter.addSockets({\r\n rooms: this.rooms,\r\n except: this.exceptRooms,\r\n }, Array.isArray(room) ? room : [room]);\r\n }", "function callEndSocketGame() {\r\n\tconsole.log(\"Peticion End Sala # \" + GAME_PORT + \" # \" + ROOM_ID);\r\n\t\r\n\tvar ab = str2ab(END_SESSION + \";\" + APP_ID + \";\" + ROOM_ID + \";\" + USER_ID);\r\n\tgameSocketUdp.write(gameSocks.socketId, ab, writeSocketGameComplete);\t\t\r\n\tt = setTimeout(function() {\t\r\n\t\tif(!controlEndSala){\t\r\n\t\t\tcallEndSocketGame();\r\n\t\t}\r\n\t}, limitLatencyToEnd);\t\t\r\n}", "destroy() {\n\t\tfor ( const socket of this._socketServer.getSocketsInRoom( this.id ) ) {\n\t\t\tsocket.disconnect();\n\t\t}\n\n\t\tif ( this.player ) {\n\t\t\tthis.player.destroy();\n\t\t}\n\n\t\tif ( this.opponent ) {\n\t\t\tthis.opponent.destroy();\n\t\t}\n\n\t\tthis.stopListening();\n\t}", "function on_socket_end() {\n if (!this.writable && this.destroyed === false) {\n this.destroy();\n had_error(new Error('Remote end closed socket abruptly.'))\n }\n }", "function close(socket) {\n // Free the IP\n let n = connectedIPs.findIndex(w => { return w.ip === socket.ip; });\n if (n !== -1) {\n util.log(socket.ip + \" disconnected.\");\n util.remove(connectedIPs, n);\n }\n // Free the token\n if (socket.key != '') { \n keys.push(socket.key);\n util.log(\"Token freed.\");\n } \n // Figure out who the player was\n let player = socket.player,\n index = players.indexOf(player);\n // Remove the player if one was created\n if (index != -1) {\n // Kill the body if it exists\n if (player.body != null) {\n player.body.invuln = false;\n setTimeout(() => {\n player.body.kill();\n }, 10000);\n }\n // Disconnect everything\n util.log('[INFO] User ' + player.name + ' disconnected!');\n util.remove(players, index);\n } else {\n util.log('[INFO] A player disconnected before entering the game.');\n }\n // Free the view\n util.remove(views, views.indexOf(socket.view));\n // Remove the socket\n util.remove(clients, clients.indexOf(socket)); \n util.log('[INFO] Socket closed. Views: ' + views.length + '. Clients: ' + clients.length + '.');\n }", "function joinRandomRoom() {\r\n socket.emit(\"joinRandomRoom\");\r\n}", "function socketListeners(){\n\tsocket.on('joined',function(){\n\t\tuser.success();\n\t});\n\tsocket.on('exists',function(err){\n\t\tuser.error(err);\n\t});\n\tsocket.on('roomList',function(roomlist){\n\t\tchatRoom.populate(roomlist);\n\t});\n}", "function handleRoomJoining(socket) {\n socket.on('join', function(room) {\n socket.leave(currentRoom[socket.id]);\n joinRoom(socket, room.newRoom);\n });\n}", "function on_socket_end() {\n if (returned && !this.writable && this.destroyed === false) {\n this.destroy();\n had_error(new Error('Remote end closed socket abruptly.'))\n }\n }", "function Disconnect(socket) {\n players--;\n console.log(\"Disconnected: \" + socket.id);\n for (let i = 0; i < player_id.length; i++) {\n if (player_id[i] === socket.id) {\n socket.broadcast.emit('left', player_id[i]);\n player_id.splice(i, 1);\n break;\n }\n }\n\n}", "removePlayer(socket) {\n const isPlayer = this.players[socket.id] !== undefined\n const isSpectator = this.spectators[socket.id] !== undefined\n const isHost = this.host.data.id === socket.data.id;\n if (isPlayer) { // we might need to swap people in\n delete this.players[socket.id]\n const newPlayer = this.upgradeSpectator()\n // if ingame, then let's see how to modify the player\n if (this.state === ROOM_INGAME) {\n // if we have a player, then let's swap them\n if (newPlayer !== undefined) {\n this.game.swapPlayers(socket, newPlayer)\n } else { // else, just remove and let game use AI\n this.game.removePlayer(socket)\n }\n }\n // if host is leaving, we need to fix that too\n if (isHost) {\n this.upgradeHost();\n }\n } else if (isSpectator) { // don't care about these guys\n delete this.spectators[socket.id]\n }\n socket.leave(this.uniqueName)\n socket.join('lobby')\n delete socket.data.room\n delete socket.data.timeJoinedRoom\n // tell everyone else that room has changed\n socket.to(this.uniqueName).emit('room_player_update', this.playerInfo())\n io.to('lobby').emit('lobby_room_update', this.basicInfo())\n return Object.keys(this.players).length === 0\n }", "static onSocketJoined(roomID) {\n if (rooms.getRoomPlayersCount(roomID) == 2) {\n rooms.getRoom(roomID).resetPlayersScore();\n io.to(roomID).emit('startGame', {\n id: rooms.getRoom(roomID).getID(),\n winner: rooms.getRoom(roomID).getWinner(),\n players: rooms.getRoom(roomID).getPlayers()\n });\n }\n }", "static onSocketReady(socket) {\n Object.keys(socket.rooms).forEach(room => {\n if (rooms.isRoomExists(room)) {\n if (rooms.getRoomPlayersCount(room) > 1) {\n rooms.getRoom(room).setPlayerReady(socket.id);\n\n let readyPlayers = 0;\n\n rooms.getRoom(room).getPlayers().forEach(player => {\n if (player.ready) {\n readyPlayers++;\n }\n })\n\n if (readyPlayers === 2) {\n rooms.getRoom(room).resetPlayersActions();\n rooms.getRoom(room).resetPlayersReady();\n\n io.to(room).emit('startGame', {\n id: rooms.getRoom(room).getID(),\n winner: rooms.getRoom(room).getWinner(),\n players: rooms.getRoom(room).getPlayers()\n });\n }\n }\n }\n })\n }", "function GameSocketServer(io, debug) {\n io.on('connection', socket => {\n\n if (debug) console.log(`Client joined! id: ${socket.id}`)\n\n // Triggered on room creation or joining\n socket.on('room', (username, userType, roomCode) => {\n\n // Set socket info\n socket.username = username\n socket.userType = userType\n\n const rooms = io.sockets.adapter.rooms\n\n if (socket.userType === 'player') {\n if (debug) console.log(`Player ${socket.username} wants to join a room.`)\n\n if (rooms[roomCode]) {\n // If the room exists\n if (debug) console.log(`Player ${socket.username} joined a room. code: ${roomCode}`)\n joinOrCreateRoom(roomCode)\n } else {\n // If the room does not exist\n if (debug) console.log(`Player ${socket.username} requested a non-existent room.`)\n socket.emit('no_room', 'Room does not exist.')\n }\n } else if (socket.userType === 'gm') {\n if (debug) console.log(`GM ${socket.username} requested a room.`)\n if (!rooms[roomCode]) {\n // If the room does not exist already, generate a new code\n // This prevents GMs from setting their own room code\n roomCode = genRoomCode()\n if (debug) console.log(`GM ${socket.username} created a room. code: ${roomCode}`)\n } else {\n // If the room exists already, don't set a new code, so they just join the room\n if (debug) console.log(`GM ${socket.username} joined a room. code: ${roomCode}`)\n }\n joinOrCreateRoom(roomCode)\n } else {\n // If anything other than the right user types were set\n socket.userType = 'player'\n socket.emit('error', 'Invalid user type.')\n }\n })\n\n // Short hand callback for broadcasting new stores\n socket.on('broadcast_stores', broadcastStores)\n\n // Short hand callback for broadcasting clear stores message\n socket.on('clear_stores', clearStores)\n\n // Sometimes the socket is undefined on improper disconnection\n socket.on('disconnect', reason => {\n if (socket) {\n updateGMRoomMembers()\n }\n const name = socket.username || \"Someone\"\n if (debug) console.log(`${name} disconnected: ${reason}`)\n })\n\n // Sends room members in a callback\n function getRoomMembers(cb) {\n // Get all room members\n io.of('/').in(socket.roomCode).clients((error, clients) => {\n if (error) throw error\n // Create empty room\n const roomPkg = [],\n connected = io.sockets.connected\n for (let id of clients) {\n // Get each socket by id\n const client = connected[id]\n // Push the socket info into the room\n roomPkg.push({\n id: id,\n username: client.username,\n userType: client.userType\n })\n }\n cb(roomPkg)\n })\n }\n\n // Sends a GM the current room member information\n function updateGMRoomMembers() {\n getRoomMembers(members => {\n for (let member of members) {\n // Find the GM\n if (member.userType === 'gm') {\n // Send them the members\n io.to(member.id).emit('room_members', members)\n return\n }\n }\n })\n }\n\n // Sends store information to all selected recipients\n function broadcastStores(stores, recipients) {\n if (debug) {\n console.log(\"Sending stores:\")\n console.log(stores)\n console.log(\"To:\")\n console.log(recipients)\n }\n for (var i = 0; i < recipients.length; i++) {\n io.to(recipients[i]).emit('new_stores', stores)\n }\n }\n\n // Sends a clear stores message to selected recipients\n // If none are provided, it sends the message to whole room\n function clearStores(recipients) {\n if (!recipients.length) {\n getRoomMembers(members => {\n sendClearStoresMessage(members)\n })\n } else {\n sendClearStoresMessage(recipients)\n }\n }\n\n // Helper function\n function sendClearStoresMessage(recipients) {\n for (var i = 0; i < recipients.length; i++) {\n io.to(recipients[i].id).emit('clear_stores')\n }\n }\n\n // Adds the socket to a room if it exists, or creates and then adds if it doesn't\n function joinOrCreateRoom(roomCode) {\n socket.join(roomCode, () => {\n // Sets the socket's room code\n socket.roomCode = roomCode\n // Sends room code to client\n socket.emit('room_joined', roomCode)\n // Updates GM's player list\n updateGMRoomMembers()\n })\n }\n\n // Generates a 5 character room code\n function genRoomCode() {\n const roomSeed = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',\n rooms = io.sockets.adapter.rooms;\n let code\n do {\n code = ''\n for (var i = 0; i < 5; i++) {\n code += roomSeed[getRandomInt(roomSeed.length)]\n }\n // Keep generating new codes if the code is already in use\n } while (rooms[code])\n return code\n }\n\n // Helper function\n function getRandomInt(upperBound) {\n return Math.floor(Math.random() * upperBound)\n }\n\n })\n}", "function endTimer(socket){\n var temps = 0;\n temps = Math.floor(timer / 60);\n if (temps == (timeRound * 2)){ // envoi le winner\n findWinner(function(data){\n socket.emit('Winner',data);\n socket.broadcast.emit('Winner',data);\n });\n clean();\n console.log(\"end of game\");\n\n clearInterval(interval);\n timer = 0;\n nbPlayers = 0;\n }\n}", "function joinRoom(userSocket, partnerSocket, allSockets, callback){\n // create room with socket id\n var room = userSocket.id.substring(2);\n userSocket.join(room);\n partnerSocket.join(room);\n\n // attach room name with sockets\n\n userSocket.room = room;\n partnerSocket.room = room;\n\n // remove sockets from array\n var connectedSockets = [];\n connectedSockets.push(userSocket);\n connectedSockets.push(partnerSocket);\n for(var i = 0; i<allSockets.length;i++){\n var j = allSockets.indexOf(userSocket);\n if (i === -1){}\n else{allSockets.splice(i, 1)};\n }\n for(var i = 0; i<allSockets.length;i++){\n var j = allSockets.indexOf(partnerSocket);\n if (i === -1){}\n else{allSockets.splice(i, 1)};\n }\n callback(null,'success'); \n}", "function sendToServer_wantnext() {\r\n socket.emit('clientend', {\r\n 'room': ROOM_ID\r\n });\r\n}", "function connectToRoom(ws,req){ // socket connection for rooms\n\n var clientId = random()\n\n function leftRoom(room,key){\n broadcast(room,socketClients[clientId].user,'onleave',key)\n }\n\n ws.on('close', function(req){\n \n //to do if user doesnot exist fallback, broadcast a leave message, on error\n //to remember: remove key can handle both array and object\n\n\n\n\n for (let key in roomsRegistry){\n\n for (let room in roomsRegistry[key].full){\n\n //remove client from full instance, remove instance from full and and add it not full\n\n if ( roomsRegistry[key].full[room].clients.includes(clientId ) ){\n\n removeFromBuilding('full',key,room)\n //because currently room is full if anyone leaves the room it will become empty\n\n\n }else{\n // console.log( roomsRegistry[key].full[room].clients[clientId] )\n }\n\n }\n\n \n for (let room in roomsRegistry[key].notFull){\n\n if ( roomsRegistry[key].notFull[room].clients.includes( clientId) ) {\n removeFromBuilding('notFull',key,room)\n }\n }\n\n }\n\n socketClients = removeKey(socketClients,clientId)\n\n })\n\n //remove user from all the room\n function removeRoomFromFullAddToNotFull(label,uniqueKeyOfRoom){\n roomsRegistry[label].notFull[uniqueKeyOfRoom] = roomsRegistry[label].full[uniqueKeyOfRoom]\n roomsRegistry[label].full = removeKey(roomsRegistry[label].full,uniqueKeyOfRoom)\n leftRoom(uniqueKeyOfRoom,label)\n }\n\n //there are two kinds of room in the building full and notFull\n function removeFromBuilding(kind,label,uniqueKeyOfRoom){\n roomsRegistry[label][kind][uniqueKeyOfRoom].clients = removeKey(roomsRegistry[label][kind][uniqueKeyOfRoom].clients,clientId)\n\n kind === 'full'? removeRoomFromFullAddToNotFull(label,uniqueKeyOfRoom) : leftRoom(uniqueKeyOfRoom,label)\n }\n\n function leaveRoom(label,uniqueKeyOfRoom,newRoom){\n\n if (!roomsRegistry[label]) {\n return sendError(label+' label is invalid',newRoom)\n }\n\n if (roomsRegistry[label].full[uniqueKeyOfRoom]){\n removeFromBuilding('full',label,uniqueKeyOfRoom)\n }else if(roomsRegistry[label].notFull[uniqueKeyOfRoom]){\n removeFromBuilding('notFull',label,uniqueKeyOfRoom)\n }\n\n }\n\n function sendError(errorMessage,label){\n ws.send( stringIt({type:'onerror', data:errorMessage, token:label}) )\n }\n //type getRoomToken\n // to do solve conflict of name query socket connection\n //limit defined by user\n ws.on('message', function(msg){\n\n\n msg = JSON.parse(msg)\n let roomLimit = 2\n // let roomId = msg.token\n let roomLabel = msg.app+'_'+msg.token //msg token is hotel name\n let roomToken = null\n if (msg.broadcastToken) roomToken = msg.broadcastToken \n if (msg.limit) if(msg.limit >= 2) roomLimit = msg.limit\n\n //what if where is not defined in update\n\n //the update function does not gives the update doc?\n\n //user can connect to multiple rooms the front end functions are mapped to \n if (msg.purpose == 'join'){\n createOrAddToRoom()\n }else if(msg.purpose == 'broadcast'){\n // console.log('broadcasting')\n broadcast(roomToken,msg.content,'ondata',roomLabel)\n }else if(msg.purpose == 'change_room'){\n\n\n\n\n //to do save from crash not defineed\n if (!msg.currentRoomLabel || !msg.unique || !msg.newToken) return sendError('required values missing')\n leaveRoom(msg.app+'_'+msg.currentRoomLabel, msg.unique, msg.newToken)\n\n // console.log('leaving room',msg.currentRoomLabel,'unique',msg.unique)\n roomLabel = msg.app+'_'+msg.newToken\n createOrAddToRoom()\n\n }else if(msg.purpose == 'leave'){\n\n if (!msg.currentToken || !msg.unique ) return sendError('required values missing')\n\n leaveRoom(msg.app+'_'+msg.currentToken,msg.unique )\n }\n\n\n \n\n //why one to one does not exist? because it can be created with room with limit 2\n\n function createOrAddToRoom(){\n\n if(!socketClients[clientId]){\n\n //if user does not exist\n return getUserData( msg.cookie ).then(function(userObject,error){//what if cookie is invalid\n if (error) return sendError('invalid cookie')\n socketClients[clientId] = {user:{id:userObject.id, username:userObject.username}, socket:ws}\n\n createOrAddToRoom()\n })\n\n \n }\n\n //also broadcast on join and leave and also joined member\n // console.log(clientId,'creating room or adding:'+roomLabel)\n function createRoom(){\n roomToken = random()\n roomsRegistry[roomLabel].notFull[roomToken] = {clients:[],limit:roomLimit}\n roomsRegistry[roomLabel].notFull[roomToken].clients.push(clientId)\n }\n\n if (!roomsRegistry[roomLabel]){ //room not constructed \n roomsRegistry[roomLabel] = { full:{},notFull:{} }\n createRoom()\n }else{\n\n if ( Object.keys(roomsRegistry[roomLabel].notFull).length === 0 ) {\n createRoom()\n }else{\n\n roomToken = Object.keys(roomsRegistry[roomLabel].notFull)[0]\n roomsRegistry[roomLabel].notFull[roomToken].clients.push(clientId)\n broadcast(roomToken,socketClients[clientId].user,'onjoin',roomLabel)\n\n let notFullRoomLimit = roomsRegistry[roomLabel].notFull[roomToken].limit\n let membersCountOfNotFull = roomsRegistry[roomLabel].notFull[roomToken].clients.length\n\n \n\n // if(membersCountOfNotFull > notFullRoomLimit) console.log('limit exceeded', membersCountOfNotFull, notFullRoomLimit)\n\n if(membersCountOfNotFull === notFullRoomLimit){\n roomsRegistry[roomLabel].full[roomToken] = roomsRegistry[roomLabel].notFull[roomToken]\n roomsRegistry[roomLabel].notFull = removeKey(roomsRegistry[roomLabel].notFull,roomToken)\n }\n\n }\n\n }\n\n broadcast(roomToken,null,'onopen',roomLabel)\n\n }\n\n })\n //add coments and decrease code\n // roomArgToken room name, roomLabel key\n function broadcast(roomArgToken,content,type,roomLabel){// room label is the type of room and roomArgToken is unique id of room which can be full or not full\n\n let token = roomLabel.split('_')[1]\n\n let broadcastTo = null\n try{\n broadcastTo = roomsRegistry[roomLabel].notFull[roomArgToken] === undefined ? roomsRegistry[roomLabel].full[roomArgToken] : roomsRegistry[roomLabel].notFull[roomArgToken] \n }catch(e){\n return ws.send( stringIt({error:roomArgToken+' room not found in '+roomLabel+'to broadcast'+e}) )\n }\n\n let members = []\n\n if (!broadcastTo) return ws.send( stringIt({ unique:roomArgToken, token:token, type:'onerror', data:'invalid unique' }))\n\n for (let index of broadcastTo.clients){\n\n members.push( socketClients[index].user )\n }\n\n if (type == 'onopen') return ws.send( stringIt({ unique:roomArgToken, token:token, members:members, type:type }))\n\n\n for (let index of broadcastTo.clients){\n if (index !== clientId) socketClients[index].socket.send( stringIt({unique:roomArgToken, members:members, token:token, sender:socketClients[clientId].user, data:content, type:type }) )\n }\n\n }\n}", "function socketOnEnd () {\n const websocket = this[kWebSocket];\n\n websocket.readyState = WebSocket.CLOSING;\n websocket._receiver.end();\n this.end();\n}", "function socketOnEnd () {\n const websocket = this[kWebSocket];\n\n websocket.readyState = WebSocket.CLOSING;\n websocket._receiver.end();\n this.end();\n}", "constructor(socketIoInstance) {\n this.rooms = {};\n\n SafeSocket.socketsOn(socketIoInstance, 'connection', (socket) => {\n Logger.logInfo('socket ' + socket.id + ' connected');\n\n socket.emit('clientConnectedToServer', {\n socketId: socket.id\n });\n\n // Default socket.io actions\n socket.on('disconnect', () => { this.onDisconnect(socket); });\n socket.on('disconnecting', () => { this.playerAttemptLeaveRoom(socket, {}); });\n // Custom actions\n socket.on('hostAttemptEndGame', (data) => { this.hostAttemptEndGame(socket, data) });\n socket.on('hostAttemptStartGame', (data) => { this.hostAttemptStartGame(socket, data) });\n socket.on('playerAttemptCreateRoom', (data) => {\n this.playerAttemptCreateRoom(socket, data)\n });\n socket.on('playerAttemptJoinRoom', (data) => { this.playerAttemptJoinRoom(socket, data) });\n socket.on('playerAttemptLeaveRoom', (data) => { this.playerAttemptLeaveRoom(socket, data) });\n });\n }", "quit_game(){\n this.room = DEFAULT_CHATROOM;\n this.socket.emit('game:stop', { chatroom: this.room });\n delete this.game;\n }", "function continueGame() { //AFTER\n socket.emit('continue', {roomnumber: currentRoom});\n}", "_onEnd() {\n if (this._socket && !this._socket.destroyed) {\n this._socket.destroy();\n }\n }", "_onEnd() {\n if (this._socket && !this._socket.destroyed) {\n this._socket.destroy();\n }\n }", "_onEnd() {\n if (this._socket && !this._socket.destroyed) {\n this._socket.destroy();\n }\n }", "function closeSocket(socket) {\n\tvar i = sockets.indexOf(socket);\t\n\n\tif (i != -1) {\n\t\tsockets.splice(i,1);\n\t}\n}", "function attachSocketHandlers() {\n socket.on('boardjoin', function (socketdata) {\n console.log(socketdata);\n if (socketdata.success) {\n boardID = socketdata.boardID;\n localStorage[\"cmuopoly_boardID\"] = boardID;\n openGameLobbyScreen($(\"#homeScreen\"), socketdata.gameID);\n }\n else {\n alert(socketdata.message);\n }\n });\n\n\tsocket.on('newplayer', function (socketdata) {\n\t\tgetGameInfo(socketdata.gameID);\n\t});\n\n socket.on('playerleft', function (socketdata) {\n getGameInfo(socketdata.gameID);\n });\n\n socket.on('boardleft', function (socketdata) {\n getGameInfo(socketdata.gameID);\n });\n\n socket.on('hostleft', function (socketdata) {\n alert(\"The host has left the game.\");\n currentGame = undefined;\n openHomeScreen($(\"#gameLobbyScreen\"));\n });\n\n\tsocket.on('gameReady', function () {\n\t\tconsole.log(\"READY.\");\n localStorage[\"cmuopoly_chatLog\"] = \"\";\n localStorage[\"cmuopoly_eventLog\"] = \"\";\n\t\twindow.location = \"/board/monopoly.html\";\n\t});\n}", "function closeSocket(socket) {\n\tvar i = sockets.indexOf(socket);\n\tif (i != -1) {\n\t\tsockets.splice(i, 1);\n\t}\n}", "removeOneRoomAll ({socket, id}) {\n\t\t\tsocket.server.sockets.emit('roomRemoved', id);\n\t\t}", "close (socket) {\r\n if (socket.target) {\r\n socket.target.close();\r\n }\r\n socket.close();\r\n this._sockets[socket.id] = null;\r\n }", "function socketOnEnd() {\n const websocket = this[kWebSocket$1];\n\n websocket._readyState = WebSocket$1.CLOSING;\n websocket._receiver.end();\n this.end();\n}", "joinRoom(room, hostExist, listensers) {\n trace(`Entering room '${room}'...`);\n this.socket.emit('join', room, hostExist, listensers);\n }", "function newSocket(socket) {\n var remoteAddress = socket.remoteAddress;\n\tsockets.push(socket);\n\tsocket.on('data', function(data) {\n\t\treceiveData(socket, data);\n\t})\n\n\n\n\tsocket.on('end', function(socket) {\n console.log('ending... ' + remoteAddress);\n delete servers[remoteAddress];\n // update list of servers in monitoring mode, client-side\n io.sockets.emit('updateservers', servers);\n\n\t\tcloseSocket(socket);\n\t})\n}", "function socketOnEnd() {\n const websocket = this[kWebSocket];\n\n websocket._readyState = WebSocket.CLOSING;\n websocket._receiver.end();\n this.end();\n}", "function socketOnEnd() {\n const websocket = this[kWebSocket];\n\n websocket._readyState = WebSocket.CLOSING;\n websocket._receiver.end();\n this.end();\n}", "function roomsAutojoin(socket, data, next){\n if(_.isEmpty(socket._rooms)){\n if(socket.user && socket.user.rooms){\n socket.user.rooms.forEach(function(room){\n socket.join(room)\n })\n }\n }\n next();\n}", "function connect(socket) {\n\n var f = functions;\n\n var clientIP = f.showConnection(this);\n\n socket.on('new_text',function(m) {\n\n var gameID = f.lookupGameID(socket.id);//gets the gameid\n var opponent = f.lookupOpponent(socket.id);\n var s = f.GoThroughSuperlist(m.first.id, m.first.text, UltraList[gameID],socket.id);//updates the super list\n s = f.GoThroughSuperlist(m.second.id, m.second.text, UltraList[gameID],socket.id);//updates it for the other guy\n socket.emit('score', s);\n opponent.emit('score', s);\n\n opponent.emit('new_text',{id:m.first.id,text:m.first.text});\n\n });\n\n socket.on('disconnect', function () {\n //console.log(clientIP, \" disconnected\");\n //remove from socketArr\n if(socket.id in gameIDArr){\n var gameID = f.lookupGameID(socket.id);\n var opponent = f.lookupOpponent(socket.id);\n delete gameIDArr[socket.id];\n var gameTuple = f.lookupGame(gameID);\n clearTimeout(gameTuple.timeout);\n var S1 = f.lookupSocket(gameTuple.player1.socketID);\n var S2 = f.lookupSocket(gameTuple.player2.socketID);\n if(S1 != null && S2 != null) {\n var player1 = f.lookupPlayer(S1.id);\n var player2 = f.lookupPlayer(S2.id);\n if (opponent) {\n opponent.emit('game_over', {\n player1: player1,\n player2: player2,\n msg: 'forfeit',\n playerForfeit: f.lookupPlayer(socket.id)\n });\n }\n }\n\n //TODO: if game in GameArr, then forefit\n }\n else {\n //remove from waitQueue if in there\n var index = waitQueue.indexOf(socket.id);\n //console.log(\"Before waitQueue =\",waitQueue);\n if (index > -1) {\n waitQueue.splice(index, 1);\n }\n //console.log(\"After waitQueue =\",waitQueue);\n }\n delete socketArr[socket.id];\n delete playerArr[socket.id];\n });\n\n socket.on('catch',function(m) {\n var opponent = f.lookupOpponent(socket.id);\n if(opponent !== null)\n opponent.emit('catch',m);\n });\n\n socket.on('caught',function(m){\n var opponent = f.lookupOpponent(socket.id);\n if(opponent !== null)\n opponent.emit('caught',m);\n });\n\n socket.on('identity',function(playerName){\n socketArr[socket.id]= socket;\n playerArr[socket.id]= playerName;\n var player = {socketID:socket.id,playerName: playerName};\n if(waitQueue.length % 2 == 0){\n waitQueue.push(player.socketID);\n }\n else{\n var player1ID = waitQueue.shift();\n var player1 = {socketID:player1ID,playerName: f.lookupPlayer(player1ID)};\n var player2 = player;\n f.createGame(player1,player2);\n }\n });\n socket.on('saveToDB', function(data){\n db.run(\"INSERT INTO Scores (player1, player2, winner, winnerScore) VALUES (?,?,?,?)\",\n data.player1, data.player2, data.winner, data.winnerScore, function(err){\n if(err){\n throw err;\n }\n });\n });\n\n socket.emit('identify');\n}", "refresh (socket) {\n\t\t\tif (this.list.length === 0) {\n\t\t\t\tsocket.emit('refreshLobby', []);\n\t\t\t}\n\t\t\tsocket.emit('refreshLobby', this.list);\n\t\t}", "function disconnectSocket() {\n const self = this;\n\n console.log(`${self.socket.user.username} disconnected.`);\n\n sqlQueries.leaveGame(self.socket.user.accountSK, function (data) {\n if (data.hasOwnProperty('errors')) {\n console.log(data.errors.message);\n } else {\n console.log(`${self.socket.user.username} left game ${data.currentGame}.`);\n\n self.socket.leave(data.currentGame);\n\n if (data.gameShutdown) {\n self.socket.broadcast.to(data.currentGame).emit('generalError', {error: 'The host left.'});\n self.socket.broadcast.to(data.currentGame).emit('gameShutdown');\n\n // Makes every socket leave the room.\n self.socket.server.of('/').in(data.currentGame).clients(function(error, clients) {\n if (clients.length > 0) {\n clients.forEach(function(socket_id) {\n self.socket.server.sockets.sockets[socket_id].leave(data.currentGame);\n });\n }\n });\n\n } else {\n Broadcast.refreshGameDetails(self.socket, data.currentGame);\n }\n }\n\n Broadcast.lobbyRefresh(self.socket);\n });\n\n self.socket.user = {\n accountSK: null,\n username: null\n };\n}", "function createSocketGameComplete(socketInfo) {\r\n\tgameSocks = socketInfo;\r\n\t//console.log(\"Create Socket OK\");\r\n\tconnectGameRoom();\r\n}", "function socketCallback(socket) {\n\n /////////////////////////////////////////////////////////////////////////////\n // place client in a room, removing them from all other rooms\n // note: client can only join a room they are authorized to be in\n // requires:\n // payload.roomId : the room to join\n // emits to socket:\n // \"joinResponse\" of either `joined room ${payload.roomId}` or \"failed\"\n /////////////////////////////////////////////////////////////////////////////\n socket.on(\"join\", function(payload) {\n let rooms = Object.keys(socket.rooms);\n rooms.forEach( room => {\n if(room.match(/room \\d+/)) {\n socket.leave(room);\n }\n });\n verifyAuthCookie(socket, userId => {\n UserRoom.UserRoom.findAll({where: {userId: userId, roomId: payload.roomId}})\n .then( userRooms => {\n if(userRooms.length > 0) {\n socket.join(`room ${payload.roomId}`);\n socket.emit(\"joinResponse\",`joined room ${payload.roomId}`);\n } else {\n socket.emit(\"joinResponse\",\"failed\");\n }\n }).catch( () => socket.emit(\"joinResponse\",\"failed\") );\n });\n });\n\n /////////////////////////////////////////////////////////////////////////////\n // remove client from a room\n // requires:\n // payload.roomId : the room to leave\n // emits: nothing\n /////////////////////////////////////////////////////////////////////////////\n socket.on(\"leave\", function(payload) {\n socket.leave(`room ${payload.roomId}`);\n });\n\n\n /////////////////////////////////////////////////////////////////////////////\n // check whether client is logged in - this should only be fired\n // AFTER a successful reconnection\n // emits:\n // \"loggedInResponse\" either \"logged in\" or \"not logged in\"\n /////////////////////////////////////////////////////////////////////////////\n socket.on(\"loggedInReconnectEvent\",function(payload) {\n verifyAuthCookie(socket,\n () => socket.emit(\"loggedInReconnectEventResponse\",\"logged in\"),\n () => socket.emit(\"loggedInReconnectEventResponse\",\"not logged in\")\n );\n });\n\n /////////////////////////////////////////////////////////////////////////////\n // user requests a lock on furniture item (no authorization here, for speed,\n // but note that furniture ID is a uuid hence effectively impossible to guess,\n // and even if guessed, all you obtain is a lock, not creation, deletion or update).\n // payload:\n // payload.furnishingId: the ID (uuid) of furnishing to lock\n // emits to socket:\n // \"lockResponse\" of either \"approved\" or \"denied\"\n /////////////////////////////////////////////////////////////////////////////\n socket.on(\"lockRequest\", function(payload) {\n verifyAuthCookie(socket, (userId,username) => {\n if(username === \"dummy\") {\n socket.emit(\"lockResponse\",\"approved\");\n } else {\n redis.get(payload.furnishingId)\n .then( result => {\n if(!result) {\n redis.set(payload.furnishingId, userId, 'PX', 2500);\n socket.emit(\"lockResponse\",\"approved\");\n } else {\n socket.emit(\"lockResponse\",\"denied\");\n }\n }).catch( () => socket.emit(\"lockResponse\",\"denied\") );\n }\n }, () => {\n socket.emit(\"lockResponse\",\"denied\");\n });\n });\n\n /////////////////////////////////////////////////////////////////////////////\n // notify every client to push the room to the undo stack\n // emits to room:\n // \"pushRoomToUndoStack\" passing on the payload\n /////////////////////////////////////////////////////////////////////////////\n socket.on(\"pushRoomToUndoStack\",function(payload) {\n verifyAuthCookie(socket, userId => {\n let rooms = Object.keys(socket.rooms);\n let roomStr = rooms.find( room => room.match(/room \\d+/))\n if(roomStr) {\n let roomId = parseInt(roomStr.split(\" \")[1])\n socket.to(`room ${roomId}`).emit(\"pushRoomToUndoStack\",payload);\n }\n });\n });\n\n /////////////////////////////////////////////////////////////////////////////\n // notify every client to push the room to the redo stack\n // emits to room:\n // \"pushRoomToRedoStack\" passing on the payload\n /////////////////////////////////////////////////////////////////////////////\n socket.on(\"pushRoomToRedoStack\",function(payload) {\n verifyAuthCookie(socket, userId => {\n let rooms = Object.keys(socket.rooms);\n let roomStr = rooms.find( room => room.match(/room \\d+/))\n if(roomStr) {\n let roomId = parseInt(roomStr.split(\" \")[1])\n socket.to(`room ${roomId}`).emit(\"pushRoomToRedoStack\",payload);\n }\n });\n });\n\n /////////////////////////////////////////////////////////////////////////////\n // notify every client to undo and persist payload to the room in DB\n // payload:\n // payload.room: the new room in object representation to persist to DB\n // emits to room:\n // \"undo\" passing on the payload\n /////////////////////////////////////////////////////////////////////////////\n socket.on(\"undo\",function(payload) {\n verifyAuthCookie(socket, userId => {\n let rooms = Object.keys(socket.rooms);\n let roomStr = rooms.find( room => room.match(/room \\d+/))\n if(roomStr) {\n let roomId = parseInt(roomStr.split(\" \")[1]);\n Furnishing.Furnishing.findAll({\n where: { roomId: roomId }\n }).then( furnishings => {\n let furnishingIds = furnishings.map(furnishing => furnishing.id);\n redis.mget(furnishingIds)\n .then( result => {\n if(!result.find( val => !!val ) ) {\n persistRoom(roomId,payload.room);\n socket.to(`room ${roomId}`).emit(\"undo\",payload);\n socket.emit(\"undo\",payload);\n }\n }).catch( () => { } );\n }).catch( () => {} );\n }\n });\n });\n\n /////////////////////////////////////////////////////////////////////////////\n // notify every client to redo and persist payload to the room in DB\n // payload:\n // payload.room: the new room in object representation to persist to DB\n // emits to room:\n // \"redo\" passing on the payload\n /////////////////////////////////////////////////////////////////////////////\n socket.on(\"redo\",function(payload) {\n verifyAuthCookie(socket, userId => {\n let rooms = Object.keys(socket.rooms);\n let roomStr = rooms.find( room => room.match(/room \\d+/))\n if(roomStr) {\n let roomId = parseInt(roomStr.split(\" \")[1]);\n Furnishing.Furnishing.findAll({\n where: { roomId: roomId }\n }).then( furnishings => {\n let furnishingIds = furnishings.map(furnishing => furnishing.id);\n redis.mget(furnishingIds)\n .then( result => {\n if(!result.find( val => !!val ) ) {\n persistRoom(roomId,payload.room);\n socket.to(`room ${roomId}`).emit(\"redo\",payload);\n socket.emit(\"redo\",payload);\n }\n }).catch( () => { } );\n }).catch( () => {} );\n }\n });\n });\n\n\n /////////////////////////////////////////////////////////////////////////////\n // notify every client to clear the undo stack\n // emits to room:\n // \"clearUndoStack\" passing on the payload\n /////////////////////////////////////////////////////////////////////////////\n socket.on(\"clearUndoStack\",function(payload) {\n verifyAuthCookie(socket, userId => {\n let rooms = Object.keys(socket.rooms);\n let roomStr = rooms.find( room => room.match(/room \\d+/))\n if(roomStr) {\n let roomId = parseInt(roomStr.split(\" \")[1])\n socket.to(`room ${roomId}`).emit(\"clearUndoStack\",payload);\n }\n });\n });\n\n /////////////////////////////////////////////////////////////////////////////\n // notify every client to clear the redo stack\n // emits to room:\n // \"clearRedoStack\" passing on the payload\n /////////////////////////////////////////////////////////////////////////////\n socket.on(\"clearRedoStack\",function(payload) {\n verifyAuthCookie(socket, userId => {\n let rooms = Object.keys(socket.rooms);\n let roomStr = rooms.find( room => room.match(/room \\d+/))\n if(roomStr) {\n let roomId = parseInt(roomStr.split(\" \")[1])\n socket.to(`room ${roomId}`).emit(\"clearRedoStack\",payload);\n }\n });\n });\n\n\n /////////////////////////////////////////////////////////////////////////////\n // user moves mouse while locked onto furniture item (does not persist!)\n // emits to room:\n // \"mouseMoved\" event passing the payload along.\n /////////////////////////////////////////////////////////////////////////////\n socket.on(\"mouseMoved\", function(payload) {\n verifyAuthCookie(socket, userId => {\n let rooms = Object.keys(socket.rooms);\n let roomStr = rooms.find( room => room.match(/room \\d+/))\n if(roomStr) {\n let roomId = parseInt(roomStr.split(\" \")[1])\n socket.to(`room ${roomId}`).emit(\"mouseMoved\",payload);\n }\n });\n });\n\n /////////////////////////////////////////////////////////////////////////////\n // user refreshes timestamp on lock\n // emits to socket:\n // \"lockRefreshResponse\" of either \"approved\" or \"denied\"\n /////////////////////////////////////////////////////////////////////////////\n socket.on(\"lockRefresh\", function(payload) {\n verifyAuthCookie(socket, (userId,username) => {\n if(username === \"dummy\") {\n socket.emit(\"lockRefreshResponse\",\"approved\");\n } else {\n redis.get(payload.furnishingId)\n .then( result => {\n if(parseInt(result) === parseInt(userId)) {\n redis.set(payload.furnishingId, userId, 'PX', 2500);\n socket.emit(\"lockRefreshResponse\",\"approved\");\n } else {\n socket.emit(\"lockRefreshResponse\",\"denied\");\n }\n }).catch( () => socket.emit(\"lockRefreshResponse\",\"denied\") );\n }\n });\n });\n\n /////////////////////////////////////////////////////////////////////////////\n // user releases lock on furniture item\n // payload:\n // payload.furnishing : new furnishing properties\n // emits to room:\n // \"update\" passing the payload along\n /////////////////////////////////////////////////////////////////////////////\n socket.on(\"lockRelease\", function(payload) {\n verifyAuthCookie(socket, userId => {\n if(payload && payload.furnishing) {\n redis.del(payload.furnishing.id);\n let rooms = Object.keys(socket.rooms);\n let roomStr = rooms.find( room => room.match(/room \\d+/))\n if(roomStr) {\n let roomId = parseInt(roomStr.split(\" \")[1])\n Furnishing.Furnishing.update({...payload.furnishing, roomId: roomId},\n {where: {id:payload.furnishing.id,roomId:roomId} });\n socket.to(`room ${roomId}`).emit(\"update\",payload);\n }\n }\n });\n });\n\n /////////////////////////////////////////////////////////////////////////////\n // user update color of furniture item -- update the DB and notify other users\n // payload:\n // payload.furnishingId : the ID (uuid) of the furnishing to update\n // payload.colorName : the new color name from the Color table\n // emits to room:\n // \"colorUpdate\" passing the payload along\n /////////////////////////////////////////////////////////////////////////////\n socket.on(\"updateColor\", function(payload) {\n verifyAuthCookie(socket, userId => {\n if(payload && payload.furnishingId && payload.colorName) {\n let rooms = Object.keys(socket.rooms);\n let roomStr = rooms.find( room => room.match(/room \\d+/))\n if(roomStr) {\n let roomId = parseInt(roomStr.split(\" \")[1])\n redis.get(payload.furnishingId)\n .then( result => {\n if(!result) {\n Furnishing.Furnishing.update({colorName:payload.colorName},\n {where:{id:payload.furnishingId, roomId:roomId}} );\n socket.to(`room ${roomId}`).emit(\"colorUpdate\",payload);\n socket.emit(\"colorUpdate\",payload);\n }\n }).catch(() => { } );\n }\n }\n });\n });\n\n /////////////////////////////////////////////////////////////////////////////\n // room is deleted by the owner, signal other clients (does nothing to DB)\n // emits to room:\n // \"roomDeleted\"\n /////////////////////////////////////////////////////////////////////////////\n socket.on(\"roomDeleted\",function() {\n verifyAuthCookie(socket, userId => {\n let rooms = Object.keys(socket.rooms);\n let roomStr = rooms.find( room => room.match(/room \\d+/))\n if(roomStr) {\n let roomId = parseInt(roomStr.split(\" \")[1])\n socket.to(`room ${roomId}`).emit(\"roomDeleted\");\n }\n });\n });\n\n /////////////////////////////////////////////////////////////////////////////\n // return client's available rooms to view\n // emits to socket:\n // \"availableRooms\" an object {availableRooms: rooms}\n /////////////////////////////////////////////////////////////////////////////\n socket.on(\"getAvailableRooms\",function(payload) {\n verifyAuthCookie(socket, userId => {\n User.User.findAll({where:{id:userId}})\n .then( users => {\n if(users.length > 0) {\n var user = users[0];\n user.getRooms().then( rooms => {\n socket.emit(\"availableRooms\",{availableRooms:rooms})\n })\n .catch( () => { } );\n }\n })\n .catch( () => { } );\n });\n });\n\n /////////////////////////////////////////////////////////////////////////////\n // user creates a furniture item -- persist the item to DB and notify other users\n // payload:\n // payload.furnishing an object representation of the new furnishing\n // emits to room:\n // \"create\" passing payload along\n /////////////////////////////////////////////////////////////////////////////\n socket.on(\"createFurnishing\", function(payload) {\n verifyAuthCookie(socket, userId => {\n if(payload && payload.furnishing) {\n let rooms = Object.keys(socket.rooms);\n let roomStr = rooms.find( room => room.match(/room \\d+/))\n if(roomStr) {\n let roomId = parseInt(roomStr.split(\" \")[1])\n Furnishing.Furnishing.create( {...payload.furnishing,roomId:roomId} )\n socket.to(`room ${roomId}`).emit(\"create\",payload);\n }\n }\n });\n });\n\n /////////////////////////////////////////////////////////////////////////////\n // remove client from all rooms\n /////////////////////////////////////////////////////////////////////////////\n socket.on(\"removeFromAllRooms\", function(payload) {\n let rooms = Object.keys(socket.rooms);\n rooms.forEach( room => {\n if(room.match(/room \\d+/)) {\n socket.leave(room);\n }\n });\n });\n\n\n /////////////////////////////////////////////////////////////////////////////\n // user deletes a furniture item -- delete from the database and notify other users\n // payload:\n // payload.furnishingId\n // emits to room:\n // \"delete\" passing along the payload\n /////////////////////////////////////////////////////////////////////////////\n socket.on(\"deleteFurnishing\", function(payload) {\n verifyAuthCookie(socket, userId => {\n if(payload && payload.furnishingId) {\n let rooms = Object.keys(socket.rooms);\n let roomStr = rooms.find( room => room.match(/room \\d+/))\n if(roomStr) {\n let roomId = parseInt(roomStr.split(\" \")[1])\n\n redis.get(payload.furnishingId)\n .then( result => {\n if(!result) {\n Furnishing.Furnishing.findAll( { where: { id: payload.furnishingId, roomId: roomId } } )\n .then( furnishings => {\n if(furnishings.length > 0) {\n let furnishing = furnishings[0];\n furnishing.destroy({force:true})\n }\n }).catch( () => { } )\n socket.to(`room ${roomId}`).emit(\"delete\",payload);\n socket.emit(\"delete\",payload);\n }\n }).catch( () => { } );\n }\n }\n });\n });\n}", "refreshOneRoomAll ({socket, room}) {\n\t\t\tsocket.server.sockets.emit('roomChanged', room);\n\t\t}", "function sendToGame(rooms) {\r\n\tconsole.log(rooms);\r\n\troomState = rooms[0];\r\n\troomCode = rooms[1];\r\n\t\r\n\tupdateStatList(rooms);\r\n\t\r\n\tif (Object.keys(roomState[roomCode][\"players\"]).length == 1) {\r\n\t\tsocket.emit('requestGame', roomCode);\r\n\t}\r\n\telse {\r\n\t\twhile (roomState[roomCode]['test'].length === 0){\r\n\t\t\tconsole.log('Player waiting');\r\n\t\t}\r\n\t\tdisplayGame(roomCode);\r\n\t}\r\n}", "_destroy(socket) {\n const nsps = Object.keys(this.nsps);\n for (const nsp of nsps) {\n const socket = this.nsps[nsp];\n if (socket.active) {\n return;\n }\n }\n this._close();\n }", "removeDisconnectedPlayer(socket) {\n this.randomrooms.forEach((index) => {\n console.log(index[0]);\n console.log(socket.id);\n if (index[0] === socket.id) {\n const i = this.randomrooms.indexOf(index);\n console.log(i);\n this.randomrooms.splice(index, 1);\n }\n });\n Object.keys(this.playrooms).forEach((roomname) => {\n const playerIDs = this.playrooms[roomname];\n if (playerIDs.includes(socket.id)) {\n this.removeRoom(roomname, playerIDs, [\"win\", \"win\"], \"play\");\n }\n });\n Object.keys(this.waitrooms).forEach((roomname) => {\n const playerIDs = this.waitrooms[roomname];\n if (playerIDs.includes(socket.id)) {\n this.removeRoom(roomname, playerIDs, [\"win\", \"win\"], \"wait\");\n }\n });\n }", "sockCloseAll() {\n Object.keys( this._socks ).forEach( id => this.sockClose( id ) );\n }", "function joinRoom(socket, roomName){\n if (getRoomPlayersNumber(roomName) < playersPerRoom){\n socket.join(roomName);\n socket.room = roomName;\n return true;\n }\n return false\n }", "function RoomSocket(io, roomId){\n this.roomId = roomId;\n this.io = io;\n}", "refreshAll (socket) {\n\t\t\tif (this.list.length === 0) {\n\t\t\t\tsocket.server.sockets.emit('refreshLobby', []);\n\t\t\t}\n\t\t\tsocket.server.sockets.emit('refreshLobby', this.list);\n\t\t}", "function join(socket, roomCode, callback) {\n if (socket && socket.join) {\n socket.join(roomCode, callback);\n }\n}", "_destroy(socket) {\n const nsps = Object.keys(this.nsps);\n\n for (const nsp of nsps) {\n const socket = this.nsps[nsp];\n\n if (socket.active) {\n debug(\"socket %s is still active, skipping close\", nsp);\n return;\n }\n }\n\n this._close();\n }", "function makeRoomSocket(name) {\n console.log(`Opening WebSocket server for room ${name}.`);\n\n const wss = new WebSocket.Server({ noServer: true });\n wss.on(\"connection\", (ws, request) => {\n const { userId } = querystring.parse(url.parse(request.url).query);\n\n socketActions.connect(wss, null, { roomName: name, userId });\n\n /* eslint-disable no-param-reassign */\n ws.userId = userId;\n ws.isAlive = true;\n ws.on(\"pong\", () => {\n console.log(`User with id ${userId} ponged room ${name}.`);\n ws.isAlive = true;\n });\n\n ws.on(\"close\", () => {\n console.log(`User with id ${userId} left room ${name}.`);\n socketActions.disconnect(wss, null, { roomName: name, userId });\n });\n\n ws.on(\"message\", (msg) => {\n if (isJSON(msg)) {\n const message = JSON.parse(msg);\n const args = { roomName: name, userId };\n if (message.type && message.type in socketActions) {\n console.log(\n `Sending socket message associated with type \"${message.type}\"`\n );\n socketActions[message.type](wss, message, args);\n } else {\n console.log(`\"${message.type}\" is not a valid socket message type.`);\n }\n } else {\n console.log(`${msg} is not valid JSON.`);\n }\n });\n });\n\n let inactivePings = 0;\n\n wss.interval = setInterval(() => {\n console.log(`Pinging clients of room ${name}...`);\n let hasActive = false;\n wss.clients.forEach((ws) => {\n if (ws.isAlive === false) {\n console.log(`User with id ${ws.userId} dropped from room ${name}.`);\n return ws.terminate();\n }\n hasActive = true;\n ws.isAlive = false;\n return ws.ping(() => {});\n });\n if (hasActive) {\n inactivePings = 0;\n } else {\n console.log(`Room ${name} has no active users.`);\n inactivePings += 1;\n }\n if (inactivePings >= MAX_INACTIVE_PINGS) {\n console.log(`Room ${name} has had no active users for too long.`);\n wss.close();\n }\n }, PING_INTERVAL);\n\n wss.on(\"close\", () => {\n console.log(`Closing WebSocket server and deleting room ${name}.`);\n wss.clients.forEach((ws) => ws.terminate());\n Rooms.deleteRoom(name);\n delete socketServers[name];\n return clearInterval(wss.interval);\n });\n\n return wss;\n}", "function removeRoom(socketId) {\n var room = roomList[socketGameMap[socketId]];\n\n if (typeof room === 'undefined') return;\n\n var players = room.game.getPlayers();\n\n delete roomList[socketGameMap[socketId]];\n\n // force all user in the room to disconnect\n for (var i = 0; i < players.length; i++) {\n var socket = players[i].socket;\n io.to(socket.id).emit('forceDisconnect');\n\n delete socketGameMap[socket.id];\n }\n\n notifyRoomListUpdated()\n }", "function leaveRoom(socket, userId) {\n const roomID = socketToRoom[userId];\n let room = users[roomID];\n if (room) {\n room = room.filter(user => user.id !== userId);\n users[roomID] = room;\n }\n socket.broadcast.emit('user left', userId);\n}", "function bindEvents(socket){\n\tsocket.on(\"sendUserJoinEvent\", function (formInfoObj){\n\t\tsendUserJoinEvent(formInfoObj);\t\t\n\t});\n\n\tsocket.on(\"sendWhiteboardDrawEvent\", function (formInfoObj){\n\t\tsendWhiteboardDrawEvent(formInfoObj);\t\t\n\t});\n\n\tsocket.on(\"sendWhiteboardUpdShapeEvent\", function (formInfoObj){\n\t\tsendWhiteboardUpdShapeEvent(formInfoObj);\t\t\n\t});\n\n\tsocket.on(\"createMeeting\", function (formInfoObj){\n\t\tcreateMeeting(formInfoObj);\t\t\n\t});\n\n\tsocket.on(\"sendJSON\", function (formInfoObj){\n\t\tsendJSON(formInfoObj);\t\t\n\t});\n\n\n}", "_destroy(socket) {\n const nsps = Object.keys(this.nsps);\n for (const nsp of nsps) {\n const socket = this.nsps[nsp];\n if (socket.active) {\n debug(\"socket %s is still active, skipping close\", nsp);\n return;\n }\n }\n this._close();\n }", "_destroy(socket) {\n const nsps = Object.keys(this.nsps);\n for (const nsp of nsps) {\n const socket = this.nsps[nsp];\n if (socket.active) {\n debug(\"socket %s is still active, skipping close\", nsp);\n return;\n }\n }\n this._close();\n }", "function onSocketClose() {\n self.resetAll(errors.SocketClosedError({\n reason: 'remote closed',\n socketRemoteAddr: self.socketRemoteAddr,\n direction: self.direction,\n remoteName: self.remoteName\n }));\n\n if (self.ephemeral) {\n var peer = self.channel.peers.get(self.socketRemoteAddr);\n if (peer) {\n peer.close(noop);\n }\n self.channel.peers.delete(self.socketRemoteAddr);\n }\n }", "function runGame() {\n // updates the word in the database\n // fires the 'load word' event to update the current word for all sockets\n async function loadWord(code, letter, position) {\n try {\n response = await db.addLetter(code, letter, position);\n io.to(code).emit(\"load word\", response);\n } catch (error) {\n console.error(\"Could not update word\" + error);\n }\n }\n\n io.on(\"connection\", function onConnect(socket) {\n /* __________GENERAL GAME SETUP LISTENERS___________ */\n\n // listener for when client joins a room\n socket.on(\"join room\", async function joinRoom(code) {\n socket.join(code);\n try {\n // update socketId in database\n await db.editSocketId(code, cookies.getSession(socket), socket.id);\n\n // get the game info\n const {\n state,\n player_info,\n current_word,\n turn_index,\n } = await db.getGameByCode(code);\n\n // if game has started, update the word\n if (state == 1) {\n socket.emit(\"load word\", current_word);\n if (helpers.isCurrentTurn(socket, player_info, turn_index)) {\n socket.emit(\"start turn\");\n }\n }\n\n // gets all player names and emit the list\n const names = await helpers.getPlayerNames(player_info);\n io.to(code).emit(\"load player list\", names.sort());\n\n // Get session ID\n let SID = cookies.getSession(socket);\n\n // Get username of player sending the message\n const userName = player_info[SID]['name'];\n\n // Emits welcome message in the chat\n socket.emit('message', {user: \"admin\", text: `${userName}, welcome to the room ${code}.`});\n\n } catch (error) {\n console.error(\"Could not get player names. \" + error);\n }\n });\n\n // Listener for game start\n // emits the 'start game event' to everyone in the room\n socket.on('start game', async (code) => {\n try {\n await db.startGame(code);\n \n const { player_info } = await db.getGameByCode(code);\n const nextSID = await helpers.getNextPlayer(code, player_info);\n \n const socketId = player_info[nextSID].socketId;\n \n io.to(code).emit('start game');\n io.to(socketId).emit('start turn');\n } catch (error) {\n console.log(`Error starting game. ${error}`);\n }\n })\n\n // Listener for when a player makes a move\n // Emits to next player the \"start turn\" event\n socket.on(\"finish turn\", async function (code, letter, position) {\n try {\n // get session ID of next player\n const { player_info } = await db.getGameByCode(code);\n const nextSID = await helpers.getNextPlayer(code, player_info);\n\n // console.log(nextSID);\n // get the socketId of the next player\n const socketId = player_info[nextSID].socketId;\n\n loadWord(code, letter, position);\n io.to(socketId).emit(\"start turn\");\n } catch (error) {\n console.log(\"Could not complete player turn. \" + error);\n }\n });\n\n /* _______CHAT LISTENERS____________ */\n\n // for when we implement chats\n\n\n socket.on('sendMessage', async ({code, message}) => {\n // Get session ID\n let SID = cookies.getSession(socket);\n\n // Get username of player sending the message\n const data = await db.getGameByCode(code);\n console.log(code);\n let userName = data['player_info'][SID]['name'];\n io.to(code).emit('message', {user: userName, text: message});\n\n //code that was present before chat was implemented \n //socket.on(\"chat message\", (code, msg) => {\n // io.to(code).emit(\"chat message\", msg);\n\n });\n\n // TODO\n\n /* _______CHALLENGE LISTENERS____________*/\n\n // Listener for challenger choosing \"isWord\" challenge\n socket.on(\"challenge\", async function (code, type) {\n // emits to everyone but the sender\n const { player_info, turn_index } = await db.getGameByCode(code);\n const challenger = cookies.getSession(socket);\n const challenged = helpers.getPreviousPlayer(player_info, turn_index);\n socket.to(code).emit(\"challenge pending\", challenger, challenged, type);\n });\n\n // gets whether was challenge was successful\n socket.on(\"challenge complete\", (code, successful) => {\n // TODO\n /* Frontend handles whether or not the word was a phony or not, and after some delay,\n backend emits to everyone whether the challenge was successful or not \n Then edits score and starts a new round by emitting \"new round\" to everyone */\n if (successful) {\n // TODO: add point to previous player\n } else {\n // TODO: add point to sender\n }\n\n io.to(code).emit(\"challenge complete\", successful);\n setTimeout(() => {\n loadWord(code, \"\");\n }, 3000);\n });\n\n // LEGACY LISTENERS __________________\n\n // when a client adds a letter, update it for everyone\n socket.on(\"letter before\", (word, code) => {\n loadWord(code, word);\n });\n\n socket.on(\"letter after\", (word, code) => {\n loadWord(code, word);\n });\n\n // reset the word\n socket.on(\"reset word\", async (code) => {\n await db.resetWord(code);\n io.to(code).emit(\"load word\", \"\");\n });\n\n // check word\n socket.on(\"check word\", (code, success) => {\n io.to(code).emit(\"word checked\", success);\n });\n });\n}", "function disconnect(socket) {\n socket.on('disconnect', function() {\n console.log('A player disconnected');\n\n // increment turn\n current_turn = (current_turn + 1) % players.length;\n players[current_turn].emit('your_turn');\n Socketio.emit('turnChange', {turn: current_turn}); // emit to all clients\n\n // remove player socket from server\n players.splice(players.indexOf(socket), 1);\n next_turn(socket);\n });\n}", "function playGameMulti(socket) {\n if (isGameOver) return;\n if (!ready) {\n socket.emit('player-ready');\n ready = true;\n playerReady(playerNum);\n }\n if (enemyReady) {\n if (currentPlayer === 'user') {\n turnDisplay.innerHTML = 'Te Köröd';\n }\n if (currentPlayer === 'enemy') {\n turnDisplay.innerHTML = 'Ellenfél Köre';\n }\n }\n }", "function newRoom() {\n socket.emit(\"newRoom\");\n}", "function unicastRoomList(socket, rooms) {\n if (rooms.length > 0) {\n socket.emit('update-room-list', rooms);\n }\n}", "onDisconnected(){\n const message = 'Game ended with disconnected';\n socket.emit('gameEnded', {\n room: this.getRoomId(),\n message: message,\n });\n }", "events() {\n const game = this.game;\n const player = this.player;\n const enemy = this.enemy;\n const rumble = this.game.rumble;\n const bell = this.game.bell;\n const scope = this;\n\n socket.on('play_rumble', function() {\n rumble.play();\n });\n\n socket.on('start_game', function() {\n bell.play();\n player.canMove = true;\n });\n\n socket.on('round_end', function() {\n bell.play();\n player.canMove = false;\n });\n\n socket.on('round_start', function() {\n bell.play();\n player.canMove = true;\n });\n\n socket.on('game_over', function(data) {\n player.canMove = false;\n });\n\n socket.on('enemy_punch', function() {\n console.log('enemy_punch received');\n enemy.punch();\n });\n\n socket.on('enemy_kick', function() {\n console.log('enemy_kick received');\n enemy.kick();\n });\n\n socket.on('el', function(data) {\n enemy.setPosition(850 - (data + (enemy.enemy.width / 2)));\n });\n\n socket.on('punch_done', function(data) {\n console.info('punch animation done');\n });\n\n socket.on('blocked_head', function(data) {\n console.info('blocked head');\n game.blockSound.play();\n });\n\n socket.on('hit_head', function(data) {\n console.info('enemy hit');\n game.hitSound.play();\n });\n\n socket.on('hitted_head', function(data) {\n console.info('Got hit');\n game.hitSound.play();\n player.takeDamage();\n console.info(data);\n player.setHeadDamage(JSON.parse(data).head_damage);\n });\n\n socket.on('hit_leg', function() {\n console.info('Hitted enemies leg');\n game.hitSound.play();\n enemy.takeDamageLegs();\n });\n\n socket.on('hitted_leg', function() {\n console.info('Your leg got hit');\n game.hitSound.play();\n player.takeDamage();\n player.takeDamageLegs();\n });\n\n socket.on('game_update', function(data) {\n if (player.canMove) {\n const json = JSON.parse(data);\n scope.round = json.round;\n scope.timeLeft = json.tl;\n scope.updateGameText();\n }\n });\n\n socket.on('set_text', function(data) {\n console.log('Update text to ' + data);\n scope.game.text.text = data;\n });\n\n socket.on('set_loc', function(data) {\n const json = JSON.parse(data);\n player.getSprite().x = json.p; // data.p == player location\n enemy.getSprite().x = json.e; // data.e == enemy location\n });\n }", "_destroy(socket) {\n const nsps = Object.keys(this.nsps);\n for (const nsp of nsps) {\n const socket = this.nsps[nsp];\n if (socket.active) {\n debug(\"socket %s is still active, skipping close\", nsp);\n return;\n }\n }\n this._close();\n }", "_runSocketServer() {\n const socketServer = new ws.Server({ port: SOCKET_SERVER_PORT });\n\n socketServer.on('connection', socket => {\n this._connectedSockets = [...this._connectedSockets, socket];\n\n socket.send(JSON.stringify(this._getProjectContent()));\n\n socket.on('close', () => {\n this._connectedSockets = this._connectedSockets.filter(\n _socket => _socket !== socket\n );\n });\n });\n }", "quitegame(myId, roomId) {\n this.socket.emit(\"quitegame\", myId, roomId);\n }", "listen (server) {\n // create socket server\n chat = io(server);\n\n chat.on('connection', (socket) => {\n guestNumber = this.assignGuestName(\n socket, guestNumber, nickNames, namesUsed\n );\n this.joinRoom(socket, 'lobby');\n this.handleMessageBroadcast(socket, nickNames);\n this.handleNameChangeAttempts(socket, nickNames, namesUsed);\n this.handleRoomJoining(socket);\n socket.on('rooms', () => {\n let rooms = [];\n \tfor (let s in chat.sockets.sockets) {\n \t rooms = rooms.concat(this.listRooms(chat.sockets.sockets[s]));\n \t}\n rooms = Array.from(new Set(rooms));\n socket.emit('rooms', rooms);\n });\n\n this.handleClientDisconnection(socket);\n });\n }", "function leaveRoom()\n {\n // Leave room\n $(this).removeClass(\"joined\");\n socket.send(JSON.stringify({\n \"command\": \"leave\", // determines which handler will be used (see chat/routing.py)\n \"room\": room_id\n }));\n }", "shutdown () {\r\n for (let ix = 0; ix < this._sockets.length; ix++) {\r\n this.close(this._sockets[ix]);\r\n }\r\n this._sockets.length = 0;\r\n }", "pollForGameNumber(socket) {\n socket.emit('poll for game number')\n }", "removePlayer(sock) {\n const socket = sock;\n\n let which;\n\n if (this.players.p1 === socket) {\n which = 'p1';\n } else if (this.players.p2 === socket) {\n which = 'p2';\n }\n\n if (which !== undefined) {\n this.players[which] = undefined;\n\n socket.leave(this.hash);\n socket.join('lobby');\n socket.player.curRoom = undefined;\n }\n\n if (this.state === 'preparing' || this.state === 'inGame') {\n this.state = 'userLeftGame';\n }\n }", "function playGameMulti(socket) {\n if (isGameOver) return\n if (!ready) {\n socket.emit('player-ready')\n ready = true\n playerReady(playerNum)\n }\n\n if (enemyReady) {\n if (currentPlayer === 'user') {\n turnDisplay.innerHTML = 'Your Go'\n }\n if (currentPlayer === 'enemy') {\n turnDisplay.innerHTML = \"Enemy's Go\"\n }\n }\n }", "function joinRoom(socket, room) {\n //Each socket is related to each individual user\n //join user into a room\n\n socket.join(room);\n currentRoom[socket.id] = room;\n //Tell the users they are joined into a specific room\n socket.emit('joinResult', {room: room});\n\n //Tell to averyone in a room that a new user has joined\n socket.broadcast.to(room).emit('message', {\n text: nickNames[socket.id] + ' has joined ' + room + '.'\n });\n\n //Get all of other users in a room\n //var usersInRoom = io.sockets.clients(room); //does not work anymore\n var usersInRoom = io.sockets.adapter.rooms[room];\n\n if(usersInRoom.length > 1) { //If there was somebody\n //Summarizer which users are in the room\n var usersInRoomSummary = \"Users currently in \" + room + \": \";\n //Loop through all users in a room\n for (var userId in usersInRoom.sockets) {\n //To everyone else but the proper user, summarize them\n if (userId != socket.id ) {\n usersInRoomSummary += nickNames[userId] + \" \";\n }\n }\n\n //finish the summarization\n usersInRoomSummary += '.';\n //Tell to everyone who are joined to a room\n socket.emit('message', {text:usersInRoomSummary});\n }\n}", "onGameEnd(callback){\n this.socket.on('gameEnded', function(data){\n callback(data);\n });\n }", "function updateChatRoom(socket, message) {\n // socket.broadcast.to(socket.room).emit('updateChat', 'SERVER', socket.username + ' has ' + message);\n}", "function updateSockets() {\n\t\tfor(var id in context.sockets) {\n\t\t\tupdateSocket(context.sockets[id]);\n\t\t}\n\t}", "addPlayer(sock) {\n const socket = sock;\n\n // prevent adding the player twice\n if (socket.player.curRoom === this.hash) {\n return;\n }\n\n if (this.players.p1 === undefined) {\n this.players.p1 = socket;\n } else if (this.players.p2 === undefined) {\n this.players.p2 = socket;\n }\n\n socket.leave('lobby');\n socket.join(this.hash);\n socket.player.curRoom = this.hash;\n socket.player.reset();\n\n if (this.players.p1 !== undefined && this.players.p2 !== undefined) {\n this.state = 'preparing';\n this.setupTimer = 0;\n\n this.players.p1.emit('matchPreparing', new Message('matchPreparing', {\n maxTime: this.maxSetupTimer,\n p1: this.players.p1.player,\n p2: this.players.p2.player,\n }));\n\n this.players.p2.emit('matchPreparing', new Message('matchPreparing', {\n maxTime: this.maxSetupTimer,\n p1: this.players.p1.player,\n p2: this.players.p2.player,\n }));\n } else {\n socket.emit('matchWaiting', new Message('waitStart', new Date().getTime()));\n }\n }", "close() {\n console.log(\"disconnecting\");\n this._distributeMessage('remove', '');\n clearInterval(this._swarmUpdater);\n this._server.close();\n Object.keys(this._connections).forEach(function(key) {\n this._connections[key].socket.end();\n }, this);\n }", "removePlayer(socket, id) {\n const room = this.findById(id)\n if (!room) {\n return socket.emit(\n 'err',\n 'Could not leave requested room because it doesn not exist'\n )\n }\n const isEmpty = room.removePlayer(socket)\n\n if (isEmpty) {\n this.removeRoom(room.id)\n }\n }", "onClose() {\n this._closeSocket(constants_1.ERRORS.SocketClosed);\n }", "function onConnect(socket) {\n\tconst connectBy = socket.handshake.headers.host\n\n\tconst clientId = socket.id\n\tplayers[clientId] = {socket: socket}\n\n\tconsole.log('Player', clientId, 'connected from', connectBy)\n\tsocket.on('disconnect', () => {\n\t\tconsole.log('Client', clientId, 'has been disconnected from', connectBy)\n\t\tif(players[clientId].room) {\n\t\t\trmPlayerFromRoom(players[clientId].room, clientId)\n\t\t}\n\t\tdelete players[clientId]\n\t})\n\n\t/**\n\t * room: str\n\t * type: str\n\t */\n\tsocket.on('create', (params, response) => {\n\t\tif(!params.room.match(ROOM_CODE_REGEXP)) {\n\t\t\tresponse({status: 'ko', err: 'Invalid room Id (\\'' + params.room + '\\' does not respect '+ ROOM_CODE_FORMAT + ')'})\n\t\t} else if(params.room in rooms) {\n\t\t\tresponse({status: 'ko', err: 'Room \\'' + params.room + '\\' already exists'})\n\t\t} else if(!(params.type in config.httpFolders)) {\n\t\t\tresponse({status: 'ko', err: 'Type of room \\'' + params.type + '\\' does not exist'})\n\t\t} else {\n\t\t\trooms[params.room] = {activity: params.type, host: null, roles:{all: []}}\n\t\t\tresponse({status: 'ok'})\n\t\t}\n\t})\n\n\t/**\n\t * room: str\n\t */\n\tsocket.on('join', (params, response) => {\n\t\tif(!(params.room in rooms)) {\n\t\t\tresponse({status: 'ko', err: 'Room \\'' + params.room + '\\' does not exists'})\n\t\t} else if(players[clientId].room) {\n\t\t\tresponse({status: 'ko', err: 'Already joined the room'})\n\t\t} else {\n\t\t\taddPlayerRoles(params.room, clientId, ['all'])\n\t\t\tio.to(params.room + '/all').emit('connected', clientId, {player: clientId, room: getRoomDescription(params.room)})\n\t\t\tresponse({status: 'ok'})\n\t\t}\n\t})\n\n\t/**\n\t * no parameters\n\t */\n\tsocket.on('leave', (params, response) => {\n\t\tif(!players[clientId].room) {\n\t\t\tresponse({status: 'ko', err: 'You are not a member of any room'})\n\t\t} else {\n\t\t\trmPlayerFromRoom(players[clientId].room, clientId)\n\t\t\tresponse({status: 'ok'})\n\t\t}\n\t})\n\n\t/**\n\t * player: str\n\t * roles: [role1, role2, ...]\n\t */\n\tsocket.on('addRoles', (params, response) => {\n\t\tconst roomId = players[clientId].room\n\t\tif(!roomId) {\n\t\t\tresponse({status: 'ko', err: 'You are not a member of any room'})\n\t\t} else if(rooms[roomId].host !== clientId) {\n\t\t\tresponse.status(401).send({err: 'Admin role required'})\n\t\t} else if(!(params.player in players) || players[params.player].room !== roomId) {\n\t\t\tresponse({status: 'ko', err: 'Player \\'' + params.player + '\\' is not in room \\'' + roomId + '\\''})\n\t\t} else {\n\t\t\taddPlayerRoles(roomId, params.player, params.roles)\n\t\t\tio.to(roomId + '/all').emit('connected', clientId, {player: params.player, room: getRoomDescription(roomId)})\n\t\t\tresponse({status: 'ok'})\n\t\t}\n\t})\n\n\t/**\n\t * player: str\n\t * roles: [role1, role2, ...]\n\t */\n\tsocket.on('rmRoles', (params, response) => {\n\t\tconst roomId = players[clientId].room\n\t\tif(!roomId) {\n\t\t\tresponse({status: 'ko', err: 'You are not a member of any room'})\n\t\t} else if(rooms[roomId].host !== clientId) {\n\t\t\tresponse.status(401).send({err: 'Admin role required'})\n\t\t} else if(!(params.player in players) || players[params.player].room !== roomId) {\n\t\t\tresponse({status: 'ko', err: 'Player \\'' + params.player + '\\' is not in room \\'' + roomId + '\\''})\n\t\t} else if('host' in params.roles || 'all' in params.roles) {\n\t\t\tresponse({status: 'ko', err: 'Cannot remove host and all rôles'})\n\t\t} else {\n\t\t\trmPlayerRoles(roomId, params.player, params.roles)\n\t\t\tio.to(roomId + '/all').emit('connected', clientId, {player: params.player, room: getRoomDescription(roomId)})\n\t\t\tresponse({status: 'ok'})\n\t\t}\n\t})\n\n\t/**\n\t * to: str (playerId)\n\t * cmd: str (command code)\n\t * content: <any>\n\t *\n\t * Will send to specified user, command id \"private/<cmd>\" with given content\n\t */\n\tsocket.on('tell', (params, response) => {\n\t\tconst roomId = players[clientId].room\n\t\tif(!roomId) {\n\t\t\tresponse({status: 'ko', err: 'You are not a member of any room'})\n\t\t} else if(!(params.to in players) || players[params.to].room !== roomId) {\n\t\t\tresponse({status: 'ko', err: 'Cannot find player \\'' + params.to + '\\' in room \\'' + roomId + '\\''})\n\t\t} else {\n\t\t\tplayers[params.to].socket.emit('private/' + params.cmd, clientId, params.content)\n\t\t\tresponse({status: 'ok'})\n\t\t}\n\t})\n\n\t/**\n\t * to: str (role)\n\t * cmd: str (command code)\n\t * content: <any>\n\t *\n\t * Will send to all users having the 'to' role in the room, command id \"<to>/<cmd>\" with given content\n\t */\n\tsocket.on('comm', (params, response) => {\n\t\tconst roomId = players[clientId].room\n\t\tif(!roomId) {\n\t\t\tresponse({status: 'ko', err: 'You are not a member of any room'})\n\t\t} else if(!(params.to === 'host' || params.to === 'all' || params.to in rooms[roomId].roles)) {\n\t\t\tresponse({status: 'ko', err: 'Role \\'' + params.to + '\\' does not exists'})\n\t\t} else {\n\t\t\tio.to(roomId + '/' + params.to).emit(params.to + '/' + params.cmd, clientId, params.content)\n\t\t\tresponse({status: 'ok'})\n\t\t}\n\t})\n\n\t/**\n\t * room: str\n\t *\n\t * Get information about a room\n\t */\n\tsocket.on('info', (params, response) => {\n\t\tif(!params.room || !ROOM_CODE_REGEXP.test(params.room)) {\n\t\t\tresponse({status: 'ko', err: 'Wrong room id \\'' + params.room + '\\''})\n\t\t} else if(params.room in rooms) {\n\t\t\tresponse({status: 'ok', room: getRoomDescription(params.room)})\n\t\t} else {\n\t\t\tresponse({status: 'ok', room: null})\n\t\t}\n\t})\n}", "listen() {\n let others = this._context._services.get(this.name, this.type).filter(entry => {\n return entry.address == this.address;\n });\n if (others.length) {\n for (let node of others) {\n this.socket.connect(node.address);\n }\n }\n this.socket.bind(this.node.host + ':' + this.port);\n }", "afterDisconnect(session, socket, done) {\n sails.log('Socket discnnected for socket id ', socket.id);\n\n // let userOnRooms = [];\n //\n // // Delete the user from room\n // for (const r in sails.rooms) {\n // userOnRooms[r][socket.id] = sails.rooms[r][socket.id];\n // delete sails.rooms[r][socket.id];\n // }\n //\n // // Tell all rooms the user is disconnected\n // for (const room in userOnRooms) {\n // sails.sockets.broadcast(room, 'unknown_disconnected', { userOnRooms: userOnRooms[room], rooms: sails.rooms });\n // }\n //\n // // Empty the temp\n // userOnRooms = [];\n\n\n // By default: do nothing.\n // (but always trigger the callback)\n return done();\n }", "lobbyRefresh(socket) {\n sqlQueries.getGames(function (GameList) {\n console.log('Refreshed lobby.');\n\n playerNames = [];\n\n // Gets all player names\n Object.keys(socket.server.sockets.sockets).forEach(function(socketid) {\n const clientsocket = socket.server.sockets.connected[socketid];\n\n if (clientsocket.user.username !== null) {\n playerNames.push(clientsocket.user.username);\n }\n });\n\n socket.server.emit('lobbyRefresh', {games: GameList, onlinePlayers: playerNames});\n });\n }", "function doDisconnect(room) {\n room.participants.forEach(remoteParticipant => {\n remoteParticipant.disconnect()\n })\n room.disconnect()\n}", "function leaveGame() {\n var gameID = currentGame.id;\n currentGame = undefined;\n socket.emit('boardleave', {\n gameID: gameID,\n boardID: boardID\n });\n openHomeScreen($(\"#gameLobbyScreen\"));\n}", "function nextGameDaemonProcedure(socket, tournament){\n\n // Try to get the next game\n var nextGame = tournament.getNextGame(),\n roomName = getRoom(tournament);\n\n // If the tournament is not finished and there is a next game\n if(!tournament.finished()){\n\n if(nextGame){\n\n // Start the game\n nextGame.start();\n\n // Register new game\n tournament.ongoingGames[nextGame.id] = nextGame;\n\n nextGame.player_1.socket.emit('ready', {\n game_id: nextGame.id,\n player_turn_id: gameConstants.PLAYER_1_TURN_ID,\n board: nextGame.board,\n movementNumber: nextGame.movementNumber\n });\n\n // Log that match started\n console.log(\n \"New match started: \" + \n nextGame.id + \" (\" + nextGame.player_1.user_name + \" vs \" +\n nextGame.player_2.user_name + \")\"\n );\n\n // Emit \n\n // Emit that users list changed\n socket.emit(\n 'player_list_changed',\n gameLists.getUnsocketedPlayerList(tournament.playerTable));\n\n // Emit that game list changed\n socket.emit(\n 'game_list_changed',\n gameLists.getUnsocketedPlayerGameList(tournament.ongoingGames));\n\n }\n }\n else{\n\n console.log(\"\");\n console.log(\"ATTENTION!! Tournament \" + tournament.id + \" has finished\");\n console.log(\"\");\n\n // Tournament is done\n tournament.finish();\n\n // Clear interval\n clearInterval(tournament.daemonIntervalID);\n\n // Tournament finished signal\n socket.broadcast.to(roomName).emit(\n 'tournament_status_changed', {\n status: tournamentConstants.STATUS.finished\n }\n );\n\n socket.emit(\n 'tournament_status_changed', {\n status: tournamentConstants.STATUS.finished\n }\n );\n }\n}", "static onGestureSelect(socket, gestureID) {\n Object.keys(socket.rooms).forEach(room => {\n if (rooms.isRoomExists(room)) {\n if (rooms.getRoomPlayersCount(room) > 1) {\n rooms.getRoom(room).setPlayerAction(socket.id, gestureID);\n\n let readyPlayers = 0;\n\n rooms.getRoom(room).getPlayers().forEach(player => {\n if (player.action) {\n readyPlayers++;\n }\n })\n\n if (readyPlayers === 2) {\n io.to(room).emit('playersReady');\n\n setTimeout(() => {\n this.processGameResult(room);\n io.to(room).emit('updatePlayers', rooms.getRoom(room).getPlayers());\n io.to(room).emit('gameFinished', rooms.getRoom(room).getWinner());\n }, 3000);\n }\n\n io.to(room).emit('updatePlayers', rooms.getRoom(room).getPlayers());\n }\n }\n })\n }" ]
[ "0.67095983", "0.65666056", "0.6465502", "0.63598245", "0.63392496", "0.6291714", "0.6026626", "0.60133773", "0.59561044", "0.5952015", "0.5904428", "0.59020364", "0.58681196", "0.583592", "0.5810024", "0.5774309", "0.57681537", "0.57665354", "0.57302386", "0.57266414", "0.57229203", "0.5718764", "0.56814593", "0.56564635", "0.5653408", "0.5638498", "0.5633904", "0.56229717", "0.56229717", "0.5598283", "0.5594014", "0.55924094", "0.55889463", "0.55889463", "0.55889463", "0.5563363", "0.55425197", "0.55399", "0.55328584", "0.5531914", "0.55259484", "0.5520365", "0.5516699", "0.55099005", "0.55099005", "0.55066025", "0.55044764", "0.5503541", "0.5483724", "0.54743886", "0.54618627", "0.545784", "0.5443655", "0.543284", "0.54235464", "0.5420056", "0.540837", "0.5366407", "0.53571576", "0.5354325", "0.5349289", "0.5348216", "0.5345435", "0.5336933", "0.5334059", "0.5330656", "0.5330656", "0.5319699", "0.5310798", "0.53034437", "0.5299183", "0.5292383", "0.528991", "0.52751535", "0.526142", "0.52585304", "0.5252545", "0.5250421", "0.5248935", "0.5244606", "0.5242527", "0.52297026", "0.5217442", "0.5208082", "0.51977646", "0.5196228", "0.5194592", "0.5181029", "0.5173983", "0.5172023", "0.5168102", "0.5167952", "0.5166686", "0.5165888", "0.51656264", "0.5165534", "0.5161032", "0.515831", "0.5153629", "0.51529753" ]
0.66460216
1
Executes desired actions upon finished disconnect of the given socket.
onDisconnect(socket) { Logger.logInfo('socket ' + socket.id + ' disconnected'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "disconnect() { socket_close(this) }", "function _onDisconnect(socket) {\n}", "function onDisconnect(socket) {\n console.log(\"Disconnection process$$$$$$$\")\n socket.disconnect();\n}", "function onDisconnect(socket) {\n}", "function onDisconnect(socket) {\n}", "function onDisconnect(socket) {\n}", "function onDisconnect(socket) {\n}", "function onDisconnect(socket) {\n\t\n}", "onDisconnect(socket) {\n\n }", "disconnect() {\n\t\tthis.debug('disconnect');\n\t\tif(!this._socket) return;\n\n\t\tif(this._reconnectTimer) {\n\t\t\tclearTimeout(this._reconnectTimer);\n\t\t\tthis._reconnectTimer = null;\n\t\t}\n\t\tif(this.__netstatTimer) {\n\t\t\tclearInterval(this.__netstatTimer);\n\t\t\tthis.__netstatTimer = null;\n\t\t\tthis._measureSpeed();\n\t\t}\n\n\t\tif(this._socket.destroyed) return;\n\n\t\tthis._beforeDisconnect && this._beforeDisconnect();\n\n\t\tthis._socket.removeAllListeners('end');\n\t\tthis._socket.removeAllListeners('close');\n\t\tthis._socket.destroy();\n\t\tthis._connected = false;\n\n\t\tthis.emit('disconnected');\n\t\tthis.status = \"Disconnected\";\n\t}", "function onSocketClose() {\n let data = _data.get(this);\n let error = data.error;\n\n data.error = null;\n data.socket = null;\n data.connected = false;\n\n _data.set(this, data);\n\n setImmediate(this.emit.bind(this, 'disconnected', error));\n}", "function onDisconnect(socket) {\n socket.emit('log', _log('\"'+socket.address+'\" leave echo!'));\n}", "function onSocketDisconnect() {\n console.log('Disconnected from socket server');\n}", "afterDisconnect(session, socket, done) {\n sails.log('Socket discnnected for socket id ', socket.id);\n\n // let userOnRooms = [];\n //\n // // Delete the user from room\n // for (const r in sails.rooms) {\n // userOnRooms[r][socket.id] = sails.rooms[r][socket.id];\n // delete sails.rooms[r][socket.id];\n // }\n //\n // // Tell all rooms the user is disconnected\n // for (const room in userOnRooms) {\n // sails.sockets.broadcast(room, 'unknown_disconnected', { userOnRooms: userOnRooms[room], rooms: sails.rooms });\n // }\n //\n // // Empty the temp\n // userOnRooms = [];\n\n\n // By default: do nothing.\n // (but always trigger the callback)\n return done();\n }", "function onDisconnect(socket) {\n\t\tlogger.info({ type : loggerType, msg : \"Socket Disconnected\"});\n\t\tif(socket.decoded_token) {\n\t\t}\n\t}", "function doDisconnect() {\n\t\tsocket.close();\n\t\tconnected = false;\n\t\t$('.connectionState').text(\"Not connected\");\n\t\t$('.connectionState').removeClass('connected');\n\t}", "handleDisconnect() {\n\t\tdebug(\n\t\t\t'warn: ' + ((this.fromServer)?'server':'client') + \n\t\t\t' connection lost'\n\t\t);\n\t\tthis.emit('disconnect');\n\t\tthis.emit('disconnection');\n\t\tthis.socket = null;\n\t}", "function onSocketClose(message) {\n say(\"Disconnected from the server\");\n }", "function socketDisconnect(socket) {\n $(\"title\").text(\"TS Bot Sync - Disconnected\");\n toggleNotification(true, \"loader\", \"Disconnected, reconnecting...\");\n socket.connect();\n}", "_disconnect(socket, err) {\n\t\terror('Error: ', err);\n\t\tdebug('Authentication failure socket %s', socket.id);\n\n\t\tsocket\n\t\t\t.emit('unauthorized')\n\t\t\t.disconnect();\n\t}", "disconnect() {\n if (!this.stopped) {\n this.socket.disconnect();\n this.stopped = true;\n }\n }", "onDisconnect(fn) {\n\n this.eventEmitter.on(settings.socket.disconnect, (data) => {\n\n fn(data)\n });\n }", "function on_socket_end() {\n if (returned && !this.writable && this.destroyed === false) {\n this.destroy();\n had_error(new Error('Remote end closed socket abruptly.'))\n }\n }", "function receiverOnFinish() {\n this[kWebSocket].emitClose();\n}", "function receiverOnFinish() {\n this[kWebSocket].emitClose();\n}", "function workOnDisconnect(socketDisconnected) {\n socketDisconnected.on(\"disconnect\", function(data) {\n console.log(data);\n let temp = nodes.find(function(obj) {\n return obj.socket.id === socketDisconnected.id;\n });\n console.log(\"disconnecting\", temp.clientId);\n let i = nodes.indexOf(temp);\n nodes.splice(i, 1);\n });\n }", "function receiverOnFinish () {\n this[kWebSocket].emitClose();\n}", "function receiverOnFinish () {\n this[kWebSocket].emitClose();\n}", "disconnect() {\n if (this.proto == 'tcp') {\n this._api.disconnect(this.socketId);\n }\n }", "function receiverOnFinish() {\n this[kWebSocket$1].emitClose();\n}", "close() {\n\t\tthis.debug('disconnect');\n\t\tif(!this._socket) return;\n\t\tthis._beforeDisconnect && this._beforeDisconnect();\n\t\tthis._socket.destroy();\n\t\tthis._connected = false;\n\t\t// 'disconnected' event will be emitted by onClose listener\n\t}", "function onSocketClose() {\n self.resetAll(errors.SocketClosedError({\n reason: 'remote closed',\n socketRemoteAddr: self.socketRemoteAddr,\n direction: self.direction,\n remoteName: self.remoteName\n }));\n\n if (self.ephemeral) {\n var peer = self.channel.peers.get(self.socketRemoteAddr);\n if (peer) {\n peer.close(noop);\n }\n self.channel.peers.delete(self.socketRemoteAddr);\n }\n }", "disconnect ( code, reason ) {\n this.socket.close( code, reason );\n }", "async disconnect () {\n this.connection.end()\n this.socket.end()\n this.server.onDisconnected()\n return this._destroy()\n }", "disconnect(){}", "function on_socket_end() {\n if (!this.writable && this.destroyed === false) {\n this.destroy();\n had_error(new Error('Remote end closed socket abruptly.'))\n }\n }", "socket_disconnect() {\n console.log(\"disconnected\", this._vm.$socket);\n }", "ondisconnect() {\n debug(\"server disconnect (%s)\", this.nsp);\n this.destroy();\n this.onclose(\"io server disconnect\");\n }", "function disconnect() {\n console.log(\"Good Bye!\");\n connection.end(); //// END CONNECTION ////\n}", "ondisconnect() {\n debug(\"server disconnect (%s)\", this.nsp);\n this.destroy();\n this.onclose(\"io server disconnect\");\n }", "ondisconnect() {\n debug(\"server disconnect (%s)\", this.nsp);\n this.destroy();\n this.onclose(\"io server disconnect\");\n }", "function socketOnEnd () {\n const websocket = this[kWebSocket];\n\n websocket.readyState = WebSocket.CLOSING;\n websocket._receiver.end();\n this.end();\n}", "function socketOnEnd () {\n const websocket = this[kWebSocket];\n\n websocket.readyState = WebSocket.CLOSING;\n websocket._receiver.end();\n this.end();\n}", "_handleDisconnect() {\n debug(\"Disconnected from TCP connection to node \" + this._node.id());\n if (this._active) {\n this._connecting = true;\n } else {\n this._connecting = false;\n }\n this.emit(\"disconnect\");\n }", "function socketOnEnd() {\n const websocket = this[kWebSocket];\n\n websocket._readyState = WebSocket.CLOSING;\n websocket._receiver.end();\n this.end();\n}", "function socketOnEnd() {\n const websocket = this[kWebSocket];\n\n websocket._readyState = WebSocket.CLOSING;\n websocket._receiver.end();\n this.end();\n}", "function socketOnClose(event) {\n\tif (this._connecting) {\n\t\tlet message = 'Unknown Error'\n\t\tif (event.code in disconnectReasons) {\n\t\t\tmessage = disconnectReasons[event.code]\n\t\t}\n\t\tthis._connecting.reject({error: message, event})\n\t\tthis._connecting = null\n\t}\n\n\tthis.emit('socket.close')\n}", "function disconnect(socket) {\n socket.on('disconnect', function() {\n console.log('A player disconnected');\n\n // increment turn\n current_turn = (current_turn + 1) % players.length;\n players[current_turn].emit('your_turn');\n Socketio.emit('turnChange', {turn: current_turn}); // emit to all clients\n\n // remove player socket from server\n players.splice(players.indexOf(socket), 1);\n next_turn(socket);\n });\n}", "ondisconnect() {\n debug(\"server disconnect (%s)\", this.nsp);\n this.destroy();\n this.onclose(\"io server disconnect\");\n }", "_onSocketClose(variable, evt) {\n variable._socketConnected = false;\n this.freeSocket(variable);\n // EVENT: ON_CLOSE\n initiateCallback(VARIABLE_CONSTANTS.EVENT.CLOSE, variable, _.get(evt, 'data'), evt);\n }", "onClose() {\n this._closeSocket(constants_1.ERRORS.SocketClosed);\n }", "handleDisconnection() {}", "disconnect() {\n console.log('Disconnecting...');\n\n // Wait a few seconds so potential messages can be sent before socket is closed\n setTimeout(() => {\n this.rtm.disconnect();\n }, 7000);\n }", "static onSocketDisconnect(socket) {\n Object.keys(socket.rooms).forEach(room => {\n try {\n if (rooms.isRoomExists(room)) {\n if (rooms.getRoomPlayersCount(room) === 1) {\n rooms.removeRoom(room);\n } else {\n rooms.getRoom(room).removePlayer(socket.id);\n rooms.getRoom(room).resetPlayersActions();\n rooms.getRoom(room).resetWinner();\n }\n }\n } catch (error) {\n console.log('' + error);\n }\n\n io.to(room).emit('opponentLeave');\n })\n }", "function handleClose(){\n\n console.log('[SOCKET] - CLOSE');\n }", "function disconnecting( connection ) {\n}", "function socketOnEnd() {\n const websocket = this[kWebSocket$1];\n\n websocket._readyState = WebSocket$1.CLOSING;\n websocket._receiver.end();\n this.end();\n}", "function emitClose() {\n socket.emit(\"close\");\n}", "socketClose() {\n console.log('sock close');\n\n GlobalVars.reset();\n this.reset();\n\n this.reconnect();\n }", "function disconnect() {\n if (!socket || !socket.close)\n return void onError(\n new Error('Invalid Disconnect: Cannot close a '\n + 'socket that has never been opened.')\n )\n socket.close()\n return socket\n }", "disconnect() {\n _try(() => this._rawConn && this._rawConn.close());\n }", "function disconnectTunnel(tcp, ws, msg) {\r\n if (ws != null) { try { ws.end(); } catch (e) { debug(2, e); } }\r\n if (tcp != null) { try { tcp.end(); } catch (e) { debug(2, e); } }\r\n debug(1, \"Tunnel disconnected: \" + msg);\r\n}", "_onEnd() {\n if (this._socket && !this._socket.destroyed) {\n this._socket.destroy();\n }\n }", "_onEnd() {\n if (this._socket && !this._socket.destroyed) {\n this._socket.destroy();\n }\n }", "_onEnd() {\n if (this._socket && !this._socket.destroyed) {\n this._socket.destroy();\n }\n }", "_onFinish () {\n if (this.destroyed) return\n\n // Wait a bit before destroying so the socket flushes.\n // TODO: is there a more reliable way to accomplish this?\n const destroySoon = () => {\n setTimeout(() => this.destroy(), 1000)\n }\n\n if (this._connected) {\n destroySoon()\n } else {\n this.once('connect', destroySoon)\n }\n }", "_onFinish () {\n if (this.destroyed) return\n\n // Wait a bit before destroying so the socket flushes.\n // TODO: is there a more reliable way to accomplish this?\n const destroySoon = () => {\n setTimeout(() => this.destroy(), 1000)\n }\n\n if (this._connected) {\n destroySoon()\n } else {\n this.once('connect', destroySoon)\n }\n }", "_onFinish () {\n if (this.destroyed) return\n\n // Wait a bit before destroying so the socket flushes.\n // TODO: is there a more reliable way to accomplish this?\n const destroySoon = () => {\n setTimeout(() => this.destroy(), 1000)\n }\n\n if (this._connected) {\n destroySoon()\n } else {\n this.once('connect', destroySoon)\n }\n }", "_onFinish () {\n if (this.destroyed) return\n\n // Wait a bit before destroying so the socket flushes.\n // TODO: is there a more reliable way to accomplish this?\n const destroySoon = () => {\n setTimeout(() => this.destroy(), 1000)\n }\n\n if (this._connected) {\n destroySoon()\n } else {\n this.once('connect', destroySoon)\n }\n }", "_onFinish () {\n if (this.destroyed) return\n\n // Wait a bit before destroying so the socket flushes.\n // TODO: is there a more reliable way to accomplish this?\n const destroySoon = () => {\n setTimeout(() => this.destroy(), 1000)\n }\n\n if (this.connected) {\n destroySoon()\n } else {\n this.once('connect', destroySoon)\n }\n }", "_onFinish () {\n if (this.destroyed) return\n\n // Wait a bit before destroying so the socket flushes.\n // TODO: is there a more reliable way to accomplish this?\n const destroySoon = () => {\n setTimeout(() => this.destroy(), 1000)\n }\n\n if (this.connected) {\n destroySoon()\n } else {\n this.once('connect', destroySoon)\n }\n }", "disconnect() { }", "disconnect() { }", "disconnect() { }", "function handleDisconnect() {\r\n console.log(\"disconect received\", { socket });\r\n // Find corressponding object in usersArray\r\n const [user, index] = findUserObject(socket);\r\n\r\n // Emit to room\r\n io.to(user.room).emit(\"userLeave\", {\r\n name: user.name,\r\n });\r\n\r\n // Remove user object\r\n removeUserObject(socket);\r\n }", "_onClose(/* hadError */) {\n if (this._parser) {\n this._parser.isClosed = true;\n this._socket.unpipe(this._parser);\n this._parser = false;\n }\n\n if (this._dataStream) {\n this._dataStream.unpipe();\n this._dataStream = null;\n }\n\n this._server.connections.delete(this);\n\n if (this._closed) {\n return;\n }\n\n this._closed = true;\n this._closing = false;\n\n this._server.logger.info(\n {\n tnx: 'close',\n cid: this.id,\n host: this.remoteAddress,\n user: (this.session.user && this.session.user.username) || this.session.user\n },\n 'Connection closed to %s',\n this.clientHostname || this.remoteAddress\n );\n setImmediate(() => this._server.onClose(this.session));\n }", "function onclose () {\n\t onerror('socket closed');\n\t }", "function onclose () {\n\t onerror('socket closed');\n\t }", "function onclose () {\n\t onerror('socket closed');\n\t }", "function onclose () {\n\t onerror('socket closed');\n\t }", "function onclose () {\n\t onerror('socket closed');\n\t }", "async disconnect() {\n this.ready = false\n return new Promise((resolve, reject) => {\n this.socket.addEventListener(\"close\", () => {\n resolve(this)\n })\n this.closeSocket()\n })\n }", "shutdown() {\n\t\tif (this.terminated) return; // already terminated\n\t\tthis.terminated = true;\n\t\tclearTimeout(this.reconnect_timer);\n\t\tthis.disconnect(new Error(`terminated`), true);\n\t}", "_disconnectEvents () {\n this._socket.off('sensorChanged', this._onSensorChanged);\n this._socket.off('deviceWasClosed', this._onDisconnect);\n this._socket.off('disconnect', this._onDisconnect);\n }", "function disconnect(data, socket){\n for(var name in clients) {\n if(clients[name].socket === socket.id) {\n delete clients[name];\n break;\n }\n }\t\n}", "function disconnect(socket) {\n winston.info('Disconnect', socket.id);\n socket.disconnect();\n if (!socket.disconnected && socket.namespace.name)\n socket.manager.namespaces[''].clients().some(function (s) {\n if (s.id === socket.id) {\n s.disconnect();\n return true;\n }\n return false;\n });\n return socket;\n }", "function onDisconnect(socket, io) {\n console.log('socket disconnect', socket.id);\n delete clients[socket.id];\n io.sockets.emit('clients', JSON.stringify(clients));\n}", "function onclose() {\n onerror(\"socket closed\");\n }", "function onclose(){\n\t onerror(\"socket closed\");\n\t }", "function onclose(){\n\t onerror(\"socket closed\");\n\t }", "function onclose(){\n\t onerror(\"socket closed\");\n\t }", "function onclose(){\n\t onerror(\"socket closed\");\n\t }", "function onclose(){\n\t onerror(\"socket closed\");\n\t }", "function onclose(){\n\t onerror(\"socket closed\");\n\t }", "function onclose(){\n\t onerror(\"socket closed\");\n\t }", "function onclose(){\n\t onerror(\"socket closed\");\n\t }", "function closeSocket(pos){\n conns[pos].socket.disconnect(true);\n conns.splice(pos,1);\n connsI.splice(pos, 1);\n console.log('connection has been closed, there are:' + conns.length + ' left');\n update();\n for(var i = 0 ; i < conns.length ; i++){\n console.log(conns[i].ip);\n }\n}", "onDisconnection (fn) {\n this.io.on('disconnection', (objSocket) => {\n fn(objSocket);\n });\n return this;\n }", "function cleanup() {\n if (socket) {\n socket.close(function(err) {\n if (err) {\n log('ERROR: could not close server: ' + err);\n } else {\n log('INFO: server closed');\n }\n });\n }\n\n if (converseTimer) {\n clearInterval(converseTimer);\n }\n\n if (bcastTimer) {\n clearTimeout(bcastTimer);\n }\n}", "function close(socket) {\n // Free the IP\n let n = connectedIPs.findIndex(w => { return w.ip === socket.ip; });\n if (n !== -1) {\n util.log(socket.ip + \" disconnected.\");\n util.remove(connectedIPs, n);\n }\n // Free the token\n if (socket.key != '') { \n keys.push(socket.key);\n util.log(\"Token freed.\");\n } \n // Figure out who the player was\n let player = socket.player,\n index = players.indexOf(player);\n // Remove the player if one was created\n if (index != -1) {\n // Kill the body if it exists\n if (player.body != null) {\n player.body.invuln = false;\n setTimeout(() => {\n player.body.kill();\n }, 10000);\n }\n // Disconnect everything\n util.log('[INFO] User ' + player.name + ' disconnected!');\n util.remove(players, index);\n } else {\n util.log('[INFO] A player disconnected before entering the game.');\n }\n // Free the view\n util.remove(views, views.indexOf(socket.view));\n // Remove the socket\n util.remove(clients, clients.indexOf(socket)); \n util.log('[INFO] Socket closed. Views: ' + views.length + '. Clients: ' + clients.length + '.');\n }" ]
[ "0.74811697", "0.740101", "0.70499253", "0.69528717", "0.69528717", "0.69528717", "0.69528717", "0.6930239", "0.6784795", "0.6738863", "0.6719454", "0.6692035", "0.666585", "0.66150254", "0.64326304", "0.6431526", "0.64082694", "0.6402869", "0.6402145", "0.6392281", "0.6373054", "0.6361065", "0.6351574", "0.6336386", "0.6336386", "0.6328173", "0.63183856", "0.63183856", "0.6277216", "0.6252016", "0.6231747", "0.6221135", "0.6214337", "0.6214021", "0.6212679", "0.62006694", "0.61877084", "0.6152472", "0.61386865", "0.6136514", "0.6136514", "0.6123356", "0.6123356", "0.6111922", "0.6111736", "0.6111736", "0.6108268", "0.6091485", "0.60502213", "0.6049999", "0.6043643", "0.60421443", "0.60377043", "0.60354376", "0.6031016", "0.6012586", "0.6008175", "0.5983245", "0.5947575", "0.5947239", "0.5946279", "0.591331", "0.59082216", "0.59082216", "0.59082216", "0.5901463", "0.5901463", "0.5901463", "0.5901463", "0.5874238", "0.5874238", "0.586973", "0.586973", "0.586973", "0.58624804", "0.5843045", "0.5838258", "0.5838258", "0.5838258", "0.5838258", "0.5838258", "0.58355016", "0.5823954", "0.5820179", "0.57791567", "0.5771673", "0.575468", "0.5748776", "0.5747404", "0.5747404", "0.5747404", "0.5747404", "0.5747404", "0.5747404", "0.5747404", "0.5747404", "0.5742995", "0.573455", "0.5734114", "0.5730604" ]
0.66416764
13
Attempts to disconnect the player from their respective room. If the room no longer has any socket connections, remove it.
playerAttemptLeaveRoom(socket, data) { Logger.logInfo('socket ' + socket.id + ' disconnecting...'); var roomCode = this._getRoomCodeFromSocket(socket); if (this.roomExists(roomCode)) { this.getRoom(roomCode).disconnectPlayer(socket); socket.leave(roomCode, () => { socket.emit('playerLeaveRoomSuccess', {}); }); this.getRoom(roomCode).playerMap.emitCustomToAll('updateLobby', (socket) => { return this.getRoom(roomCode).getLobbyData(socket); }); } else { socket.emit('playerLeaveRoomFailure', { reason: 'Room does not exist' }); return; } if (this.getRoom(roomCode).socketsEmpty()) { this.removeRoom(roomCode); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "destroy() {\n\t\tfor ( const socket of this._socketServer.getSocketsInRoom( this.id ) ) {\n\t\t\tsocket.disconnect();\n\t\t}\n\n\t\tif ( this.player ) {\n\t\t\tthis.player.destroy();\n\t\t}\n\n\t\tif ( this.opponent ) {\n\t\t\tthis.opponent.destroy();\n\t\t}\n\n\t\tthis.stopListening();\n\t}", "disconnect() {\n if (this.room) {\n this.room.leave();\n this.room = null;\n }\n if (this.connection) {\n this.connection.disconnect();\n this.connection = null;\n }\n }", "static onSocketDisconnect(socket) {\n Object.keys(socket.rooms).forEach(room => {\n try {\n if (rooms.isRoomExists(room)) {\n if (rooms.getRoomPlayersCount(room) === 1) {\n rooms.removeRoom(room);\n } else {\n rooms.getRoom(room).removePlayer(socket.id);\n rooms.getRoom(room).resetPlayersActions();\n rooms.getRoom(room).resetWinner();\n }\n }\n } catch (error) {\n console.log('' + error);\n }\n\n io.to(room).emit('opponentLeave');\n })\n }", "onDisconnect(id) {\n // this.sockets_not_used.delete(id);\n this.sockets.delete(id);\n this.players.delete(id);\n }", "function onClientDisconnect () {\n util.log('Player has disconnected: ' + this.id)\n\n var removePlayer = playerById(this.id)\n\n // Player not found\n if (!removePlayer || !removePlayer.PC) {\n console.log('Removing Player not found: ', this.id)\n return\n }\n\n // Room number not found\n if (!roomById(removePlayer.PC.roomid)){\n console.log('Removing Player Room not found: ', removePlayer.PC.roomid);\n return\n }\n\n this.broadcast.to('room'+removePlayer.PC.roomid).emit('message', {message: removePlayer.PC.name + \" goes to sleep.\", styles: [{color: '#ffffff', weight: 'Bold', position: 0}]});\n\n // Remove player from players array\n players.splice(players.indexOf(removePlayer), 1)\n\n // Broadcast removed player to connected socket clients\n //this.broadcast.emit('remove player', {id: this.id})\n}", "removePlayer(socket) {\n const isPlayer = this.players[socket.id] !== undefined\n const isSpectator = this.spectators[socket.id] !== undefined\n const isHost = this.host.data.id === socket.data.id;\n if (isPlayer) { // we might need to swap people in\n delete this.players[socket.id]\n const newPlayer = this.upgradeSpectator()\n // if ingame, then let's see how to modify the player\n if (this.state === ROOM_INGAME) {\n // if we have a player, then let's swap them\n if (newPlayer !== undefined) {\n this.game.swapPlayers(socket, newPlayer)\n } else { // else, just remove and let game use AI\n this.game.removePlayer(socket)\n }\n }\n // if host is leaving, we need to fix that too\n if (isHost) {\n this.upgradeHost();\n }\n } else if (isSpectator) { // don't care about these guys\n delete this.spectators[socket.id]\n }\n socket.leave(this.uniqueName)\n socket.join('lobby')\n delete socket.data.room\n delete socket.data.timeJoinedRoom\n // tell everyone else that room has changed\n socket.to(this.uniqueName).emit('room_player_update', this.playerInfo())\n io.to('lobby').emit('lobby_room_update', this.basicInfo())\n return Object.keys(this.players).length === 0\n }", "function doDisconnect(room) {\n room.participants.forEach(remoteParticipant => {\n remoteParticipant.disconnect()\n })\n room.disconnect()\n}", "function disconnectSocket() {\n const self = this;\n\n console.log(`${self.socket.user.username} disconnected.`);\n\n sqlQueries.leaveGame(self.socket.user.accountSK, function (data) {\n if (data.hasOwnProperty('errors')) {\n console.log(data.errors.message);\n } else {\n console.log(`${self.socket.user.username} left game ${data.currentGame}.`);\n\n self.socket.leave(data.currentGame);\n\n if (data.gameShutdown) {\n self.socket.broadcast.to(data.currentGame).emit('generalError', {error: 'The host left.'});\n self.socket.broadcast.to(data.currentGame).emit('gameShutdown');\n\n // Makes every socket leave the room.\n self.socket.server.of('/').in(data.currentGame).clients(function(error, clients) {\n if (clients.length > 0) {\n clients.forEach(function(socket_id) {\n self.socket.server.sockets.sockets[socket_id].leave(data.currentGame);\n });\n }\n });\n\n } else {\n Broadcast.refreshGameDetails(self.socket, data.currentGame);\n }\n }\n\n Broadcast.lobbyRefresh(self.socket);\n });\n\n self.socket.user = {\n accountSK: null,\n username: null\n };\n}", "disconnectPlayer(socket) {\n var username = this.playerMap.getUsernameBySocket(socket);\n\n this.playerMap.removePlayerSocket(username);\n this.gameServer.deactivateListenersForSocket(socket);\n\n if (this.socketIsHost(socket)) {\n this.reassignHostSocket();\n }\n if (!this.gameServer.isInGame()) {\n this.playerMap.removePlayerByUsername(username);\n }\n }", "function Disconnect(socket) {\n players--;\n console.log(\"Disconnected: \" + socket.id);\n for (let i = 0; i < player_id.length; i++) {\n if (player_id[i] === socket.id) {\n socket.broadcast.emit('left', player_id[i]);\n player_id.splice(i, 1);\n break;\n }\n }\n\n}", "function onClientDisconnect () {\n num_of_players--;\n util.log('Player has disconnected: ' + this.id)\n\n var removePlayer = playerById(this.id)\n\n // Player not found\n if (!removePlayer) {\n util.log('Player not found: ' + this.id)\n return\n }\n\n // Remove player from players array\n players.splice(players.indexOf(removePlayer), 1)\n\n // Broadcast removed player to connected socket clients\n this.broadcast.emit('remove player', {id: this.id, num_of_players: num_of_players})\n}", "function onClientDisconnect () {\n util.log('Player has disconnected: ' + this.id)\n\n var removePlayer = playerById(this.id)\n\n // Player not found\n if (!removePlayer) {\n util.log('Player not found: ' + this.id)\n return\n }\n players.splice(players.indexOf(removePlayer), 1) // Remove player from players array\n\n // Broadcast removed player to connected socket clients\n this.broadcast.emit('remove player', {id: this.id})\n}", "function onClientDisconnect () {\n util.log('Player has disconnected: ' + this.id)\n\n var removePlayer = playerById(this.id)\n if (!removePlayer) {\n util.log('Player not found: ' + this.id)\n return\n }\n if (playerQueue.length>0) {\n if(playerQueue[0].id==this.id) playerQueue.shift();\n }\n destroyMatch(removePlayer.id,0)\n players.splice(players.indexOf(removePlayer),1)\n}", "function onClientDisconnect () {\n util.log('Player has disconnected: ' + this.id)\n\n var removePlayer = playerById(this.id)\n\n // Player not found\n if (!removePlayer) {\n util.log('Player not found: ' + this.id)\n return\n }\n\n // Remove player from players array\n players.splice(players.indexOf(removePlayer), 1)\n\n // Broadcast removed player to connected socket clients\n this.broadcast.emit('remove player', {id: this.id})\n}", "removePlayer(sock) {\n const socket = sock;\n\n let which;\n\n if (this.players.p1 === socket) {\n which = 'p1';\n } else if (this.players.p2 === socket) {\n which = 'p2';\n }\n\n if (which !== undefined) {\n this.players[which] = undefined;\n\n socket.leave(this.hash);\n socket.join('lobby');\n socket.player.curRoom = undefined;\n }\n\n if (this.state === 'preparing' || this.state === 'inGame') {\n this.state = 'userLeftGame';\n }\n }", "removeDisconnectedPlayer(socket) {\n this.randomrooms.forEach((index) => {\n console.log(index[0]);\n console.log(socket.id);\n if (index[0] === socket.id) {\n const i = this.randomrooms.indexOf(index);\n console.log(i);\n this.randomrooms.splice(index, 1);\n }\n });\n Object.keys(this.playrooms).forEach((roomname) => {\n const playerIDs = this.playrooms[roomname];\n if (playerIDs.includes(socket.id)) {\n this.removeRoom(roomname, playerIDs, [\"win\", \"win\"], \"play\");\n }\n });\n Object.keys(this.waitrooms).forEach((roomname) => {\n const playerIDs = this.waitrooms[roomname];\n if (playerIDs.includes(socket.id)) {\n this.removeRoom(roomname, playerIDs, [\"win\", \"win\"], \"wait\");\n }\n });\n }", "removePlayer(socket) {\n delete this.sockets[socket.id];\n delete this.players[socket.id];\n }", "removePlayer(socket, id) {\n const room = this.findById(id)\n if (!room) {\n return socket.emit(\n 'err',\n 'Could not leave requested room because it doesn not exist'\n )\n }\n const isEmpty = room.removePlayer(socket)\n\n if (isEmpty) {\n this.removeRoom(room.id)\n }\n }", "function onClientdisconnect() {\r\n\tconsole.log('disconnect'); \r\n\r\n\tvar removePlayer = find_playerid(this.id); \r\n\t\t\r\n\tif (removePlayer) {\r\n\t\tplayer_lst.splice(player_lst.indexOf(removePlayer), 1);\r\n\t}\r\n\t\r\n\tconsole.log(\"removing player \" + this.id);\r\n\t\r\n\t//send message to every connected client except the sender\r\n\tthis.broadcast.emit('remove_player', {id: this.id});\r\n\t\r\n}", "function onClientdisconnect() {\r\n\tconsole.log('disconnect'); \r\n\r\n\tvar removePlayer = find_playerid(this.id); \r\n\t\t\r\n\tif (removePlayer) {\r\n\t\tplayer_lst.splice(player_lst.indexOf(removePlayer), 1);\r\n\t}\r\n\t\r\n\tconsole.log(\"removing player \" + this.id);\r\n\t\r\n\t//send message to every connected client except the sender\r\n\tthis.broadcast.emit('remove_player', {id: this.id});\r\n\t\r\n}", "function disconnect(socket) {\n socket.on('disconnect', function() {\n console.log('A player disconnected');\n\n // increment turn\n current_turn = (current_turn + 1) % players.length;\n players[current_turn].emit('your_turn');\n Socketio.emit('turnChange', {turn: current_turn}); // emit to all clients\n\n // remove player socket from server\n players.splice(players.indexOf(socket), 1);\n next_turn(socket);\n });\n}", "function removeRoom(socketId) {\n var room = roomList[socketGameMap[socketId]];\n\n if (typeof room === 'undefined') return;\n\n var players = room.game.getPlayers();\n\n delete roomList[socketGameMap[socketId]];\n\n // force all user in the room to disconnect\n for (var i = 0; i < players.length; i++) {\n var socket = players[i].socket;\n io.to(socket.id).emit('forceDisconnect');\n\n delete socketGameMap[socket.id];\n }\n\n notifyRoomListUpdated()\n }", "leave() {\n if (this.client.browser) return;\n const connection = this.client.voice.connections.get(this.guild.id);\n if (connection && connection.channel.id === this.id) connection.disconnect();\n }", "destroy() {\n \n if(self.stream){\n var tracks = self.stream.getTracks();\n tracks.map(track => {\n track.stop();\n });\n }\n\n // close out each peer connection\n // befor we leave\n for(var connection in self.peerConnections){\n self.sendMessage({\n type: 'leaving_room',\n from: YAWB.user.uid,\n to: connection\n });\n self.removeConnection(connection);\n }\n }", "leaveRoom() {\n debug('videoChat:leaveRoom');\n const localMedia = this.get('stream');\n if (localMedia) {\n (localMedia.getTracks() || []).forEach(t => t.stop());\n }\n get(this, 'webrtc').leaveRoom(this.get('roomId'));\n get(this, 'webrtc').disconnect();\n (get(this, 'webrtc.webrtc.localStreams') || []).forEach(stream => stream.getTracks().forEach(t => t.stop()));\n }", "Leave() {\n this.channel.leave();\n this.joined = false;\n this.isPlaying = false;\n delete globals.connections[this.channel.guild.id];\n }", "function leaveRoom(connection) {\n\tif(connection&&connection.room) {\n\t\tvar index=connection.room.players.indexOf(connection.player);\n\t\tif(-1!==index) {\n\t\t\tconnection.room.players.splice(index,1);\n\t\t\troomsConnects[connection.room.id].splice(\n\t\t\t\troomsConnects[connection.room.id].indexOf(connection.sessid),1);\n\t\t\t// notifying players\n\t\t\troomsConnects[connection.room.id].forEach(function(destId) {\n\t\t\t\tconnections[destId].connection.sendUTF(JSON.stringify(\n\t\t\t\t\t{'type':'leave','player':connection.player.id})\n\t\t\t\t);\n\t\t\t});\n\t\t\tconnection.room=null;\n\t\t}\n\t}\n}", "socketsLeave(room) {\r\n this.adapter.delSockets({\r\n rooms: this.rooms,\r\n except: this.exceptRooms,\r\n }, Array.isArray(room) ? room : [room]);\r\n }", "handleDisconnect(client){\n // Remove the client from the array of clients\n for(let i = 0; i < this.clients.length; i++){\n if(this.clients[i].socket.id === client.socket.id){\n this.removeFromRoom(client);\n this.clients.splice(i, 1);\n break;\n }\n }\n\t}", "function disconnect(data, socket){\n for(var name in clients) {\n if(clients[name].socket === socket.id) {\n delete clients[name];\n break;\n }\n }\t\n}", "function detachPlayerFromRoom(request)\n {\n var diff_lvl = request.session.player.diff_lvl;\n var tag = request.session.player.player_tag;\n\n roomCount[diff_lvl]--;\n request.io.leave(diff_lvl);\n console.log('LEAVE [' + diff_lvl + '] (' + tag + '): roomCount=' + roomCount[diff_lvl] );\n \n if (roomCount[diff_lvl] > 0)\n {\n var player = { player_tag: tag };\n request.io.room('' + diff_lvl).broadcast('gamer_exited_room', player );\n console.log(\"BROADCAST [\" + diff_lvl + \"]: gamer_exited_room (\" + tag + \")\");\n }\n else\n {\n console.log(\"...not BROADCASTing, since room [\" + diff_lvl + \"] is empty\");\n }\n }", "function leaveGames(socket) {\r\n var player = players[socket.id];\r\n for (var [gameId, game] of games) {\r\n game.removePlayer(player);\r\n // Remove the player from the room.\r\n if (socket) socket.leave('game ' + game.id);\r\n\r\n if (game.numPlayers() === 0 || socket.id === game.id) {\r\n games.delete(socket.id);\r\n }\r\n }\r\n}", "endForOnePlayer(player, room){\n socket.emit(\"end-pb-player\", {player : player, room : room});\n }", "function disconnection() {\n playersOnline--\n primus.forEach(spark => spark.emit(GAME_EVENT.PLAYERS_ONLINE, playersOnline))\n }", "disconnect() {\n this.rtm.disconnect();\n // NOTE: removal of event listeners possibly does not belong in disconnect, because they are not added in connect.\n return this.rtm.removeAllListeners();\n }", "function onClientDisconnect() {\r\n\tconsole.log(\"Client has disconnected: \"+this.id);\r\n\tvar nsp = url.parse(this.handshake.headers.origin).hostname;\r\n\t// Broadcast removed player to connected socket clients\r\n\tio.of(nsp).emit(\"userLeft\",{id: this.id});\r\n}", "function disconnect() {\n console.log('INFO (join.js): Connection disconnect!');\n connection.removeEventListener(\n JitsiMeetJS.events.connection.CONNECTION_ESTABLISHED,\n onConnectionSuccess);\n connection.removeEventListener(\n JitsiMeetJS.events.connection.CONNECTION_FAILED,\n onConnectionFailed);\n connection.removeEventListener(\n JitsiMeetJS.events.connection.CONNECTION_DISCONNECTED,\n disconnect);\n}", "delete() {\n for (var p of this.players) {\n p.connection.close();\n players[p.id] = undefined;\n }\n lobbies[this.lobbyCode] = undefined;\n }", "onDisconnect(socket){\n socket.on('disconnect', (reason) => {\n if(USERS.get(socket.id)) {\n console.log('[onDisconnect]: user disconnected', USERS.get(socket.id));\n USERS.delete(socket.id);\n console.log('[onDisconnect]: online users:', USERS);\n }\n })\n }", "function onRemovePlayer () {\n var removePlayer = playerById(this.id)\n\n // Player not found\n if (!removePlayer) {\n util.log('Player not found: ' + this.id)\n return\n }\n\n // Remove player from players array\n players.splice(players.indexOf(removePlayer), 1)\n\n // Broadcast removed player to connected socket clients\n this.broadcast.emit('remove player', {id: this.id, num_of_players: num_of_players})\n}", "function leaveRoom() {\n // Call the server to leave the room\n socketInstance.delete('/room/' + roomId + '/onlineUsers', { id: myChatId });\n\n }", "function disconnectRemoveSocketID(socketid){\n var room_id;\n var element_to_delete;\n users.forEach(element => {\n if(element.id === socketid){\n room_id = element.room;\n index_to_delete = users.indexOf(element);\n }\n });\n users.splice(index_to_delete,1);\n return room_id;\n}", "function disconnectPlayerOther(player) {\n activePlayerCount--;\n delete playerOthers[player.clientId];\n }", "disconnect() {\n\t\tthis.debug('disconnect');\n\t\tif(!this._socket) return;\n\n\t\tif(this._reconnectTimer) {\n\t\t\tclearTimeout(this._reconnectTimer);\n\t\t\tthis._reconnectTimer = null;\n\t\t}\n\t\tif(this.__netstatTimer) {\n\t\t\tclearInterval(this.__netstatTimer);\n\t\t\tthis.__netstatTimer = null;\n\t\t\tthis._measureSpeed();\n\t\t}\n\n\t\tif(this._socket.destroyed) return;\n\n\t\tthis._beforeDisconnect && this._beforeDisconnect();\n\n\t\tthis._socket.removeAllListeners('end');\n\t\tthis._socket.removeAllListeners('close');\n\t\tthis._socket.destroy();\n\t\tthis._connected = false;\n\n\t\tthis.emit('disconnected');\n\t\tthis.status = \"Disconnected\";\n\t}", "function handleDisconnect() {\r\n console.log(\"disconect received\", { socket });\r\n // Find corressponding object in usersArray\r\n const [user, index] = findUserObject(socket);\r\n\r\n // Emit to room\r\n io.to(user.room).emit(\"userLeave\", {\r\n name: user.name,\r\n });\r\n\r\n // Remove user object\r\n removeUserObject(socket);\r\n }", "quit_game(){\n this.room = DEFAULT_CHATROOM;\n this.socket.emit('game:stop', { chatroom: this.room });\n delete this.game;\n }", "function close(socket) {\n // Free the IP\n let n = connectedIPs.findIndex(w => { return w.ip === socket.ip; });\n if (n !== -1) {\n util.log(socket.ip + \" disconnected.\");\n util.remove(connectedIPs, n);\n }\n // Free the token\n if (socket.key != '') { \n keys.push(socket.key);\n util.log(\"Token freed.\");\n } \n // Figure out who the player was\n let player = socket.player,\n index = players.indexOf(player);\n // Remove the player if one was created\n if (index != -1) {\n // Kill the body if it exists\n if (player.body != null) {\n player.body.invuln = false;\n setTimeout(() => {\n player.body.kill();\n }, 10000);\n }\n // Disconnect everything\n util.log('[INFO] User ' + player.name + ' disconnected!');\n util.remove(players, index);\n } else {\n util.log('[INFO] A player disconnected before entering the game.');\n }\n // Free the view\n util.remove(views, views.indexOf(socket.view));\n // Remove the socket\n util.remove(clients, clients.indexOf(socket)); \n util.log('[INFO] Socket closed. Views: ' + views.length + '. Clients: ' + clients.length + '.');\n }", "close() {\n console.log(\"disconnecting\");\n this._distributeMessage('remove', '');\n clearInterval(this._swarmUpdater);\n this._server.close();\n Object.keys(this._connections).forEach(function(key) {\n this._connections[key].socket.end();\n }, this);\n }", "removeRoom(roomname, playerIDs, reason, roomType) {\n if (roomType === \"play\" || roomType === \"game_end\") {\n delete this.playrooms[roomname];\n delete this.map[roomname];\n }\n else if (roomType === \"wait\"){\n delete this.waitrooms[roomname];\n delete this.map[roomname];\n }\n delete this.cameras[roomname];\n playerIDs.forEach((playerID, index) => {\n this.sockets[playerID].emit(Constants.MSG_TYPES.GAME_OVER, reason[index]);\n this.removePlayer(this.sockets[playerID]);\n });\n }", "async disconnect () {\n this.connection.end()\n this.socket.end()\n this.server.onDisconnected()\n return this._destroy()\n }", "_disconnect() {\n\t\tlet aChannelMembers = this._oConnection.getVoiceChannel().getMembers();\n\t\tif (aChannelMembers.length === 1) {\n\t\t\tthis._oClient.setPresence(\"\");\n\t\t\tconnectionsHandler.unregisterConnection(this.getId().toString());\n\t\t}\n\t}", "function removeConnection() {\n\t\tthis.originPort.remove();\n\t\tthis.destinationPort.remove();\n\t\tdocument.getElementById(MAP).removeChild(document.getElementById(this.id));\n\t}", "function closeConnection(connection) {\n if (connection.id) {\n try {\n if (users[connection.id]) {\n delete users[connection.id];\n outputLog(\"User has been removed: \" + connection.id)\n }\n } catch (err) {\n outputLog(\"Error while removing user:\" + connection.id)\n }\n try {\n if (rooms[connection.id]) {\n outputLog(\"Room deleted with id: \" + rooms[connection.id].adminId + \" and name: \" + rooms[connection.id].name);\n delete rooms[connection.id];\n }\n } catch (err) {\n outputLog(\"Error while removing room:\" + connection.id)\n }\n }\n}", "afterDisconnect(session, socket, done) {\n sails.log('Socket discnnected for socket id ', socket.id);\n\n // let userOnRooms = [];\n //\n // // Delete the user from room\n // for (const r in sails.rooms) {\n // userOnRooms[r][socket.id] = sails.rooms[r][socket.id];\n // delete sails.rooms[r][socket.id];\n // }\n //\n // // Tell all rooms the user is disconnected\n // for (const room in userOnRooms) {\n // sails.sockets.broadcast(room, 'unknown_disconnected', { userOnRooms: userOnRooms[room], rooms: sails.rooms });\n // }\n //\n // // Empty the temp\n // userOnRooms = [];\n\n\n // By default: do nothing.\n // (but always trigger the callback)\n return done();\n }", "function onDisconnect(socket) {\n QQArtist.findOne({socket:socket.id},function(err,qqartist){\n if (qqartist){\n qqartist.removeAsync()\n qqartist.save(); \n }\n }) \n}", "function cleanup_games() {\r\n\tfor (var game in games) {\r\n\t\tvar d = games[game];\r\n\t\tvar remove_game = false;\r\n\t\tif (d['p1'].disconnected) {\r\n\t\t\tremove_game = true;\r\n\t\t\tif (!d['p2'].disconnected) {\r\n\t\t\t\td['p2'].emit('opponent_disconnect');\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if (d['p2'].disconnected) {\r\n\t\t\tremove_game = true;\r\n\t\t\tif (!d['p1'].disconnected) {\r\n\t\t\t\td['p1'].emit('opponent_disconnect');\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (remove_game) {\r\n\t\t\tdelete games[d['p1'].game_id];\r\n\t\t}\r\n\t}\r\n}", "function connectToRoom(ws,req){ // socket connection for rooms\n\n var clientId = random()\n\n function leftRoom(room,key){\n broadcast(room,socketClients[clientId].user,'onleave',key)\n }\n\n ws.on('close', function(req){\n \n //to do if user doesnot exist fallback, broadcast a leave message, on error\n //to remember: remove key can handle both array and object\n\n\n\n\n for (let key in roomsRegistry){\n\n for (let room in roomsRegistry[key].full){\n\n //remove client from full instance, remove instance from full and and add it not full\n\n if ( roomsRegistry[key].full[room].clients.includes(clientId ) ){\n\n removeFromBuilding('full',key,room)\n //because currently room is full if anyone leaves the room it will become empty\n\n\n }else{\n // console.log( roomsRegistry[key].full[room].clients[clientId] )\n }\n\n }\n\n \n for (let room in roomsRegistry[key].notFull){\n\n if ( roomsRegistry[key].notFull[room].clients.includes( clientId) ) {\n removeFromBuilding('notFull',key,room)\n }\n }\n\n }\n\n socketClients = removeKey(socketClients,clientId)\n\n })\n\n //remove user from all the room\n function removeRoomFromFullAddToNotFull(label,uniqueKeyOfRoom){\n roomsRegistry[label].notFull[uniqueKeyOfRoom] = roomsRegistry[label].full[uniqueKeyOfRoom]\n roomsRegistry[label].full = removeKey(roomsRegistry[label].full,uniqueKeyOfRoom)\n leftRoom(uniqueKeyOfRoom,label)\n }\n\n //there are two kinds of room in the building full and notFull\n function removeFromBuilding(kind,label,uniqueKeyOfRoom){\n roomsRegistry[label][kind][uniqueKeyOfRoom].clients = removeKey(roomsRegistry[label][kind][uniqueKeyOfRoom].clients,clientId)\n\n kind === 'full'? removeRoomFromFullAddToNotFull(label,uniqueKeyOfRoom) : leftRoom(uniqueKeyOfRoom,label)\n }\n\n function leaveRoom(label,uniqueKeyOfRoom,newRoom){\n\n if (!roomsRegistry[label]) {\n return sendError(label+' label is invalid',newRoom)\n }\n\n if (roomsRegistry[label].full[uniqueKeyOfRoom]){\n removeFromBuilding('full',label,uniqueKeyOfRoom)\n }else if(roomsRegistry[label].notFull[uniqueKeyOfRoom]){\n removeFromBuilding('notFull',label,uniqueKeyOfRoom)\n }\n\n }\n\n function sendError(errorMessage,label){\n ws.send( stringIt({type:'onerror', data:errorMessage, token:label}) )\n }\n //type getRoomToken\n // to do solve conflict of name query socket connection\n //limit defined by user\n ws.on('message', function(msg){\n\n\n msg = JSON.parse(msg)\n let roomLimit = 2\n // let roomId = msg.token\n let roomLabel = msg.app+'_'+msg.token //msg token is hotel name\n let roomToken = null\n if (msg.broadcastToken) roomToken = msg.broadcastToken \n if (msg.limit) if(msg.limit >= 2) roomLimit = msg.limit\n\n //what if where is not defined in update\n\n //the update function does not gives the update doc?\n\n //user can connect to multiple rooms the front end functions are mapped to \n if (msg.purpose == 'join'){\n createOrAddToRoom()\n }else if(msg.purpose == 'broadcast'){\n // console.log('broadcasting')\n broadcast(roomToken,msg.content,'ondata',roomLabel)\n }else if(msg.purpose == 'change_room'){\n\n\n\n\n //to do save from crash not defineed\n if (!msg.currentRoomLabel || !msg.unique || !msg.newToken) return sendError('required values missing')\n leaveRoom(msg.app+'_'+msg.currentRoomLabel, msg.unique, msg.newToken)\n\n // console.log('leaving room',msg.currentRoomLabel,'unique',msg.unique)\n roomLabel = msg.app+'_'+msg.newToken\n createOrAddToRoom()\n\n }else if(msg.purpose == 'leave'){\n\n if (!msg.currentToken || !msg.unique ) return sendError('required values missing')\n\n leaveRoom(msg.app+'_'+msg.currentToken,msg.unique )\n }\n\n\n \n\n //why one to one does not exist? because it can be created with room with limit 2\n\n function createOrAddToRoom(){\n\n if(!socketClients[clientId]){\n\n //if user does not exist\n return getUserData( msg.cookie ).then(function(userObject,error){//what if cookie is invalid\n if (error) return sendError('invalid cookie')\n socketClients[clientId] = {user:{id:userObject.id, username:userObject.username}, socket:ws}\n\n createOrAddToRoom()\n })\n\n \n }\n\n //also broadcast on join and leave and also joined member\n // console.log(clientId,'creating room or adding:'+roomLabel)\n function createRoom(){\n roomToken = random()\n roomsRegistry[roomLabel].notFull[roomToken] = {clients:[],limit:roomLimit}\n roomsRegistry[roomLabel].notFull[roomToken].clients.push(clientId)\n }\n\n if (!roomsRegistry[roomLabel]){ //room not constructed \n roomsRegistry[roomLabel] = { full:{},notFull:{} }\n createRoom()\n }else{\n\n if ( Object.keys(roomsRegistry[roomLabel].notFull).length === 0 ) {\n createRoom()\n }else{\n\n roomToken = Object.keys(roomsRegistry[roomLabel].notFull)[0]\n roomsRegistry[roomLabel].notFull[roomToken].clients.push(clientId)\n broadcast(roomToken,socketClients[clientId].user,'onjoin',roomLabel)\n\n let notFullRoomLimit = roomsRegistry[roomLabel].notFull[roomToken].limit\n let membersCountOfNotFull = roomsRegistry[roomLabel].notFull[roomToken].clients.length\n\n \n\n // if(membersCountOfNotFull > notFullRoomLimit) console.log('limit exceeded', membersCountOfNotFull, notFullRoomLimit)\n\n if(membersCountOfNotFull === notFullRoomLimit){\n roomsRegistry[roomLabel].full[roomToken] = roomsRegistry[roomLabel].notFull[roomToken]\n roomsRegistry[roomLabel].notFull = removeKey(roomsRegistry[roomLabel].notFull,roomToken)\n }\n\n }\n\n }\n\n broadcast(roomToken,null,'onopen',roomLabel)\n\n }\n\n })\n //add coments and decrease code\n // roomArgToken room name, roomLabel key\n function broadcast(roomArgToken,content,type,roomLabel){// room label is the type of room and roomArgToken is unique id of room which can be full or not full\n\n let token = roomLabel.split('_')[1]\n\n let broadcastTo = null\n try{\n broadcastTo = roomsRegistry[roomLabel].notFull[roomArgToken] === undefined ? roomsRegistry[roomLabel].full[roomArgToken] : roomsRegistry[roomLabel].notFull[roomArgToken] \n }catch(e){\n return ws.send( stringIt({error:roomArgToken+' room not found in '+roomLabel+'to broadcast'+e}) )\n }\n\n let members = []\n\n if (!broadcastTo) return ws.send( stringIt({ unique:roomArgToken, token:token, type:'onerror', data:'invalid unique' }))\n\n for (let index of broadcastTo.clients){\n\n members.push( socketClients[index].user )\n }\n\n if (type == 'onopen') return ws.send( stringIt({ unique:roomArgToken, token:token, members:members, type:type }))\n\n\n for (let index of broadcastTo.clients){\n if (index !== clientId) socketClients[index].socket.send( stringIt({unique:roomArgToken, members:members, token:token, sender:socketClients[clientId].user, data:content, type:type }) )\n }\n\n }\n}", "disconnect () {\n // close all data tunnel\n this.userTunnel.off();\n this.messageTunnel.off();\n this.channelStatusTunnel.off();\n this.removeAllListeners();\n }", "disconnect() {\n console.log('Disconnecting...');\n\n // Wait a few seconds so potential messages can be sent before socket is closed\n setTimeout(() => {\n this.rtm.disconnect();\n }, 7000);\n }", "function leaveRoom(){\n\n disableElements(\"leaveRoom\");\n var message = {\n id: \"leaveRoom\"\n };\n\n participants[sessionId].rtcPeer.dispose();\n sendMessage(message);\n participants = {};\n\n var myNode = document.getElementById(\"video_list\");\n while (myNode.firstChild) {\n myNode.removeChild(myNode.firstChild);\n }\n}", "disconnect() {\n this.shouldReconnect = false;\n this._listenersMap = new Map();\n this.closeAllConnections()\n }", "function disconnect() {\r\n\t\t console.log('disconnect!');\r\n\t\t connection.removeEventListener(\r\n\t\t JitsiMeetJS.events.connection.CONNECTION_ESTABLISHED,\r\n\t\t onConnectionSuccess);\r\n\t\t connection.removeEventListener(\r\n\t\t JitsiMeetJS.events.connection.CONNECTION_FAILED,\r\n\t\t onConnectionFailed);\r\n\t\t connection.removeEventListener(\r\n\t\t JitsiMeetJS.events.connection.CONNECTION_DISCONNECTED,\r\n\t\t disconnect);\r\n\t\t}", "function onDisconnectListener() {\n console.debug(\"cs disconnected\");\n googlemusicport = null;\n googlemusictabId = null;\n connecting = false;\n refreshContextMenu();\n\n song.reset();\n player.reset();\n updateBrowserActionInfo();\n iconClickSettingsChanged();\n\n //try to connect another tab\n while (parkedPorts.length > 0) {\n var parkedPort = parkedPorts.shift();\n try {\n parkedPort.onDisconnect.removeListener(removeParkedPort);\n connectPort(parkedPort);\n break;\n } catch (e) {\n //seems to be disconnected, try next\n }\n }\n }", "_destroyConnection(event) {\n const ownerId = event.sender.id;\n\n if (this._connections[ownerId]) {\n log.debug('Destroy socket connection', ownerId);\n\n this._connections[ownerId].owner.send('ipcProvider-setWritable', false);\n\n this._connections[ownerId].socket.destroy();\n delete this._connections[ownerId];\n Sockets.remove(ownerId);\n }\n }", "function participantDisconnected(participant, room) {\n // If the disconnected Participant was pinned as the active Participant, then\n // unpin it so that the active Participant can be updated.\n if (activeParticipant === participant && isActiveParticipantPinned) {\n isActiveParticipantPinned = false;\n setCurrentActiveParticipant(room);\n }\n\n // Remove the Participant's media container.\n $(`div#${participant.sid}`, $participants).remove();\n}", "removeOneRoomAll ({socket, id}) {\n\t\t\tsocket.server.sockets.emit('roomRemoved', id);\n\t\t}", "function closeConnection() {\n discordClient.destroy();\n\n discordClient = initializeRemoteDiscordClient();\n loggedIn = false;\n previousPlaying = '';\n}", "async function teardown() {\n server.close();\n sockets.forEach((socket)=>{\n sockets.delete(socket);\n socket.destroy();\n });\n if (worker) {\n await worker.end();\n }\n }", "async unsubscribe (room) {\n await this.connecting()\n this.connection.client.send(JSON.stringify({\n action: 'UNSUBSCRIBE',\n room\n }))\n this.connection.subscriptions = this.connection.subscriptions.filter(s => s.room !== room)\n }", "async onPlayerRemoved(player) {}", "disconnect() { socket_close(this) }", "close() {\n console.log(`disconnected from ${this.address}`)\n Connection.all.delete(this.address)\n if (this.name != null && Connection.waiting.has(this.name)) {\n Connection.waiting.delete(this.name)\n }\n this.endGame(this.gameID)\n }", "function disconnect(socket) {\n winston.info('Disconnect', socket.id);\n socket.disconnect();\n if (!socket.disconnected && socket.namespace.name)\n socket.manager.namespaces[''].clients().some(function (s) {\n if (s.id === socket.id) {\n s.disconnect();\n return true;\n }\n return false;\n });\n return socket;\n }", "function deleteRoom(roomCode){\n let room = rooms[roomCode];\n if(room){\n let players = room.players;\n for(let i = 0; i < players.length; i++){\n let player = players[i];\n delete socks[player].room;\n }\n delete rooms[roomCode];\n }\n}", "function unregisterOnlineList(socket) {\r\n var data = \"\";\r\n \r\n for (var i=0; i<onlineList.length; i++) {\r\n for (var j=0; j<onlineList[i].length; j++) {\r\n if (onlineList[i][j].id == socket.id) {\r\n // remove from a match\r\n onlineList[i].splice(j, 1);\r\n for (var k=0; k<onlineList[i].length; k++) {\r\n data = JSON.stringify({\"type\":\"connection\", \"match\":i, \"message\":\"Online budy disconnected...\"});\r\n onlineList[i][k].send(data); \r\n }\r\n \r\n // remove from online list if match empty\r\n if (onlineList[i].length === 0) {\r\n onlineList.splice(i, 1);\r\n }\r\n return;\r\n }\r\n }\r\n } \r\n}", "cleanup() {\n const { ws, udp } = this.sockets;\n\n if (ws) {\n ws.removeAllListeners('error');\n ws.removeAllListeners('ready');\n ws.removeAllListeners('sessionDescription');\n ws.removeAllListeners('startSpeaking');\n ws.shutdown();\n }\n\n if (udp) udp.removeAllListeners('error');\n\n this.sockets.ws = null;\n this.sockets.udp = null;\n }", "function disconnectPeers() {\n\t// Close the RTCDataChannel if they're open.\n\tdataChannel.close();\n\n\t// Close the RTCPeerConnection\n\tpeerConnection.close();\n\n\tdataChannel = null;\n\tpeerConnection = null;\n\n\t// Update user interface elements\n\tdisconnectButton.disabled = true;\n\tsendButton.disabled = true;\n\n\tmessageInputBox.value = \"\";\n\tmessageInputBox.disabled = true;\n}", "disconnect() {\n if (this.connected) {\n debug(\"performing disconnect (%s)\", this.nsp);\n this.packet({\n type: socket_io_parser_1.PacketType.DISCONNECT\n });\n } // remove socket from pool\n\n\n this.destroy();\n\n if (this.connected) {\n // fire events\n this.onclose(\"io client disconnect\");\n }\n\n return this;\n }", "function unload() {\n for(let i = 0; i<localTracks.length; i++) {\n localTracks[i].dispose();\n }\n room.leave();\n connection.disconnect();\n}", "disconnect() {\n if (this.proto == 'tcp') {\n this._api.disconnect(this.socketId);\n }\n }", "handleClientDisconnection (socket) {\n socket.on('disconnect', () => {\n const nameIdx = namesUsed.indexOf(nickNames[socket.id]);\n delete nickNames[socket.id];\n namesUsed = [\n ...namesUsed.slice(0, nameIdx),\n ...namesUsed.slice(nameIdx + 1)\n ];\n });\n }", "disconnect() {\n if (this.connected) {\n debug(\"performing disconnect (%s)\", this.nsp);\n this.packet({ type: socket_io_parser_1.PacketType.DISCONNECT });\n }\n // remove socket from pool\n this.destroy();\n if (this.connected) {\n // fire events\n this.onclose(\"io client disconnect\");\n }\n return this;\n }", "disconnect() {\n if (this.connected) {\n debug(\"performing disconnect (%s)\", this.nsp);\n this.packet({ type: socket_io_parser_1.PacketType.DISCONNECT });\n }\n // remove socket from pool\n this.destroy();\n if (this.connected) {\n // fire events\n this.onclose(\"io client disconnect\");\n }\n return this;\n }", "disconnect() {\n if (this.connected == true) {\n this.superRemove();\n this.connected = false;\n }\n }", "disconnect() {\n if (this.connected) {\n debug(\"performing disconnect (%s)\", this.nsp);\n this.packet({ type: dist.PacketType.DISCONNECT });\n }\n // remove socket from pool\n this.destroy();\n if (this.connected) {\n // fire events\n this.onclose(\"io client disconnect\");\n }\n return this;\n }", "disconnect(details) {\n if (this._messageHandler)\n window.removeEventListener(\"message\", this._messageHandler);\n if (!this._disconnected) {\n this._disconnected = true;\n if (typeof this._frame !== \"undefined\") {\n this._frame.parentNode.removeChild(this._frame);\n } // otherwise farme is not yet created\n this._fire(\"disconnected\", details);\n }\n if (this._peer_id && all_connections[this._peer_id])\n delete all_connections[this._peer_id];\n }", "function removePlayer(id, mapId)\n{\n\tclearAgro(id, mapId);\n\tdelete killParticipation[mapId][id];\n\tdelete connected[mapId][id];\n\tdelete connection[id];\n\n\t// notify other players on the same map that the player has disconnected\n\tfor (var i in connected[mapId])\n\t{\n\t\tio.to(i).emit('removePlayer', id);\n\t}\n}", "function onDisconnect(socket, io) {\n console.log('socket disconnect', socket.id);\n delete clients[socket.id];\n io.sockets.emit('clients', JSON.stringify(clients));\n}", "onDisconnected() {\n if (!this.connected) return\n this.multiplexer.stop()\n // We need to unset the id in order to receive an immediate response with new\n // client id when reconnecting.\n this.id = undefined\n this.connected = false\n log('disconnected')\n this.emit('disconnected')\n }", "function handleClientDisconnection(socket) {\n socket.on(\"disconnect\", function() {\n var connectedClients = io.sockets.clients(\"clients\").length - 1;\n socket.broadcast.to(\"clients\").emit(\"clients\", {\"clients\": connectedClients});\n });\n}", "function closeConnection() {\n if (that.connection.isConnected()) {\n // send disconnect signal then close ws connection\n var message = new ChatMessage(ChatMessage.DisconnectMessage);\n\n that.connection.send(message);\n $('onlineUsers').innerHTML = \"<p>Aktive Mitglieder</p> <p style='color:red'>Verbindung geschlossen </p>\";\n that.connection.close();\n\n }\n that.connection = null;\n }", "disconnect() {\n console.log(\"disconnect!\");\n this.connection.removeEventListener(\n JitsiMeetJS.events.connection.CONNECTION_ESTABLISHED,\n this.onConnectionSuccess.bind(this)\n );\n this.connection.removeEventListener(\n JitsiMeetJS.events.connection.CONNECTION_FAILED,\n this.onConnectionFailed.bind(this)\n );\n this.connection.removeEventListener(\n JitsiMeetJS.events.connection.CONNECTION_DISCONNECTED,\n this.disconnect.bind(this)\n );\n\n this.disconnectedFunction();\n }", "function leaveClient() {\n\tsocket.emit('leave', {name: playerId});\n}", "function clientDisconnect() {\r\n delete clients[connection.remoteAddress];\r\n console.log('connection closed: ' + remoteAddress + \" \" + now.getHours() + \":\" + now.getMinutes() + \":\" + now.getSeconds());\r\n\r\n\r\n }", "removeConnection(connection){\n self.peerConnections[connection].close();\n delete self.peerConnections[connection];\n }", "disconnectSockets(close = false) {\r\n this.adapter.disconnectSockets({\r\n rooms: this.rooms,\r\n except: this.exceptRooms,\r\n }, close);\r\n }", "function handlePlayerDisConn(letterCode, id) {\n // Remove player from host\n if (!codeCheck(letterCode)) {\n console.log('[INFO]: Did not handle player disconnection successfully.');\n return 0;\n }\n const host = _.find(hosts, ['code', letterCode]);\n if (host === undefined) {\n console.error(`[ERROR]: Could not find Host - ${letterCode}`);\n writeToFile(error_log, `[ERROR]: Could not find Host - ${letterCode}`);\n // return -1;\n }\n const player = _.find(players, ['id', id]);\n if (player === undefined) {\n console.error(`[ERROR]: Could not find Player: ${id}`);\n writeToFile(error_log, `[ERROR]: Could not find Player: ${id}`);\n return -1;\n }\n var removed_player = _.remove(host.players, player);\n if (removed_player !== undefined) {\n console.log(`[INFO]: Removing player: ${player.id} from host: ${letterCode}`);\n writeToFile(server_log, `Removing player: ${player.id} from host: ${letterCode}`);\n console.log('[INFO]: Handled player removal from host successfully.');\n writeToFile(server_log, 'Handled player removal from host successfully.');\n } else {\n console.error(`[ERROR]: [ERROR]: Removing player: ${player.id} from host: ${letterCode}`);\n writeToFile(error_log, `[ERROR]: Removing player: ${player.id} from host: ${letterCode}`);\n console.error('[ERROR]: Handled player removal from host unsuccessfully.');\n writeToFile(error_log, 'Handled player removal from host unsuccessfully.');\n }\n removed_player = _.remove(players, player);\n if (removed_player !== undefined) {\n console.log(`[INFO]: Removing player: ${player.id} from player list`);\n writeToFile(server_log, `Removing player: ${player.id} from player list`);\n console.log('[INFO]: Handled player removal from player list successfully.');\n writeToFile(server_log, 'Handled player removal from player list successfully.');\n } else {\n console.error(`[ERROR]: Removing player: ${player.id} from player list`);\n writeToFile(error_log, `[ERROR]: Removing player: ${player.id} from player list`);\n console.error('[ERROR]: Handled player removal from player list unsuccessfully.');\n writeToFile(error_log, 'Handled player removal from player list unsuccessfully.');\n }\n player.socket.end();\n\n player.socket.destroy();\n if (player.socket.destroyed) {\n console.log(`[INFO]: Player: ${player.id} socket destroyed successfully`);\n writeToFile(server_log, `Player: ${player.id} socket destroyed successfully`);\n } else {\n console.error(`[ERROR]: Player: ${player.id} socket destroyed unsuccessfully`);\n writeToFile(error_log, `Player: ${player.id} socket destroyed unsuccessfully`);\n }\n\n update_hosts();\n update_players();\n\n return 1;\n}", "disconnect() {\n if (!_.isNil(this._dataChanel)) {\n this._dataChanel.close();\n }\n if (!_.isNil(this._receiveChanel)) {\n this._receiveChanel.close();\n }\n if (!_.isNil(this._pc)) {\n this._pc.close();\n }\t\n try {\n this._pc = null;\n } catch (e) {};\n\t}", "closeConnections() {\n Object.keys(this.connections).forEach((socketId) => {\n let socket = this.connections[socketId];\n if (socket) {\n socket.destroy();\n }\n });\n }", "function disconnect(ws) {\n ws.terminate();\n ws.isAlive = false;\n sockets.delete(ws.id);\n if (ws.userId != undefined) {\n if (userSockets.has(ws.userId)) {\n userSockets.get(ws.userId).delete(ws);\n }\n }\n if (ws.channels != undefined) {\n for (let ch of ws.channels) {\n if (channelSockets.has(ch)) {\n channelSockets.get(ch).delete(ws);\n }\n }\n }\n console.log('WebSocket client disconnected \"%s\".', ws.id);\n }" ]
[ "0.7549337", "0.746207", "0.74367696", "0.717408", "0.71303415", "0.69996125", "0.6983756", "0.6982726", "0.69243854", "0.6915905", "0.684387", "0.6801671", "0.67985797", "0.67504376", "0.6743738", "0.6723735", "0.6717301", "0.6701697", "0.6583741", "0.6583741", "0.65765405", "0.6502382", "0.64765507", "0.6460493", "0.64497465", "0.6420218", "0.64137244", "0.6408162", "0.6407162", "0.63949466", "0.6360967", "0.6338036", "0.6323314", "0.63207895", "0.6295326", "0.62710357", "0.62667304", "0.62660056", "0.62398607", "0.6225107", "0.6217045", "0.61733526", "0.61717147", "0.6161813", "0.61221164", "0.6118356", "0.609969", "0.6085369", "0.60799193", "0.6077859", "0.6014636", "0.6011065", "0.60093385", "0.5986671", "0.5973185", "0.59515214", "0.59262705", "0.5923552", "0.58873844", "0.58651954", "0.5858807", "0.5852244", "0.58518946", "0.5851019", "0.5850203", "0.5849521", "0.5845362", "0.5832558", "0.582249", "0.5819829", "0.580039", "0.5799596", "0.57879615", "0.57818747", "0.5768623", "0.57620007", "0.5757255", "0.57377976", "0.5730817", "0.57276577", "0.57232606", "0.5721387", "0.5721387", "0.571279", "0.5712205", "0.57114655", "0.57050085", "0.5703298", "0.5697817", "0.5696046", "0.56940836", "0.56925607", "0.569241", "0.56887496", "0.56791836", "0.5671915", "0.56696075", "0.5660367", "0.5659031", "0.56580377" ]
0.6099578
47
Create randomizer to pull 4 different powers of a pokemon and push it into a new array
function getRandomPower(movesArr, data) { let min = 0; let max = data.moves.length; let randomMove = Math.floor(Math.random() * (max - min) + min); movesArr.push(data.moves[randomMove]); // put the four random moves in a new array }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generatePokemonAry(){\n wildPokemon = []\n\n for (let i = 1; i < 650; i++) {\n wildPokemon.push(i);\n \n }\n return wildPokemon;\n \n}", "async function generatePokemonArray(pokemon) {\n randomPokemon = pokemon[Math.floor(Math.random() * 151)]\n getRandomPokemonData(randomPokemon);\n }", "static getRandomPokemon() {\n let randomNum = Math.floor(Math.random() * (802));\n return Pokemon.allPokemons[randomNum]\n }", "function randomisePokemon(noOfPokemon) {\n\tvar pokeballArray = allPokemon.slice(0, noOfPokemon).map(function() {\n\t\treturn this.splice(Math.floor(Math.random() * this.length), 1)[0];\n\t}, allPokemon.slice());\n\treturn pokeballArray;\n}", "function levelOne_ActOne() {\r\n\tlet levelOneRollOne = [];\r\n\tlet genreRollOne;\r\n\tlet genreRollTwo;\r\n\tlet genreRollThree;\r\n\tlet genreRollFour;\r\n\r\n\tgenreRollOne = rollDie(diceTwenty);\r\n\tgenreRollTwo = rollDie(diceTwenty);\r\n\tgenreRollThree = rollDie(diceTwenty);\r\n\tgenreRollFour = rollDie(diceTwenty);\r\n\t\r\n\t\r\n\tlet result = levelOneRollOne.push(genreRollOne, genreRollTwo, genreRollThree, genreRollFour);\r\n\treturn result;\r\n//STEP 1: ROLL THE DICE TO SELECT THE 4 GENRES YOU CAN CHOOSE FROM\r\n}", "function powerBallGen(min, max, num){\n\n var powerBallArray = [];\n\n // Math.random() * (max - min) + min\n for (var i = 0; i < num; i++) {\n\n var powerNumbers = Math.round(Math.random() * (59 - 1) + 1);\n\n powerBallArray [i] = powerNumbers;\n\n }\n\n return powerBallArray;\n\n}", "static getRelevantPokemon(typeArray) { // array of pokemon's relevant types\n // Randomly select a TYPE from the array\n let randType = typeArray[Math.floor(Math.random() * typeArray.length)]\n // Collect an array of pokemon with that TYPE\n let arrayTypePokemon= Pokemon.filterPokemonByType(randType)\n // Randomly select a POKEMON from the weakArray\n let pokemonWithType = arrayTypePokemon[Math.floor(Math.random() * arrayTypePokemon.length)]\n return pokemonWithType\n }", "function pick_9_Pokemons_from_list(pokemon){\n\n\t\tfor (let i = 0; i < 9;i++){\n\t\t\tgetRandomPokemon(pokemon);\n\t\t}\n\t\t//selectRandomName();\n\t}", "generatePowers(tier) {\n let powers = this._generatePowersMundane(tier);\n for (let category of this.racePowerCategories()) {\n powers = powers.concat(\n this._generatePowersForCategory(\n category,\n 1, // All Bakemono powes are 1\n 1 + RNG.d0(RNG.retier(tier)),\n )\n );\n }\n\n return powers;\n }", "function randomPokemon() {\n selector = Math.floor(Math.random()* 781) + 26 //Random number between 26 and 809\n getAPIData(`https://pokeapi.co/api/v2/pokemon/${selector}`).then((pokeData) => {\n populatePokeCards(pokeData)\n })\n}", "function make_power_up()\n{\n\tvar pos = [Math.floor(Math.random()*40),Math.floor(Math.random()*40)];\n\twhile(!check_pos_valid(pos))\n\t\t{\n\t\tpos = [Math.floor(Math.random()*40),Math.floor(Math.random()*40)];\n\t}\n\tpower_up['position'] = new Array(pos[0]*10,pos[1]*10);\n\tvar num = Math.floor(Math.random()*50+1);\n\tif(num % power_up['cherry'] == 0)\n\t{\n\t\tpower_up['type'] = 'cherry';\n\t}\n\telse if(num % power_up['apple'] == 0)\n\t{\n\t\tpower_up['type'] = 'apple';\n\t}\n\telse if(num % power_up['grape'] == 0)\n\t{\n\t\tpower_up['type'] = 'grape';\n\t}\n\telse if(num % power_up['banana'] == 0)\n\t{\n\t\tpower_up['type'] = 'banana'; \n\t}\n\telse\n\t{\n\t\tpower_up['type'] = 'onion';\n\t}\n}", "function pickPok() {\n\t\tvar random = Math.floor(Math.random() * randomPokemon.length);\n\t\treturn randomPokemon[random];\n\t}", "function randomPokemon(pokedex) {\r\n let num = Math.floor((Math.random() * 156) + 1);\r\n let pokemon = pokedex[num].url;\r\n return pokemon\r\n}", "function generatorOpinion (num) {\n var tempArray = [];\n for (var i = 0; i < num; i++ ) {\n tempArray.push(randomOpinion(opinions));\n }\n return tempArray;\n}", "function powerBallNumberGen(min, max, num1) {\n\n var ballArray = [];\n\n for (var i = 0; i < num1; i++){\n\n var ballNumbers = Math.round(Math.random() * (35 - 1) + 1);\n\n ballArray [i] = ballNumbers;\n\n }\n\n return ballArray;\n\n}", "function pokemon(num_array) {\n let num_pokemon = 0;\n let array_pokemon = [];\n for (let i = 0; i < num_array.length; i++) {\n num_pokemon = num_pokemon + num_array[i];\n array_pokemon.push(num_pokemon);\n }\n return array_pokemon;\n }", "function randomPiece(){\n let r = randomN = Math.floor(Math.random() * PIECES.length) //math.floor rounds the number to an integer\n return new Piece( PIECES[r][0],PIECES[r][1]); //math.raandom generates numbers between 0 and 1 \n} //to generate numbers between 0 and 7, multiply math.random by the length of the tetromino array", "randomAbility(){\n let rolls = [];\n for (let i = 0; i < 4; i++){\n rolls.push(this.rollDice(1, 6));\n }\n\n rolls = this.bubble(rolls); // sort to take highest 3\n return rolls[1] + rolls[2] + rolls[3];\n }", "determinize(battleside) {\n\n _.each(battleside.pokemon, function(pokemon) {\n if(!!pokemon.set.probabilities) {\n var set = pokemon.set\n\n set.item = sample_from(set.probabilities.items, function(e){return e[1]})[0]\n set.evs = _.sample(set.probabilities.evs)\n //set.moves = pokemon.trueMoves + _.map(_.sampleSize(set.probabilities.moves, 4-pokemon.trueMoves.length), function(m){return m[0]})\n\n // Create the new pokemon\n var new_pokemon = new BattlePokemon(set, battleside);\n new_pokemon.trueMoves = pokemon.trueMoves\n new_pokemon.nickname = pokemon.nickname\n pokemon.position = pokemon.position;\n battleside.pokemon[pokemon.position] = new_pokemon;\n\n if (pokemon.position === 0) {\n battleside.active = [new_pokemon];\n new_pokemon.isActive = true;\n }\n }\n })\n \n\n battleside.pokemon = _.sortBy(battleside.pokemon, function(pokemon) { return pokemon.isActive ? 0 : 1 });\n for(var i = 0; i < 6; i++) {\n battleside.pokemon[i].position = i\n }\n }", "function powerballLotto(max, min, num) {\n for (var i = 0; i < num; i++) {\n powerballQP[i] = Math.random() * (max - min) + min; //math object to select a random number\n powerballQP[i] = Math.round(powerballQP[i]); //math object to round number to nearest whole number\n }\n console.log(\"Your Powerball lottery quick pick numbers are \" + powerballQP); //console outputs the Powerball quick pick numbers.\n}", "function randomizePieces() {\n const randomPieces = pieces.slice()\n for (let i = randomPieces.length - 1; i > 0; i--) {\n const rand = Math.floor(Math.random() * (i + 1));\n [randomPieces[i], randomPieces[rand]] = [randomPieces[rand], randomPieces[i]];\n }\n return randomPieces\n}", "function randomPowerballNum(min, max){ //arguments\n\n var powerballArray = []; //will give me 5 nums\n\n for (var i = 0; i < 5; i++){ //will run until i equals 5\n var powerball = Math.random() * (max - min) + min; //set up random num\n\n powerball = Math.round(powerball); //rounds nums to wholes\n powerballArray [i] = powerball; // will display array\n\n }\n\n return powerballArray;\n\n }", "function randomWeapon() {\r\n let array = [\r\n { weapon: \"Sword\", type: \"physical\", ability: \"randomInt(4, 12)\", deathNote: \"was sliced in half by a sword!\" },\r\n { weapon: \"Shovel\", type: \"physical\", ability:\"randomInt(3, 10)\", deathNote: \"got dugged by a shovel!\" },\r\n { weapon: \"Pistol\", type: \"ranged\", ability: \"randomInt(7, 20)\", deathNote: \"was shot by a pistol!\" },\r\n { weapon: \"Knife\", type: \"physical\", ability: \"randomInt(6, 9)\", deathNote: \"was stabbed in the throat!\" },\r\n { weapon: \"Shotgun\", type: \"ranged\", ability: \"randomInt(4, 12)\", deathNote: \"was blasted to rubble!\" },\r\n { weapon: \"Spear\", type: \"ranged\", ability: \"randomInt(1, 20) + randomInt(1, 10)\", deathNote: \"got pierced by a spear!\" },\r\n { weapon: \"Molotov\", type: \"ranged\", ability: \"randomInt(4, 7) + randomInt(4, 7)\", deathNote: \"screamed as fire from a broken molotov seared thy skin.\" },\r\n { weapon: \"Machine Gun\", type: \"ranged\", ability: \"randomInt(4, 5) + randomInt(6, 7) + randomInt(7, 8)\", deathNote: \"was ripped apart by bullets!\" },\r\n { weapon: \"Frying Pan\", type: \"magic\", ability: \"randomInt(10, 12)\", deathNote: \"was fried by a frying pan!\" },\r\n { weapon: \"Blood Magic\", type: \"magic\", ability: \"randomInt(0, 22)\", deathNote: \"was destroyed inside-out by inner blood turmoil!\" },\r\n { weapon: \"Laser Sword\", type: \"magic\", ability: \"randomInt(11, 13)\", deathNote: \"was cut in half by pure plasma!\" },\r\n { weapon: \"Grenade\", type: \"ranged\", ability: \"10\", deathNote: \"was blew up by a grenade!\" },\r\n { weapon: \"Shield\", type: \"physical\", ability: \"randomInt(7, 10) - 5\", deathNote: \"neck broke by getting bashed by a shield!\" },\r\n { weapon: \"Rocket Launcher\", type: \"physical\", ability: \"randomInt(20, 50) - 30\", deathNote: \"torn apart by a missle!\" },\r\n { weapon: \"Holy Cross\", type: \"magic\", ability: \"randomInt(1, 12) + 10\", deathNote: \"was smited by a holy might!\" },\r\n { weapon: \"Railgun\", type: \"ranged\", ability: \"randomInt(1, 100) - 40\", deathNote: \"was fried by a plasma beam!\" }\r\n ];\r\n\r\n let random = randomInt(0, array.length);\r\n return array[random];\r\n}", "function randomType() {\r\n let array = [\r\n { personality: \"Brawny\", bonus: \"if (players[attacker].wep.type == 'physical'){temp += 5}\", applied: 'offense' }, // if attacker's weapon is physical, damage + 5,\r\n { personality: \"Vampire\", bonus: \"if (players[attacker].wep.type == 'magic'){temp += 5}\", applied: 'offense' }, // if attacker's weapon is physical, damage + 5,\r\n { personality: \"Clown\", bonus: \"if (players[attacker].hp <= 10){temp += 8}\", applied: '' }, // If attacker is bellow ten hp, damage + 8\r\n { personality: \"Smart\", bonus: \"if (players[defender].type.personality == 'Dumb'){temp += 15}\", applied: 'offense' }, // if defender personality is dumb, damage + 15\r\n { personality: \"Dumb\", bonus: \"if (players[attacker].hp >= '10'){temp += 5}\", applied: 'offense' }, // if attacker is above ten HP, damage + 5\r\n { personality: \"Saiyan\", bonus: \"if (randomInt(1, 10) > 5){temp += 5}\", applied: 'offense' }, // If random number from 1-10 above 5, + 5 damage.\r\n { personality: \"Paladin\", bonus: \"if (players[defender].hp < 10){temp -= 5}\", applied: 'defence' }, // if defender bellow ten hp, + 5 shield\r\n { personality: \"Ailen\", bonus: \"if (players[defender].hp > 20){temp -= 3}\", applied: 'defence' }, // if defender above 20 HP, shield + 3\r\n { personality: \"Slave\", bonus: \"if (players[attacker].type.personality == 'Clown'){temp += 15}\", applied: 'offense' }, // If attacker personality is clown, + 15 damage\r\n { personality: \"Military\", bonus: \"if (players[attacker].wep.weapon == 'ranged'){temp += 5}\", applied: 'offense' }, // if weapon is ranged, + 5 damage\r\n { personality: \"Brain Dead\", bonus: \"if (randomInt(0, 10) < 5){temp -= 10}\", applied: 'offense' }, // if a number between 1 and 10 bellow 5, opponet shield += 10\r\n ]\r\n\r\n let random = randomInt(0, array.length);\r\n return array[random];\r\n}", "function pickRandomWizards(arr) {\n\n for (var y = 0; y < 4; y++) {\n\n var a = arr[Math.floor(Math.random() * arr.length)];\n\n wizardNumbers.push(a);\n }\n\n console.log(\"wizard numbers: \" + wizardNumbers);\n\n } // End of pick random wizard houses", "genCode() {\n let numColors = this.state && colors[this.state.difficulty].length;\n numColors = numColors || 4;\n return new Array(4).fill().map(dummy => Math.floor(Math.random() * numColors));\n }", "function randomizer() {\n target = Math.floor(Math.random() * 100) + 19;\n gem1rando = Math.floor(Math.random() * 13) + 2;\n gem2rando = Math.floor(Math.random() * 13) + 2;\n gem3rando = Math.floor(Math.random() * 13) + 2;\n gem4rando = Math.floor(Math.random() * 13) + 2;\n }", "function randTile(num) {\n for (let i = 0; i < 4; i++) {\n let a = num[Math.floor(Math.random() * num.length)];\n\n tileNumber.push(a);\n }\n // check which numbers have been picked\n console.log(tileNumber);\n } // End function", "function powerball(max, min, num){\n for (var i = 0; i < num; i++) {\n powerB[i] = Math.random() * (max - min) + min; //math object to select a random number\n powerB[i] = Math.round(powerB[i]); //math object to round number to nearest whole number\n\n }\n console.log(\"Your Powerball is \" + powerB); //console outputs the Powerball number.\n}", "function RandomPieceBag()\n{\n var pieces=[];\n\n this.takePiece = function()\n {\n if(pieces.length==0)\n {\n for(var i=0; i<7; i++)\n {\n pieces.push(i);\n }\n }\n \n var randomIndex=Math.floor(Math.random()*pieces.length);\n var piece = pieces[randomIndex];\n pieces.splice(randomIndex, 1);\n return piece;\n }\n \n}", "function getPokemon() {\n var rngIndex = Math.floor(Math.random() * pokemonList.length);\n return pokemonList[rngIndex].name.toUpperCase();\n}", "function nextLevel(){\n pizzaorder++;\n if(pizzaorder >= 5){\n pizzaorder = 5;\n }\n level++;\n for(let i = 0; i < pizzaorder; i++){\n pizzas[i] = new Rock(random(0, width), random(-height, 0), random(width/40, width/10));\n }\n}", "function poolSelection(players) {\n // Start at 0\n let index = 0\n\n // Pick a random number between 0 and 1\n let r = random(1)\n\n // Keep subtracting probabilities until you get less than zero\n // Higher probabilities will be more likely to be fixed since they will\n // subtract a larger number towards zero\n while (r > 0) {\n r -= players[index].fitness\n // And move on to the next\n index += 1\n }\n\n // Go back one\n index -= 1\n\n return players[index].copy() // This way i don't need to reset the values\n}", "function getWpnDmg() {\r\n\tvar wpn = equippedWpnArr[0]; //player wpn\r\n\tvar wpnDmg = 0;\r\n\tfor(var i = 0; i < itemStorageArray.length; i++) {\r\n\t\tif(wpn == itemStorageArray[i].code) {\r\n\t\t\twpnDmg = itemStorageArray[i].effect;\r\n\t\t\tif(wpnDmg == \"1-2\") {\r\n\t\t\t\twpnDmg = randomIntFromInterval(1, 2);\r\n\t\t\t}\r\n\t\t\telse if(wpnDmg == \"2-4\") {\r\n\t\t\t\twpnDmg = randomIntFromInterval(2, 4);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn wpnDmg;\r\n}", "getOptions(countries){\n const arr = [];\n for(let i = 0; i < 4; i++){\n let j = Math.floor(Math.random() * Math.floor(countries.length));\n arr.push(countries[j]);\n }\n return arr;\n }", "function pickALetter(pool) { \n return poolOfLetters[Math.round(Math.random(0, poolOfLetters.length - 1)*10)] \n}", "function generateRandomPokemon(){\n const MAX = 809;\n const MIN = 1;\n const id = Math.floor(Math.random() * (MAX - MIN) + MIN)\n return id;\n}", "constructor(){\n this.code = [];\n this.cheat = [];\n for (var i = 0; i < 4; i++){\n this.code[i] = getRandomIntInclusive(0, 9);\n this.cheat[i] = this.code[i];\n this.code[i] = new Number(this.code[i]);\n }\n }", "function GrabPokemon() {\n let PokeIndex = Math.floor(Math.random() * PokeList.length);\n PokeList.splice(PokeIndex, 1);\n return (PokeList[PokeIndex]);\n}", "gen2or4() {\r\n let weighted2At90 = [2, 2, 2, 2, 2, 2, 2, 2, 2, 4];\r\n return weighted2At90[Math.floor(Math.random() * Math.floor(10))];\r\n }", "generateNumbers() {\n // generate rounds numbers\n let numbers = [];\n for (let i = 0; i < this.puzzleAmount; i++) {\n this.getUniqueNumber(numbers, (num) => numbers.push(num));\n }\n\n return numbers;\n }", "function makeRocks(num) {\n allRocks = [];\n let randomXset = getX(num); // Get random, not repeated, 'x' coordinates\n for (let x of randomXset) {\n allRocks.push(new Rock(x, randomY()));\n }\n}", "function computerGenerateChoice() {\n \n // Math.floor(Math.random() * 4) ;\n game.computerArrayOfChoicesToMatch.push(game.colors[(Math.floor(Math.random() * 4))])\n\n\n}", "function randomateSurvPerks() {\n \n // Shuffles the array and returns it\n var Survshuffled = SurvImgSrc.sort(function () {\n return .5 - Math.random()\n });\n // Select the first 4 in the new array \n var Survselected = Survshuffled.slice(0, 4);\n\n // Puts the first 4 in slots made in html.\n document.getElementById(\"perkslotone\").innerHTML = Survselected[0];\n document.getElementById(\"perkslottwo\").innerHTML = Survselected[1];\n document.getElementById(\"perkslotthree\").innerHTML = Survselected[2];\n document.getElementById(\"perkslotfour\").innerHTML = Survselected[3];\n\n}", "function newValues() {\n\tvalues = [];\n\tfor (var i = 0, t = 14; i < 4; i++) {\n\t\tvalues.push(Math.round(Math.random() * t) + (i + 1));\n\t}\n}", "function sample_population(population, fitnesses, selection_rate) {\n num_of_selected_chromosome = parseInt(selection_rate * population.length)\n mating_population = []\n // console.log(num_of_selected_chromosome + \" \" + population.length)\n for (var i = 0; i < num_of_selected_chromosome; i++) \n mating_population.push(roulette_wheel(population, fitnesses))\n\n return mating_population\n}", "function generateXp() {\n return Math.floor(Math.random() * 7) + 8;\n}", "attackWith() {\r\n const randomWeaponIndex = Math.floor(Math.random() * 8);\r\n return this.weapons[randomWeaponIndex];\r\n }", "function regenUserPokeMoves(pokemon){\n let pokeAPI = `https://pokeapi.co/api/v2/pokemon/${pokemon}/`\n $.ajax({\n url: pokeAPI,\n method: \"GET\"\n }).then(function(response) {\n \n var allUserMoves = response.moves;\n var randomMove1 = Math.floor(Math.random()*allUserMoves.length);\n var randomMove2 = Math.floor(Math.random()*allUserMoves.length);\n var randomMove3 = Math.floor(Math.random()*allUserMoves.length);\n var randomMove4 = Math.floor(Math.random()*allUserMoves.length);\n moveName1 = response.moves[randomMove1].move.name;\n moveName2 = response.moves[randomMove2].move.name;\n moveName3 = response.moves[randomMove3].move.name;\n moveName4 = response.moves[randomMove4].move.name;\n generateMoves();\n getUserPokeType1();\n getUserPokeType2();\n getUserPokeType3();\n getUserPokeType4();\n \n })\n}", "function lottoGenerator() {\n const arr = []\n function rando(lot) {\n const ran = Math.floor(Math.random() * (60 - 1 + 1)) + 1\n return lot.includes(ran) ? rando(lot) : ran\n }\n for (let i = 0; i < 6; i++) {\n const ran = rando(arr)\n arr.push(ran)\n }\n return arr\n}", "function randomateKillPerks() {\n var Killshuffled = KillImgSrc.sort(function () {\n return .5 - Math.random()\n });\n var Killselected = Killshuffled.slice(0, 4);\n\n document.getElementById(\"perkslotone\").innerHTML = Killselected[0];\n document.getElementById(\"perkslottwo\").innerHTML = Killselected[1];\n document.getElementById(\"perkslotthree\").innerHTML = Killselected[2];\n document.getElementById(\"perkslotfour\").innerHTML = Killselected[3];\n}", "function spawn(aPlayer, count, percents) {\n player = aPlayer;\n for (var i = 0; i < count; i++) {\n var idx = RNG.rollWeighted(\n percents[0],\n percents[1],\n percents[2],\n percents[3],\n percents[4],\n percents[5],\n percents[6],\n percents[7],\n percents[8]\n );\n spawnArray[idx]()\n }\n if (window.debug) {\n console.log(pu + \" powerups spawned\");\n console.log(en + \" enemies spawned\");\n }\n}", "function chance(){\n return sumDiceArray();\n}", "function shuffle(num) {\n return ingredients[num];\n}", "function randomizeArray() {\n const pigeonObj = dinosaurs.pop();\n dinosaurs.sort(() => Math.random() - 0.5);\n dinosaurs.push(pigeonObj);\n dinosaurs.splice(4,0,human);\n}", "function randomGenerator() {\n var pieceList = [0, 1, 2, 3, 4, 5, 6];\n return pieceList.sort(function () {\n return 0.5 - rng.next()\n });\n}", "function createLevelPattern(player){\n //Adds each element using Math.random and converting numbers in to colors.\n //randomly generate number\n var generateNumber = Math.floor(Math.random() * 4 + 1);\n if(player == 1){\n arraySequence1.push(colorChoise(generateNumber));\n console.log(arraySequence1);\n }\n else if(player == 2){\n //push the generated number in to array.\n arraySequence2.push(colorChoise(generateNumber));\n console.log(arraySequence2);\n }\n //console.log(arraySequence);\n}", "function random(){ \n var num = Math.floor(Math.random() * pieces);\n return num;\n}", "function radomTiles() {\n for (var i = 1; i < 13; i++) {\n var num = Math.floor(Math.random() * 12)+1; //pick a random number\n if (doubles.includes(num)) { //if the random number has already been chosen lower i by 1 and try again\n i--;\n continue;\n }else{\n doubles.push(num) //add chosen number to doubles array\n flipped.push(dogs[num]) //use random number to pick a dog and add it to flipped array\n\n }\n }\n}", "function traduzirPokemon(pokemonTypes) {\n var tipoPokemonTraduzido = []\n for(let i=0 ; i < pokemonTypes.length ; i++){\n switch (pokemonTypes[i]) {\n case \"grass\":\n tipoPokemonTraduzido[i] = \"Planta\" \n break;\n case \"fire\":\n tipoPokemonTraduzido[i] = \"Fogo\" \n break;\n case \"water\":\n tipoPokemonTraduzido[i] = \"Água\" \n break;\n case \"poison\":\n tipoPokemonTraduzido[i] = \"Venenoso\" \n break;\n case \"psychic\":\n tipoPokemonTraduzido[i] = \"Psíquico\" \n break;\n case \"ground\":\n tipoPokemonTraduzido[i] = \"Terra\"\n break;\n case \"electric\":\n tipoPokemonTraduzido[i] = \"Elétrico\"\n break; \n case \"flying\":\n tipoPokemonTraduzido[i] = \"Voador\"\n break;\n case \"ice\" :\n tipoPokemonTraduzido[i] = \"Gelo\"\n break;\n case \"bug\" :\n tipoPokemonTraduzido[i] = \"Inseto\"\n break; \n case \"dark\" :\n tipoPokemonTraduzido[i] = \"Sombrio\"\n break; \n case \"dragon\" :\n tipoPokemonTraduzido[i] = \"Dragão\"\n break; \n case \"fairy\" :\n tipoPokemonTraduzido[i] = \"Fada\"\n break;\n case \"fighting\" :\n tipoPokemonTraduzido[i] = \"Lutador\"\n break; \n case \"ghost\" :\n tipoPokemonTraduzido[i] = \"Fantasma\"\n break; \n case \"rock\" :\n tipoPokemonTraduzido[i] = \"Pedra\"\n break; \n case \"steel\" :\n tipoPokemonTraduzido[i] = \"Aço\"\n break; \n default:\n tipoPokemonTraduzido[i] = \"Normal\"\n break;\n }\n }\n return tipoPokemonTraduzido\n}", "scaleDificulty() {\n\n var result = []; //The result array.\n var numThorns = 0; //The number of thorns in a level.\n var numWalls = 0; //The number of wall objects in a level.\n var numFoods = 0; //The number of food items in a level.\n var numRegZombs = 0; //The number of regular zombies in a level.\n var numSupZombs = 0;\n\n if (this.currentLevel <= 3) {\n\n numThorns = this.getRand(2, 6);\n numWalls = this.getRand(2, 4);\n numFoods = 4;\n numRegZombs = 1;\n numSupZombs = 0;\n\n } else if (this.currentLevel >= 4 && this.currentLevel <= 8) {\n\n numThorns = this.getRand(4, 7);\n numWalls = this.getRand(3, 5);\n numFoods = this.getRand(2, 3);\n numRegZombs = 2;\n numSupZombs = this.getRand(0, 1);\n\n } else if (this.currentLevel >= 9 && this.currentLevel <= 13) {\n numThorns = this.getRand(5, 9);\n numWalls = this.getRand(4, 6);\n numFoods = this.getRand(1, 2);\n numRegZombs = this.getRand(1, 2);\n numSupZombs = this.getRand(1, 2);\n } else {\n numThorns = this.getRand(7, 9);\n numWalls = this.getRand(6, 7);\n numFoods = this.getRand(1, 2);\n numRegZombs = this.getRand(1, 2);\n numSupZombs = this.getRand(2, 4);\n\n }\n\n result[0] = numThorns;\n result[1] = numWalls;\n result[2] = numFoods;\n result[3] = numRegZombs;\n result[4] = numSupZombs;\n\n return result;\n\n }", "function pickNum(){\n num_arr= [1,2,3,4,5,6,7,8,9];\n ans_arr= []; // this array will have 4 random number from the list.\n for(var i=0; i< 4; i+=1){\n var sele = num_arr.splice(Math.floor(Math.random()*(9 - i)),1)[0];\n ans_arr.push(sele);\n }\n}", "generateRandomPoisonIndex() {\n let randoms = [];\n while (randoms.length <= this.numberOfGrids) {\n let currentNumber = Math.floor(\n Math.random() * this.numberOfGrids * this.numberOfGrids\n );\n if (randoms.indexOf(currentNumber) < 0) {\n randoms.push(currentNumber);\n }\n }\n return randoms;\n }", "placePowerups(powerups) {\n for (let i = 0; i < powerups.length; i++) {\n for (let j = 0; j < powerups[i].number; j++) {\n this.placeRandomTile(powerups[i].name);\n }\n }\n console.log('[World] Placed powerups');\n }", "getroworspeed(arrayobj) {\n let level_num = arrayobj.length;\n let index = parseInt(Math.random() * 10 / level_num);\n return arrayobj[index]\n }", "async function getPokemonData() {\n\tlet randomPokemonId = Math.floor(Math.random() * numOfPokemon) + 1;\n\tlet randomPokemon;\n\ttry {\n\t\trandomPokemon = await fetch(\n\t\t\t`https://pokeapi.co/api/v2/pokemon/${randomPokemonId}`\n\t\t)\n\t\t\t.then((res) => res.json())\n\t\t\t.then((pokemon) => {\n\t\t\t\treturn pokemon;\n\t\t\t});\n\t} catch (err) {\n\t\trandomPokemon = await fetch(\n\t\t\t`https://pokeapi.co/api/v2/pokemon/${randomPokemonId}`\n\t\t)\n\t\t\t.then((res) => res.json())\n\t\t\t.then((pokemon) => {\n\t\t\t\treturn pokemon;\n\t\t\t});\n\t}\n\n\tpokemonSprite.src = await randomPokemon.sprites.front_default;\n\n\tanswer = await randomPokemon.name;\n\twrongAnswers = [];\n\n\t//Randomize the order of the answers\n\tconst rand = Math.floor(Math.random() * 4);\n\tlet rand4 = [0, 1, 2, 3];\n\tlet item = rand4.pop();\n\tlet item2 = rand4.shift();\n\trand4.splice(rand, 0, item);\n\trand4.splice(rand, 0, item2);\n\n\t//Create an array of unique random numbers for random pokemon ids to fetch for the wrong numbers array\n\tlet uniqueRanNumsArr = [];\n\tconst createUniqueWrong = (randNum) => {\n\t\tif (!uniqueRanNumsArr.includes(randNum) && randNum !== randomPokemonId) {\n\t\t\treturn randNum;\n\t\t}\n\t\treturn createUniqueWrong(Math.floor(Math.random() * numOfPokemon) + 1);\n\t};\n\n\t//Fill wrong answers array with random unique numbers\n\tfor (let i = 0; i < 3; i++) {\n\t\tlet randomID = Math.floor(Math.random() * numOfPokemon) + 1;\n\t\tuniqueRanNumsArr.push(createUniqueWrong(randomID));\n\t\tawait fetch(`https://pokeapi.co/api/v2/pokemon/${uniqueRanNumsArr[i]}`)\n\t\t\t.then((res) => res.json())\n\t\t\t.then((pokemon) => {\n\t\t\t\twrongAnswers.push(pokemon.name);\n\t\t\t});\n\t}\n\n\tconst createWrongAnswers = async () => {\n\t\tanswers[rand4[0]].innerText = wrongAnswers[0];\n\t\tanswers[rand4[1]].innerText = wrongAnswers[1];\n\t\tanswers[rand4[2]].innerText = wrongAnswers[2];\n\t\tanswers[rand4[3]].innerText = answer;\n\t\tstartTimer();\n\t};\n\tawait createWrongAnswers();\n}", "function pickRandomCrystals(arr) {\n\t\t//crystal random value\n\t\tfor (var k = 0; k < 4; k++) {\n\t\t\tvar crystalRandom = arr[Math.floor(Math.random() * arr.length)];\n\t\t\tcrystalNumbers.push(crystalRandom);\n\t\t}\n\t\tconsole.log(\"crystal numbers: \" + crystalNumbers);\n\t}", "function poolSelection(player) {\r\n // Start at 0\r\n let index = 0;\r\n \r\n // Pick a random number between 0 and 1\r\n let r = Math.random(1);\r\n \r\n // Keep subtracting probabilities until you get less than zero\r\n // Higher probabilities will be more likely to be fixed since they will\r\n // subtract a larger number towards zero\r\n while (r > 0) {\r\n r -= player[index].fitness;\r\n // And move on to the next\r\n index += 1;\r\n }\r\n \r\n // Go back one\r\n index -= 1;\r\n \r\n // Make sure it's a copy!\r\n // (this includes mutation)\r\n return player[index].copy();\r\n }", "function makeSecret() {\n let arr = [];\n arr[0] = random(1, 9);\n let numsInArr = 1;\n while (numsInArr < 4) {\n let newNum = random(0, 9);\n let isNumUniq = 1;\n for (let n of arr) {\n if (newNum === n) {\n isNumUniq = 0;\n }\n }\n if (isNumUniq === 1) {\n arr[numsInArr] = newNum;\n numsInArr = numsInArr + 1;\n }\n }\n return arr;\n }", "function generateAscNum() {\n var maxNumber, baseNumber, fracChance;\n var temp = [];\n var gameInfo = {\n type: \"ascendingNumber\",\n answer: [],\n data: []\n };\n\n /* sets generation values based on the difficulty level */\n switch(difficulty){\n case 1:\n maxNumber = 10;\n baseNumber = 1;\n fracChance = 0;\n break;\n case 2:\n maxNumber = 100;\n baseNumber = 1;\n fracChance = 0.25;\n break;\n case 3:\n maxNumber = 50;\n baseNumber = -50;\n fracChance = 0.25;\n break;\n case 4:\n maxNumber = 100;\n baseNumber = -100;\n fracChance = 0.25;\n break;\n }\n\n for(var i = 0; i < 4; i++) {\n var num = {\n pos: 0,\n value: 0\n };\n num.value = Math.random() < fracChance ? genFraction() : genWhole();\n num.pos = i + 1;\n temp[i] = num;\n }\n\n gameInfo.data = temp.slice();\n temp.sort(compareNumbers);\n\n for(var i = 0; i < 4; i++) {\n gameInfo.answer[i] = temp[i].pos;\n }\n\n return gameInfo;\n\n /* function to generate a fraction */\n function genFraction() {\n var a = Math.floor((Math.random() * maxNumber) + baseNumber);\n var b = Math.floor((Math.random() * maxNumber) + baseNumber);\n return (a + \"/\" + b);\n }\n\n /* function to generate a whole number */\n function genWhole() {\n var val;\n var found\n do {\n val = Math.floor((Math.random() * maxNumber) + baseNumber).toString();\n found = temp.some(function (el) {\n return el.value === val;\n });\n } while(found);\n return val;\n }\n\n /* comparision function used to sort the array of numbers */\n function compareNumbers(a,b) {\n return eval(a.value) - eval(b.value);\n }\n}", "reproduce(matingPool) \n {\n //Set the new array for the new offspring\n let newPopulation = new Array(this.popSize);\n\n //Using the crossover function cross matingPool A and matingPool B\n for(let i = 0; i < this.popSize; i++) \n {\n let a = int(random(this.popSize));\n let b = int(random(this.popSize));\n\n newPopulation[i] = this.crossover(matingPool[a], matingPool[b]);\n }\n\n return newPopulation;\n }", "async function randomPokemon(num) {\n try {\n const opposingPokeData = await axios.get(`https://pokeapi.co/api/v2/pokemon/${num}/`)\n let opposingNameData = opposingPokeData.data.name\n let opposingSpriteData = opposingPokeData.data.sprites.front_default\n let opposingTypeData = opposingPokeData.data.types[0].type.name\n // console.log(opposingNameData);\n // console.log(opposingSpriteData);\n let opposingPokemonName = document.getElementsByClassName('opposing-pokemon-name');\n opposingPokemonName = opposingNameData\n let opposingSprite = document.getElementById('opposing-pokemon-sprite');\n opposingSprite.src = opposingSpriteData\n return opposingTypeData\n } catch (err) {\n alert(err, 'Try spell-checking your pokemon');\n }\n}", "_shufflePieces(array) {\n for (var i = array.length - 1; i > 0; i--) {\n var j = Math.floor(Math.random() * (i + 1));\n var temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n }\n return array;\n }", "function randomArray(seed_size) {\n let arr = [];\n for (let i = 0; i < seed_size; i++) {\n //1-2512\n arr.push(Math.floor(Math.random() * comicMax) + 1);\n }\n return arr;\n}", "function pickMystery(){\nlet suspect = suspectsArray[Math.floor( Math.random() * suspectsArray.length)]\nlet weapon = weaponsArray[Math.floor( Math.random() * weaponsArray.length)]\nlet room = roomsArray[Math.floor( Math.random() * roomsArray.length )]\n\nreturn { suspect, weapon, room} // return gives us the object\n}", "function poisonLokation(number) {\n poisonArray = [];\n for (let i = 0; i < number; i++) {\n let vx = Math.floor(Math.random() * canvas.width / gitter) * gitter;\n let vy = Math.floor(Math.random() * canvas.height / gitter) * gitter;\n poisonArray.push([vx, vy]);\n }\n}", "function getPrize()\n\n{\n //Percent Total\n var percentTotal = 0;\n \n //Shuffle Prizes\n shuffle(prizes);\n \n //Create number array\n var numberArray = [0];\n \n //Loop through prizes\n for (var i=0;i<prizes.length;i++\n )\n {\n //Add to percent total\n percentTotal += prizes[i].percent;\n \n //Add to number array\n numberArray.push(numberArray[i] += prizes[i].percent);\n \n }; //end of FOR [Loop through prizes]\n //Get Random Number\n var rnd = Math.floor(Math.random() * percentTotal);\n \n //DEBUG - Random and Ceiling numbers\n cb.log('Random number: ' + rnd + '\\n Percent Total: ' + percentTotal);\n \n //Select a Prize\n switch (true\n )\n {\n //Prize 1\n case (rnd <= numberArray[1])\n : \n {\n //code\n lastPrize = prizes[1].prize;\n \n //Odds\n cb.log('Odds of winning this prize: ' + (prizes[1].percent/percentTotal)*100 + '%');\n \n //break\n break;\n \n }; //end of CASE ITEM [Prize 1]\n \n //Prize 2\n case (rnd > numberArray[1] && rnd <= numberArray[2])\n : \n {\n //code\n lastPrize = prizes[2].prize;\n \n //Odds\n cb.log('Odds of winning this prize: ' + (prizes[2].percent/percentTotal)*100 + '%');\n \n //break\n break;\n \n }; //end of CASE ITEM [Prize 2]\n \n //Prize 3\n case (rnd > numberArray[2] && rnd <= numberArray[3])\n \n : \n {\n //code\n lastPrize = prizes[3].prize;\n \n //Odds\n cb.log('Odds of winning this prize: ' + (prizes[3].percent/percentTotal)*100 + '%');\n \n //break\n break;\n \n }; //end of CASE ITEM [Prize 3]\n \n //Prize 4\n case (rnd > numberArray[3] && rnd <= numberArray[4])\n \n \n : \n {\n //code\n lastPrize = prizes[4].prize;\n \n //Odds\n cb.log('Odds of winning this prize: ' + (prizes[4].percent/percentTotal)*100 + '%');\n \n //break\n break;\n \n }; //end of CASE ITEM [Prize 4]\n \n //Prize 5\n case (rnd > numberArray[4] && rnd <= numberArray[5])\n : \n {\n //code\n lastPrize = prizes[5].prize;\n \n //Odds\n cb.log('Odds of winning this prize: ' + (prizes[5].percent/percentTotal)*100 + '%');\n \n //break\n break;\n \n }; //end of CASE ITEM [Prize 5]\n \n //Prize 6\n case (rnd > numberArray[5] && rnd <= numberArray[6])\n : \n {\n //code\n lastPrize = prizes[6].prize;\n \n //Odds\n cb.log('Odds of winning this prize: ' + (prizes[6].percent/percentTotal)*100 + '%');\n \n //break\n break;\n \n }; //end of CASE ITEM [Prize 6]\n \n //Prize 7\n case (rnd > numberArray[6] && rnd <= numberArray[7])\n : \n {\n //code\n lastPrize = prizes[7].prize;\n \n //Odds\n cb.log('Odds of winning this prize: ' + (prizes[7].percent/percentTotal)*100 + '%');\n \n //break\n break;\n \n }; //end of CASE ITEM [Prize 7]\n \n //Prize 8\n case (rnd > numberArray[7] && rnd <= numberArray[8])\n : \n {\n //code\n lastPrize = prizes[8].prize;\n \n //Odds\n cb.log('Odds of winning this prize: ' + (prizes[8].percent/percentTotal)*100 + '%');\n \n //break\n break;\n \n }; //end of CASE ITEM [Prize 8]\n \n //Prize 9\n case (rnd > numberArray[8] && rnd <= numberArray[9])\n : \n {\n //code\n lastPrize = prizes[9].prize;\n \n //Odds\n cb.log('Odds of winning this prize: ' + (prizes[9].percent/percentTotal)*100 + '%');\n \n //break\n break;\n \n }; //end of CASE ITEM [Prize 9]\n \n //Prize 10\n case (rnd > numberArray[9] && rnd <= numberArray[10])\n : \n {\n //code\n lastPrize = prizes[10].prize;\n \n //Odds\n cb.log('Odds of winning this prize: ' + (prizes[10].percent/percentTotal)*100 + '%');\n \n //break\n break;\n \n }; //end of CASE ITEM [Prize 10]\n \n default :\n //default\n //No prize?\n lastPrize = 'Something went wrong...';\n \n //break\n break;\n \n }; //end of switch [Select a Prize]\n \n}", "pick(){\r\n\t\tlet r = random(1)\r\n\t\tlet index = 0\r\n\t\twhile(r>0){\r\n\t\t\tr -= this.players[index].score\r\n\t\t\tindex ++ \r\n\t\t}\r\n\t\tindex--\r\n\t\treturn index\r\n\t}", "function allFour() {\n var lCuC = lC.concat(uC);\n var lCuCnM = lCuC.concat(nM);\n var all = lCuCnM.concat(sP);\n var random = Math.floor(Math.random() * (all.length - 1));\n return all[random];\n }", "function pickAnswer(){//pick counrty from array\r\n var index=Math.floor(Math.random()*country.length);\r\n return country[index];\r\n}", "function fights(){\n setSecondPokemon(prev => {\n const firstRandom=Math.floor(Math.random()*yourBattlePokemonObject.attacks.length)\n const hp = parseInt(prev.hp) - parseInt(yourBattlePokemonObject.attacks[firstRandom].damage)\n if(hp<=0){\n return pokemon[Math.floor(Math.random()*pokemon.length)]\n }\n return {\n ...prev,\n hp\n }\n })\n setYourBattlePokemonObject(prev=>{\n const secondRandom=Math.floor(Math.random()*secondPokemon.attacks.length)\n const hp = parseInt(prev.hp) - parseInt(secondPokemon.attacks[secondRandom].damage)\n if(hp<=0){\n const filterid=prev.id\n setYourPokemonArray(prev=>{\n console.log(123456,[...prev.filter(pokemons=>pokemons.id!==filterid)])\n return [...prev.filter(pokemons=>pokemons.id!==filterid)]\n ////filter should be filtering out in123456, but still showing in 9900\n })\n const filteredArray = yourPokemonArray.filter(pokemons=>pokemons.id!==filterid)\n console.log(9900,yourPokemonArray)\n if (filteredArray.length === 0) {\n alert('congradulations all your pokeomon have died, you must not be a very good trainer')\n disableButtons()\n return {}\n }\n return filteredArray[Math.floor(Math.random()*filteredArray.length)]\n }\n return {\n ...prev,\n hp\n }\n })\n }", "function randomFourArray() {\n const a = [0, 1, 2, 3];\n const b = [];\n\n for (let i = 0; i < 4; i++) {\n const x = Math.floor((4 - i) * Math.random());\n b.push(a[x]);\n a.splice(x, 1);\n }\n\n return b;\n}", "function randomNumGenerator(min, max) {//function to get single powerball number\n\n var power = Math.round(Math.random() * (max - min)+ min);//randomly generate the single digit\n\nreturn power; //return power\n}", "getWeightedData() {\n const weightedNumber = Math.floor(Math.random(0, 13) * 13);\n let returnedNumber;\n if(weightedNumber >= 9) {\n returnedNumber = Math.floor(Math.random(10, 13) * 10);\n console.log(weightedNumber)\n } else if(weightedNumber >= 6 && weightedNumber < 9) {\n returnedNumber = Math.floor(Math.random(6,10) * 10);\n } else {\n returnedNumber = Math.floor(Math.random(1, 6) * 10);\n }\n return this.state.possibleSlots[returnedNumber];\n }", "function generateBulletPower(num){\r\n\tif(num == 249 && allBulletPowers.size < 3){\r\n\t\tvar power = BulletPower(bulletPowerCount);\r\n\t\t++bulletPowerCount;\r\n\t\tallBulletPowers.set(power.id, power);\r\n\t}\r\n}", "function CreateLottoValues() {\n for (var i=0; i<randomArray.length; i++) {\n randomArray[i] = array[Math.floor(Math.random() * array.length)]; \n }\n}", "function genrandom(){\r\n\r\nfor(var i = 0;i<9; i++){\r\n\tbomb[i] = Math.floor(Math.random() * 81);\r\n}\r\n}", "function randomOpinion (array) {\n return array[Math.floor(Math.random() * array.length)];\n}", "function hp(gen) {\n if (gen === \"Ancient Dragon\") {\n return (Math.floor((Math.random() * 20)) + 81);\n } else if (gen === \"Prowler\") {\n return (Math.floor((Math.random() * 20)) + 50);\n } else {\n return (Math.floor((Math.random() * 20)) + 20);\n }\n}", "function genBonusPipes() {\n\tvar xPos = Math.floor(Math.random() * 6);\n var yPos = Math.floor(Math.random() * 6) + 2;\n map.putTile(313, layer5.getTileX(xPos * 64), layer5.getTileY(yPos * 64), 'Tile Layer 5');\n}", "function sample (population, count) {\n var arr = population.slice();\n var j, tmp, ln = arr.length;\n for (var i = ln - 1; i > (ln - count - 1); i--) {\n j = baseRandInt(i + 1);\n tmp = arr[i];\n arr[i] = arr[j];\n arr[j] = tmp;\n }\n return arr.slice(ln - count);\n }", "function hangmanGenerator(arr){\n return hangmanChoices[Math.floor(Math.random() * arr.length)];\n}", "popuniIzvjestaj() {\n this.donja = Util.getRandomIntIn(50, 100);\n this.gornja = Util.getRandomIntIn(70, 140);\n this.puls = Util.getRandomIntIn(50, 160);\n }", "function startUp()\n {\n targetNumber= Math.floor(Math.random() * 120) +1; //to randomize target number with Math.floor(Math.random() * ((y-x)+1) + x);\n\n counter = 0;\n \n // For each iteration, generate a new random number between 1 and 12.\n // for (i=0; i <= myPokemon.length; i++){\n // var pokemonValue= Math.floor(Math.random() * 12) + 1;\n var pokemonValue1 = Math.floor(Math.random() * 12) +1;\n var pokemonValue2 = Math.floor(Math.random() * 12) +1;\n var pokemonValue3 = Math.floor(Math.random() * 12) +1;\n var pokemonValue4 = Math.floor(Math.random() * 12) +1;\n // console.log(pokemonValue1);\n // console.log(pokemonValue2);\n // console.log(pokemonValue3);\n // console.log(pokemonValue4);\n \n // update the html\n $('#wins').text(wins);\n $('#losses').text(losses);\n $(\"#guess\").text(targetNumber);\n $('#counter').text(counter);\n \n // Each imageCrystal will be given a data attribute called data-pokemonValue.\n // This data attribute will be set equal to the array value.\n \n $(\".pokemon1\").attr(\"data-pokemonvalue\", pokemonValue1);\n $(\".pokemon2\").attr(\"data-pokemonvalue\", pokemonValue2);\n $(\".pokemon3\").attr(\"data-pokemonvalue\", pokemonValue3);\n $(\".pokemon4\").attr(\"data-pokemonvalue\", pokemonValue4);\n \n\n // // add the data-pokemonvalue to each pokemon div\n // $('.pokemon' + i).attr('data-pokemonvalue', pokemonValue);\n // }\n }", "function randomLevel() {\n const index = Math.floor(Math.random() * 8);\n return levels[index];\n}", "function getRandomValue(){\r\n return values[Math.floor(Math.random() * 7)]\r\n}", "function generatetrials(numtrials) { \n var bucket = []; \n if (numtrials >= 3){ //random without replacement if we can help it\n for (let i = 0; i < numtrials; i++) {\n switch(i%3){\n case 0:\n bucket.push(\"faster\");\n break;\n case 1:\n bucket.push(\"slower\");\n break;\n case 2:\n bucket.push(\"nochange\");\n }\n } \n } else { //just random with replacement if there are only a few trials\n for(let i = 0; i < numtrials; i++) {\n var pick = getRandomInt(0,2);\n switch(pick%3){\n case 0:\n bucket.push(\"faster\");\n break;\n case 1:\n bucket.push(\"slower\");\n break;\n case 2:\n bucket.push(\"nochange\");\n }\n }\n }\n return bucket;\n}", "function floridaLotto(max, min, num){\n for (var i = 0; i < num; i++){\n floridaQP[i] = Math.random() * (max - min) + min; //math object to select a random number\n floridaQP[i] = Math.round(floridaQP[i]); //math object to round number to nearest whole number\n }\n\n console.log(\"Your Florida lottery quick pick numbers are \" + floridaQP); //console outputs the Florida Lottery quick pick numbers.\n\n}", "async genType(){\n let result = ['barren', 'lush', 'aquatic', 'gas', 'rocky', 'plains', 'polis'];\n for(var k = 0; k < misc.randomnum(500,5000); k++){\n result.sort(() => Math.random() - 0.5);\n }\n return result[0];\n }", "function tiradas(n){\n var lista = [];\n for (var i = 0; i < n; i++) {\n lista.push(random(6));\n }\n return lista;\n}" ]
[ "0.7005367", "0.67773926", "0.6680528", "0.6574842", "0.65537995", "0.6510981", "0.65074015", "0.6484808", "0.6430658", "0.63793385", "0.6373412", "0.6362663", "0.6345218", "0.62932444", "0.6280637", "0.6278372", "0.6272051", "0.6262572", "0.624271", "0.6241701", "0.6209146", "0.62004787", "0.6194146", "0.6192454", "0.6171129", "0.61204326", "0.61109596", "0.61008257", "0.6085305", "0.6078332", "0.6066205", "0.606166", "0.605947", "0.6056296", "0.60493904", "0.6042162", "0.6019527", "0.6013875", "0.60043687", "0.5977497", "0.59702444", "0.5966171", "0.59423256", "0.59291625", "0.5921103", "0.5917856", "0.5914013", "0.59107953", "0.5905795", "0.5903624", "0.58993065", "0.5885574", "0.58719915", "0.5862582", "0.58619535", "0.58534634", "0.58457464", "0.5841855", "0.58407867", "0.5819602", "0.5810924", "0.5799359", "0.5796688", "0.57865936", "0.5783754", "0.57778674", "0.57768154", "0.5766192", "0.57609576", "0.57513314", "0.5748351", "0.57280415", "0.57152337", "0.57149", "0.5713135", "0.57093537", "0.57084495", "0.57059985", "0.5700964", "0.57002133", "0.569866", "0.5695571", "0.56954736", "0.569168", "0.5689137", "0.5682991", "0.56810784", "0.5675865", "0.56662935", "0.56660277", "0.56635237", "0.565606", "0.56549466", "0.5652223", "0.56505316", "0.56498975", "0.56486243", "0.56462383", "0.56443727", "0.5633849" ]
0.7426572
0
Function to capitalise firstletters
function capitaliseFirstLetter(string) { return string.charAt(0).toUpperCase() + string.slice(1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function caps(a) {return a.substring(0,1).toUpperCase() + a.substring(1,a.length);}", "function capitalize(str) {}", "function capitalFirstLetter(name) {\n return name.charAt(0).toUpperCase() + name.slice(1)\n}", "function capitaliseFirstLetter(string){\n\t\t\tvar newstring = string.toLowerCase();\n\t\t\treturn newstring.charAt(0).toUpperCase() + newstring.slice(1);\n\t\t}", "function cap_first(s) {\n return s[0].toUpperCase() + s.substring(1); \n}", "function capitalie(str){\n\treturn str.charAt(0).toUpperCase() + str.slice(1);\n\n}", "function firstLetterUpperCase(value){\n\tvar value = value.substr(0,1).toUpperCase() + value.substr(1,value.length);\n\treturn value;\n}", "function ucFirst(str) {\n\n }", "function capfirst(str) {\n str = str.toLowerCase().replace(/\\b[a-z]/g, function (letter) {\n return letter.toUpperCase();\n });\n return str;\n}", "function LetterCapitalize(str) {\n return str.replace(/\\w\\S*/g, function(txt) {\n return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();\n });\n}", "function capitalizeFirstLetter(input) {\n return input.charAt(0).toUpperCase() + input.slice(1);\n}", "function uppercaseFirstLetter(str) {\n\treturn str[0].toUpperCase() + str.slice(1);\n\t// Prend la première lettre de la chaine de caractère reçu en param\n\t// La met en majuscule\n\t// concatène le reste de la chaine de caractère (toujours en minuscule) avec cette lettre en maj\n}", "function fn_CapitalizeFirstChar(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n}", "capitalizeFirstLetter(word) {\n return (word.charAt(0).toUpperCase() + word.substring(1));\n }", "capitalizeFirstLetter(str) {\n let pattern = /(^|[-\\s])([a-zа-яё])/g;\n let normalizedName = str.toLowerCase();\n\n normalizedName = normalizedName.replace(pattern, function($2){\n \treturn $2.toUpperCase();\n });\n\n return normalizedName;\n }", "function capitalizeFirstLetter(text) {\n if (typeof text !== 'string') {\n return '';\n }\n return text.charAt(0).toUpperCase() + text.slice(1);\n }", "static capitalizeFirstLetter(string){\n return string.charAt(0).toUpperCase() + string.substring(1)\n }", "function capitaliseFirstLetter(string)\n{\n return string.charAt(0).toUpperCase() + string.slice(1);\n}", "function capitaliseFirstLetter(string)\n{\n return string.charAt(0).toUpperCase() + string.slice(1);\n}", "function capitaliseFirstLetter(string)\n{\n return string.charAt(0).toUpperCase() + string.slice(1);\n}", "function capFirstLetter(string){\r\n return string.charAt(0).toUpperCase() + string.slice(1);\r\n }", "function firstToUpper(text) {\n\n return text.charAt(0).toUpperCase() + text.substr(1);\n\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 capitalizeFirstLetter(val) {\n return val.charAt(0).toUpperCase() + val.slice(1);\n}", "function firstLetterUpper(word){\n\treturn word.charAt(0).toUpperCase() + word.slice(1);\n}", "function capitaliseLetter(str) {\n return str[0].toUpperCase() + str.substring(1);\n}", "function firstLetterCapital(str){\n str = str.toLowerCase().split(' ');\n\n for (var i = 0; i < str.length; i++) {\n\n str[i] = str[i].charAt(0).toUpperCase() + str[i].slice(1);\n }\n\n return str.join(' ');\n}", "function capitolFirstLetter(string) \n{\n return string.charAt(0).toUpperCase() + string.slice(1).toLowerCase();\n}", "function ucfirst(str,force){\n str=force ? str.toLowerCase() : str;\n return str.replace(/(\\b)([a-zA-Z])/,\n function(firstLetter){\n return firstLetter.toUpperCase();\n });\n }", "function capitalize(a) {\n return a.charAt(0).toUpperCase() + a.slice(1);\n }", "function firstLetterCap(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}", "static capitalize(string){\n let firstLetter = string.slice(0,1).toUpperCase()\n return firstLetter + string.slice(1)\n }", "function capitalize(s){\n\t\t\treturn s[0].toUpperCase() + s.slice(1);\n\t\t}", "function capitaliseFirstLetter(string) {\n try {\n return string.charAt(0).toUpperCase() + string.slice(1);\n } catch (e) {\n showErrorMsg(e);\n }\n }", "function firstLetterCapitalized (word){\n var letterOne = word.substring(0,1)\n var capitalizedLetter = letterOne.toUpperCase()\n return capitalizedLetter + word.substring(1)\n}", "function capitalizeFirstLetter(string) {\n\t\t\t\t\treturn string.charAt(0).toUpperCase() + string.slice(1);\n\t\t\t\t}", "function firstToUpper(text) { // 143\n // 144\n return text.charAt(0).toUpperCase() + text.substr(1); // 145\n // 146\n }", "function capitalizeFirstLetter(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n }", "function capitaliseFirstLetters(str) {\r\n var splitStr = str.toLowerCase().split(' ');\r\n for (var i = 0; i < splitStr.length; i++) {\r\n // Assign it back to the array\r\n splitStr[i] = splitStr[i].charAt(0).toUpperCase() + splitStr[i].substring(1);\r\n }\r\n // Directly return the joined string\r\n return splitStr.join(' ');\r\n}", "function capitalize(input) {\n return input.replace(input.charAt(0), input.charAt(0).toUpperCase());\n}", "function firstToUpper(text) { // 160\n // 161\n return text.charAt(0).toUpperCase() + text.substr(1); // 162\n // 163\n }", "function capitaliseFirstLetter(string) {\n var pieces = string.split(\"\");\n pieces[0] = pieces[0].toUpperCase();\n return pieces.join(\"\");\n}", "function capitalize(s){\n return s[0].toUpperCase() + s.slice(1);\n}", "UpperCaseFirstLetter(name) {\n let Name = name[0].toUpperCase() + name.substring(1);\n return Name;\n }", "function capitalize(value) {\n\t return value.charAt(0).toUpperCase() + slice(value).call(value, 1);\n\t}", "function titleCase(str) {\nreturn str.replace(/\\w\\S*/g, function(txt) { // Checks for a character then zero or more non-white space\n return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();}); // replaces the first char with a CAP letter\n}", "function capitalizeFirstLetter(string) {\n\treturn string.charAt(0).toUpperCase() + string.slice(1);\n }", "function titlecase(str){\n return str.replace(/\\w\\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});\n}", "function capitalizeFirstLetter(str) {\n\treturn str.charAt(0).toUpperCase() + str.substring(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 capitalizeFirstLetter(string) {\n string=string.toLowerCase()\n return string.charAt(0).toUpperCase() + string.slice(1);\n }", "function firstLetterCap(string) {\r\n return string.charAt(0).toUpperCase() + string.slice(1);\r\n}", "static capitalize(str){\n return str.charAt(0).toUpperCase() + str.substring(1);\n }", "function titleCase(str) {\nreturn str.replace(/\\w\\S*/g, function(txt) { // Checks for a character then zero or more non-white space\n return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();}); // Replaces the first char with a CAP letter\n}", "function capitalize(s) {\r\n return s.charAt(0).toUpperCase() + s.slice(1)\r\n}", "function titleCases(arg){\n return arg.charAt(0).toUpperCase() + arg.substring(1);\n }", "function capitalizeFirst(s) {\n\n return s.substr(0, 1).toUpperCase() + s.substr(1);\n\n}", "static capitalize(str){\n return str[0].toUpperCase() + str.slice(1)\n }", "function firstWordCapitalize(word){\n let firstCharcter = word[0].toUpperCase();\n return firstCharcter + word.slice(1);\n \n}", "function firstLetterCapital (word) {\n var wordArray = word.split(' ');\n var newWordArray = [];\n for (var i = 0; i < wordArray.length; i++) {\n newWordArray.push(wordArray[i].charAt(0).toUpperCase() + wordArray[i].slice(1));\n }\n return newWordArray.join(' ');\n}", "function capitalizeFirstLetter(string) {\n var modified = string.charAt(0).toUpperCase() + string.slice(1);\n return modified;\n}", "static capitalize(name){\n return name.charAt(0).toUpperCase() + name.slice(1);\n }", "static capitalize(str){\n return str.charAt(0).toUpperCase() + str.slice(1)\n }", "function capitalize(s) {\n return s.charAt(0).toUpperCase() + s.slice(1);\n }", "function camelCase(str, firstCapital) {\n if (firstCapital === void 0) { firstCapital = false; }\n return str.replace(/^([A-Z])|[\\s-_](\\w)/g, function (match, p1, p2, offset) {\n if (firstCapital === true && offset === 0)\n return p1;\n if (p2)\n return p2.toUpperCase();\n return p1.toLowerCase();\n });\n}", "function firstCapital(str) {\n return str[0].toUpperCase() + str.slice(1);\n }", "function firstCharUpperCase(str){\n\tif(str == null){\n\t\treturn str;\n\t}\n\tstr = str.replace(/(^|\\s+)\\w/g,function(s){return s.toUpperCase();});\n\treturn str;\n}", "function firstLetterCap(string){\n return result = string.charAt(0).toUpperCase() + string.slice(1);\n}", "static capitalize(str){\n return str.charAt(0).toUpperCase() + str.slice(1);\n }", "function capitalizeFirstLetter(string) {\r\n return string.charAt(0).toUpperCase() + string.slice(1);\r\n}", "function capitalizeLetter(str) {\n return str.replace(/\\w\\S*/g, function(txt) {\n return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();\n });\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}", "static capitalize(sentence){\n let a= sentence.toUpperCase().charAt(0);\n return a+sentence.substr(1);\n }", "function i(e){return e[0].toUpperCase()+e.substr(1)}", "function capitalize(s) {\n return s.charAt(0).toUpperCase() + s.slice(1);\n }", "function capitalizeFirstLetter (str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}", "function upperCaseFirst(s) {\r\n return s ? s.replace(/\\w\\S*/g, function (txt) {\r\n return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();\r\n }) : '';\r\n}", "function capitalizeFirstLetter(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n }", "function capital_letter(str) {\n str = str.split(\" \");\n for (var i = 0, x = str.length; i < x; i++) {\n str[i] = str[i][0].toUpperCase() + str[i].substr(1);\n }\n\n return str.join(\" \");\n}", "function capitalizeFirstLetter(item) {\n return item.charAt(0).toUpperCase() + item.slice(1);\n}", "function uncapitalize(text) {\n if (!text || typeof text !== \"string\") {\n return '';\n }\n return text.charAt(0).toLowerCase() + text.substr(1);\n }", "function capitalizeFirstLetter(str) {\n let strS=str.split(\" \");\n let strMap= strS.map((a)=>a.slice(0,1).toUpperCase()+a.slice(1));\n return strMap.join()\n}", "function capitalize(name) {\n let capInitial = name.substring(0, 1).toUpperCase() + name.substring(1).toLowerCase();\n console.log(capInitial);\n}", "function Capitalize(str) {\n \tvar first = str[0];\n\n \tif(isNaN(first))\n return first.toUpperCase() + str.slice(1);\n \telse \n \t return str;\n}", "function ucfirst(str) { \nreturn str.charAt(0).toUpperCase() + str.substr(1);\n}", "function capitalizeFirstLetter(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n }", "function capitalizeFirstLetter(string)\n{\n\treturn string.charAt(0).toUpperCase() + string.slice(1);\n}", "function Capitalize(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n }", "function Capitalize(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n }", "function capitalizeFirstLetter(string) {\n return string.charAt(0) + string.slice(1).toLowerCase();\n}", "function ucFirst(str) {\n return str[0].toUpperCase() + str.slice(1);\n}", "function ucf(text) {\n return text.substr(0, 1).toUpperCase() + text.substr(1);\n}", "function capitalizeFirstLetter(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n }", "function capitalizeFirstLetter(str) {\n return str.charAt(0).toUpperCase() + str.slice(1).toLowerCase();\n}", "function capitalize(s){\n let ss='';\n let c=s.charCodeAt(0);\n if(c > 96 && c < 123){\n ss+=String.fromCharCode(c - 32);\n }else{\n ss+=String.fromCharCode(c);\n }\n for (let i=1; i<s.length; i++){\n c=s.charCodeAt(i);\n if(c > 64 && c < 91){\n ss+=String.fromCharCode(c + 32);\n }else{\n ss+=String.fromCharCode(c);\n }\n }\n \n return ss;\n //return '*'+s.toLowerCase()+'*';\n}", "function capitalizeFirstLetter(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n }", "function capitalizeFirstLetter(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n }", "function capitalizeFirstLetter(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n }", "function capitalizeFirstLetter(string) {\n\treturn string.charAt(0).toUpperCase() + string.slice(1);\n}" ]
[ "0.8213183", "0.81953067", "0.81399673", "0.80937546", "0.8059772", "0.79980177", "0.79878026", "0.79865927", "0.79527646", "0.7950897", "0.79493636", "0.794932", "0.79415804", "0.79404116", "0.7928362", "0.79268533", "0.7925957", "0.7924953", "0.7924953", "0.7924953", "0.791976", "0.7900505", "0.7895165", "0.7877076", "0.78385085", "0.7835115", "0.7821485", "0.78140336", "0.78119403", "0.78092456", "0.7807913", "0.7800694", "0.780027", "0.7777936", "0.77639663", "0.775537", "0.7754436", "0.77481854", "0.77466875", "0.7742669", "0.7740673", "0.77387124", "0.7738636", "0.77377725", "0.77365285", "0.7734144", "0.77325946", "0.77288884", "0.77255934", "0.77237654", "0.77201074", "0.7718997", "0.77178454", "0.7714584", "0.7697915", "0.7692672", "0.7690615", "0.7686659", "0.7684441", "0.7683502", "0.7683104", "0.76753676", "0.7674562", "0.76740843", "0.7665943", "0.7660699", "0.76573884", "0.76562905", "0.7654468", "0.765196", "0.76439595", "0.76435137", "0.7643212", "0.7643125", "0.7636617", "0.7632133", "0.7631413", "0.76203823", "0.76165205", "0.7615936", "0.7613291", "0.76113015", "0.7610986", "0.7607451", "0.7604884", "0.75935066", "0.7592701", "0.7591056", "0.7591056", "0.7589241", "0.75883514", "0.75868386", "0.7586154", "0.7583827", "0.75795436", "0.7578664", "0.7578664", "0.7578664", "0.7576919" ]
0.7774763
34
Create a function called travelFrom that receives a start station and an end station.
function travelFrom() { var startStationInput = document.querySelector("#startStation"); var startStation = startStationInput.value; var endStationInput = document.querySelector("#endStation"); var endStation = endStationInput.value; var start = capitaliseFirstLetter(startStation.toLowerCase()); var end = capitaliseFirstLetter(endStation.toLowerCase());var startLine = findLine(start); var endLine = findLine(end); var startLineArray = sydneyTrains[startLine]; var endLineArray = sydneyTrains[endLine]; // Check if stations exists on the lines entered if (!stations.includes(start) || !stations.includes(end)) { var message = ("Something went wrong and the stations you entered don't exist on those lines"); } else if (endLineArray.includes(start) || startLineArray.includes(end)) { //Tell person to switch to the line. if (endLineArray.includes(start)) { var correctLine = endLine; } else { var correctLine = startLine; } var numberofStops = Math.abs(endLineArray.indexOf(end) - startLineArray.indexOf(start)); if (numberofStops > 1) { var stopOrStops = "stops"; } else { var stopOrStops = "stop"; }; var message = "To go from "+start+" to "+end+" - you will need to go through "+numberofStops+" "+stopOrStops+" on the "+correctLine+"."; } else { //Find first station that matches both startLine and endLine = switchingStation var switchingStation = endLineArray.find(function(item) { return startLineArray.includes(item); }); //Tell person how many stops from startStation to switchingStation //Tell person where to switch (switchingStation) //Tell person how many stops from switchingStation to endStation var numberofStops1 = Math.abs(startLineArray.indexOf(switchingStation) - startLineArray.indexOf(start)); var numberofStops2 = Math.abs(endLineArray.indexOf(switchingStation) - endLineArray.indexOf(end)); if (numberofStops1 > 1) { var stopOrStops1 = "stops"; } else { var stopOrStops1 = "stop"; }; if (numberofStops2 > 1) { var stopOrStops2 = "stops"; } else { var stopOrStops2 = "stop"; }; var message = "To go from "+start+" to "+end+" - you will need to take "+startLine+" for "+numberofStops1+" "+stopOrStops1+", switch at "+switchingStation+" to "+endLine+", then go through "+numberofStops2+" "+stopOrStops2+"."; }; answer.innerText = message; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_journey(station1, station2) {\n const toDate = new Moment().format(\"YYYY-MM-DD\");\n const fromDate = new Moment().businessSubtract(20).format(\"YYYY-MM-DD\");\n\n return {\n \"from_loc\":station1,\n \"to_loc\":station2,\n \"from_time\":\"0000\",\n \"to_time\":\"2359\",\n \"from_date\":fromDate,\n \"to_date\":toDate,\n \"days\":\"WEEKDAY\"\n }\n }", "function calculateAndDisplayRoute(directionsService, directionsDisplay) {\n \n //start should be lat+\",\"+lng\n var start = document.getElementById('start').value;\n //if the user chooses to use current location\n if(start===\"\"){\n //getLocation();\n start = 34.0666664+\",\"+-118.167332664;//document.getElementById('start').value;\n }\n\n //end should be (lat,lng)\n var end = document.getElementById('end').value;\n\n //gets the route to take for the map\n directionsService.route({\n origin: start,\n destination: end,\n travelMode: 'WALKING' //walking from point A to B\n }, function(response, status) {\n \n //if no errors found it fins the route\n //else display error message\n if (status === 'OK') {\n directionsDisplay.setDirections(response);\n } else {\n window.alert('Directions request failed due to ' + status);\n }\n });\n}", "function calcRoute() {\n\n var start = pos;\n var end = document.getElementById('end').value;\n var request = {\n origin:start,\n destination:end,\n travelMode: google.maps.TravelMode.DRIVING\n };\n directionsService.route(request, function(response, status) {\n if (status == google.maps.DirectionsStatus.OK) {\n directionsDisplay.setDirections(response);\n }\n });\n}", "function calcRouteLatLong(latinicio, longinicio, latfin, longfin) {\nvar start = new google.maps.LatLng(latinicio, longinicio);\nvar end = new google.maps.LatLng(latfin, longfin);\nvar request = {\n origin: start,\n destination: end, \n travelMode: google.maps.TravelMode.DRIVING\n};\ndirectionsService.route(request, function(response, status) {\n if (status == google.maps.DirectionsStatus.OK) {\n directionsDisplay.setDirections(response);\n }\n else{\n alert(\"No se ha podido calcular ruta\");\n }\n}); \n}", "function travel(r, zipcode) {\n // your code\n}", "function calcRoutee(){\r\n\t\t\r\n\t\tvar half= document.getElementById(\"half\").value;\r\n\t\tvar end = document.getElementById(\"end\").value;\r\n\t\tvar request = { origin: half, destination: end,\r\n\t\t\ttravelMode: google.maps.DirectionsTravelMode.DRIVING\r\n\t\t};\r\n\t\tdirectionsService.route(request, function(directionsResults, status){\r\n\t\t\tif(status==google.maps.DirectionsStatus.OK){\r\n\t\t\t\thandleDirectionsResponse1(\r\n\t\t\t\t\t\t half,end, directionsResults);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t }", "function createRoute() {\n\n var start = new google.maps.LatLng(markers[0].position.lat(), markers[0].position.lng());\n var end = new google.maps.LatLng(markers[1].position.lat(), markers[1].position.lng());\n calculateRoute(start, end);\n\n}", "function Journey(str_begin_line, begin_stp, str_desti_line, desti_stp) {\n //str_begin_line ----> begin_line &&\n //str_desti_line ----> desti_line_\n this.stp_nochangeline = stp_nochangeline(interatelines(str_begin_line), begin_stp, desti_stp)\n this.stp_before_inter = stp_before_inter(interatelines(str_begin_line), begin_stp, interatelines(str_desti_line));\n this.doesinter = doesinter(str_begin_line, str_desti_line);\n this.stp_after_inter = stp_after_inter(interatelines(str_begin_line), desti_stp, interatelines(str_desti_line));\n this.total = function( ) { return this.stp_before_inter.length+this.stp_after_inter.length };\n}", "function buildFlightSearchURL(from, to, departure, arrival) {\n return \"https://www.expedia.com/Flights-Search?trip=roundtrip&leg1=from:\"+from+\",to:\"+to+\",departure:\"+departure+\"TANYT&leg2=from:\"+to+\",to:\"+from+\",departure:\"+arrival+\"TANYT&passengers=children:0,adults:1,seniors:0,infantinlap:Y&mode=search\";\n}", "function shortest_path(to_x, to_y, use_stations) {\n\t// {{{\n\tvar route = \"<br>\";\n\tvar from_x = current_x;\n\tvar from_y = current_y;\n\n\tvar dist_by_foot = distance_AP(from_x, from_y, to_x, to_y);\n\tvar dist_to_station = places_station[0][3];\n\n\tif (dist_by_foot == 0) {\n\t\troute += \"You are already there ! No need to move.<br>\";\n\t\t// generate_direction() is used to update the direction arrows\n\t\tgenerate_direction(current_x, current_y, to_x, to_y, enable_hud, true);\n\t\treturn route;\n\t}\n\n\tif ((!use_stations) || (dist_by_foot < dist_to_station)) {\n\t\troute += \"Walk to your destination (\" + dist_by_foot + action_point_str + \": \" +\n\t\t\t generate_direction(current_x, current_y, to_x, to_y, enable_hud, true) + \")<br>\";\n\t\treturn route;\n\t}\n\n\tvar places_station_tmp = new Array();\n\tfor (var i = 0; i < places_station.length; ++i) {\n\t\tplaces_station_tmp[i] = new Array();\n\t\tplaces_station_tmp[i][0] = places_station[i][0];\n\t\tplaces_station_tmp[i][1] = places_station[i][1];\n\t\tplaces_station_tmp[i][2] = places_station[i][2];\n\t\tplaces_station_tmp[i][3] = -1;\n\t}\n\t// Compute the distance from to_x, to_y to stations and sort them\n\tsort_places(to_x, to_y, places_station_tmp);\n\n\tvar best_dist_to_dest = dist_to_station + transit_cost_action_point + places_station_tmp[0][3];\n\n\t// Same AP cost ? then walk\n\tif (best_dist_to_dest >= dist_by_foot) {\n\t\troute += \"Walk to your destination (\" + dist_by_foot + action_point_str + \": \" +\n\t\t\t generate_direction(current_x, current_y, to_x, to_y, enable_hud, true) + \")<br>\";\n\t\treturn route;\n\t}\n\n\tif (dist_to_station > 0) {\n\t\troute += \"Walk to the \" + places_station[0][0] + \" station (\" + dist_to_station + action_point_str + \": \"+\n\t\t\t generate_direction(current_x, current_y, places_station[0][1], places_station[0][2], enable_hud, true) + \")<br>\";\n\t}\n\troute += \"Take the train up to \" + places_station_tmp[0][0] + \" station (\" + transit_cost_action_point + action_point_str + \" + \"+transit_cost_coins+\" \"+ money_unit_str + \").<br>\";\n\troute += \"Walk to your destination (\" + places_station_tmp[0][3] + action_point_str + \": \"+\n\t\t generate_direction(places_station_tmp[0][1], places_station_tmp[0][2], to_x, to_y, false, false) + \")<br>\";\n\n\troute += \"Total travel cost: \" + (parseInt(dist_to_station) + transit_cost_action_point + parseInt(places_station_tmp[0][3])) + action_point_str + \" & \" + transit_cost_coins + \" \" + money_unit_str + \".<br>\";\n\n\treturn route;\n\t// }}}\n}", "function travel(destination, myFunc){\n console.log(\"travelling to \" + destination);\n let a = myFunc(); //our a variable is equal to \"apples\"\n return a;\n}", "function generateRoute() {\n var from = document.getElementById(\"from\").value;\n var to = document.getElementById(\"to\").value;\n directions.load(\"from: \" + from + \" to: \" + to, { preserveViewport: true, getSteps: true });\n }", "function calculateRoute(start, end) {\n\n var request = {\n origin: start,\n destination: end,\n travelMode: 'DRIVING'\n };\n directionsService.route(request, function (response, status) {\n if (status === 'OK') {\n directionsDisplay.setDirections(response);\n\n //Calculate total duration and distance\n var totalDistance = 0.0;\n var totalDuration = 0.0;\n var legs = response.routes[0].legs;\n for (var i = 0; i < legs.length; i++) {\n totalDistance += legs[i].distance.value;\n totalDuration += legs[i].duration.value;\n }\n totalDistance = totalDistance / KILOMETER;\n totalDuration = totalDuration / MINUTE;\n\n showRouteInfo(totalDistance, totalDuration, calculateTripCost(totalDistance));\n }\n });\n}", "function route(origin_place_id, destination_place_id, travel_mode) {\n\n if (!origin_place_id || !destination_place_id) {\n return;\n }\n directionsService.route({\n origin: {\n 'placeId': origin_place_id\n },\n destination: {\n 'placeId': destination_place_id\n },\n travelMode: travel_mode\n }, function (response, status) {\n if (status === google.maps.DirectionsStatus.OK) {\n directionsDisplay.setDirections(response);\n \n // Guardamos las coordenadas en BeanRuta\n // var iniLat = response.routes.legs[0].steps.start_location.lat;\n // var iniLon = response.routes.legs[0].steps.start_location.lng;\n // var finLat = response.routes.legs[0].steps.end_location.lat;\n // var finLon = response.routes.legs[0].steps.end_location.lng;\n //guardaCoordenadas(iniLat, iniLon, finLat, finLon);\n\n } else {\n window.alert('Directions request failed due to ' + status);\n }\n });\n\n}", "function getTrainsBetweenStations(sender,source,destination,dd,mm){\n\n request('http://api.railwayapi.com/between/source/'+ source +'/dest/'+ destination +'/date/'+dd +'-'+mm+'/apikey/'+ apiKey, (err, response, body) => {\n\t if(JSON.parse(body).error === \"Quota exhausted for day\"){\n\t console.log(JSON.parse(body).error);\n\t }else{\n\n sendText(sender,\"There are \"+JSON.parse(body).total+\" trains availble..\");\n\n var trainList = JSON.parse(body).train\n for (var i=0;i<trainList.length;i++){\n sendText(sender,JSON.parse(body).train[i].number +\" \"+ JSON.parse(body).train[i].name+\", \"+\n JSON.parse(body).train[i].from.name +\" -> \" + JSON.parse(body).train[i].to.name +\"\\nSch Dep : \"+JSON.parse(body).train[i].src_departure_time +\" Hrs\"\n +\"\\nSch Arr : \"+JSON.parse(body).train[i].dest_arrival_time +\" Hrs\"+\"\\nTravel Time : \"+ JSON.parse(body).train[i].travel_time +\" Hrs\\n\");\n\n\n }\n\n\n\t }\n});\n\n\n}", "constructor(station, arrive) {\n\t\t\tthis.station = station;\n\t\t\tif (typeof arrive == 'function')\n\t\t\t\tthis.arrive = arrive;\n\t\t}", "function calcRoute() {\n\n var request = {\n origin: start,\n destination: end,\n travelMode: google.maps.TravelMode[travelMode],\n waypoints: waypts\n };\n\n directionsService.route(request, function(result, status) {\n\n if (status == google.maps.DirectionsStatus.OK) {\n directionsDisplay.setDirections(result);\n }\n });\n}", "calculateRoute(startFeature, endFeature) {\n const getId = feature => {\n const payload = JSON.parse(feature.properties.althurayyaData)\n return payload.URI;\n }\n\n const start = getId(startFeature);\n const end = getId(endFeature);\n\n // Note that this returns the IDs of the *NODES* along the road, i.e.\n // we now need to look up the segments which connect these nodes\n const path = this._graph.findShortestPath(start, end);\n\n if (path) {\n // Sliding window across path, pairwise\n const segments = [];\n for (var i=1; i<path.length; i++) {\n segments.push(this.findSegment(path[i - 1], path[i]));\n }\n\n return segments;\n }\n }", "function getDirections(start, end) {\n centerpointMarker.setVisible(false);\n\n var request = {\n origin: start,\n destination: end,\n travelMode: google.maps.TravelMode.DRIVING\n };\n\n directionsService.route(request, function(response, status) {\n if (status == google.maps.DirectionsStatus.OK) {\n directionsDisplay.setDirections(response);\n }\n });\n}", "function travel(destination, myFunc){ \n console.log(\"travelling to \" + destination);\n myFunc();\n printStuff();\n // return myFunc;\n}", "function PlanRoad (start, end)\n{\n //Check if road is already known\n var roadIsKnown = false;\n var knownRoads = start.room.memory.roomInfo.knownRoads;\n\n if ( knownRoads && knownRoads.length > 0)\n {\n for ( let n in knownRoads )\n {\n var knownRoad = knownRoads[n];\n if ( knownRoad.start.x == start.pos.x && knownRoad.start.y == start.pos.y && knownRoad.end.x == end.pos.x && knownRoad.end.y == end.pos.y )\n {\n roadIsKnown = true;\n }\n }\n }\n // If not a known road, plan it.\n if ( !roadIsKnown )\n {\n var road = {};\n\n // Special case, if start and end are the same, build a road around the object\n // otherwise plan one from start to end\n if (start == end )\n {\n console.log('control.Construction.PlanRoad: Around Position: ' + start.pos );\n\n road = getSurroundingPositions(start) ;\n\n }\n else\n {\n console.log('control.Construction.PlanRoad: start: ' + start + ' - position: ' + start.pos );\n console.log('control.Construction.PlanRoad: end: ' + end + ' - position: ' + end.pos );\n\n road = PathFinder.search(start.pos, { pos: end.pos, range: 1 }) ;\n }\n for ( let n in road.path )\n {\n var buildPosition = road.path[n];\n start.room.memory.roomInfo.futureConstructionSites.push({position: buildPosition, structure: STRUCTURE_ROAD})\n }\n\n start.room.memory.roomInfo.knownRoads.push({start: start.pos, end: end.pos });\n }\n\n // Set a return value, so the caller knows if we did anything\n return (!roadIsKnown);\n}", "constructor(from, to) {\n this.from = from;\n this.to = to;\n }", "function routes_tourist() {\n\n\t// clear tourist markers from map\n\tclearAllTouristMarkers(markers);\n\tvar starting = origin.getPlace();\n\n\tif (!geolocation) {\n\t\t//getting the lat and lng of the input address \n\t\t// display error to user if valid starting location not entered\n\t\tif (!starting) {\n\t\t\t$('.invalid-location-error').show();\n\t\t\treturn false;\n\t\t} else {\n\t\t\t//starting address latitude\n\t\t\tvar starting_lat = starting.geometry.location.lat();\n\t\t\tvar starting_lng = starting.geometry.location.lng();\n\t\t}\n\t}\n\n\t// Create a renderer for directions and bind it to the map.\n\tdirectionsRenderer = new google.maps.DirectionsRenderer({\n\t\tmap: map,\n\t\tpreserveViewport: true\n\t});\n\n\t// Instantiate an info window to hold step text.\n\tvar stepDisplay = new google.maps.InfoWindow;\n\n\t// Display the route between the initial start and end selections.\n\tcalculateAndDisplayRoute(directionsRenderer, directionsService, markerArray, stepDisplay, map);\n\treturn true;\n}", "function calculateAndDisplayRoute(directionsService, directionsDisplay) {\r\n\r\n\t//initialize variables\r\n\tvar start = document.getElementById('start_point').value;\r\n\tvar end = {lat: 53.3601147, lng: -6.2763354};\r\n\r\n\t//set the starting point and destination for travel mode (plus display status)\r\n\tdirectionsService.route({\r\n\t\torigin: start,\r\n\t\tdestination: end,\r\n\t\ttravelMode: google.maps.TravelMode.DRIVING\r\n\t\t}, function(response, status) {\r\n\t\t\tif (status === google.maps.DirectionsStatus.OK) {\r\n\t\t\t\tdirectionsDisplay.setDirections(response);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\twindow.alert('Location cannot be found!');\r\n\t\t\t}\r\n\t});\r\n}", "function helper(s, path, toConsider) {\n if(s.name === station2) { //Condition to stop when destination is reached at\n setPrev(s, path);\n return s;\n } else {\n path = pair(s, path);\n //Setting the values of vertices in a graph\n map(function(x) { \n var dv = s.dv + 1; //Note all edges have weight of 1\n if(dv < x.dv) {\n x.dv = dv;\n } else {}\n }, filter(function(x) { return !is_empty_list(x) && is_empty_list(member(x, path)); }, \n s.neighbours));\n toConsider = filter(function(x) { return !is_empty_list(x); }, toConsider);\n toConsider = filter(function(x) { return is_empty_list(member(x, path)); }, toConsider);\n setPrev(s, path);\n //To find shortest path\n var next_s = accumulate(function(x, y) {\n return x.dv < y.dv ? x : y;\n }, {\"dv\": 1/0}, toConsider);\n toConsider = remove_all(next_s, toConsider);\n toConsider = append(toConsider, next_s.neighbours);\n toConsider = filter(function(x) { return !is_empty_list(x); }, toConsider);\n toConsider = filter(function(x) { return is_empty_list(member(x, path)); }, toConsider);\n return helper(next_s, path, toConsider);\n }\n }", "function go() {\n\n //error handling\n let errorPresent = false;\n if (date == null) {\n errorPresent = true;\n setTimeErrorText(\"Please enter a valid date and time\");\n }\n if (start.current.coords.length === 0) {\n errorPresent = true;\n setStartErrorText(\"Please enter a valid address\");\n }\n if (dest.current.coords.length === 0) {\n errorPresent = true;\n setDestErrorText(\"Please enter a valid address\");\n }\n if(!errorPresent) {\n // run the algorithm\n\n setLoadingText(\"Loading...\");\n console.log(stops.current);\n\n console.log(\"ReRoutes: \" + reRoutes);\n\n const toSend = {\n startLat: start.current.coords[0],\n startLon: start.current.coords[1],\n destLat: dest.current.coords[0],\n destLon: dest.current.coords[1],\n time: date,\n stops: stops.current,\n reRoutes: reRoutes\n };\n\n let config = {\n headers: {\n \"Content-Type\": \"application/json\",\n 'Access-Control-Allow-Origin': '*',\n }\n }\n\n axios.post(\n \"http://localhost:4567/run\",\n toSend,\n config\n )\n .then(response => {\n console.log(response.data);\n setRoute(response.data[\"route\"]);\n })\n .catch(function (error) {\n console.log(error);\n setLoadingText(\"Something went wrong. Please try again\");\n });\n\n console.log([dest.current.coords[0], dest.current.coords[1]]);\n }\n\n }", "function depart(start, destination, done) {\n bart.sched.depart({\n orig: start,\n dest: destination\n }, function (err, xml, body) {\n if (err) {\n throw err;\n }\n\n // xml is a parser instance from https://github.com/polotek/libxmljs\n // it supports xpath and more!\n var trips = [];\n\n xml.find('/root/schedule/request/trip').forEach(function (trip) {\n trips.push({\n orig: trip.attr('origin').value(),\n dest: trip.attr('destination').value(),\n times: {\n orig: trip.attr('origTimeMin').value(),\n dest: trip.attr('destTimeMin').value()\n },\n legs: trip.find('leg').map(function (leg) {\n return {\n orig: leg.attr('origin').value(),\n dest: leg.attr('destination').value(),\n line: leg.attr('line').value(),\n head: leg.attr('trainHeadStation').value(),\n times: {\n orig: leg.attr('origTimeMin').value(),\n dest: leg.attr('destTimeMin').value()\n }\n };\n })\n })\n });\n\n // If you hate libxmljs, you can access the raw buffered body too!\n //\n // console.log(body);\n //\n // bart.sched.arrive() will also return the request instance, if you\n // would rather parse the output using a streaming parser such as\n // sax-js.\n done(trips)\n });\n}", "function planTrip(sLine, sStop, eLine, eStop){\r\n\r\n // Getting the selected start line\r\n var line = getLine(sLine);\r\n // Printing the output of the line and stops\r\n console.log(`You must travel through the following stops on the ${sLine} line: ${fromTo(line, sStop, communStop)}`)\r\n\r\n // Changing the line if it's not the same line for the whole trip\r\n if(sLine !== eLine)\r\n console.log(`Change at Union Square from the ${sLine} line to the ${eLine} line.`);\r\n\r\n // Getting the selected end line\r\n line = getLine(eLine);\r\n // Printing the output of the line and stops\r\n console.log(`Your journey continues through the following stops: ${fromTo(line, communStop, eStop)}`)\r\n\r\n // Printing the total number of stops\r\n console.log(`${stopCounter} stops in total.`)\r\n\r\n // Reseting stop counter\r\n stopCounter = 0;\r\n}", "function calcRoute(origin, destination){\n\n var request= {\n origin: origin,\n destination: destination,\n travelMode: google.maps.TravelMode.WALKING,\n transitOptions:{\n routingPreference: google.maps.TransitRoutePreference.LESS_WALKING\n },\n unitSystem: google.maps.UnitSystem.Metric\n }\n\n directionsService.route(request, function(response, status) {\n if (status == google.maps.DirectionsStatus.OK) {\n directionsDisplay.setDirections(response);\n }\n });\n}", "async function hereGetRoutePolyline(origin, destination){\r\n let routingParameters = {\r\n routingMode: 'fast',\r\n 'transportMode': 'car',\r\n 'origin': origin,\r\n 'destination': destination,\r\n 'return': 'polyline,travelSummary'\r\n }\r\n router.calculateRoute(routingParameters, onResult, function(error){ console.log(error.message); });\r\n}", "routes(departStop, arriveStop, schedule) {\n const direction = CaltrainService.direction(departStop, arriveStop);\n const departTimes = this.times(departStop, direction, schedule);\n const arriveTimes = this.times(arriveStop, direction, schedule);\n // let skip = (schedule === 'Sunday') ? caltrainServiceData.saturdayTripIds : [];\n const skip = [];\n return CaltrainService.merge(departTimes, arriveTimes, skip);\n }", "constructor(start, v1, v2, end) {\n this.start = start;\n this.v1 = v1;\n this.v2 = v2;\n this.end = end;\n }", "function Waypoint( startX, startY, endX, endY, carHeading, initialActive )\n{\n\tthis.sX = startX;\n\tthis.sY = startY;\n\tthis.eX = endX;\n\tthis.eY = endY;\n\tthis.active = initialActive ? true : false;\n\t\n\tthis.spawnX = ( startX + endX ) / 2 ;\n\tthis.spawnY = ( startY + endY ) / 2;\n\tthis.heading = carHeading;\n}", "function calcTravelTime(source, target, unit){\n\tlet unitSpeed = getSpeed(unit);\n\tlet fields = distance(source.split('|'), target.split('|'));\n\treturn unitSpeed*fields;\n}", "function trip(src, dst, network) {\n let ls = []\n ls.push(src.geometry.coordinates)\n const ps = geojson.findClosest(src, network)\n const pe = geojson.findClosest(dst, network)\n let trip = geojson.route(ps, pe, airport.serviceroads)\n trip.coordinates.forEach(function(p, idx) {\n ls.push(p)\n })\n ls.push(dst.geometry.coordinates)\n return geojson.Feature(geojson.LineString(ls))\n}", "function pathFinding(map, from, to) {\n // Lets start with an eucledian distance\n const distX = from.x - to.x;\n const distY = from.y - to.y;\n\n let move;\n\n if (Math.abs(distX) > Math.abs(distY)) {\n if (distX > 0) {\n move = directionsEnum.EAST;\n } else {\n move = directionsEnum.WEST;\n }\n } else {\n if (distY > 0) {\n move = directionsEnum.NORTH;\n } else {\n move = directionsEnum.SOUTH;\n }\n }\n\n return move;\n}", "traverse(start, f) {\n const stack = [[null, start, 0]];\n function visit() {\n const [source, current, distance] = stack.pop();\n f(current, distance);\n allDirections.forEach(dir => {\n if (current.isConnected(dir)) {\n const adj = current.adjacent(dir);\n if (adj !== source) {\n stack.push([current, adj, distance+1]);\n }\n }\n });\n }\n while (stack.length > 0) visit();\n }", "function timeToTravel(src, dst, speed, network, airport) {\n const startplace = src.split(\":\")\n let db = startplace[0]\n let rsn = startplace[1]\n if (!airport.hasOwnProperty(db)) {\n debug.error(\"cannot find position database '\" + db + \"'\")\n return false\n }\n let rs = geojson.findFeature(rsn, airport[db], \"name\") // no check\n if (!rs) {\n debug.error(\"cannot find position '\" + rsn + \"' in database '\" + db + \"'\")\n return false\n }\n\n const endplace = src.split(\":\")\n db = endplace[0]\n rsn = endplace[1]\n if (!airport.hasOwnProperty(db)) {\n debug.error(\"cannot find position database '\" + db + \"'\")\n return false\n }\n let re = geojson.findFeature(rsn, airport[db], \"name\") // no check\n if (!rs) {\n debug.error(\"cannot find position '\" + rsn + \"' in database '\" + db + \"'\")\n return false\n }\n const ls = trip(rs, re, airport[network])\n const len = turf.length(ls, { units: \"kilometers\" })\n return 3600 * len / speed\n}", "function parseGoTo(params, callback) {\n const coordinates = params.split(',');\n if (coordinates.length === 2) {\n const xVal = coordinates[0];\n const yVal = coordinates[1];\n\n if (!isNaN(yVal) && !isNaN(xVal)) {\n //send goTo request with koordinates\n sendMsg('app_goto_target', [parseInt(xVal), parseInt(yVal)]);\n callback();\n } else adapter.log.error('GoTo need two koordinates with type number');\n adapter.log.info('xVAL: ' + xVal + ' yVal: ' + yVal);\n\n } else {\n adapter.log.error('GoTo only work with two arguments seperated by ', '');\n }\n}", "function addRoad(startName, endingName) {\n console.log(`called addRoad, start: '${startName}' end: '${endingName}'`);\n /* the rest is the same as the book\n you DON'T need to implement this */\n}", "function findRoute(graph, from, to) {//the graph is from buildGraph function, so are from and to\n let work = [{at: from, route: []}];\n //a new variable is initialised called work to get key and value pairs\n for (let i = 0; i < work.length; i++) { //use for loop to get through all elements in work\n let {at, route} = work[i]; //use destructuring method to assign what work[i] is\n for (let place of graph[at]) { //define a new local variable called place to loop through graph[at], which is the location of the robot\n if (place == to) return route.concat(place); //if the location of robot and the destination ( pickup or drop-off) point are the same, return place using concat method. This is to tell the robot to remember the route by having the string pushed into the empty array\n if (!work.some(w => w.at == place)) {//use some function to \n //The some() method tests whether at least one element in the array passes the test implemented by the provided function. It returns a Boolean value.\n work.push({at: place, route: route.concat(place)});//keep updating the start point before the pickup point and the drop-off point are the same, then push all the routes out to the array for the robot to remember.\n }\n }\n }\n }", "constructor(startLocation,endLocation,startTime,endTime,startTimetoLocale,endTimetoLocale){ \n this._startLocation=startLocation;\n this._endLocation=endLocation;\n this._pathTaken=[];\n this._startTime=startTime;\n this._endTime=endTime; \n this._startTimetoLocale=startTimetoLocale;\n this._endTimetoLocale=endTimetoLocale;\n this._timeTaken;\n this._distanceRan;\n this._averageSpeed;\n this._nickname;\n this._description;\n }", "async function getRouteDist(start, end, vid, partofroute){\n var url = 'https://api.mapbox.com/directions/v5/mapbox/driving-traffic/' + start[0] + ',' + start[1] + ';' + end[0] + ',' + end[1] + '?steps=true&geometries=geojson&access_token=' + mapboxgl.accessToken;\n let result = await makeRequest('GET', url);\n var json = JSON.parse(result);\n var data = json.routes[0];\n if (partofroute == 'driven'){\n trucks[vid].distanceDriven = data.distance;\n }\n else{\n trucks[vid].distanceLeft = data.distance;\n }\n var route = data.geometry.coordinates;\n return route;\n}", "function fromTo(begin, end) {\n return to(\n from(begin), \n end)\n ;\n}", "function calcRoute() {\n var lon = parseFloat($(\"#tour-longitude\").html())\n var lat = parseFloat($(\"#tour-latitude\").html())\n var myLatLng = new google.maps.LatLng(lat,lon)\n var waypts = []\n\n var locations = $(\"input:checked\").parent().text()\n \n if(locations != \"\"){\n var locationsArray = locations.split(\"|\") \n var newLocationsArray = $.map(locationsArray, function(v){\n return v.trim() === \"\" ? null : v.trim(); \n })\n\n newLocationsArray.forEach(function(z){\n var xlon = z.match(/Longitude:(.*)/)\n var xlat = z.match(/Latitude:(.*)/)\n var zlon = parseFloat(xlon[1].trim())\n var zlat = parseFloat(xlat[1].trim()) \n\n var zloc = zlat +\" , \"+zlon\n waypts.push({location: zloc})\n });\n }\n\n request = {\n origin: $(\"input[name='start']\").val() || myLatLng,\n destination: $(\"input[name='destination']\").val() || myLatLng,\n waypoints: waypts, \n optimizeWaypoints: true, \n travelMode: google.maps.TravelMode.WALKING \n };\n\n directionsService.route(request, function(result, status) {\n if (status == google.maps.DirectionsStatus.OK) {\n directionsDisplay.setDirections(result);\n }\n }); \n}", "async function returnRoute(startLatLng, endLatLng, originName, destName){\n let route;\n directionsService.route({\n origin: startLatLng.lat+','+startLatLng.lng,\n destination: endLatLng.lat+','+endLatLng.lng,\n travelMode: 'DRIVING'\n }, function(response, status){\n if(status === 'OK'){\n console.log(originName);\n console.log(destName);\n let routes = response.routes[0].legs[0].steps;\n console.log(routes);\n let instructions = routes.map(route =>{\n return route.instructions\n });\n console.log(instructions);\n initializeGameBoard(originName, destName, instructions);\n }\n else{\n console.log(status);\n }\n })\n}", "function directions(...args) {\n var [start, ...remaining] = args\n var [finish, ...stops] = remaining.reverse()\n console.log(`drive through ${args.length} towns`)\n console.log(`start in ${start}`)\n console.log(`the destination is ${finish}`)\n console.log(`stopping ${stops.length} times in between`)\n}", "function buildRoute (theForm) {\n // get selected stations from form array object, elements accessible by name attribute\n var startStation = theForm[\"startStation\"].value;\n var endStation = theForm[\"endStation\"].value;\n\n // get the start/end lines and start/end stations\n var startLine = startStation.slice(0, startStation.indexOf(\",\"));\n var endLine = endStation.slice(0, endStation.indexOf(\",\"));\n var firstStation = startStation.slice(startStation.indexOf(\",\")+2);\n var lastStation = endStation.slice(endStation.indexOf(\",\")+2);\n\n // get the change over station by querying the obj instead of hardcoding value\n var changeOver = \"Union Square\";\n var stopCount = 0;\n\n // clear route details when plan route is clicked\n document.getElementById(\"routeInfoStops\").innerHTML = \"\";\n document.getElementById(\"routeInfoMsg\").innerHTML = \"\";\n\n // validate select stations\n if (routeValidation(startLine, firstStation, endLine, lastStation)){\n\n // check if a line change is needed\n if (startLine === endLine){\n changeOver = \"none\";\n\n // determine route direction and adjust array elements if needed\n if (subway[startLine].indexOf(firstStation) > subway[startLine].indexOf(lastStation)) { subway[startLine].reverse(); }\n\n // loop through each of the stations on the same line\n for(var i = subway[startLine].indexOf(firstStation); i <= subway[startLine].indexOf(lastStation); i++ ){\n stopCount++;\n // display route summary\n displayRoute(subway[startLine][i]);\n }\n displaySummary(startLine, endLine, firstStation, lastStation, stopCount, changeOver);\n\n } else {\n // determine route direction and adjust array elements if needed\n if (subway[startLine].indexOf(firstStation) > subway[startLine].indexOf(changeOver)) { subway[startLine].reverse(); }\n\n // loop through each of the stations (array value) on the line until a change over is needed\n for(var i = subway[startLine].indexOf(firstStation); i < subway[startLine].indexOf(changeOver); i++ ){\n stopCount++;\n // display part 1 route summary\n displayRoute(subway[startLine][i]);\n }\n\n // determine route direction and adjust array elements if needed\n if (subway[endLine].indexOf(changeOver) > subway[endLine].indexOf(lastStation)) { subway[endLine].reverse(); }\n\n // display second part of journey\n for(var i = subway[endLine].indexOf(changeOver); i <= subway[endLine].indexOf(lastStation); i++ ){\n stopCount++;\n // display part 1 route summary\n displayRoute(subway[endLine][i]);\n }\n // display summary route information\n displaySummary(startLine, endLine, firstStation, lastStation, stopCount, changeOver);\n }\n }\n }", "function calcRoute(dirChoice) {\n var start = '15095 West 123rd Street Olathe, KS 66062';\n var end;\n if (dirChoice == 1){\n end = new google.maps.LatLng(38.913209, -94.760504);\n }\n else{\n end = new google.maps.LatLng(38.957052,-94.663555);\n }\n var request = {\n origin: start,\n destination: end,\n travelMode: google.maps.TravelMode.DRIVING\n };\n directionsService.route(request, function(response, status) {\n if (status == google.maps.DirectionsStatus.OK) {\n directionsDisplay.setDirections(response);\n }\n });\n}", "async function urlCreator(otpHost, reqBody) {\r\n try {\r\n fromPlace = await geocoder.search({q:reqBody.fromPlace});\r\n fromPlace = [fromPlace[0].lat, fromPlace[0].lon];\r\n fromPlace = fromPlace[0] + ',' + fromPlace[1];\r\n console.log(fromPlace);\r\n }\r\n catch(err) {\r\n throw new Error('Your origin could not be found');\r\n }\r\n\r\n try {\r\n toPlace = await geocoder.search({q:reqBody.toPlace});\r\n toPlace = [toPlace[0].lat, toPlace[0].lon];\r\n toPlace = toPlace[0] + ',' + toPlace[1];\r\n console.log(toPlace);\r\n }\r\n catch(err) {\r\n throw new Error('Your destination could not be found');\r\n }\r\n \r\n startTime = reqBody.startTime;\r\n startDate = reqBody.startDate;\r\n arriveBy = reqBody.arriveBy;\r\n maxWalkDistance = (reqBody.maxWalkDistance) * 1609; //received in miles must be in meters\r\n optimize = reqBody.optimize;\r\n return url = otpHost + '/otp/routers/default/plan?fromPlace=' + fromPlace + '&toPlace=' \r\n + toPlace + '&time=' + startTime + '&date=' + startDate + '&mode=TRANSIT,WALK&maxWalkDistance='\r\n + maxWalkDistance +'&arriveBy=' + arriveBy + '&optimize=' + optimize;\r\n}", "function tflURL(from, to) {\n var TFL_API = \"https://api.tfl.gov.uk/journey/journeyresults/\"\n var TFL_key = \"?app_id=11944170&app_key=b5950c6792c4a2e09bb2331e499ff205\"\n var url = TFL_API + from + \"/to/\" + to + TFL_key;\n console.log(url);\n return url;\n}", "function planLine(lineName, begin, end) {\n // looking at lineObjects and taking whatever lineName is from it, putting it into a string array:\n const line = lineObjects[lineName];\n const startIndex = line.indexOf(begin);\n const endIndex = line.indexOf(end);\n\n // reverse direction to travel down another line:\n let direction = -1;\n if (startIndex < endIndex) {\n direction = 1;\n }\n\n // create empty array to store the order of stations passed through:\n let stations = [];\n // starting at the beginning station, and travelling either forwards or backwards as determined by 'direction'.\n // loop through the line array and stop at the endIndex:\n for (let i = startIndex; i !== endIndex; i += direction) {\n // add each station to the end of the new stations array to log their order:\n stations.push(line[i]);\n }\n // add final station as this could not be added in the loop above due to being excluded in our for loop:\n stations.push(end);\n return stations;\n}", "function subwaySystem(startLine, startStop, endLine, endStop) {\n\n // Defining Variables \n\n var numberOfStops = 0;\n\n var firstTripString = `You must travel through the following stops on the ${startLine} line: `;\n\n var secondTripString = 'Your journey continues through the following stops: ';\n\n\n\n // Defining two functions to calculate out stops and log them\n\n function firstJourney(startLine,startStop){\n\n\n\n // I used if statement to decide which way the customer is heading\n\n if(startLine.indexOf(startStop) > startLine.indexOf('Union Square')){\n\n startLine.reverse(); \n\n }\n\n for (let i = startLine.indexOf(startStop)+1; i < startLine.indexOf('Union Square'); i++) {\n\n firstTripString += startLine[i] + ', ';\n\n numberOfStops++;\n\n }\n\n firstTripString += 'and Union Square.'\n\n numberOfStops++;\n\n\n\n // logging the first string and changing at Union Square message\n\n console.log(firstTripString);\n\n console.log('Change at Union Square.');\n\n }\n\n\n\n function secondJourney(endLine,endStop){\n\n \n\n // I used if statement to decide which way the customer is heading\n\n if(endLine.indexOf(endStop) > endLine.indexOf('Union Square')){\n\n for (let i = endLine.indexOf('Union Square'); i < endLine.indexOf(endStop)+1; i++) {\n\n if( i <= endLine.indexOf(endStop)){\n\n secondTripString += endLine[i] + ', '\n\n }\n\n else{\n\n secondTripString += 'and ' + endLine[i] + '.'\n\n }\n\n } \n\n }\n\n else if (endLine.indexOf(endStop) < endLine.indexOf('Union Square')){\n\n endLine.reverse();\n\n for (let i = endLine.indexOf('Union Square')+1; i < endLine.indexOf(endStop)+1; i++){\n\n if( i <= endLine.indexOf(endStop) -1){\n\n secondTripString += endLine[i] + ', '\n\n }\n\n else{\n\n secondTripString += 'and ' + endLine[i] + '.'\n\n }\n\n numberOfStops++;\n\n } \n\n }\n\n \n\n // logging the second string and the total number of stops\n\n console.log(secondTripString);\n\n console.log(`${numberOfStops} stops in total.`);\n\n \n\n }\n\n\n\n\n\n // starting line and ending line validations then assigning their value to the lines' arrays \n\n if(startLine.toUpperCase() == 'N'){\n\n startLine = lineN;\n\n }\n\n else if(startLine.toUpperCase() == 'L'){\n\n startLine = lineL;\n\n }\n\n else if(startLine.toUpperCase() == '6'){\n\n startLine = line6;\n\n }\n\n else{\n\n return console.log('Please enter a valid starting line');\n\n \n\n }\n\n\n\n if(endLine.toUpperCase() == 'N'){\n\n endLine = lineN;\n\n }\n\n else if(endLine.toUpperCase() == 'L'){\n\n endLine = lineL;\n\n }\n\n else if(endLine.toUpperCase() == '6'){\n\n endLine = line6;\n\n }\n\n else{\n\n return console.log('Please enter a valid ending line');\n\n \n\n }\n\n\n\n // starting and ending stop Validations\n\n if(!startLine.includes(startStop)){\n\n return console.log('Oppss! we can\\'t find your start destination. Enter a valid destination, please');\n\n }\n\n if(!endLine.includes(endStop)){\n\n return console.log('Oppss! we can\\'t find your end destination. Enter a valid destination, please');\n\n }\n\n\n\n\n\n // Running the functions\n\n firstJourney(startLine,startStop);\n\n secondJourney(endLine,endStop);\n\n \n\n}", "function getCoords() {\n var start = $('#start').val(); // 2203 Commerce St, Dallas, TX 75201\n var end = $('#end').val(); // 2901 Indiana St., Dallas, TX\n\n if (start.length == 0 || end.length == 0) {\n // TODO: Display input error\n return;\n }\n\n var queryStart = baseGeocoding + start.replace(' ', '+') + json + requestToken;\n var queryEnd = baseGeocoding + end.replace(' ', '+') + json + requestToken;\n\n var startLat;\n var startLng;\n var endLat;\n var endLng;\n\n $.when(\n $.getJSON(queryStart, function( data ) {\n startLat = data.features[0].center[0];\n startLng = data.features[0].center[1];\n }),\n\n $.getJSON(queryEnd, function( data ) {\n endLat = data.features[0].center[0];\n endLng = data.features[0].center[1];\n }))\n .then(function() {\n drawRoute(startLat, startLng, endLat, endLng);\n });\n}", "function getRoute(latlo, egal){\r\n //check if first stopover on route\r\n if(waypoints.length <= 1){\r\n if(egal){\r\n hereGetRouteSummary(homebase, latlo, homebase);\r\n /*waypoints.push([latlo,0,-1]); //push destination in\r\n waypoints.push([homebase,0,-1]); //push homebase for return */\r\n }\r\n } else { //not the first stopover\r\n for(let i=0;i<=waypoints.length-2;i++){ //for every stopover in waypoints (-2: ignor homebase at the end) \r\n hereGetRouteSummary(waypoints[i][0], latlo, waypoints[i+1][0]) //call function to call HERE API hereGetRouteSummary(origin, via, destination)\r\n }\r\n let min = 0; //index of shortest way\r\n setTimeout(function(){ //timeout to await callback from HERE API\r\n for(let i=0;i<(sectionViaTimes[1].length);i++){ //intariat through every entry in sectionViaTimes to find shortes route\r\n if(sectionViaTimes[1][i][0] + sectionViaTimes[1][i][1] < sectionViaTimes[1][min][0] + sectionViaTimes[1][min][1]){ //if time is shorter then current shortest time = overwrite shortest index\r\n min = i;\r\n }\r\n }\r\n // Put coordinates in waypoints array (acording to shortes travel time as calculated above)\r\n //for(let i=1;)*/\r\n let y;\r\n //indexOf() sorta, workaround to find position in waypoint araray of shortest offset\r\n for(y=0;y<waypoints.length;y++){\r\n if(sectionViaTimes[0][min] == waypoints[0][y]) break; \r\n }\r\n //calculate the eta from departure point to arrival point + stoovertime\r\n let eta = waypoints[y][1] + sectionViaTimes[1][min][0] + stopovertime;\r\n //put coordinates and eta in waypoints array at the correct position\r\n waypoints.splice(y+1,0,[latlo,waypoints[y][1] + eta, egal ? -1 : 0]); \r\n //calculate the eta offset for all the following waypoints\r\n let etaoffset = eta + sectionViaTimes[1][min][1];\r\n //put them eta offsets in\r\n for(let i=y+2;i<waypoints.length;i++){\r\n waypoints[i][1] += etaoffset; \r\n }\r\n console.log(waypoints);\r\n }, 300); \r\n }\r\n}", "constructor(start, end, fullStart = start, details = null) {\n this.start = start;\n this.end = end;\n this.fullStart = fullStart;\n this.details = details;\n }", "constructor(start, end, fullStart = start, details = null) {\n this.start = start;\n this.end = end;\n this.fullStart = fullStart;\n this.details = details;\n }", "function getRoute(start,target) {\n\tapi({ data: \"cmd=getroute&start=\"+start+\"&target=\"+target, type: \"block\" },selectRoute);\n}", "calcDirectionCoordsForTraitor(lat1, lon1, lat2, lon2) {\n //Line will be around 1000m long or something\n const multiplier = 1000 / this.calcDistance(lat1, lon1, lat2, lon2);\n return ([{\n latitude: lat2 + ((lat1 - lat2) * multiplier),\n longitude: lon2 + ((lon1 - lon2) * multiplier)\n },\n {\n latitude: lat2,\n longitude: lon2\n }]);\n }", "function calculateRoute(map, directions_service, start, stop, transportation) {\n return $.Deferred(function(routeDeferred) {\n directions_service.route({\n origin: start,\n destination: stop,\n travelMode: transportation\n }, function(response, status) {\n if (status === google.maps.DirectionsStatus.OK) {\n routeDeferred.resolve(response);\n } else {\n alert('Directions request failed due to ' + status);\n }\n });\n }).promise();\n}", "function go(){\n var mapX = document.getElementById(\"mapX\").value;\n var mapY = document.getElementById(\"mapY\").value;\n var posX = document.getElementById(\"posX\").value.toUpperCase();\n var posY = document.getElementById(\"posY\").value.toUpperCase();\n var posD = document.getElementById(\"posD\").value.toUpperCase();\n var directions = document.getElementById(\"directions\").value.toUpperCase();\n var rover = createRover(\n getMapSizeObj(mapX,mapY),\n getPosObj(posX,posY,posD)\n );\n if(rover.runMovements(directions)) {\n var endPos = rover.getPosition();\n alert(JSON.stringify(endPos, null, 4));\n } else {\n alert(\"Please input accurate directions\");\n }\n\n\n}", "async function calculateTrip(params) {\n var origin = params.origin;\n var num_waypoints = parseInt(params.num_waypoints);\n var types = params.types == \"\" ? [] : params.types.split(',');\n types.push(\"tourist_attraction\");\n // if only a radius is provided, calculate a random destination near edge of radius\n if ('destination' in params) {\n var destination = params.destination;\n }\n else if ('radius' in params) {\n destination = await calculateDestination(origin, parseInt(params.radius));\n num_waypoints--;\n }\n var initial_route = await client\n .directions({\n params: {\n origin: origin,\n destination: destination,\n key: process.env.GOOGLE_MAPS_API_KEY\n },\n timeout: 2000 // milliseconds\n });\n if (initial_route.data.status != \"OK\") {\n throw \"Google maps error: \" + initial_route.data.status;\n }\n var points = polyline.decode(initial_route.data.routes[0].overview_polyline.points); // array of lat/lng points\n var x = Math.floor(points.length/(num_waypoints+1)); // points array offset\n var trip_length = geometry.computeLength(points.map((point) => [point[1], point[0]]));\n var waypoints = [];\n var waypoint_radius = Math.min(Math.ceil((trip_length/(num_waypoints+1))/2), 50000); // how far out from each point we should search for a place (in meters), 805 = (1609 m)/2\n // Find all waypoints for trip\n for (let i = 1; i <= num_waypoints; i++) {\n var type = types[(i-1)%types.length];\n try {\n var waypoint = await findPlace(points[i*x], waypoint_radius, waypoints, origin, destination, type);\n } catch (e) {\n if (e == \"Google maps error: ZERO_RESULTS\") { // try one more time, with different type\n waypoint = await findPlace(points[i*x], waypoint_radius, waypoints, origin, destination, \"tourist_attraction\");\n } else {\n throw e;\n }\n }\n waypoints.push(waypoint);\n }\n return {\n 'origin': origin,\n 'destination': destination,\n 'waypoints': waypoints\n };\n }", "function getStartStations(lat, lon) {\n //assign distance to station\n for (var i in stations_full) {\n var s = stations_full[i];\n if (s.availableBikes > 0) {\n var d = getDistance(lat, lon, s.latitude, s.longitude, 'K');\n s.distance = d;\n } else {\n s.distance = 1000000;\n }\n }\n stations_full.sort(function(a, b) {\n return a.distance - b.distance;\n });\n // three closest station potentially\n var targets = stations_full.slice(0, 3);\n return targets;\n // get walking distance from Google\n // for (var i in targets) {\n // var s = targets[i];\n // getRoutes(i, new google.maps.LatLng(lat, lon), new google.maps.LatLng(s.latitude, s.longitude));\n // }\n // console.log('------');\n }", "function distanceFromSpaceStation() {\n prompt.start();\n prompt.get(['city'],function(err, result) {\n var requestAddress = 'https://maps.googleapis.com/maps/api/geocode/json?address=' + result.city;\n request(requestAddress, function(err, result) {\n var resultObject = JSON.parse(result.body);\n lat1 = resultObject.results[0].geometry.location.lat;\n lon1 = resultObject.results[0].geometry.location.lng;\n console.log(lat1);\n console.log(lon1);\n var issAddress = 'http://api.open-notify.org/iss-now.json';\n request(issAddress, function(err, result) {\n var resultObject = JSON.parse(result.body);\n lat2 = resultObject.iss_position.latitude.toFixed(2);\n lon2 = resultObject.iss_position.longitude.toFixed(2);\n console.log(distanceBetweenTwoPoints(lat1, lon1, lat2, lon2));\n });\n });\n });\n}", "static direction(departStop, arriveStop) {\n const depart = caltrainServiceData.southStops.indexOf(departStop);\n const arrive = caltrainServiceData.southStops.indexOf(arriveStop);\n return depart < arrive ? \"South\" : \"North\";\n }", "function showLocation() {\n var start = document.getElementById(\"startLocation\").value;\n var end = document.getElementById(\"endLocation\").value\n var distanceInput = document.getElementById(\"distance\");\n var request = {\n origin: start,\n destination: end,\n travelMode: google.maps.DirectionsTravelMode.DRIVING,\n unitSystem: google.maps.UnitSystem.IMPERIAL\n };\n\n directionsService.route(request, function(response, status) {\n if (status == google.maps.DirectionsStatus.OK) {\n directionsDisplay.setDirections(response);\n distanceInput.value = response.routes[0].legs[0].distance.text;\n }\n }); \n }", "function tripHandler(trip, callback) {\n\tlet startPoint = trip.origin;\n\tlet endPoint = trip.destination;\n\tlet req = {\n\t\torigin: startPoint,\n\t\tdestination: endPoint\n\t};\n\tgetDirections(req, function(err, res) {\n\t\tcallback(res.json, err);\n\t});\n}", "function getStationsAndVehiclesFromTrips(trips, timeRange){\n\tvar stations = [];\n\tvar vehicles = [];\n\tvar indexByStationName = d3.map();\n\tvar stationNameByIndex = d3.map();\n\tvar indexByVehicleID = d3.map();\n\tvar vehicleIDByIndex = d3.map();\n\tvar n = 0;\n\tvar k = 0;\n\ttrips.forEach(function(trip) {\n\t\tif (!indexByStationName.has(trip.start_station)) {\n\t\t\tstations.push({\n\t\t\t\tstation_id : trip.start_station,\n\t\t\t\tstation_name : trip.start_station_name,\n\t\t\t\tlat : trip.start_station_lat,\n\t\t\t\tlng : trip.start_station_lng,\n\t\t\t\tinitial: 0\n\t\t\t});\n\t\t\tstationNameByIndex.set(n, trip.start_station);\n\t\t\tindexByStationName.set(trip.start_station, n++);\n\t\t}\n\t\tif (!indexByStationName.has(trip.end_station)) {\n\t\t\tstations.push({\n\t\t\t\tstation_id : trip.end_station,\n\t\t\t\tstation_name : trip.end_station_name,\n\t\t\t\tlat : trip.end_station_lat,\n\t\t\t\tlng : trip.end_station_lng,\n\t\t\t\tinitial: 0\n\t\t\t});\n\t\t\tstationNameByIndex.set(n, trip.end_station);\n\t\t\tindexByStationName.set(trip.end_station, n++);\n\t\t}\n\t\tif (!indexByVehicleID.has(trip.bikeid)) {\n\t\t\tvehicles.push({\n\t\t\t\tvehicle_id : trip.bikeid\n\t\t\t});\n\t\t\tvehicleIDByIndex.set(k, trip.bikeid);\n\t\t\tindexByVehicleID.set(trip.bikeid, k++);\n\t\t\tstations[indexByStationName.get(trip.start_station)].initial++;\n\n\t\t}\n\t\tif(trip.start_date<=timeRange[0]){\n\t\t\tif(trip.type==\"full\") inTransit_initial++;\n\t\t\tif(trip.type==\"empty\") dispatched_initial++;\n\t\t}\n\t});\n\treturn {\n\t\tstations: stations,\n\t\tvehicles: vehicles,\n\t\tinTransit_initial: inTransit_initial,\n\t\tdispatched_initial: dispatched_initial\n\t}\n}", "function calcRoute(i) { \n var start = miubicacion;\n var end = events[i].LatLng[0];\n var request = {\n origin: start,\n destination: end,\n travelMode: \"DRIVING\"\n };\n if(miubicacion !== undefined){\n htmlGoogle = `https://www.google.com/maps/dir/?api=1&origin=${start.lat},${start.lng}&destination=${end.lat},${end.lng}`;\n\n document.querySelector(\"#controlText\").style.visibility=\"visible\";\n document.querySelector(\"#controlUI\").style.visibility=\"visible\";\n\n directionsService.route(request, function(result, status) {\n if (status == \"OK\") {\n directionsRenderer.setDirections(result);\n }\n });\n } else{\n alert(\"No tenemos acceso a tu ubicacion aun, revisa que hayas dado permiso al GPS para usar esta funcion\")\n }\n}", "function tflURL(from, to) {\n var TFL_API = \"https://api.tfl.gov.uk/journey/journeyresults/\"\n var TFL_key = \"?app_id=11944170&app_key=b5950c6792c4a2e09bb2331e499ff205\"\n var url = TFL_API + from + \"/to/\" + to + TFL_key;\n\n return url;\n}", "function findRoute(graph, from, to) {\n let work = [{ at: from, route: [] }]; // start point and route\n for (let i = 0; i < work.length; i++) {\n let { at, route } = work[i]; // for each work item\n for (let place of graph[at]) {\n // for each place that `at` is connected to\n if (place == to) return route.concat(place); // if destination found, return list of routes\n if (!work.some(w => w.at == place)) {\n work.push({ at: place, route: route.concat(place) });\n }\n }\n }\n}", "function valid_trip(rider, driver, current_endpoint, valid_trip_callback) {\n const rider_leave_earliest = rider.leave_earliest.getMinutes();\n const rider_leave_latest = rider.leave_latest.getMinutes();\n\n const driver_leave_earliest = driver.leave_earliest.getMinutes();\n const driver_leave_latest = driver.leave_latest.getMinutes();\n\n const leave_earliest = Math.max(rider_leave_earliest, driver_leave_earliest);\n const leave_latest = Math.min(rider_leave_latest, driver_leave_latest);\n\n\n // departure_time: (leave_earliest + leave_latest) / 2\n // TODO could use leave date to calcuate time in the future. incorporate into both calls\n\n const new_trip_conf = {\n origin: driver.start_point.toString(), destination: driver.end_point.toString(),\n waypoints: `optimize:true|${driver.stringify_waypoints()}|${current_endpoint.toString()}`,\n };\n\n // TODO does not consider the drivers current waypoints\n const old_trip_conf = {\n origin: driver.start_point.toString(), destination: driver.end_point.toString(),\n };\n\n async.map([new_trip_conf, old_trip_conf], lookup_trip, (err, results) => {\n if (err) {\n valid_trip_callback(err);\n return;\n }\n\n const new_trip_time = trip_time(results[0]);\n const old_trip_time = trip_time(results[1]);\n\n if (driver.threshold >= new_trip_time - old_trip_time) {\n const new_match = new Match(rider.id,\n driver.id,\n current_endpoint,\n new_trip_time,\n rider.leave_date,\n new Time(leave_earliest),\n new Time(leave_latest));\n\n valid_trip_callback(null, new_match);\n } else {\n valid_trip_callback(null, null);\n }\n });\n}", "async fromToFlow(type) {\n try {\n await this.connectAndMigrate();\n } catch (error) {\n return error;\n }\n\n const suggestedStations = await this.getStationList();\n\n let from;\n let to;\n\n try {\n from = await autoCompletePromise.stations(\n suggestedStations,\n \"Van welk station zou je vertrekken?\"\n );\n to = await autoCompletePromise.stations(\n suggestedStations,\n \"Naar welk station wil je reizen?\"\n );\n } catch (error) {\n //console.log(error);\n return error;\n }\n let dateResult;\n\n if (type) {\n try {\n dateResult = await this.getDate(type);\n } catch (error) {\n return error;\n }\n }\n\n try {\n await storageAPI.saveToHistory(from, to);\n return await this.getRoute(from, to, dateResult);\n } catch (error) {\n return error;\n }\n }", "function searchFlights(from, to) {\n from = from.toUpperCase()\n to = to.toUpperCase()\n const result = data.filter(item => {\n if (item.Origin === from && item.Destination === to) {\n return item\n }\n })\n result.sort(function(a,b){\n if (a.Price !== b.Price) {\n return Number(a.Price.slice(1)) - Number(b.Price.slice(1))\n } else {\n let timeA = new Date(a['Departure Time'])\n let timeB = new Date(b['Departure Time'])\n return timeA - timeB\n }\n })\n return result\n}", "function setRoute(start, end) {\n // make a directions request using cycling profile\n var url = 'https://api.mapbox.com/directions/v5/mapbox/cycling/' + start[0] + ',' + start[1] + ';' + end[0] + ',' + end[1] + '?geometries=geojson&access_token=' + mapboxgl.accessToken;\n \n // make an XHR request https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest\n var req = new XMLHttpRequest();\n req.responseType = 'json';\n req.open('GET', url, true);\n req.onload = function() {\n var data = req.response.routes[0];\n var route = data.geometry.coordinates;\n var geojson = {\n type: 'Feature',\n properties: {},\n geometry: {\n type: 'LineString',\n coordinates: route\n }\n };\n \n // if the route already exists on the map, reset it using setData\n if (map.getSource('route')) {\n endMarker.setLngLat([start[0], start[1]]);\n map.getSource('route').setData(geojson);\n } else { // otherwise, make a new request\n map.addLayer({\n id: 'route',\n type: 'line',\n source: {\n type: 'geojson',\n data: {\n type: 'Feature',\n properties: {},\n geometry: {\n type: 'LineString',\n coordinates: geojson.geometry.coordinates\n }\n }\n },\n layout: {\n 'line-join': 'round',\n 'line-cap': 'round'\n },\n paint: {\n 'line-color': '#7ECE96',\n 'line-width': 5,\n 'line-opacity': 0.75\n //'line-dasharray': [1, 2]\n }\n });\n\n endMarkerEle.classList.remove('hide');\n endMarker.setLngLat([start[0], start[1]]);\n }\n map.flyTo({center: [start[0], start[1]], zoom: 14});\n\n };\n req.send();\n }", "function getRoute(end) {\n // make a directions request using cycling profile\n // an arbitrary start will always be the same\n // only the end or destination will change\n // if (!null) {\n var start = currentPosition;\n var url =\n \"https://api.mapbox.com/directions/v5/mapbox/cycling/\" +\n start[0] +\n \",\" +\n start[1] +\n \";\" +\n end[0] +\n \",\" +\n end[1] +\n \"?steps=true&geometries=geojson&access_token=\" +\n mapboxgl.accessToken;\n\n // make an XHR request https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest\n var req = new XMLHttpRequest();\n req.open(\"GET\", url, true);\n req.onload = function () {\n var json = JSON.parse(req.response);\n var data = json.routes[0];\n var route = data.geometry.coordinates;\n var geojson = {\n type: \"Feature\",\n properties: {},\n geometry: {\n type: \"LineString\",\n coordinates: route,\n },\n };\n // get the sidebar and add the instructions\n var instructions = document.getElementById(\"instructions\");\n var steps = data.legs[0].steps;\n\n var tripInstructions = [];\n for (var i = 0; i < steps.length; i++) {\n tripInstructions.push(\"<br><li>\" + steps[i].maneuver.instruction) +\n \"</li>\";\n instructions.innerHTML =\n '<br><span class=\"duration\">Trip duration: ' +\n Math.floor(data.duration / 60) +\n \" min 🚴 </span>\" +\n tripInstructions;\n }\n // if the route already exists on the map, reset it using setData\n if (map.getSource(\"route\")) {\n map.getSource(\"route\").setData(geojson);\n } else {\n // otherwise, make a new request\n map.addLayer({\n id: \"route\",\n type: \"line\",\n source: {\n type: \"geojson\",\n data: {\n type: \"Feature\",\n properties: {},\n geometry: {\n type: \"LineString\",\n coordinates: geojson,\n },\n },\n },\n layout: {\n \"line-join\": \"round\",\n \"line-cap\": \"round\",\n },\n paint: {\n \"line-color\": \"#3887be\",\n \"line-width\": 5,\n \"line-opacity\": 0.75,\n },\n });\n }\n // add turn instructions here at the end\n };\n\n req.send();\n // }\n}", "function showRoute() {\n\n navigator.geolocation.getCurrentPosition(function(pos) {\n var start = new google.maps.LatLng(pos.coords.latitude, pos.coords.longitude);\n\n var request = {\n origin:start,\n destination:SDU,\n travelMode: google.maps.TravelMode.WALKING\n };\n directionsService.route(request, function(response, status) {\n if (status = google.maps.DirectionsStatus.OK) {\n var route = response.routes[0];\n var start = route.legs[0].start_location;\n addMarker(start);\n directionsDisplay.setDirections(response);\n } else alert(\"Directions request failed: \"+status);\n });\n });\n}", "function get_distance(start, destination)\n{ \n return new Promise((resolve, reject) => distanceService.getDistanceMatrix(\n {\n // Get and place the user input origin and destination from the \n // website.\n origins: [start],\n destinations: [destination],\n travelMode: google.maps.TravelMode.DRIVING,\n unitSystem: google.maps.UnitSystem.IMPERIAL,\n durationInTraffic: true,\n avoidHighways: false,\n avoidTolls: false\n },\n\n response => \n {\n // Make sure this completes. \n resolve(response.rows[0].elements[0].distance.text);\n \n // Store the distance retrieved into the global variable for use in \n // our eventhandler when calculating the distance between sailor \n // location and garage sale. \n var distance = response.rows[0].elements[0].distance.text;\n distFromStart = parseFloat(distance);\n }));\n}", "function Trainer(name,course,passion,location){\n}", "drawRoute(start, finish) {\n let params = {\n \"mode\": \"fastest;car\",\n \"waypoint0\": \"geo!\" + start.Latitude + \",\" + start.Longitude,\n \"waypoint1\": \"geo!\" + finish.Latitude + \",\" + finish.Longitude,\n \"representation\": \"display\"\n }\n this.router.calculateRoute(params, data => {\n if(data.response) {\n data = data.response.route[0];\n let lineString = new H.geo.LineString();\n data.shape.forEach(point => {\n let parts = point.split(\",\");\n lineString.pushLatLngAlt(parts[0], parts[1]);\n });\n let routeLine = new H.map.Polyline(lineString, {\n style: { strokeColor: \"blue\", lineWidth: 5 }\n });\n this.map.addObjects([routeLine]);\n }\n }, error => {\n console.error(error);\n });\n }", "function CloudTravel (latitude, longitude, origin, destination) {\n this.lat1 = latitude[origin];\n this.lat2 = latitude[destination];\n this.lon1 = longitude[origin];\n this.lon2 = longitude[destination];\n this.getInfo = shortesCouriertTrip(this.lat1,this.lon1,this.lat2,this.lon2);\n}", "function routeBetweenCoordinates(origin, destination)\r\n{\r\n let directionRequest = {\r\n origin : origin,\r\n destination : destination,\r\n transportType : mapkit.Directions.Transport.Walking,\r\n requestsAlternateRoutes : false\r\n };\r\n\r\n let directions = new mapkit.Directions();\r\n\r\n directions.route(directionRequest, function(error, results) {\r\n if(error)\r\n {\r\n return;\r\n }\r\n\r\n var coordinates = Array();\r\n\r\n results.routes.forEach(function(route) {\r\n route.path.forEach(function(step) {\r\n step.forEach(function(coordinate) {\r\n coordinates.push(coordinate);\r\n });\r\n });\r\n \r\n drawRoute(coordinates, mapCustomColor[0], false);\r\n });\r\n });\r\n}", "showDirection() {\n if (!this.canShowDirection()) return;\n this.removeRouteLine();\n mainNav.showDirectionBox();\n let start_pos = this.start_point.getPos();\n let params = {\n transportMode: this.transport_mode,\n routingMode: \"fast\",\n origin: start_pos.lat + ',' + start_pos.lng\n };\n if (this.via_point) {\n let via_pos = this.via_point.getPos();\n params.via = via_pos.lat + ',' + via_pos.lng;\n }\n let dest_pos = this.dest_point.getPos();\n params.destination = dest_pos.lat + ',' + dest_pos.lng;\n params.return = \"polyline,summary,actions,instructions,passthrough\";\n params.spans = \"maxSpeed,speedLimit\";\n let me = this;\n this.router.calculateRoute(params, (res) => me.successCalculate(res), this.error);\n }", "constructor(origin, destination) {\n this.origin = origin.pos;\n this.destination = destination.pos;\n }", "function getNextTrains(direction,stop_id,stationClicked) { \n var nextThree; \n if (direction == 'south') {\n var stop_headsign = 'Century%20Park';\n } else {\n var stop_headsign = 'Clareview';\n }\n var etsUrl = 'https://data.edmonton.ca/resource/xeux-ngrz.json?$query=SELECT%20arrival_time_2%20WHERE%20stop_id=%22'+stop_id+'%22%20AND%20stop_headsign=%22'+stop_headsign+'%22%20GROUP%20BY%20arrival_time_2%20ORDER%20BY%20arrival_time_2%20ASC';\n $.ajax({\n url: etsUrl,\n dataType: 'json',\n success: function(data) {\n arrivalTimes = data;\n var i = 0;\n if (arrivalTimes.length > 0) {\n var arrivalTime = arrivalTimes[i].arrival_time_2;\n while (timeNow() > arrivalTime) {\n i++;\n arrivalTime = arrivalTimes[i].arrival_time_2;\n if (i > arrivalTimes.length) {\n break;\n }\n }\n if (direction == 'south') {\n nextThree = '<p> South Trains: <br>'+arrivalTimes[i].arrival_time_2+'<br>'+arrivalTimes[i+1].arrival_time_2+'<br>'+arrivalTimes[i+2].arrival_time_2+'</p>';\n } else {\n nextThree = '<p> North Trains: <br>'+arrivalTimes[i].arrival_time_2+'<br>'+arrivalTimes[i+1].arrival_time_2+'<br>'+arrivalTimes[i+2].arrival_time_2+'</p>';\n }\n } else {\n nextThree = 'No Train Times Available';\n }\n if (direction == 'south') {\n stationClicked.infowindow().setContent(stationClicked.infowindow().getContent()+nextThree);\n stationClicked.infowindow().open(map,stationClicked.marker());\n } else {\n stationClicked.infowindow().setContent(stationClicked.infowindow().getContent()+nextThree);\n }\n },\n error: function(jqXHR, exception) {\n if (direction == 'south') {\n nextThree = '<p> South Trains: <br>Unable to access ETS stop times</p>';\n stationClicked.infowindow().setContent(stationClicked.infowindow().getContent()+nextThree);\n stationClicked.infowindow().open(map,stationClicked.marker());\n } else {\n nextThree = '<p> North Trains: <br>Unable to access ETS stop times</p>';\n stationClicked.infowindow().setContent(stationClicked.infowindow().getContent()+nextThree);\n }\n console.log('Status: '+jqXHR.status+' Exception: '+exception);\n }\n });\n }", "function fromTo(line, startPoint, destination){\r\n var through = \"\"; // String to hold the stops\r\n var a = line.indexOf(startPoint); // starting point index\r\n var b = line.indexOf(destination); // ending point index\r\n \r\n // Checking whether to loop normally through the array or in reverse\r\n if(b > a){\r\n // Moving forward through the array to the desired stop\r\n // a+1 is to start from the next stop\r\n for (let i = a+1; i <= b; i++) {\r\n through += line[i]; // Adding the stop to the string\r\n // If done end the string with \".\" else add \", \"\r\n if(i === b) through += \".\"\r\n else through += \", \"\r\n // Increment stop counter\r\n stopCounter++;\r\n }\r\n } else {\r\n // Moving backward through the array to the desired stop\r\n // a-1 is to start from the next stop\r\n for (let i = a-1; i >= b; i--) {\r\n through += line[i]; // Adding the stop to the string\r\n // If done end the string with \".\" else add \", \"\r\n if(i === b) through += \".\"\r\n else through += \", \"\r\n // Increment stop counter\r\n stopCounter++;\r\n }\r\n\r\n }\r\n // Returning the stops\r\n return through;\r\n}", "calculateAndDisplayRoute(\n directionsService,\n directionsRenderer,\n des_lat,\n des_lng\n ) {\n // const selectedMode = document.getElementById(\"mode\").value;\n console.log(\"123\", des_lat, des_lng);\n const selectedMode = \"DRIVING\";\n directionsService.route(\n {\n origin: {\n lat: this.des_site_five.cur_lat,\n lng: this.des_site_five.cur_lng,\n },\n destination: { lat: des_lat, lng: des_lng },\n // Note that Javascript allows us to access the constant\n // using square brackets and a string value as its\n // \"property.\"\n travelMode: google.maps.TravelMode[selectedMode],\n },\n (response, status) => {\n if (status == \"OK\") {\n console.log(response);\n directionsRenderer.setDirections(response);\n } else {\n window.alert(\"Directions request failed due to \" + status);\n }\n }\n );\n }", "function getRoute(end) {\n // make directions request using cycling profile\n var url =\n 'https://api.mapbox.com/directions/v5/mapbox/cycling/' +\n start[0] +\n ',' +\n start[1] +\n ';' +\n end[0] +\n ',' +\n end[1] +\n '?steps=true&geometries=geojson&access_token=' +\n mapboxgl.accessToken;\n\n // make an XHR request https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest\n var req = new XMLHttpRequest();\n req.open('GET', url, true);\n req.onload = function () {\n var json = JSON.parse(req.response);\n var data = json.routes[0];\n var route = data.geometry.coordinates;\n var geojson = {\n type: 'Feature',\n properties: {},\n geometry: {\n type: 'LineString',\n coordinates: route,\n },\n };\n // if the route already exists on the map, we'll reset it using setData\n if (map.getSource('route')) {\n map.getSource('route').setData(geojson);\n }\n // otherwise, we'll make a new request\n else {\n map.addLayer({\n id: 'route',\n type: 'line',\n source: {\n type: 'geojson',\n data: {\n type: 'Feature',\n properties: {},\n geometry: {\n type: 'LineString',\n coordinates: geojson,\n },\n },\n },\n layout: {\n 'line-join': 'round',\n 'line-cap': 'round',\n },\n paint: {\n 'line-color': '#3887be',\n 'line-width': 5,\n 'line-opacity': 0.75,\n },\n });\n }\n\n // get the sidebar and add the instructions\n var instructions = document.getElementById('instructions');\n var steps = data.legs[0].steps;\n\n var tripInstructions = [];\n for (var i = 0; i < steps.length; i++) {\n tripInstructions.push('<br><li>' + steps[i].maneuver.instruction) +\n '</li>';\n instructions.innerHTML =\n '<br><span class=\"duration\">Trip duration: ' +\n Math.floor(data.duration / 60) +\n ' min 🚴 </span>' +\n tripInstructions;\n }\n };\n req.send();\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}", "static async requestVan (start, fromVB, toVB, destination, walkingTime, passengerCount = 1) {\n await this.updateVanLocations()\n\n // determine best van from all possible vans (the one with the lowest duration)\n const bestVan = await VanRequestService.requestBestVan(start, fromVB, toVB, walkingTime, passengerCount, this.vans)\n if (!bestVan) {\n // error, no van found!\n return { code: 403, message: 'No van currently available please try later' }\n }\n\n Logger.info('bestVan ' + bestVan.vanId)\n\n // set potential route (and thus lock the van)\n const vanId = bestVan.vanId\n this.vans[vanId - 1].potentialRoute = bestVan.potentialNewRoute\n this.vans[vanId - 1].potentialCutOffStep = bestVan.potentialCutOffStep\n this.vans[vanId - 1].potentialStops = bestVan.potentialStops\n\n this.vans[vanId - 1].potentialRouteTime = new Date()\n // const timeToVB = GoogleMapsHelper.readDurationFromGoogleResponse(route)\n const timeToVB = bestVan.toStartVBDuration\n\n return {\n vanId: vanId,\n nextStopTime: new Date(Date.now() + (timeToVB * 1000)),\n userVanRoute: bestVan.userVanRoute,\n userArrivalAtDestVBS: bestVan.userArrivalAtDestVBS,\n rideStartTime: bestVan.rideStartTime\n }\n }", "function getDirectionsShaun() {\n var start = myLoc;\n var end = new google.maps.LatLng(allMarkers[2][1],allMarkers[2][2]);\n\n var request = {\n origin: start,\n destination: end,\n travelMode: google.maps.TravelMode.WALKING\n };\n directionsService.route(request, function(result, status) {\n if(status == google.maps.DirectionsStatus.OK) {\n directionsDisplay.setDirections(result);\n }\n });\n}", "function testfunction() {\n//Two google services are stored as a variable. \n var directionsDisplay = new google.maps.DirectionsRenderer;\n var directionsService = new google.maps.DirectionsService;\n\n//It stores two elements from the form as a variable. \n var origin_input = document.getElementById('start');\n var destination_input = document.getElementById('end');\n\n//It autofills the Start and End element with address when anything is typed in. \n var autocomplete_origin = new google.maps.places.Autocomplete(origin_input); \n var autocomplete_destination = new google.maps.places.Autocomplete(destination_input); \n \n//It sets up a Panel.\n directionsDisplay.setPanel(document.getElementById('right-panel'));\n \n//The Panel from the form. \n var control = document.getElementById('right-panel');\n control.style.display = 'block';\n \n\n var onChangeHandler = function() {\n calculateAndDisplayRoute(directionsService, directionsDisplay);\n };\n //On clicking the submit Button calculateAndDisplayRoute is called. \n document.getElementById('submitButton').addEventListener('click', onChangeHandler);\n\n}", "travelTo(gameObjectTravelling, finalPosition, time, parameters) {\n const _from = {\n x: gameObjectTravelling.position.x,\n y: gameObjectTravelling.position.y,\n z: gameObjectTravelling.position.z\n };\n\n const _to = {\n x: finalPosition.x,\n y: finalPosition.y,\n z: finalPosition.z\n };\n\n const _easing =\n parameters && parameters.easing\n ? parameters.easing\n : TWEEN.Easing.Linear.None;\n const _target = parameters && parameters.target ? parameters.target : false;\n\n const tween = new TWEEN.Tween(_from)\n .to(_to, time)\n .easing(_easing)\n .onUpdate(function() {\n gameObjectTravelling.position.set(_from.x, _from.y, _from.z);\n if (_target) {\n gameObjectTravelling.lookAt(_target);\n }\n })\n .onComplete(function() {\n // TODO: emit event or dispatch to redux\n })\n .start();\n }", "function findPath(startID, goalID, via) {\n\t//check inputs are numbers\n\tif ((typeof startID == \"undefined\") || (isNaN(parseInt(startID))) || (getById(stations, parseInt(startID)) == null)) {\n\t\tthrow new Error(\"Cannot find path between stations \" + startID + \" and \" + goalID + \" because \" + startID + \" is not a valid station id\");\n\t}\n\tif ((typeof goalID == \"undefined\") || (isNaN(parseInt(goalID))) || (getById(stations, parseInt(goalID)) == null)) {\n\t\tthrow new Error(\"Cannot find path between stations \" + startID + \" and \" + goalID + \" because \" + goalID + \" is not a valid station id\");\n\t}\n\n\tvar openSet = [parseInt(startID)]; //set of stations to evaluate, starting with the first station\n\tvar closedSet = [];\n\tvar cameFrom = []; //list of nodes followed so far\n\n\t//keep track of routes + distances\n\tvar g_scores = []; //keep track of distances travelled to each point\n\tvar f_scores = []; //associative array to keep track of f_scores tested so far\n\tf_scores[startID] = get_f_score(startID);\n\n\t//look it up if you can, otherwise don't\n\tfunction get_f_score(ID) {\n\t\tif (typeof f_scores[ID] == \"undefined\") {\n\t\t\tf_scores[ID] = get_g_score(ID) + distance_estimate(ID, goalID);\n\t\t}\n\t\treturn f_scores[ID];\n\t}\n\n\tfunction get_g_score(ID) {\n\t\tif (typeof g_scores[ID] == \"undefined\") {\n\t\t\tg_scores[ID] = 0;\n\t\t}\n\t\treturn g_scores[ID];\n\t}\n\n\tvar counter = 0;\n\twhile (openSet.length > 0) {\n\t\t//pick the lowest f_score value first\n\t\tvar current = null;\n\t\tvar lowest = 99999;\n\t\tfor (var i = 0; i < openSet.length; i++) {\n\t\t\tif (get_f_score(openSet[i]) < lowest) {\n\t\t\t\tcurrent = openSet[i];\n\t\t\t\tlowest = get_f_score(current, goalID);\n\t\t\t}\n\t\t}\n\n\t\t//check if we've arrived at the right station yet\n\t\tif (current == goalID) {\n\t\t\t//find how we got here\n\t\t\tvar pathTaken = reconstruct_path(cameFrom, goalID, 0);\n\n\t\t\t//if no via option, no need to check\n\t\t\tif ((typeof via == \"undefined\") || (isNaN(parseInt(via))) || (getById(stations, parseInt(via)) == null)) {\n\t\t\t\treturn [pathTaken, get_g_score(goalID)];\n\t\t\t}\n\n\t\t\t//is the via station on the way?\n\t\t\tfor (var i = 0; i < pathTaken.length; i++) {\n\t\t\t\tif (pathTaken[i] == via) {\n\t\t\t\t\treturn [pathTaken, get_g_score(goalID)];\t\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//if neither of those, do it in two parts\n\t\t\tvar partA = findPath(startID, via);\n\t\t\tvar partB = findPath(via, goalID);\n\t\t\tvar fullPath = partA[0].concat(partB[0]);\n\t\t\tvar fullScore = partA[1] + partB[1];\n\t\t\treturn [fullPath, fullScore];\n\n\t\t}\n\n\t\t//remove current option from openSet and add to closedSet\n\t\topenSet.splice(openSet.indexOf(current), 1);\n\t\tif (closedSet.indexOf(current) == -1) {\n\t\t\tclosedSet.push(current);\n\t\t}\n\t\t\n\t\t//time out to limit route searching\n\t\tcounter++;\n\t\tif (counter >= routeTestLimit) {\n\t\t\treturn;\n\t\t}\n\n\t\t//test each of the current station's neighbours\n\t\tvar currentStation = getById(stations, current);\n\t\tvar currentNeighbours = currentStation.getNeighbours();\n\t\tfor (var i = 0; i < currentNeighbours.length; i++) {\n\t\t\tvar neighbour = currentNeighbours[i][0];\n\t\t\tvar neighbourDistance = currentNeighbours[i][1];\n\t\t\t\n\t\t\tvar tentative_g = get_g_score(current) + neighbourDistance;\n\t\t\tvar tentative_f = tentative_g + distance_estimate(current, neighbour);\n\t\t\tif ((closedSet.indexOf(neighbour) != -1) && (tentative_f >= get_f_score(neighbour))) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t//don't double back on yourself!\n\t\t\tif (cameFrom[current] == neighbour) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t//only do further steps if it's worth it\n\t\t\tif ((openSet.indexOf(neighbour) == -1) || (tentative_f < get_f_score[neighbour])) {\n\t\t\t\tcameFrom[neighbour] = current;\n\t\t\t\tg_scores[neighbour] = tentative_g;\n\t\t\t\tf_scores[neighbour] = tentative_f;\n\t\t\t\tif (openSet.indexOf(neighbour) == -1) {\n\t\t\t\t\topenSet.push(neighbour);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n \t}\n\n \treturn null;\n}", "function setRoute() {\n clearMarkers();\n clearResults();\n showNavResults();\n dirService = new google.maps.DirectionsService();\n dirDisplay = new google.maps.DirectionsRenderer({ map });\n dirDisplay.setPanel(document.getElementById('navResults'));\n \n // Uses the formatted address from the previous chosen locations by the user \n // so it can be referenced for the navigation API.\n var start = startID;\n var end = finishID;\n \n // Does a quick check to see if an address is in both variables and if not\n // simply displays a message to the user to select a location.\n if (startID == null || finishID == null) {\n alert('Please select locations to travel to and from.');\n resetSearch();\n searchPOI();\n } else {\n var request = {\n origin: start,\n destination: end,\n travelMode: 'DRIVING',\n };\n dirService.route(request, function(result, status) {\n if (status == 'OK') {\n dirDisplay.setDirections(result);\n }\n else {\n window.alert('Directions request failed due to ' + status + '\\n Try searching for another location!');\n resetSearch();\n searchPOI();\n }\n });\n }\n}", "function calculateAndDisplayRoute(directionsService, directionsDisplay) {\n\n directionsService.route({\n origin: new google.maps.LatLng({ lat: -8.060726, lng: -34.891307 }),\n destination: document.getElementById('end').value,\n travelMode: 'DRIVING'\n }, function (response, status) {\n if (status === 'OK') {\n directionsDisplay.setDirections(response);\n } else {\n window.alert('Requisição de direção falhou. Erro: ' + status);\n }\n });\n}", "function getRoute(start, end, event, eventTime, viableEvents) {\n $.post(\"https://www.mapquestapi.com/directions/v2/routematrix?key=7wBdDHmKJfeob8pxGJYQWNArZwtLnWu5\",\n \"json=\" + JSON.stringify({\n 'locations': [start, end],\n 'options': { 'allToAll': false }\n }),\n function (response) {\n console.log(response);\n travelTime = response.time[1];\n // travelTime calculated to determin if user can travel to event address by event start time (based on current/quiried location)\n //if time of arrivale is < event start time, append current event to viable events array for display\n var t1 = new Date(searchTime);\n var t2 = new Date(eventTime);\n var dif = (t1 - t2)/1000; // how much time is betwwen qurried time and event start in seconds\n console.log(eventTime);\n console.log(t2);\n console.log(dif);\n if(dif>travelTime) {\n viableEvents.push(event); // current event from parent function checkEvents()\n }\n renderEvents();\n }, \"json\");\n }", "function getRoute(end) {\n var url = `https://api.mapbox.com/directions/v5/mapbox/${prevoz}/` + start[0] + ',' + start[1] + ';' + end[0] + ',' + end[1] + '?steps=true&geometries=geojson&access_token=' + mapboxgl.accessToken;\n var req = new XMLHttpRequest();\n req.open('GET', url, true);\n req.onload = function () {\n var json = JSON.parse(req.response);\n var data = json.routes[0];\n var route = data.geometry.coordinates;\n var geojson = {\n type: 'Feature',\n properties: {},\n geometry: {\n type: 'LineString',\n coordinates: route\n }\n };\n if (map.getSource('route')) {\n map.getSource('route').setData(geojson);\n } else {\n map.addLayer({\n id: 'route',\n type: 'line',\n source: {\n type: 'geojson',\n data: {\n type: 'Feature',\n properties: {},\n geometry: {\n type: 'LineString',\n coordinates: geojson\n }\n }\n },\n layout: {\n 'line-join': 'round',\n 'line-cap': 'round'\n },\n paint: {\n 'line-color': '#3887be',\n 'line-width': 5,\n 'line-opacity': 0.75\n }\n });\n }\n var instructions = document.getElementById('instructions');\n var steps = data.legs[0].steps;\n\n var tripInstructions = [];\n for (var i = 0; i < steps.length; i++) {\n tripInstructions.push('<br><li>' + steps[i].maneuver.instruction) + '</li>';\n instructions.innerHTML = '<br><span class=\"duration\">Trip duration: ' + Math.floor(data.duration / 60) + ' min 🚴 </span>' + tripInstructions;\n }\n\n };\n req.send();\n }", "function findRoute(graph, from, to){\n //work array adds an object for every update in which at is the location at that specific moment and route is the path followed to get to that place\n let work = [{at: from, route: []}];\n //the inner for is run for every destination of the \"at location\", then the outer array starts again on its next iteration having those locations returns by the graph[at] object key as the \"at\" destination\n for (let i = 0; i < work.length; i++){\n let {at, route} = work[i];\n //graph[at] is the array containing all the destinations possible from the \"at\" location\n for (let place of graph[at]){\n //in case the final destination has been reached, the final destination is added on the route array, which is returns afterwards\n if (place == to) return route.concat(place);\n //in case the current location has been visited before the work array is not updated\n if (!work.some(w => w.at == place)){\n //the work array is updated with an object containing the current location, being the current location added to the route array\n work.push({at: place, route: route.concat(place)});\n }\n }\n }\n}", "function findRoute(graph, from, to){\n //work array adds an object for every update in which at is the location at that specific moment and route is the path followed to get to that place\n let work = [{at: from, route: []}];\n //the inner for is run for every destination of the \"at location\", then the outer array starts again on its next iteration having those locations returns by the graph[at] object key as the \"at\" destination\n for (let i = 0; i < work.length; i++){\n let {at, route} = work[i];\n //graph[at] is the array containing all the destinations possible from the \"at\" location\n for (let place of graph[at]){\n //in case the final destination has been reached, the final destination is added on the route array, which is returns afterwards\n if (place == to) return route.concat(place);\n //in case the current location has been visited before the work array is not updated\n if (!work.some(w => w.at == place)){\n //the work array is updated with an object containing the current location, being the current location added to the route array\n work.push({at: place, route: route.concat(place)});\n }\n }\n }\n}" ]
[ "0.62054175", "0.5913088", "0.5890718", "0.57346815", "0.5714327", "0.56850135", "0.56673986", "0.5622518", "0.557216", "0.5567229", "0.5535041", "0.55243945", "0.5486196", "0.5436927", "0.5353946", "0.53172594", "0.53129697", "0.527652", "0.52694666", "0.52590513", "0.52135086", "0.5209383", "0.51688415", "0.51362073", "0.51137304", "0.51074564", "0.51058906", "0.51058614", "0.5103731", "0.5094913", "0.5087064", "0.50856626", "0.50843364", "0.507278", "0.5071194", "0.5064205", "0.50593853", "0.50491023", "0.5042088", "0.5037485", "0.5036735", "0.5021023", "0.50191224", "0.49951458", "0.49929285", "0.49863064", "0.4980721", "0.49652174", "0.49477863", "0.4942743", "0.49386242", "0.4934582", "0.49271026", "0.49208748", "0.4919104", "0.49114817", "0.49114817", "0.4909885", "0.49000514", "0.48966986", "0.4895778", "0.489111", "0.4888884", "0.48882413", "0.48859686", "0.48847088", "0.48840317", "0.4882781", "0.48787606", "0.48727775", "0.48725194", "0.4861047", "0.48608562", "0.48599973", "0.48573884", "0.4854688", "0.48469493", "0.48462301", "0.4844936", "0.4842389", "0.48423082", "0.4831077", "0.48158208", "0.48067054", "0.4803238", "0.47962743", "0.47933412", "0.47812924", "0.4780414", "0.4778003", "0.47741508", "0.47672433", "0.47578475", "0.47562855", "0.47551295", "0.47547927", "0.47519055", "0.474491", "0.47414035", "0.47414035" ]
0.64472765
0
This method is to define many drawing instructions inside the class, so render method can use them without redefining them every time.
loadInstructions () { this.instructionParameters = { clearRect: ['ctx', 'x', 'y', 'width', 'height'], clearPolygon: ['ctx', 'path'], drawImage: [ 'ctx', 'src', 'srcPos', 'size', 'canvasPos', 'resize', 'alpha' ], drawImageByPos: [ 'ctx', 'src', 'pos', 'areaSize', 'srcPos', 'size', 'canvasPos', 'resize', 'alpha' ], drawImageInNinePos: [ 'ctx', 'src', 'pos', 'length', 'lengthDiagonal', 'srcPos', 'size', 'canvasPos', 'resize', 'alpha' ], drawDifferentImageInNinePos: ['ctx', 'src', 'pos', 'allCoords', 'alpha'], drawImageInPolygon: [ 'ctx', 'src', 'path', 'srcPos', 'size', 'canvasPos', 'resize', 'alpha' ], drawImageInPolygonByValue: [ 'ctx', 'src', 'value', 'areaWidth', 'path', 'srcPos', 'size', 'canvasPos', 'resize', 'alpha' ], writeTextLine: [ 'ctx', 'y', 'value', 'color', 'fontSize', 'alpha' ], writeTextLines: [ 'ctx', 'y', 'value', 'newLineOnBelow', 'color', 'fontSize', 'alpha' ] } // everything here has `this.instruction` as `this` this.instruction = { _sin45: Math.sin(Math.PI * 0.75), _posOrder: [ 'upleft','up','upright', 'left','neutral','right', 'downleft','down','downright' ], /** * Take the position data and convert their number to either -1, 0, or 1. * * It turns out there's a joystick that can't push the input all the way to 1, * so this method is to ensure stick/dpad position is always one of 9 possible cases. * * @param {number[]} pos * array of x-axis and y-axis value, each in a range of 0 ~ 1 (inclusive) * @param {number} [threshold=0.5] axis value below this is considered inactive * @returns {number[]} returns new pos data with values always being either -1, 0, or 1. * @private */ _getDigitalPos: function (pos, threshold = 0.5) { if (!pos) { pos = [0, 0] } const posMagnitude = [ Math.abs(pos[0]), Math.abs(pos[1]) ] const digitalPos = [ posMagnitude[0] >= threshold ? pos[0] / posMagnitude[0] : 0, posMagnitude[1] >= threshold ? pos[1] / posMagnitude[1] : 0 ] if (digitalPos[0] % 1 !== 0 || digitalPos[1] % 1 !== 0) { GamepadRenderer.announceMessage( new Error('Value divided by its magnitude didn\'t return 1. ' + 'Code will keep running but it should be always rounded.') ) digitalPos[0] = Math.round(digitalPos[0]) digitalPos[1] = Math.round(digitalPos[1]) } return digitalPos }, clearRect: function ( ctx, x, y, width, height ) { ctx.clearRect(x, y, width, height) }, clearPolygon: function ( ctx, path ) { ctx.save() ctx.globalCompositeOperation = 'destination-out' ctx.beginPath() for (let p = 0; p < path.length; p=p+2) { if (typeof path[p+1] === 'undefined') { continue } ctx.lineTo(path[p], path[p+1]) } ctx.closePath() ctx.fill() ctx.restore() }, drawImage: function ( ctx, src, srcPos, size, canvasPos, resize, alpha = 1 ) { if ( alpha === 0 || !srcPos || !size || !canvasPos ) { return } if (alpha !== 1) { ctx.save() ctx.globalAlpha = alpha } ctx.drawImage(src, ...srcPos, ...size, ...canvasPos, ...resize||size) if (alpha !== 1) { ctx.restore() } }, drawImageByPos: function ( ctx, src, pos, areaSize, srcPos, size, canvasPos, resize, alpha = 1 ) { if (!srcPos || !size || !canvasPos) { return } if (pos === null) { pos = [0, 0] } const fixedPos = [] for (let a = 0; a < 2; a++) { fixedPos.push(pos[a] * areaSize[a] + canvasPos[a]) } this.drawImage( ctx, src, srcPos, size, fixedPos, resize, alpha ) }, drawImageInNinePos: function ( ctx, src, pos, length, lengthDiagonal, srcPos, size, canvasPos, resize, alpha = 1 ) { if (pos === null) { pos = [0, 0] } if (typeof lengthDiagonal === 'undefined') { lengthDiagonal = length * this._sin45 } const digitalPos = this._getDigitalPos(pos) // if both axis is not zero then dP[0]*dP[1] will be true const fixedLength = digitalPos[0] * digitalPos[1] ? lengthDiagonal : length const fixedPos = [] for (let a = 0; a < 2; a++) { fixedPos.push(digitalPos[a] * fixedLength + canvasPos[a]) } this.drawImage( ctx, src, srcPos, size, fixedPos, resize, alpha ) }, drawDifferentImageInNinePos: function ( ctx, src, pos, allCoords, alpha = 1 ) { if (pos === null) { pos = [0, 0] } const digitalPos = this._getDigitalPos(pos) /* * this.posOrder = [ * 'upleft','up','upright', * 'left','neutral','right', * 'downleft','down','downright' * ] */ const positionIndex = 4 + digitalPos[0] + 3 * digitalPos[1] const coord = allCoords[this._posOrder[positionIndex]] if (!coord) { return } this.drawImage( ctx, src, coord[0], coord[1], coord[2], coord[3], alpha ) }, drawImageInPolygon: function ( ctx, src, path, srcPos, size, canvasPos, resize, alpha = 1 ) { ctx.save() if (alpha === 0) { return } if (alpha !== 1) { ctx.globalAlpha = alpha } ctx.beginPath() for (let p = 0; p < path.length; p=p+2) { if (typeof path[p+1] === 'undefined') { continue } ctx.lineTo(path[p], path[p+1]) } ctx.closePath() ctx.clip() ctx.drawImage(src, ...srcPos, ...size, ...canvasPos, ...resize||size) ctx.restore() }, drawImageInPolygonByValue: function ( ctx, src, value, areaWidth, path, srcPos, size, canvasPos, resize, alpha = 1 ) { const fixedPath = [] const width = value * areaWidth for (let p = 0; p < path.length; p++) { if (path[p].constructor === Array) { fixedPath.push( path[p][0] + (path[p][1] ? 1 : -1) * width ) } else { fixedPath.push(path[p]) } } this.drawImageInPolygon( ctx, src, fixedPath, srcPos, size, canvasPos, resize, alpha ) }, /** * write text on a semitransparent black line that fills up the full width * @param {CanvasRenderingContext2D} ctx * @param {number} y bottom point of the text * @param {string} value * @param {string} [color='white'] * @param {number} [fontSize=16] * @param {number} [alpha=1] */ writeTextLine: function ( ctx, y, value, color = 'white', fontSize = 16, alpha = 1 ) { ctx.save() // fill background color ctx.globalAlpha = 0.5 * alpha ctx.fillStyle = 'black' /*const letterHeight = parseFloat( window.getComputedStyle(ctx.canvas, null) .getPropertyValue('font-size') )*/ ctx.fillRect(0, y, ctx.canvas.clientWidth, -1 * fontSize) // write text ctx.globalAlpha = alpha ctx.fillStyle = color ctx.font = '1em monospace' ctx.textBaseline = 'ideographic' ctx.fillText(value, 0, y) ctx.restore() }, /** * write multiple text lines on a semitransparent black line that fills up the full width * @param {CanvasRenderingContext2D} ctx * @param {number} y bottom point of the text * @param {string[]} value * @param {boolean} [newLineOnAbove=false] next line will appear above the last line * @param {string} [color='white'] * @param {number} [fontSize=16] * @param {number} [alpha=1] */ writeTextLines: function ( ctx, y, value, newLineOnAbove = false, color = 'white', fontSize = 16, alpha = 1 ) { ctx.save() // fill background color ctx.globalAlpha = 0.25 * alpha ctx.fillStyle = 'black' const totalHeight = value.length * fontSize ctx.fillRect(0, y, ctx.canvas.clientWidth, -1 * totalHeight) ctx.globalAlpha = alpha ctx.fillStyle = color ctx.font = '1em monospace' ctx.textBaseline = 'ideographic' for (let l = 0; l < value.length; l++) { ctx.fillText( value[l], 0, y - ( newLineOnAbove ? l : (value.length - 1 - l) ) * fontSize ) } ctx.restore() } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function draw(){\n\t\t// Needed to comply with Tool Delegate design pattern\n\t}", "draw() {}", "draw() {}", "draw() {}", "draw() {}", "function draw() {}", "function draw() {}", "_draw() {\n\n }", "draw() { }", "draw() { }", "draw() { }", "function draw() {\n Gravity();\n Animation();\n FrameBorder(); \n FrameBorderCleaner();\n Controls();\n Interaction();\n}", "constructor() {\n super();\n this.draw();\n }", "draw() {\n }", "draw() {\n\n }", "draw() {\n\n this.drawInteractionArea();\n\n //somewhat depreciated - we only really draw the curve interaction but this isnt hurting anyone\n if(lineInteraction)\n this.drawLine();\n else\n this.drawCurve();\n\n this.drawWatch(); \n\n }", "function finalDraw() {\n\t Registry.getComponentMethod('shapes', 'draw')(gd);\n\t Registry.getComponentMethod('images', 'draw')(gd);\n\t Registry.getComponentMethod('annotations', 'draw')(gd);\n\t Registry.getComponentMethod('legend', 'draw')(gd);\n\t Registry.getComponentMethod('rangeslider', 'draw')(gd);\n\t Registry.getComponentMethod('rangeselector', 'draw')(gd);\n\t Registry.getComponentMethod('sliders', 'draw')(gd);\n\t Registry.getComponentMethod('updatemenus', 'draw')(gd);\n\t }", "function Drawing(){\n\n\tthis.header={\n\t\t$INSBASE:{x:0,y:0,z:0},\n\t\t$EXTMIN:{x:0,y:0,z:0},\n\t\t$EXTMAX:{x:10,y:10,z:0}\n\t};\n\tthis.tables={\n\t\tlinetype:{\n\t\t\tContinuous:{\n name: \"Continuous\",\n description: \"Solid line\",\n patternLength: 0\n },\n HIDDEN2: {\n name: \"HIDDEN2\",\n description: \"Hidden (.5x) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\",\n pattern:[0.125, -0.0625],\n patternLength: 0.1875\n }\n\t\t},\n\t\tlayer:{\n\t\t\thandle: \"2\",\n\t\t\townerHandle: \"0\",\n\t\t\tlayers: {\n\t\t\t\t\"0\":{Name:\"0\", Visible:true, color:16711680},\n\t\t\t\t\"A-WALL\":{Name:\"0\", Visible:true, color:16711680}\n\t\t\t}\t\t\n\t\t}\n\t};\n\tthis.blocks={};\n\tthis.entities=[\n\t\tline.create(this)\n\t\t//new line.Line(this)\n\t];\t\n}", "draw () { //change name to generate?? also need to redo\n return null;\n }", "draw(){\n }", "draw(context) {\n //TO-DO\n }", "_draw_all(){\r\n\t\tthis._draw_bg();\r\n\t\tthis._draw_fg();\r\n\t}", "function Draw() {\n}", "function finalDraw() {\n Registry.getComponentMethod('shapes', 'draw')(gd);\n Registry.getComponentMethod('images', 'draw')(gd);\n Registry.getComponentMethod('annotations', 'draw')(gd);\n Registry.getComponentMethod('legend', 'draw')(gd);\n Registry.getComponentMethod('rangeslider', 'draw')(gd);\n Registry.getComponentMethod('rangeselector', 'draw')(gd);\n Registry.getComponentMethod('sliders', 'draw')(gd);\n Registry.getComponentMethod('updatemenus', 'draw')(gd);\n }", "function finalDraw() {\n Registry.getComponentMethod('shapes', 'draw')(gd);\n Registry.getComponentMethod('images', 'draw')(gd);\n Registry.getComponentMethod('annotations', 'draw')(gd);\n Registry.getComponentMethod('legend', 'draw')(gd);\n Registry.getComponentMethod('rangeslider', 'draw')(gd);\n Registry.getComponentMethod('rangeselector', 'draw')(gd);\n Registry.getComponentMethod('sliders', 'draw')(gd);\n Registry.getComponentMethod('updatemenus', 'draw')(gd);\n }", "draw() {\n this.loop(DrawableArray.drawFunction);\n }", "draw() {\n this.loop(DrawableArray.drawFunction);\n }", "draw() {\n this.loop(DrawableArray.drawFunction);\n }", "function DrawInterface()\n{\n}", "draw() {\n this.checkContext();\n this.setRendered();\n\n if (!this.formatted) this.format();\n\n const num_lines = this.options.num_lines;\n const width = this.width;\n const x = this.x;\n let y;\n\n // Render lines\n for (let line = 0; line < num_lines; line++) {\n y = this.getYForLine(line);\n\n this.applyStyle();\n if (this.options.line_config[line].visible) {\n this.context.beginPath();\n this.context.moveTo(x, y);\n this.context.lineTo(x + width, y);\n this.context.stroke();\n }\n this.restoreStyle();\n }\n\n // Draw the modifiers (bar lines, coda, segno, repeat brackets, etc.)\n for (let i = 0; i < this.modifiers.length; i++) {\n // Only draw modifier if it has a draw function\n if (typeof this.modifiers[i].draw === 'function') {\n this.modifiers[i].applyStyle(this.context);\n this.modifiers[i].draw(this, this.getModifierXShift(i));\n this.modifiers[i].restoreStyle(this.context);\n }\n }\n\n // Render measure numbers\n if (this.measure > 0) {\n this.context.save();\n this.context.setFont(this.font.family, this.font.size, this.font.weight);\n const text_width = this.context.measureText('' + this.measure).width;\n y = this.getYForTopText(0) + 3;\n this.context.fillText('' + this.measure, this.x - text_width / 2, y);\n this.context.restore();\n }\n\n return this;\n }", "function draw() {\n \n\n \n}", "display() {\n fill('#323230');\n noStroke();\n if(this.shape === 'rect') {\n rectMode(CENTER);\n rect(this.x, this.y, this.size, this.size);\n } else if(this.shape === 'circle') {\n circle(this.x, this.y, this.size);\n } else {\n triangle(this.x - this.size / 2, this.y + this.size / 2, this.x + this.size / 2, this.y + this.size / 2, this.x, this.y - this.size / 2);\n }\n }", "draw() {\n const _wasDrawn = this.drawn;\n this.drawRect();\n if (!_wasDrawn) {\n this.firstDraw();\n if (this.isString(this.componentName)) {\n this.drawMarkup();\n }\n if (this.isArray(this.options.classNames)) {\n this.options.classNames.forEach(_className => {\n this.setCSSClass(_className);\n });\n }\n this.options.style && this.setStyles(this.options.style);\n this.options.html && this.setHTML(this.options.html);\n // Extended draw for components to define / extend.\n // This is preferred over drawSubviews, when defining\n // parts of a complex component.\n if (this.isFunction(this.extDraw)) {\n this.extDraw();\n }\n // Extended draw for the purpose of drawing sub-views.\n this.drawSubviews();\n // if options contain a sub-views function, call it with the name-space of self\n if (this.isFunction(this.options.subviews)) {\n this.options.subviews.call(this, this);\n }\n // for external testing purposes, a custom className can be defined:\n if (this.options.testClassName) {\n ELEM.addClassName(this.elemId, this.options.testClassName);\n }\n if (this.isntNullOrUndefined(this.options.tabIndex)) {\n this.setTabIndex(this.options.tabIndex);\n }\n if (!this.isHidden) {\n this.show();\n }\n if (this.options.focusOnCreate === true && !BROWSER_TYPE.mobile) {\n this.timeouts.push(setTimeout(() => {this.setFocus();}, 300));\n }\n }\n this.refresh();\n return this;\n }", "draw() {\n\t\tthis.newPosition()\n\t\tthis.hoverCalc()\n\n\n\t\t// this.drawWaves()\n\n\t\tthis.applyCircleStyle()\n\n\n\t\tthis.ly.circle( this.x, this.y, 2 * this.r * this.scale )\n\n\t\tthis.applyTextStyle()\n\t\tthis.ly.text( this.label, this.x, this.y )\n\n\n\n\t}", "function draw_Buttons() {\r\n btnDown.drawButton(context1.context);\r\n btnUp.drawButton(context1.context);\r\n btnLeft.drawButton(context1.context);\r\n btnRight.drawButton(context1.context);\r\n btnFire.drawButton(context1.context);\r\n btnMiddle.drawButton(context1.context);\r\n }", "function draw() {\n \n}", "function draw() {\r\n \r\n}", "function draw() {\n \n}", "draw() {\n if (this._selected) {\n this.selectedDraw();\n }\n if (this._hovered) {\n this.hoveredDraw();\n }\n if (!this._hovered && !this._selected) {\n this.normalDraw();\n }\n this.isHovered();\n this.isClicked();\n }", "function draw() {\n}", "function draw() {\n}", "function draw() {\n}", "function draw() {\n}", "function draw() {\n}", "paint() {\r\n }", "function drawOnDemand(){\n\n\n}", "function ProceduralRenderer3(){}", "function draw(\n\n) {}", "function paint() {\n}", "displayInstructions() {\n ctx.fillStyle = \"white\";\n ctx.fillRect(this.rightBoundary/2, tileSize/2, this.rightBoundary/2, 3*tileSize);\n\n ctx.fillStyle = this.instructionColor;\n ctx.font = this.instructionFont;\n ctx.fillText(\"press arrow keys to start the game\", this.rightBoundary/2 + this.offset, this.leftBoundary);\n }", "constructor() {\n this.canvas = document.getElementById(\"canvas\");\n this.ctx = this.canvas.getContext(\"2d\");\n this.bounds = this.canvas.getBoundingClientRect();\n this.color = COLORS.red;\n this.tool = TOOLS.pen;\n\n // tool customization\n this.pencilWidth = 10;\n this.eraserWidth = 10;\n this.shapeWidth = 10;\n this.fontSize = 16;\n this.fontFamily = \"Arial\";\n\n this.drawing = false;\n\n // store the mouse coordinates\n this.currentPosition = {\n x: 0,\n y: 0,\n };\n this.startPosition = {\n x: 0,\n y: 0,\n };\n\n this.savedCanvas;\n this.savedActions = [];\n\n this.draw = this.draw.bind(this);\n this.startDrawing = this.startDrawing.bind(this);\n this.stopDrawing = this.stopDrawing.bind(this);\n this.onMouseMove = this.onMouseMove.bind(this);\n this.showTextInput = this.showTextInput.bind(this);\n this.addText = this.addText.bind(this);\n this.init = this.init.bind(this);\n }", "function draw()\n{\n}", "draw() {\n this.checkContext();\n this.setRendered();\n if (this.unbeamable) return;\n\n if (!this.postFormatted) {\n this.postFormat();\n }\n\n this.drawStems();\n this.applyStyle();\n this.drawBeamLines();\n this.restoreStyle();\n }", "draw() {\n // if not initialized\n if (this.viewportFollow === null) return;\n\n // draw background\n this._drawEveryCellWrapper(this._drawLayer.bind(this, 'ground'));\n\n // draw foreground\n for (const [, layerName, renderFunction, renderArgs] of this.customizedLayers) {\n if (renderFunction === '_drawCharacters') {\n this._drawCharacters(renderArgs);\n } else {\n this._drawEveryCellWrapper(this._drawLayer.bind(this, layerName));\n }\n }\n }", "draw() {\n\t\tlet width = 30;\n\n\t\tinfo.context.beginPath();\n\t\tinfo.context.moveTo(this.position.x - width/2, this.position.y + width/2);\n\t\tinfo.context.lineTo(this.position.x + width/2, this.position.y + width/2);\n\t\tinfo.context.lineTo(this.position.x, this.position.y - width/2);\n\t\tinfo.context.closePath();\n\t\tinfo.context.fillStyle = this.color;\n\t\tinfo.context.fill();\n\t}", "function draw()\n{\n \n}", "draw() {\n this.bg.forEach((a) => a.draw());\n this.shapes.forEach((a) => a.draw());\n Help.clean(this.shapes);\n }", "function draw() {\n\n}", "function draw() {\n\n}", "function draw() {\n\n}", "function draw() {\n\n}", "function draw() {\n\n}", "function draw() {\n\n}", "function draw() {\n\n}", "function draw() {\n\n}", "function draw() {\n\n}", "function draw() {\n\n}", "function draw() {\n\n}", "function basicDrawing(x, y, tool){tool.drawPixel(x, y);}", "draw() {\n this.setSize();\n this.setSizeBounds();\n this.move();\n this.coordinates = getPlaneCoordinates(this);\n this.gridCoordinates = getGridCoordinates(this);\n }", "function drawElements() {\n that.gameArea.paint(that.contex);\n that.food.paint(that.contex, that.gameArea.cellSize);\n that.snake.paint(that.contex, that.gameArea.cellSize);\n }", "draw() {\n this.setRendered();\n const x = this.getAbsoluteX();\n const y = this.stave.getYForLine(this.line + -3);\n\n L('Rendering Dynamics: ', this.sequence);\n\n let letter_x = x;\n this.glyphs.forEach((glyph, index) => {\n const current_letter = this.sequence[index];\n glyph.render(this.context, letter_x, y);\n letter_x += TextDynamics.GLYPHS[current_letter].width;\n });\n }", "paint() {\r\n graphics.fillStyle = \"#ff1a1a\";\r\n graphics.beginPath();\r\n graphics.moveTo(this.x, this.y + this.h / 2);\r\n graphics.lineTo(this.x + this.w / 2, this.y - this.h / 2);\r\n graphics.lineTo(this.x - this.w / 2, this.y - this.h / 2);\r\n graphics.closePath();\r\n graphics.fill();\r\n }", "function coreDraw() {\r\n\t\t\tdrawMethod();\r\n\t\t\texecRequestAnimationFrameFnList();\r\n\t\t\t// if the tween component exists let's update it\r\n\t\t\tif (TWEEN) {\r\n\t\t\t\tTWEEN.update();\r\n\t\t\t}\r\n\t\t}", "function rectButton(x,y,width,height,onClick,label,drawFunction,onHover){\n\tthis.x=x;\n\tthis.y=y;\n\tthis.width=width;\n\tthis.height=height;\n\tthis.label=label;\n\tthis.buttonColors=[\"#2E9AFE\",\"#084B8A\",\"white\",\"black\"];\n\tthis.engine;\n\tthis.offsetX=0;\n\tthis.offsetY=0;\n\n\t//drawfunction to be drawn onto the screen every frame\n\tif(drawFunction===undefined || drawFunction===null){\n\t\tdrawFunction=function(){\n\t\t\tthis.engine.context.fillStyle=this.buttonColors[0];\n\t\t\tthis.engine.context.fillRect(this.x+this.offsetX,this.y+this.offsetY,this.width,this.height);\n\t\t\tthis.engine.context.fillStyle=this.buttonColors[1];\n\t\t\tthis.engine.context.fillRect(this.x+this.offsetX,this.y+this.offsetY+this.height-this.height/5,this.width,this.height/5);\t\n\t\t\tif(!(this.label===undefined)){\n\t\t\t\tthis.buttonColors[2]===undefined?this.buttonColors[2]=\"white\":this.buttonColors[2]=this.buttonColors[2];\n\t\t\t\tthis.buttonColors[3]===undefined?this.buttonColors[3]=\"black\":this.buttonColors[3]=this.buttonColors[3];\n\t\t\t\tthis.engine.context.fillStyle=this.buttonColors[2];\n\t\t\t\tthis.engine.context.font=this.height/2+\"px \"+this.engine.font;\n\t\t\t\tthis.engine.context.fillText(this.label,this.x+(this.width-this.engine.context.measureText(this.label).width)/2+this.offsetX,this.y+this.offsetY+(this.height*2/3));\t\n\t\t\t\tthis.engine.context.font=this.engine.fontsize+\"px \"+this.engine.font;\n\t\t\t}\n\t\t}\n\t}\n\tthis.drawFunction=drawFunction;\n\n\t//called when mouse is hovering over button\n\tif(onHover===undefined || onHover===null){\n\t\tonHover=function(){\n\t\t\tthis.engine.context.fillStyle=this.buttonColors[1];\n\t\t\tthis.engine.context.fillRect(this.x+this.offsetX,this.y+this.offsetY,this.width,this.height);\n\t\t\tif(!(this.label===undefined)){\n\t\t\t\tthis.buttonColors[2]===undefined?this.buttonColors[2]=\"white\":this.buttonColors[2]=this.buttonColors[2];\n\t\t\t\tthis.buttonColors[3]===undefined?this.buttonColors[3]=\"black\":this.buttonColors[3]=this.buttonColors[3];\n\t\t\t\tthis.engine.context.fillStyle=this.buttonColors[3];\n\t\t\t\tthis.engine.context.font=this.height/2+\"px \"+this.engine.font;\n\t\t\t\tthis.engine.context.fillText(this.label,this.x+this.offsetX+2+(this.width-this.engine.context.measureText(this.label).width)/2,this.y+2+(this.height*2/3)+this.offsetY);\t\n\t\t\t\tthis.engine.context.fillStyle=this.buttonColors[2];\n\t\t\t\tthis.engine.context.fillText(this.label,this.x+this.offsetX+(this.width-this.engine.context.measureText(this.label).width)/2,this.y+(this.height*2/3)+this.offsetY);\t\n\t\t\t\tthis.engine.context.font=this.engine.fontsize+\"px \"+this.engine.font;\n\t\t\t}\n\t\t}\n\t}\n\tthis.onHover=onHover;\n\n\t//called when clicked\n\tif(onClick===undefined || onClick===null){\n\t\tonClick=function(){\n\t\t\tconsole.log(\"Button Clicked\");\n\t\t}\n\t}\n\tthis.onClick=onClick;\n\n\t//draws the button depending on its state\n\tthis.drawButton=function(x,y,w,h){\n\t\tif(x+w > this.x+this.offsetX && x < (this.x + this.width)+this.offsetX && y+h > this.y+this.offsetY && y < (this.y + this.height)+this.offsetY){\n\t\t\tthis.onHover();\n\t\t} else {\n\t\t\tthis.drawFunction();\n\t\t}\n\t}\n}", "Draw(){\n\t\tthis.context.beginPath();\n\t\tthis.context.fillRect(this.posX, this.posY, this.width, this.height);\n\t\tthis.context.closePath();\n }", "draw() {\n let ctx = this.ctx;\n ctx.beginPath();\n ctx.fillStyle = Action.BGCOLOR;\n if (this.activated) {\n ctx.fillStyle = Action.BGACTIVATEDCOLOR;\n }\n CanvasHelper.fillRect(\n ctx,\n this.x, this.y, this.w, this.h,\n Action.PADDING\n );\n\n let fontSize = 30;\n\n ctx.fillStyle = Action.TEXT_COLOR;\n ctx.font = fontSize + \"px serif\";\n ctx.fillText(this.typeSymbol, this.x + this.w / 3, this.y + this.h * 3 / 4);\n }", "draw() {\n\t\tlet width = 30;\n\n\t\tinfo.context.beginPath();\n\t\tinfo.context.rect(this.position.x - width/2, this.position.y - width/2, width, width);\n\t\tinfo.context.fillStyle = this.color;\n\t\tinfo.context.fill();\n\t}", "draw() {\n rect(this.x1, this.y1, this.Width, this.Height);\n }", "draw() {\n rect(this.x1, this.y1, this.Width, this.Height);\n }", "draw() {\n throw new Error('You have to implement this method');\n }", "draw5() { // draw5 -> Method\n console.log('Drawing 5...');\n }", "function Draw() {\n\n this.fullX = 3000;\n this.fullY = 1850;\n this.halfX = Math.round(this.fullX/2);\n this.halfY = Math.round(this.fullY/2);\n\n var u = (this.fullX);\n this.units = (u/910);\n\n // TEXT SIZES //\n this.headerType = Math.round(u/12);\n this.midType = Math.round(u/45);\n this.bodyType = Math.round(u/65);\n this.dataType = Math.round(u/82);\n this.subType = Math.round(u/100);\n\n var Canvas = require('canvas');\n this.canvas = new Canvas(this.fullX, this.fullY);\n this.cxa = this.canvas.getContext('2d');\n}", "function render() {\n mario.drawMario();\n }", "function init() {\r\n Draw() ;\r\n}", "startPaint(){\n this.toolbarHolder.forEach((tool)=>{\n tool.addEventListener(\"click\", (e)=>{\n this.addTool(e.target);\n // if(this.toolss == \"f\"){}\n if(this.toolss == \"cut\"){\n this.cut() \n }\n else if(this.toolss == \"copy\"){\n this.copy() \n }\n else if(this.toolss == \"paste\"){\n this.paste() \n }\n else if(this.toolss == \"text\"){\n this.textss();\n this.draw();\n }\n else if(this.toolss == \"resize\"){\n this.resize();\n this.draw();\n }\n else if(this.toolss == \"fillers\"){\n this.filler();\n this.draw();\n }\n else if(this.toolss == \"rotate-flip-ver\" || this.toolss == \"rotate-flip-hor\"){\n this.flip(this.toolss);\n this.draw();\n }\n else if(this.toolss == \"rotate-right-90-deg\" || this.toolss == \"rotate-left-90-deg\" || this.toolss == \"rotate-180-deg\"){\n this.rotate(this.toolss);\n this.draw();\n }\n else if(this.toolss == \"size-1\" || this.toolss == \"size-2\" || this.toolss == \"size-3\" || this.toolss == \"size-4\"){\n this.isDrawing = false; \n this.isMoving = false;\n if(this.toolss == \"size-1\"){this.lineSize = 4}\n if(this.toolss == \"size-2\"){this.lineSize = 6}\n if(this.toolss == \"size-3\"){this.lineSize = 8}\n if(this.toolss == \"size-4\"){this.lineSize = 10}\n }\n else if(this.toolss == \"fills-no-color\"){\n this.isDrawing = false; \n this.isMoving = false;\n this.fillColor = \"rgba(255, 255, 255, 0)\";\n this.ctx.globalAlpha = 1;\n }\n else if(this.toolss == \"fills-solid-color\"){\n this.isDrawing = false; \n this.isMoving = false;\n this.fillColor = document.querySelector(\".color-two-bg\").style.background;\n this.ctx.globalAlpha = 1;\n }\n else if(this.toolss == \"fills-marker\"){\n this.isDrawing = false; \n this.isMoving = false;\n this.fillColor = document.querySelector(\".color-two-bg\").style.background;\n this.ctx.globalAlpha = 0.7;\n }\n else if(this.toolss == \"outline-no-color\"){\n this.isDrawing = false; \n this.isMoving = false;\n this.strokeColor = \"rgba(255, 255, 255, 0)\";\n this.ctx.globalAlpha = 1;\n }\n else if(this.toolss == \"outline-solid-color\"){\n this.isDrawing = false; \n this.isMoving = false;\n this.strokeColor = document.querySelector(\".color-One-bg\").style.background;\n this.ctx.globalAlpha = 1;\n }\n else if(this.toolss == \"file-open\"){\n this.isDrawing = false; \n this.isMoving = false;\n this.draw();\n }\n else if(this.toolss == \"file-save\"){\n this.isDrawing = false; \n this.isMoving = false;\n this.draw();\n }\n else{\n this.draw();\n } \n })\n })\n }", "function Draw(width,height){\n this.width = width\n this.height = height \n\n let draw = function(){\n console.log('this is draw method');\n }\n}", "draw(){\n push();\n\n beginShape();\n texture(this.texture);\n textureWrap(MIRROR);\n //draw as a rectangle, divide by 2 for width and height\n vertex(this.getX() - (this.w/2.0), this.getY() - (this.h/2.0),CENTER,TOP_EDGE); //bottom right, CCW, Need UV coordinates for texture mapping\n vertex(this.getX() + (this.w/2.0), this.getY() - (this.h/2.0),RIGHT_EDGE,TOP_EDGE); //for some reason this starts on bottom right?\n vertex(this.getX() + (this.w/2.0), this.getY() + (this.h/2.0),RIGHT_EDGE,CENTER);\n vertex(this.getX() - (this.w/2.0), this.getY() + (this.h/2.0),CENTER,CENTER);\n\n endShape(CLOSE);\n\n pop();\n }", "constructor() {\n this.standardProgram = null; // Draw static point in the middle\n this.globalDrawingProgram = null; // Draw point defined by global parameters\n this.vertexColorProgram = null; // Draw static point in the middle\n }", "draw() {\n\n // only display the dirt if it is visible... \n if (this.visible){\n\n ctxDATA.fillStyle = this.color; \n ctxDATA.fillRect(this.x, this.y, this.w, this.h);\n \n // end of visibility check \n }\n\n // end of the draw method for the Dirt \n }", "draw(){ //define a function within an object by dropping the function keyword\n console.log('draw');\n }", "draw(){ //define a function within an object by dropping the function keyword\n console.log('draw');\n }", "draw(){ //define a function within an object by dropping the function keyword\n console.log('draw');\n }", "function render() {\n // showFPSaverage();\n showCompletedLines();\n game.getBoard.drawme();\n\n // game.getBoard.getPieces.forEach(piece => piece.drawme());\n}", "doDraw(offset) {\n super.doDraw(offset);\n let pp = [this.pos[0] - 64 - offset, this.pos[1] - 256];\n let image = \"wizard-\";\n if (this.dir == 1){\n image+=\"r\";\n } else {\n image+=\"l\";\n }\n drawImage(Graphics[image], pp);\n if (this.spell != undefined) {\n this.spell.doDraw(offset);\n }\n // draw_window.\n for (let i=0; i < this.health; i+=1) { // hud\n drawImage(Graphics[\"wizard_health\"], [canvas_element.width-40, 8 + i*32]);\n }\n \n }", "draw() {\n let anchorWidth = -this.width * this.anchor.x;\n let anchorHeight = -this.height * this.anchor.y;\n\n this.context.save();\n this.context.translate(this.x, this.y);\n\n if (this.rotation) {\n this.context.rotate(this.rotation);\n }\n\n if (this.image) {\n this.context.drawImage(\n this.image,\n 0, 0, this.image.width, this.image.height,\n anchorWidth, anchorHeight, this.width, this.height\n );\n }\n else if (this.currentAnimation) {\n this.currentAnimation.render({\n x: anchorWidth,\n y: anchorHeight,\n width: this.width,\n height: this.height,\n context: this.context\n });\n }\n else {\n this.context.fillStyle = this.color;\n this.context.fillRect(anchorWidth, anchorHeight, this.width, this.height);\n }\n\n this.context.restore();\n }", "draw() {\n this.drawExistingEntities();\n this.disableEntities();\n this.blockHeroMovement();\n this.killedEnemiesCounter();\n }", "function drawMethod() {\n startupView = 1;\n \n // gl draw parameters\n var count;\n var primitiveType;\n var offset = 0;\n\n // Clear out the position arrays that will be changed by generate functions\n bezierPos = [];\n bezierPos2 = [];\n bezier3dPos = [];\n bezier3dPos2 = [];\n ans = [];\n ans2 = [];\n \n // Clear out the viewport with solid black color\n gl.viewport(0, 0, gl.viewportWidth, gl.viewportHeight);\n gl.clear( gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n\n //draws the dotted horizontal axis lines\n var primitiveType = gl.LINES;\n var count = axisRotation.length/2;\n gl.lineWidth(2);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(axisRotation), gl.STATIC_DRAW);\n gl.uniform4f(colorLocation, 0, 0, 0, 1);\n gl.drawArrays(primitiveType, offset, count);\n\n //If a point is being moved then draw the current highlighted point\n if(moveMode == 1)\n {\n count = 1;\n primitiveType = gl.POINTS;\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(highlightPoint), gl.STATIC_DRAW);\n gl.uniform4f(colorLocation, 1, 0, 1, 1);\n gl.drawArrays(primitiveType, offset, count);\n }\n\n //draws the control points\n primitiveType = gl.POINTS;\n count = positions.length/2;\n gl.uniform4f(colorLocation, 0.47, 0.47, 0.47, 1);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(positions), gl.STATIC_DRAW);\n gl.drawArrays(primitiveType, offset, count);\n\n //draws the dotted lines\n generateDottedLine();\n gl.lineWidth(1);\n primitiveType = gl.LINES;\n count = dottedLinePoints.length/2;\n gl.uniform4f(colorLocation, 0, 0, 0, 1);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(dottedLinePoints), gl.STATIC_DRAW);\n gl.drawArrays(primitiveType, offset, count);\n\n //generate and draw the bezier curve everytime the control points are moved\n generateBezierCurve();\n gl.lineWidth(3);\n gl.uniform4f(colorLocation, 1, 0, 0, 1);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(bezierPos), gl.STATIC_DRAW);\n count = subdivisions+1;\n primitiveType = gl.LINE_STRIP;\n gl.drawArrays(primitiveType, offset, count);\n\n //draw the 2nd bezier curve that we just generated\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(bezierPos2), gl.STATIC_DRAW);\n count = subdivisions+1;\n primitiveType = gl.LINE_STRIP;\n gl.drawArrays(primitiveType, offset, count);\n} // End of drawMethod()", "Render() {\n gdi.HollowBrush();\n gdi.PurplePen();\n\n for ( let spt = 0; spt < this.m_Spots.length; ++spt ) {\n gdi.Circle( this.m_Spots[ spt ].m_vPos, this.m_Spots[ spt ].m_dScore );\n }\n\n if ( this.m_pBestSupportingSpot != null ) {\n gdi.GreenPen();\n gdi.Circle( this.m_pBestSupportingSpot.m_vPos, this.m_pBestSupportingSpot.m_dScore );\n };\n }", "function Renderer() {}" ]
[ "0.73082095", "0.70346916", "0.70346916", "0.70346916", "0.70346916", "0.6950455", "0.6950455", "0.6932039", "0.6868791", "0.6868791", "0.6868791", "0.683042", "0.6829487", "0.6801683", "0.6668261", "0.66600645", "0.6633977", "0.66174203", "0.65915954", "0.65626174", "0.653168", "0.65244204", "0.65232134", "0.6498294", "0.6498294", "0.646962", "0.646962", "0.646962", "0.64686614", "0.64157164", "0.6408894", "0.6404844", "0.6400466", "0.63467246", "0.6338719", "0.63354254", "0.6326358", "0.6308322", "0.63070035", "0.63044125", "0.63044125", "0.63044125", "0.63044125", "0.63044125", "0.6302252", "0.62941223", "0.6290566", "0.62854946", "0.62847555", "0.6276136", "0.6275411", "0.6273681", "0.6268639", "0.62607676", "0.62595457", "0.62480366", "0.62430054", "0.62253463", "0.62253463", "0.62253463", "0.62253463", "0.62253463", "0.62253463", "0.62253463", "0.62253463", "0.62253463", "0.62253463", "0.62253463", "0.6224918", "0.6222657", "0.62117434", "0.6205868", "0.6204272", "0.62013704", "0.6200908", "0.6193646", "0.6171937", "0.617028", "0.61549413", "0.61549413", "0.6153692", "0.6150429", "0.6143498", "0.6141094", "0.61404675", "0.6136394", "0.61347294", "0.613213", "0.6131744", "0.6131083", "0.61297685", "0.61297685", "0.61297685", "0.61255634", "0.61212975", "0.6121145", "0.6120049", "0.6106021", "0.60986584", "0.60938853" ]
0.6733822
14
This method is to define gamepad input orders in a way I can hopefully efficiently loop through.
loadOrders () { this.order = { stick: ['left','right'], buttonGroup: ['dpad', 'face', 'shoulder'], button: [ // joystick rendering will skip after first property of this array // so first property should be the joystick related dpad value ['value','up','down','left','right'], [ 'down','right','left','up', 'select','start','l3','r3', 'home','touchpad' ], ['l1','r1','l2','r2'] ] } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startEventListenerOnKeyPads(selectors) {\n function shuffle(array) {\n array.sort(() => Math.random() - 0.5);\n}\n\nlet a = 'up';\nlet b = 'down';\nlet c = 'left';\nlet d = 'right';\n\n\nlet KeyDirection = [a, b, c, d];\n\nshuffle(KeyDirection);\nconsole.log(KeyDirection);\n\nvar up = KeyDirection[0];\nvar down = KeyDirection[1];\nvar left = KeyDirection[2];\nvar right = KeyDirection[3];\n\nconsole.log(up, down, left, right);\n\n\n oxo.inputs.listenKey(\"right\", function () {\n console.log(\"right\");\n oxo.animation.move(selectors.astronaute, right, stepAstronauteMove);\n });\n\n oxo.inputs.listenKey(\"left\", function () {\n console.log(\"left\");\n oxo.animation.move(selectors.astronaute, left, stepAstronauteMove);\n });\n oxo.inputs.listenKey(\"up\", function () {\n console.log(\"up\");\n oxo.animation.move(selectors.astronaute, up, stepAstronauteMove);\n\n });\n\n oxo.inputs.listenKey(\"down\", function () {\n console.log(\"down\");\n oxo.animation.move(selectors.astronaute, down, stepAstronauteMove);\n });\n\n}", "function updateOrder () {\n\tbackup();\n\n\tvar sel = 's' + slots.sel;\n\tvar sBackup = copyVar(slots[sel]);\n\tfor (var num = 0; num < counters.length; num++) {\n\t\tfor (var num2 = 1; num2 < 5; num2++) {\n\t\t\tslots[sel][counters[num]][num2 - 1] = sBackup[counters[num]][assistInfo.order[num2] - 1];\n\t\t}\n\t}\n\trestore();\n\n\tvar cBackup = copyVar(characters);\n\tchangeCharacters(1, cBackup[assistInfo.order[1]]);\n\tchangeCharacters(2, cBackup[assistInfo.order[2]]);\n\tchangeCharacters(3, cBackup[assistInfo.order[3]]);\n\tchangeCharacters(4, cBackup[assistInfo.order[4]]);\n\n\tplayerOrder = ['', 1, 2, 3, 4];\n\torderCurPlayer = playerOrder[1];\n}", "function Inputs() {\n if (keyIsDown(37)) {\n pokemonList[0].xvel = -4;\n pokemonList[0].yvel = 0;\n pokemonList[0].dir = 2;\n }\n if (keyIsDown(38)) {\n pokemonList[0].xvel = 0;\n pokemonList[0].yvel = -4;\n pokemonList[0].dir = 0;\n }\n if (keyIsDown(39)) {\n pokemonList[0].xvel = 4;\n pokemonList[0].yvel = 0;\n pokemonList[0].dir = 3;\n }\n if (keyIsDown(40)) {\n pokemonList[0].xvel = 0;\n pokemonList[0].yvel = 4;\n pokemonList[0].dir = 1;\n } \n}", "function checkOrder(){\n\t\tif (colorOrder == inputOrder){\n\t\t\ttoArray();\n\n\t\t\tinputSequence = 0;\n\t\t\tinputOrder = [];\n\t\t\tsetTimeout(function(){\n\t\t\t\tround();\t\n\t\t\t}, 500);\n\n\t\t} else {\n\t\t\tgameFail();\n\t\t}\n\t\t\n\t}", "defineMovementKeys() {\n const props = this.props;\n let keyUp = props.keyUp,\n keyDown = props.keyDown,\n keyEnter = props.keyEnter,\n keyLeave = props.keyLeave,\n getObjectArray;\n getObjectArray = (keys) => {\n return keys.map(key => {\n let splitted;\n if (typeof key===\"number\") {\n return {\n key\n };\n }\n if (key.itsa_contains(\"+\")) {\n // special key present\n splitted = key.split(\"+\");\n return {\n key: parseInt(splitted.pop(), 10),\n special: splitted.map(item => SPECIAL_KEYS[item])\n };\n }\n return {\n key: parseInt(key, 10)\n };\n });\n };\n // first handle keyUp:\n Array.isArray(keyUp) || (keyUp=[keyUp]);\n this._keysUp = getObjectArray(keyUp);\n // next keyDown:\n Array.isArray(keyDown) || (keyDown=[keyDown]);\n this._keysDown = getObjectArray(keyDown);\n // next keyEnter:\n Array.isArray(keyEnter) || (keyEnter=keyEnter ? [keyEnter] : []);\n this._keysEnter = getObjectArray(keyEnter);\n // next keyLeave:\n Array.isArray(keyLeave) || (keyLeave=[keyLeave]);\n this._keysLeave = getObjectArray(keyLeave);\n }", "function __processInput() {\n var degreeInc = 2.0,\n zInc = 0.05;\n //console.log(_keyPressed);\n\n for (var keyCode in __keyPressed) {\n\n if (!__keyPressed[keyCode]) {\n continue;\n }\n\n var key = parseInt(keyCode);\n\n switch (key) {\n case 87: // rotate up keys = (w, W)\n case 119:\n __rotateMap(degreeInc);\n break;\n\n case 83: // rotate down keys = (s, S)\n case 115:\n __rotateMap(-degreeInc);\n break;\n\n case 65: // rotate left keys = (a, A)\n case 97:\n __rotateMap(null, degreeInc);\n break;\n\n case 68: // rotate right keys = (d, D)\n case 100:\n __rotateMap(null, -degreeInc);\n break;\n\n case 32: // space bar\n __hasGameStarted = true;\n __setGamePauseStatus(!__getGameStatus());\n break;\n\n case 37: // move player left\n if (!__isGamePaused()) {\n __thePlayer.setDirection(__DIRECTIONS.EAST);\n }\n break;\n\n case 39: // move player right\n if (!__isGamePaused()) {\n __thePlayer.setDirection(__DIRECTIONS.WEST);\n }\n break;\n\n case 49: // zoom out\n __rotateMap(null, null, -zInc);\n break;\n\n case 50: // zoom in\n __rotateMap(null, null, zInc);\n break;\n\n default:\n console.log('Did not recognize key with code: ' + keyCode);\n __keyPressed[keyCode] = false;\n __keyReleased[keyCode] = false;\n\n break;\n }\n\n if (key === 32 || (__keyPressed[keyCode] && __keyReleased[keyCode])) {\n\n switch (key) {\n case 37: // stop player\n case 39:\n __thePlayer.setDirection(__DIRECTIONS.NONE);\n break;\n\n default:\n break;\n }\n\n __keyPressed[keyCode] = false;\n __keyReleased[keyCode] = false;\n //console.log(__keyReleased);\n }\n\n }\n }", "function setGameControls() {\n\n function eventHandler(event) {\n\n // Prevent arrows from moving the page around\n if(event.keyCode && [32, 37, 38, 39, 40].indexOf(event.keyCode) > -1) {\n event.preventDefault();\n }\n \n var token = event.keyCode ? event.keyCode : event.target.id;\n switch (token) {\n case \"d-pad-left\":\n moveInterval = setInterval(function() { movePlayer(\"left\") }, 100);\n case 37:\n case 65:\n // D-pad left, left arrow, keyboard \"a\" button\n movePlayer(\"left\");\n break;\n case \"d-pad-up\":\n moveInterval = setInterval(function() { movePlayer(\"up\"); }, 100);\n case 38:\n case 87:\n // D-pad up, up arrow, keyboard \"w\" button\n movePlayer(\"up\");\n break;\n case \"d-pad-right\":\n moveInterval = setInterval(function() { movePlayer(\"right\"); }, 100);\n case 39:\n case 68:\n // D-pad right, right arrow, keyboard \"d\" button\n movePlayer(\"right\");\n break;\n case \"d-pad-down\":\n moveInterval = setInterval(function() { movePlayer(\"down\"); }, 100);\n case 40:\n case 83:\n //D-pad down, down arrow, keyboard \"s\" button\n movePlayer(\"down\");\n break;\n case \"a-button\":\n case 75:\n // a-button, keyboard \"k\" button\n if (playerState !== \"locked\") {\n interactOrSelect();\n } else {\n cancelOrBack();\n }\n break;\n case \"b-button\":\n case 76:\n // b-button, keyboard \"l\" button\n cancelOrBack();\n break;\n case \"select\":\n case 71:\n // select, keyboard \"g\" button\n console.log(\"The select button was pressed\");\n break;\n case \"start\":\n case 72:\n // start, keyboard \"h\" button\n console.log(\"The start button was pressed\");\n break;\n default:\n }; \n }\n\n $(document).on(\"keydown\", eventHandler);\n $(document).on(\"mousedown\", eventHandler);\n\n $(document).on(\"keyup\", function(event) {\n var gameButtons = [37, 65, 38, 87, 39, 68, 40, 83];\n if (gameButtons.includes(event.keyCode) && playerState === \"walking\") {\n playerState = \"standing\";\n walkingAnimation(playerDirection);\n }\n });\n\n $(document).on(\"mouseup\", function(event) {\n clearInterval(moveInterval);\n if (playerState === \"walking\") {\n playerState = \"standing\";\n walkingAnimation(playerDirection);\n }\n });\n}", "function GamepadInput(index) {\n this.data = {};\n this.valid = navigator.getGamepads()[index];\n this.index = index;\n}", "function move(divi) {\n longPressed = false;\n\n //for loop to assign addEventListener onmouseleave to all the buttons. it will activate the reset function that will show the result on\n //the display and will go to the next position in a way to choise another symbol.\n\n for (i = 0; i <= 11; i++) {\n let element = \"number\" + i;\n document.getElementById(element).addEventListener(\"mouseleave\",\n function reset() {\n document.getElementById(\"keypad\").value = text;\n counter = 0;\n return counter;\n });\n // document.getElementById(element).addEventListener(\"long-press\",\n // function set() {\n\n // document.getElementById(\"keypad\").value = text;\n // });\n\n }\n //switch will check which div button has been pressed and will display the correct symbol. Inside the cases there are two if.\n //one to check the counter ( to check which symbol need to be displayed )\n //the second one is to check if the capital symbol button is clicked, if yes, all the next symbols will be Capital symbol till will not be deactivated.\n\n switch (divi) {\n case 0:\n counter++;\n if (counter >= 6) {\n\n counter = 1;\n text = text.toString().replace(/.$/, \".\");\n document.getElementById(\"keypad\").value = text;\n\n //return counter;\n }\n else {\n\n if (counter % 3 == 0) {\n text = text.toString().replace(/.$/, \"?\");\n document.getElementById(\"keypad\").value = text;\n }\n\n else if (counter % 4 == 0) {\n text = text.toString().replace(/.$/, \"!\");\n document.getElementById(\"keypad\").value = text;\n }\n\n else if (counter % 5 == 0) {\n text = text.toString().replace(/.$/, \"'\");\n document.getElementById(\"keypad\").value = text;\n }\n\n else if (counter % 2 == 0) {\n text = text.toString().replace(/.$/, \",\");\n document.getElementById(\"keypad\").value = text;\n }\n\n else {\n text += \".\";\n document.getElementById(\"keypad\").value = text;\n\n }\n }\n\n break;\n\n case 1:\n counter++;\n\n if (counter >= 4) {\n counter = 1;\n text = text.toString().replace(/.$/, \"a\");\n document.getElementById(\"keypad\").value = text;\n\n }\n else {\n if (counter % 3 == 0) {\n\n text = text.toString().replace(/.$/, \"c\");\n document.getElementById(\"keypad\").value = text;\n }\n\n else if (counter % 2 == 0) {\n text = text.toString().replace(/.$/, \"b\");\n document.getElementById(\"keypad\").value = text;\n }\n else {\n text += \"a\";\n document.getElementById(\"keypad\").value = text;\n }\n }\n break;\n case 2:\n counter++;\n\n if (counter >= 4) {\n\n counter = 1;\n text = text.toString().replace(/.$/, \"d\");\n document.getElementById(\"keypad\").value = text;\n\n }\n else {\n if (counter % 3 == 0) {\n text = text.toString().replace(/.$/, \"f\");\n document.getElementById(\"keypad\").value = text;\n }\n\n else if (counter % 2 == 0) {\n text = text.toString().replace(/.$/, \"e\");\n document.getElementById(\"keypad\").value = text;\n }\n else {\n text += \"d\";\n document.getElementById(\"keypad\").value = text;\n }\n }\n break;\n case 3:\n counter++;\n\n if (counter >= 4) {\n counter = 1;\n text = text.toString().replace(/.$/, \"g\");\n document.getElementById(\"keypad\").value = text;\n\n }\n else {\n if (counter % 3 == 0) {\n text = text.toString().replace(/.$/, \"i\");\n document.getElementById(\"keypad\").value = text;\n }\n else if (counter % 2 == 0) {\n text = text.toString().replace(/.$/, \"h\");\n document.getElementById(\"keypad\").value = text;\n\n }\n else {\n text += \"g\";\n document.getElementById(\"keypad\").value = text;\n }\n }\n break;\n case 4:\n counter++;\n\n if (counter >= 4) {\n counter = 1;\n text = text.toString().replace(/.$/, \"j\");\n document.getElementById(\"keypad\").value = text;\n }\n else {\n if (counter % 3 == 0) {\n text = text.toString().replace(/.$/, \"l\");\n document.getElementById(\"keypad\").value = text;\n\n }\n else if (counter % 2 == 0) {\n text = text.toString().replace(/.$/, \"k\");\n document.getElementById(\"keypad\").value = text;\n\n }\n else {\n text += \"j\";\n document.getElementById(\"keypad\").value = text;\n }\n }\n break;\n case 5:\n counter++;\n\n if (counter >= 4) {\n counter = 1;\n text = text.toString().replace(/.$/, \"m\");\n document.getElementById(\"keypad\").value = text;\n }\n else {\n if (counter % 3 == 0) {\n text = text.toString().replace(/.$/, \"o\");\n document.getElementById(\"keypad\").value = text;\n\n }\n else if (counter % 2 == 0) {\n text = text.toString().replace(/.$/, \"n\");\n document.getElementById(\"keypad\").value = text;\n }\n else {\n text += \"m\";\n document.getElementById(\"keypad\").value = text;\n\n }\n }\n break;\n case 6:\n counter++;\n\n if (counter >= 5) {\n\n counter = 1;\n text = text.toString().replace(/.$/, \"p\");\n document.getElementById(\"keypad\").value = text;\n\n }\n else {\n if (counter % 3 == 0) {\n\n text = text.toString().replace(/.$/, \"r\");\n document.getElementById(\"keypad\").value = text;\n\n }\n\n else if (counter % 4 == 0) {\n\n text = text.toString().replace(/.$/, \"s\");\n document.getElementById(\"keypad\").value = text;\n }\n else if (counter % 2 == 0) {\n\n text = text.toString().replace(/.$/, \"q\");\n document.getElementById(\"keypad\").value = text;\n\n }\n\n else {\n\n text += \"p\";\n document.getElementById(\"keypad\").value = text;\n\n\n }\n }\n break;\n case 7:\n counter++;\n\n if (counter >= 4) {\n counter = 1;\n text = text.toString().replace(/.$/, \"t\");\n document.getElementById(\"keypad\").value = text;\n }\n else {\n if (counter % 3 == 0) {\n text = text.toString().replace(/.$/, \"v\");\n document.getElementById(\"keypad\").value = text;\n }\n else if (counter % 2 == 0) {\n text = text.toString().replace(/.$/, \"u\");\n document.getElementById(\"keypad\").value = text;\n }\n else {\n text += \"t\";\n document.getElementById(\"keypad\").value = text;\n }\n }\n break;\n case 8:\n counter++;\n\n if (counter >= 5) {\n counter = 1;\n text = text.toString().replace(/.$/, \"w\");\n document.getElementById(\"keypad\").value = text;\n }\n else {\n if (counter % 3 == 0) {\n text = text.toString().replace(/.$/, \"y\");\n document.getElementById(\"keypad\").value = text;\n }\n else if (counter % 4 == 0) {\n text = text.toString().replace(/.$/, \"z\");\n document.getElementById(\"keypad\").value = text;\n }\n\n else if (counter % 2 == 0) {\n text = text.toString().replace(/.$/, \"x\");\n document.getElementById(\"keypad\").value = text;\n }\n\n else {\n text += \"w\";\n document.getElementById(\"keypad\").value = text;\n\n }\n }\n break;\n case 9:\n counter++;\n\n if (counter >= 1) {\n text += \"*\";\n document.getElementById(\"keypad\").value = text;\n }\n\n break;\n case 10:\n counter++;\n\n if (counter >= 1) {\n text += \" \";\n document.getElementById(\"keypad\").value = text;\n }\n\n break;\n case 11:\n counter++;\n if (counter >= 1) {\n text += \"#\";\n document.getElementById(\"keypad\").value = text;\n }\n break;\n\n\n }\n\n}", "function _turnOrder(e) { \n if (power === 'on') {\n\n switch(true) {\n case turn === true:\n if (e.target.textContent === '') {\n gameText.unshift('X');\n spaceSelectX(e); \n turn = false;\n spaces.forEach(space => space.addEventListener('click', scoring))\n \n } else {\n spaces.forEach(space => space.removeEventListener('click', scoring))\n };\n break;\n \n case turn != true:\n if (e.target.textContent === '') {\n gameText.unshift('O');\n spaceSelectO(e);\n turn = true;\n }\n break;\n }\n }\n }", "function setUpControl(){\n $(document).keydown( (e) => {\n switch (e.which) {\n case 27:\n if (gameStarted)\n togglePause()\n break\n case 37:\n case 65:\n if (!gameStarted || next.dir != RIGHT){\n next = { dir: LEFT, x: -1, y: 0 }\n startGame()\n }\n break\n case 38:\n case 87:\n if (!gameStarted || next.dir != DOWN){\n next = { dir: UP, x: 0, y: -1 }\n startGame()\n }\n break\n case 39:\n case 68:\n if (!gameStarted || next.dir != LEFT){\n next = { dir: RIGHT, x: 1, y: 0 }\n startGame()\n }\n break\n case 40:\n case 83:\n if (!gameStarted || next.dir != UP){\n next = { dir: DOWN, x: 0, y: 1 }\n startGame()\n }\n break\n }\n })\n}", "preStep() {\n if (this.pressedKeys.up) {\n this.sendInput('up', { movement: true });\n }\n\n if (this.pressedKeys.down) {\n this.sendInput('down', { movement: true });\n }\n\n if (this.pressedKeys.left) {\n this.sendInput('left', { movement: true });\n }\n\n if (this.pressedKeys.right) {\n this.sendInput('right', { movement: true });\n }\n\n if (this.pressedKeys.space) {\n this.sendInput('space', { movement: true });\n }\n }", "function game_order_keypress(e){\n if(e.shiftKey && e.which==13){\n validate_game();\n }\n}", "assignKeybinds() {\n //KEYBOARD INPUT\n this.room2_key_W = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.W);\n this.room2_key_A = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.A);\n this.room2_key_S = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.S);\n this.room2_key_D = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.D);\n this.room2_key_E = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.E);\n this.room2_key_Q = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.Q);\n this.room2_key_M = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.M);\n this.room2_key_B = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.B);\n this.room2_key_U = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.U);\n this.room2_key_1 = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.ONE);\n this.room2_key_2 = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.TWO);\n this.room2_key_3 = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.THREE);\n this.room2_key_4 = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.FOUR);\n this.room2_key_5 = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.FIVE);\n this.room2_key_R = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.R);\n this.room2_key_H = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.H);\n this.key_Right = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.RIGHT);\n this.key_Left = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.LEFT);\n this.room2_key_N = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.N);\n }", "function populateKeys() {\n\tfor (var i = 0; i < alphabet.length; i++) {\n\t\tkeys[alphabet.substring(i, i + 1)] = false;\n\t}\n\tfor (var i = 0; i < 10; i++) {\n\t\tkeys[\"num\" + i] = false; // Set when either numpad or number row keys are pushed\n\t}\n}", "function keyboardInputs(obj,input) {\n switch (input) {\n case \"1\":\n case \"2\": \n case \"3\":\n case \"4\":\n case \"5\":\n case \"6\":\n case \"7\":\n case \"8\":\n case \"9\":\n case \"0\":inputHandling(obj,input);\n break;\n case\"+\":\n case\"-\":\n case\"*\":\n case\"/\":\n case\"%\":operatorHandling(obj,input);\n break;\n case\"Enter\":\n case\"=\":equalsHandling(obj);\n break;\n case\"Backspace\":backspaceHandling(obj);\n break;\n case\".\":dotHandling(obj);\n break;\n default:break;\n }\n}", "handleGamepads() {\n const gamepad = navigator.getGamepads()[0];\n if (gamepad) {\n const buttons = gamepad.buttons.map((button) => button.pressed);\n\n buttons.forEach((button, i) => {\n if (button && !this.lastButtons[i]) {\n this.usingGamepad = true;\n this.callbacks[IOEvents.BUTTON_DOWN].forEach((callback) => callback(i));\n } else if (!button && this.lastButtons[i]) {\n this.callbacks[IOEvents.BUTTON_UP].forEach((callback) => callback(i));\n }\n });\n this.lastButtons = buttons;\n } else {\n this.lastButtons = [];\n }\n }", "preUpdate() {\n this.gamepad.update();\n for (let a of this.actions) {\n a.state = this.getKeyState(a.key) | State.Up;\n if (a.state == State.Up) {\n if (a.button1 != null)\n a.state = this.gamepad.getButtonState(a.button1);\n if (a.state == State.Up && a.button2 != null) {\n a.state = this.gamepad.getButtonState(a.button2);\n }\n }\n }\n this.updateStick();\n }", "pressEvent(e) {\n let key = e.keyCode;\n if (key >= 65 && key <= 90) {\n //for Alphabets\n this.inputChars.push(e.key); //pushes new character into the inputChars array\n for(let i = 0; i < this.inPlayWords.length; i++) {\n this.inPlayWords[i].checkChar(this.inputChars); //checks match with each word\n }\n } else if (key === 8) {\n //for Backspace\n this.inputChars.pop();\n for(let i = 0; i < this.inPlayWords.length; i++) {\n this.inPlayWords[i].checkChar(this.inputChars);\n }\n } else if (key === 13) {\n //for Enter\n for(let i = 0; i < this.inPlayWords.length; i++) {\n if(this.inPlayWords[i].isUpdated) {\n if(this.inPlayWords[i].checkMatch(this.inputChars)) {\n this.inPlayWords.splice(i, 1); //removes word from array if match found\n this.score++;\n scoreEl.innerHTML = this.score; //updates score on screne\n console.log(this.score % 13, this.score % 13 === 0)\n if(this.score % 13 === 0 && this.level < 5) this.level++; //level up after 13 words :: max level 10\n if(this.score % 21 === 0) this.speed++; //speed up after certain interval\n //use of prime numbers to avoid two events from overlapping\n }\n }\n }\n this.inputChars = []; //emptys inputChars array when enter is pressed\n }\n }", "function applyInput(inputList, gid, playerPos) {\n gameList[gid].processInput(inputList, playerPos);\n }", "function game(battleFieldSize = 10) {\n let len = String(battleFieldSize).length;\n let top = \"\";\n const readline = require('readline');\n let battleField = [];\n rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n });\n\n for (let i = 0; i < battleFieldSize; i++){\n battleField[i] = [];\n for (let j = 0; j < battleFieldSize; j++){\n battleField[i][j] = \"░\"; //alt 176\n }\n }\n\n // for (let i = 0; i < len; i++){\n // top += \" \";\n // }\n // for (let i = \"a\".charCodeAt(0); i < (\"a\".charCodeAt(0) + battleFieldSize); i++){\n // top += String.fromCharCode(i);\n // }\n // console.log(top);\n // for (let i = 1; i <= battleFieldSize; i++){\n // let line = \"\";\n // for (let k = 1; k <= (len - String(i).length); k++){ //console.log(k + \" \" + String(k).length);\n // line += \" \";\n // }\n // line += String(i);\n // for (let i = \"a\".charCodeAt(0); i < (\"a\".charCodeAt(0) + battleFieldSize); i++){\n // line += \"░\"; //alt 176\n // }\n // console.log(line);\n // }\n\n draw(battleField);\n let ship1 = [1 + Math.round(Math.random()*(battleFieldSize - 1)), 1 + Math.round(Math.random()*(battleFieldSize - 1))];\n console.log(\"(cheat: \" + ship1 + \")\\n\");\n\n console.log(\"Guess the ship position (e.g. 'd3'), or enter 'q' for exit.\");\n rl.on('line', (input) => {\n if(input === \"q\"){\n console.log(\"Finish the game.\");\n rl.close();\n process.exit();\n } else {\n console.log( String(input[0]).charCodeAt(0) - \"a\".charCodeAt(0) + 1 );\n console.log( Number(input.slice(1)) );\n let guessedX = String(input[0]).charCodeAt(0) - \"a\".charCodeAt(0) + 1;\n let guessedY = Number(input.slice(1));\n guessed = [guessedX, guessedY];\n\n if(guessedX === ship1[0] && guessedY === ship1[1]){\n battleField[guessedX - 1][guessedY - 1] = \"X\";\n draw(battleField);\n console.log(\"Congratulations! You are winner!\");\n rl.close();\n process.exit();\n } else {\n battleField[guessedX - 1][guessedY - 1] = \"·\";\n draw(battleField);\n console.log(\"Try again!\");\n }\n }\n });\n\n}", "function start() {\n\n let division_content = \"\";\n\n for (i = 0; i <= 11; i++) {\n let element = \"number\" + i;\n division_content = division_content + '<div class=\"symbol\" id=\"' + element + '\">' + num[i] + '<br>' + symbol[i] + '</div>';\n if ((i + 1) % 3 == 0) division_content = division_content + '<div style=\"clear:both;\"></div>';\n }\n\n // onclick=\"move(' + i + ');\"\n\n document.getElementById(\"contentOfKey\").innerHTML = division_content;\n\n var button = document.querySelectorAll('.symbol')\n const len = button.length;\n for (var i = 0;i < len; ++i) {\n \n button[i].onmousedown = function(e) {\n longPressed = false;\n busy = true;\n clearTimeout(is_busy);\n if (click !== e.target) {\n busy = false;\n }\n if (change >= text.length - 1 || click !== e.target) {\n change = 0;\n click = e.target;\n } else {\n change = change + 1;\n }\n if (text[0] === '#') {\n hold = setTimeout(function() {\n \n }, delay);\n return;\n }\n hold = setTimeout(function() {\n var number = parseInt(e.target.id.split(\"number\")[1])\n number++;\n if(number == 11)\n number = 0\n else if(number == 10)\n number = \"*\"\n else if(number == 12)\n number = \"#\"\n text += number+\"\"\n document.getElementById(\"keypad\").value = text;\n counter = 0;\n longPressed = true;\n }, delay);\n // input.value = busy ? input.value.slice(0, -1) + text[change] : input.value + text[change];\n };\n button[i].onmouseup = function(e) {\n const number = parseInt(e.target.id.split(\"number\")[1])\n if(!longPressed) \n move(number)\n clearTimeout(hold);\n busy = true;\n is_busy = setTimeout(function() {\n change = -1;\n busy = false;\n e.target = null;\n }, delay);\n // put caret at the end of text input\n };\n }\n}", "function keyPressed() {\n //for PONG\\\\\n if (keyCode == LEFT_ARROW) {\n paddle_step = -3;\n }\n else if (keyCode == RIGHT_ARROW) {\n paddle_step = 3;\n }\n else if (key == ' ') {\n pong_s += 1;\n reset();\n }\n //for milo\n else if (key == 'A' && nextQ == 2) {\n miloPoints++;\n nextQ++;\n }\n else if (key == 'B' && nextQ == 1) {\n miloPoints++;\n nextQ++;\n }\n else if (key == 'C') {\n nextQ++;\n }\n else if (key == 'D' && nextQ == 0) {\n miloPoints++;\n nextQ++;\n }\n //for chou chou\n else if (key == 'E' && nextQc == 1) {\n chouChouPoints++;\n nextQc++;\n }\n else if (key == 'F' && nextQc == 0) {\n chouChouPoints -= 1;\n nextQc++;\n }\n else if (key == 'G') {\n nextQc++;\n }\n else if (key == 'H' && nextQc == 2) {\n chouChouPoints++;\n nextQc++;\n }\n //for Soup\n else if (key == 'I' && nextQs == 1) {\n soupPoints++;\n nextQs++;\n }\n else if (key == 'J' && nextQs == 2) {\n soupPoints++;\n nextQs++;\n }\n else if (key == 'K' && nextQs == 0) {\n soupPoints += 1;\n nextQs++;\n }\n else if (key == 'L') {\n nextQs++;\n }\n //for Baguette\n else if (key == 'M' && nextQb == 0) {\n baguettePoints -= 2;\n nextQb++;\n }\n else if (key == 'N') {\n baguettePoints -= 1;\n nextQb++;\n }\n else if (key == 'O' && nextQb == 1) {\n baguettePoints++;\n nextQb++;\n }\n else if (key == 'P' && nextQb == 2) {\n baguettePoints++;\n nextQb++;\n }\n //for demitri\n else if (key == 'Q' && nextQd == 1) {\n demitriPoints++;\n nextQd++;\n }\n else if (key == 'R' && nextQd == 0) {\n demitriPoints++;\n nextQd++;\n }\n else if (key == 'S' && nextQd == 2 || nextQd == 3) {\n demitriPoints++;\n nextQd++;\n }\n else if (key == 'T' && nextQd == 2 || nextQd == 3) {\n demitriPoints++;\n nextQd++;\n }\n //max\n else if (key == 'U') {\n nextQm++;\n maxPoints++;\n }\n else if (key == 'V') {\n nextQm++;\n nextQd++;\n }\n else if (key == 'W') {\n nextQm++;\n nextQd++;\n }\n else if (key == 'X') {\n nextQm++;\n nextQd++;\n }\n else {\n nextQ++;\n nextQc++;\n nextQs++;\n nextQb++;\n nextQd++;\n nextQm++;\n }\n}", "function operatorPressed(){\n if(num1 == this){\n return;\n }\n if(num1 == null){\n ++i;\n num1 = totalInt1;\n }\n if(num2 == null) {\n num2 = totalInt2;\n var val = $(this).text();\n inputs.push(val);\n $(\"#displayScreen p\").text(val);\n ++i;\n // inputs[i] = val;\n }else{\n var val = $(this).text();\n inputs.push(val);\n $(\"#displayScreen p\").text(val);\n\n }\n if(inputs[0] == \"\"){\n inputs = [\"\"];\n i = 0;\n return;\n }\n operator = $(this).text();\n}", "constructor()\r\n {\r\n // object for storing bound inputs and callbacks\r\n\r\n // an object where each key represents an input, and each value is an array of actions bound to it\r\n this.keydown_actions = {}\r\n \r\n // an object where each key represents an action, and each value is an array of callback object to be called when the action occurs\r\n this.action_functions = {}\r\n\r\n // an object that stores each connected gamepad\r\n this.connected_gamepads = {}\r\n\r\n // an object that stores the key state of each key (keys only exist in this object if they were pressed or released at some point)\r\n this.key_states = {}\r\n\r\n // an object of objects that store the state of each button on each connected gamepad\r\n this.gamepad_button_states = {}\r\n\r\n // same as gamepad_button_states, but used for detecting changes - pls use gamepad_button_states if you want to read them\r\n this.last_gamepad_button_states = {}\r\n\r\n // an object of arrays of values that store the most recent value for each gamepad axes\r\n this.last_gamepad_axes = {};\r\n\r\n // deadzone for gamepad axes released detection\r\n this.release_deadzone = 0.1;\r\n\r\n // keyevent and gamepad event listeners\r\n\r\n document.addEventListener(\"keydown\", ((event) => {\r\n //event.preventDefault()\r\n this.#handle_keydown(event, \"pressed\")\r\n }).bind(this))\r\n\r\n document.addEventListener(\"keyup\", ((event) => {\r\n //event.preventDefault()\r\n this.#handle_keydown(event, \"released\")\r\n }).bind(this))\r\n\r\n window.addEventListener(\"gamepadconnected\", (function(e) { this.#gamepadHandler(e, true); }).bind(this), false);\r\n window.addEventListener(\"gamepaddisconnected\", (function(e) { this.#gamepadHandler(e, false); }).bind(this), false);\r\n }", "function checkKeyboardInput(event) {\n\n // if there is no saved game being replayed now, handle inputs from the keyboard\n if(!replayingAGame) {\n switch (event.key) {\n case 'ArrowUp':\n recordGame.saveGameEvent(playerLevelEnvironment.frameNumber, 'keyPressed', 'rotateRight');\n handlePlayerInput('rotateRight');\n break;\n case 'ArrowDown':\n recordGame.saveGameEvent(playerLevelEnvironment.frameNumber, 'keyPressed', 'rotateLeft');\n handlePlayerInput('rotateLeft');\n break;\n case 'ArrowLeft':\n recordGame.saveGameEvent(playerLevelEnvironment.frameNumber, 'keyPressed', 'moveLeft');\n handlePlayerInput('moveLeft');\n break;\n case 'ArrowRight':\n recordGame.saveGameEvent(playerLevelEnvironment.frameNumber, 'keyPressed', 'moveRight');\n handlePlayerInput('moveRight');\n break;\n case ' ':\n recordGame.saveGameEvent(playerLevelEnvironment.frameNumber, 'keyPressed', 'instantDrop');\n handlePlayerInput('instantDrop');\n break;\n default:\n return;\n }\n }\n event.preventDefault();\n }", "function inputResult() {\n\n\tvar action = \"none\";\n\n\tfor(var i=0; i < allPlayers.length; i++) {\n\t\tif( isKeyboardKeyDown( playerControls[i].up ) )\n\t\t\t{ keyboardKeys[ playerControls[i].up ] = \"none\"; action = \"up\"; }\n\t\telse if( isKeyboardKeyDown( playerControls[i].gc_up ) )\n\t\t\t{ keyboardKeys[ playerControls[i].gc_up ] = \"none\"; action = \"up\"; }\n\n\t\telse if( isKeyboardKeyDown( playerControls[i].down ) )\n\t\t\t{ keyboardKeys[ playerControls[i].down ] = \"none\"; action = \"down\"; }\n\t\telse if( isKeyboardKeyDown( playerControls[i].gc_down ) )\n\t\t\t{ keyboardKeys[ playerControls[i].gc_down ] = \"none\"; action = \"down\"; }\n\t\t\n\t\telse if( isKeyboardKeyDown( playerControls[i].left ) )\n\t\t\t{ keyboardKeys[ playerControls[i].left ] = \"none\"; action = \"left\"; }\n\t\telse if( isKeyboardKeyDown( playerControls[i].gc_left ) )\n\t\t\t{ keyboardKeys[ playerControls[i].gc_left ] = \"none\"; action = \"left\"; }\n\t\t\n\t\telse if( isKeyboardKeyDown( playerControls[i].right ) )\n\t\t\t{ keyboardKeys[ playerControls[i].right ] = \"none\"; action = \"right\"; }\n\t\telse if( isKeyboardKeyDown( playerControls[i].gc_right ) )\n\t\t\t{ keyboardKeys[ playerControls[i].gc_right ] = \"none\"; action = \"right\"; }\n\n\t\t//only char change if over a char\n\t\tif( resultVars[ \"blockp\" + i] < 4) {\n\t\t\tif( action === \"up\") {\n\t\t\t\tresultVars[ \"c\" + resultVars[ \"blockp\" + i] + \"p\" + i] += 1;\n\t\t\t\tif( resultVars.ccZref < resultVars[ \"c\" + resultVars[ \"blockp\" + i] + \"p\" + i] )\n\t\t\t\t\t{ resultVars[ \"c\" + resultVars[ \"blockp\" + i] + \"p\" + i] = resultVars.ccAref; }\n\t\t\t}\n\t\t\tif( action === \"down\") {\n\t\t\t\tresultVars[ \"c\" + resultVars[ \"blockp\" + i] + \"p\" + i] -= 1;\n\t\t\t\tif( resultVars.ccAref > resultVars[ \"c\" + resultVars[ \"blockp\" + i] + \"p\" + i] )\n\t\t\t\t\t{ resultVars[ \"c\" + resultVars[ \"blockp\" + i] + \"p\" + i] = resultVars.ccZref; }\n\t\t\t}\n\t\t\tallResultVisuals.midLayer[\"player\" + (i+1) + \"c\" + resultVars[ \"blockp\" + i] ].text(\n\t\t\t\tString.fromCharCode( resultVars[ \"c\" + resultVars[ \"blockp\" + i] + \"p\" + i] )\n\t\t\t);\n\t\t}//end if changing a char\n\n\t\t//move the block\n\t\tif( (action === \"left\") && (resultVars[ \"blockp\" + i] > 1) ) {\n\t\t\tresultVars[ \"blockp\" + i] -= 1;\n\t\t\tallResultVisuals.frontLayer[\"player\" + (i+1) + \"block\"].x( allResultVisuals.midLayer[\"player\" + (i+1) + \"c\" + resultVars[ \"blockp\" + i] ].x() );\n\t\t}\n\t\telse if( (action === \"right\") && (resultVars[ \"blockp\" + i] < 4) ) {\n\t\t\tresultVars[ \"blockp\" + i] += 1;\n\t\t\tallResultVisuals.frontLayer[\"player\" + (i+1) + \"block\"].x(\n\t\t\t\tallResultVisuals.midLayer[\"player\" + (i+1) + \"c1\" ].x()\n\t\t\t\t+ ( (resultVars[ \"blockp\" + i] - 1) * allResultVisuals.frontLayer[\"player\" + (i+1) + \"block\"].width() )\n\t\t\t);\n\t\t}\n\n\t} //end for each player\n\n\n\n\n\t//End the input to submit scores.\n\tif(keyboardKeys[\"Enter\"] === \"down\") {\n\n\t\tresultScoreCheckingBeforePageReload();\n\n\t\tdocument.location.reload(true);\n\t}\n\n}", "determinePlayingOrder(room, profile) {\n let renderOrder = [];\n const white = room.game.white;\n const black = room.game.black;\n const red = room.game.red;\n const gold = room.game.gold;\n try {\n switch (room.game.gameType) {\n case \"four-player\":\n renderOrder = [this.renderGold, this.renderBlack, this.renderRed, this.renderWhite];\n if(!black) {\n break;\n }\n switch (profile._id) {\n case black.playerId:\n renderOrder = [this.renderRed, this.renderWhite, this.renderGold, this.renderBlack];\n break;\n case gold.playerId:\n renderOrder = [this.renderBlack, this.renderRed, this.renderWhite, this.renderGold];\n break;\n case red.playerId:\n renderOrder = [this.renderWhite, this.renderGold, this.renderBlack, this.renderRed];\n break;\n case white.playerId:\n default:\n break;\n }\n break;\n case \"standard\":\n default:\n renderOrder = [this.renderBlack, this.renderWhite];\n if(!black) {\n break;\n }\n switch (profile._id) {\n case black.playerId:\n renderOrder = [this.renderWhite, this.renderBlack];\n break;\n case white.playerId:\n default:\n break;\n }\n break;\n }\n } catch (err) {\n console.error(err);\n }\n return renderOrder;\n }", "function handleKeyboard(e)\n{\n\tif (e && e.which)\n\t{\n\t\n\t//document.getElementById(\"testInfoDiv\").innerHTML=\"Last recieved keycode from keypress: \" + e.which;\n\t\n\t//P1 Exclusive Section\n\t\tif (e.which == 49 && p1) //1 key.\n\t\t{\n\t\t\tif (p1.ap > 100) {p1.ap -=100;}\n\t\t}\n\t//End of P1 Section\n\t\t\n\t\tif (e.which == 37){;}\n\t\tif (e.which == 38){;}\n\t\tif (e.which == 39){;}\n\t\tif (e.which == 40){;}\n\t\t\n\t\tif (e.which == 65){;}\n\t\tif (e.which == 68){;} //Watch out. Order swap here in the ASWD set.\n\t\tif (e.which == 83){;}\n\t\t\n\t\tif (e.which == 32 || e.which == 87 || e.which == 16) //Spacebar, W key, Shift.\n\t\t{\n\t\t\t;\n\t\t}\n\t\t\n\t\t\n\t\t//Getting the Reserve AP is an All-or-Nothing bid.\n\t\t//For testing, we'll just swap.\n\t\t//Ideally, this would occur automatically when\n\t\t//changing paradigm.\n\t\t\n\t\tif (e.which == 16) //Shift key.\n\t\t{\n\t\t\tif (p1.rap >= p1.apMax)\n\t\t\t{\n\t\t\t\tp1.ap = p1.rap; //Replace AP with reserve.\n\t\t\t\tp1.rap = -p1.rap; //Sets reserve back to negative to build up.\n\t\t\t} \n\t\t\telse\n\t\t\t{\n\t\t\t\tp1.ap = 0;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}\n}", "function processChoice(key, answer, valid) {\n if (valid.indexOf(key) > -1) {\n validPicked.push(key);\n lettersPicked.push(key);\n lettersRemaining = (answerKey.length - validPicked.length) \n rebuildBoard(validPicked);\n } else {\n document.getElementById(\"lettersPicked\").textContent += \" \" + key;\n lettersPicked.push(key);\n guessesRemaining--;\n document.getElementById(\"guessesRemaining\").textContent = guessesRemaining;\n\n }\n checkForGameOver(guessesRemaining, lettersRemaining);\n}", "function initKeyboardControls() {\n //detect when key is pressed\n window.addEventListener('keydown', function (e) {\n //get the key the user pressed\n //and convert it to lowercase\n //in case if the users keyboard\n //has capsLock on\n let keyPressed = e.key.toLowerCase();\n //we only save the state of key press\n //actually update of positions happens in movebird\n if(keyPressed === \"a\" || keyPressed === \"arrowleft\") mvL = true;\n if(keyPressed === \"d\" || keyPressed === \"arrowright\") mvR = true;\n if (keyPressed === \" \" || keyPressed === \"w\") mvU = true;\n\n });\n\n //detect when key is no longer pressed\n window.addEventListener('keyup', function (e) {\n let keyPressed = e.key.toLowerCase();\n\n if(keyPressed === \"a\" || keyPressed === \"arrowleft\") mvL = false;\n if(keyPressed === \"d\" || keyPressed === \"arrowright\") mvR = false;\n if (keyPressed === \" \" || keyPressed === \"w\") mvU = false;\n\n });\n}", "function $gameplay () { \n var $string = \"\";\n for (i = 1; i <= $currentNickname.length; i++){ \n $string = $string + \"_\";\n $(\"#blank-answer\").text($string); \n }\n var keysGuessed = \"\";\n if ($string !== $currentNickname && $guesses <= 10){\n $(document).keypress(function(event){\n var letterPressed = event.key;\n var lowerCasedArray = $currentNickname.split('').map(function(char){\n return char.toLowerCase();\n });\n var indexValue = lowerCasedArray.indexOf(letterPressed);\n \n if (indexValue >= 0){\n var newAnswers = $(\"#blank-answer\").text().split('');\n newAnswers[indexValue] = $currentNickname[indexValue];\n console.log(newAnswers);\n\n $(\"#blank-answer\").text(newAnswers.join(''));\n }\n\n else {\n if(keysGuessed !== '') {\n keysGuessed += ', ' + letterPressed;\n }\n else {\n keysGuessed += letterPressed;\n }\n console.log(keysGuessed);\n $(\"#letters-used-area\").text(keysGuessed);\n } \n }) \n }\n}", "_onInputButtonPressed(input) {\n switch (typeof input) {\n case 'number':\n if (input==1) {\n this.state.freq[0][0]+=3\n }\n if (input==2) {\n this.state.freq[0][1]+=3\n }\n if (input==3) {\n this.state.freq[0][2]+=3\n }\n if (input==4) {\n this.state.freq[1][0]+=3\n }\n if (input==5) {\n this.state.freq[1][1]+=3\n }\n if (input==6) {\n this.state.freq[1][2]+=3\n }\n if (input==7) {\n this.state.freq[2][0]+=3\n }\n if (input==8) {\n this.state.freq[2][1]+=3\n }\n if (input==9) {\n this.state.freq[2][2]+=3\n }\n if (input==0) {\n this.state.freq[3][0]+=3\n }\n return this._handleNumberInput(input)\n case 'string':\n return this._handleStringInput(input)\n }\n }", "function registerInputs() {\n\t\tinputLeftIds[input.KeyEvent.DOM_VK_A] = myKeyboard.registerHandler(function() {\n\t\t\tmodel.moveSingleDown(Demo.assets['effect-1']);\n\t\t},\n\t\tinput.KeyEvent.DOM_VK_A, false\n\t\t);\n\t\tinputLeftIds[input.KeyEvent.DOM_VK_Q] = myKeyboard.registerHandler(function() {\n\t\t\tmodel.moveSingleUp(Demo.assets['effect-1']);\n\t\t},\n\t\tinput.KeyEvent.DOM_VK_Q, false\n\t\t);\n\n\t\tinputLeftIds[input.KeyEvent.DOM_VK_S] = myKeyboard.registerHandler(function(elapsedTime) {\n\t\t\tmodel.moveRepeatDown(Demo.assets['effect-2'], elapsedTime);\n\t\t},\n\t\tinput.KeyEvent.DOM_VK_S, true\n\t\t);\n\t\tinputLeftIds[input.KeyEvent.DOM_VK_W] = myKeyboard.registerHandler(function(elapsedTime) {\n\t\t\tmodel.moveRepeatUp(Demo.assets['effect-2'], elapsedTime);\n\t\t},\n\t\tinput.KeyEvent.DOM_VK_W, true\n\t\t);\n\n\t\tinputLeftIds[input.KeyEvent.DOM_VK_D] = myKeyboard.registerHandler(function() {\n\t\t\tmodel.moveRepeatTimedDown(Demo.assets['effect-3']);\n\t\t},\n\t\tinput.KeyEvent.DOM_VK_D, true, 250\n\t\t);\n\t\tinputLeftIds[input.KeyEvent.DOM_VK_E] = myKeyboard.registerHandler(function() {\n\t\t\tmodel.moveRepeatTimedUp(Demo.assets['effect-3']);\n\t\t},\n\t\tinput.KeyEvent.DOM_VK_E, true, 250\n\t\t);\n\t}", "function getOrder(input) {\n let ledgible = '', menu = { burg:'Burger', frie:'Fries', chic:'Chicken', pizz:'Pizza', sand:'Sandwich', onio:'Onionrings', milk:'Milkshake' ,\n coke:'Coke' };\n for (let chars in menu)\n for (let i = 0; i < input.length; i++) //should be i < input.length - 4 instead\n if (input.substring(i, i + 4) === chars) //add item when the 4-char string matches the selected key 'chars'\n ledgible += menu[chars] + ' '; \n return ledgible.trim();\n}", "function useKeyboard(e) {\n if (e.keyCode === 48) getNumber(0); \n if (e.keyCode === 49) getNumber(1); \n if (e.keyCode === 50) getNumber(2); \n if (e.keyCode === 51) getNumber(3); \n if (e.keyCode === 52) getNumber(4); \n if (e.keyCode === 53) getNumber(5); \n if (e.keyCode === 54) getNumber(6); \n if (e.keyCode === 55) getNumber(7); \n if (e.keyCode === 56) getNumber(8); \n if (e.keyCode === 57) getNumber(9); \n if (e.keyCode === 13) equalsSign();\n if (e.keyCode === 27) clearAll();\n}", "function computerMove() {\n\tfor (var i = 0;i<aiOrder.length;i++){//loop over the order array...\n\t\tif($(\"#game-area #panel\"+aiOrder[i]).text()==\"\"){//if the panel selected in this loop is empty...\n\t\t\t//...then apply the computers character to the panel, take away its click event, set the cursor to default, and removed the enabled class...\n\t\t\t$(\"#game-area #panel\"+aiOrder[i]).text(computerChar).unbind(\"click\").css({\"cursor\":\"default\"}).removeClass(\"enabled\");\n\t\t\tbreak;//stop further execution of the outer loop.\n\t\t}\n\t}\n\tfor (var i = 0;i<rules.length;i++){\n\t\tcheckCombination(rules[i], computerChar);//check the combinations of the computer player...\n\t}\n}", "function switch_input() {\n var in_text = document.getElementById('input_text').value;\n var in_lines = in_text.trim().split(\"\\n\");\n var dir = 0;\n var inp = get_input();\n if (inp == \"result\" && in_lines.length % 2 == 0) {\n dir = 1;\n }\n for (var i = 0; i < in_lines.length; i++) {\n if (i % 2 == (in_lines.length + dir) % 2) {\n in_lines[i] = in_lines[i].replace(/K/g, \"O\");\n in_lines[i] = in_lines[i].replace(/P/g, \"K\");\n in_lines[i] = in_lines[i].replace(/O/g, \"P\");\n }\n if (i % 2 != (in_lines.length + dir) % 2) {\n var split_string = in_lines[i].split(\"\");\n var reverse_array = split_string.reverse();\n in_lines[i] = reverse_array.join(\"\")\n }\n }\n in_lines = in_lines.reverse();\n document.getElementById('input_text').value = in_lines.join(\"\\n\")\n if (inp == \"result\") {\n document.getElementById(\"explain\").innerHTML = \"The sequence of K's and P's correspond left-to-right, top-to-bottom with the visible grid of stitches on the final result\";\n }\n else {\n document.getElementById(\"explain\").innerHTML = \"The sequence of stiches and new rows one would have to knit in order to achieve the final result\"\n }\n}", "function keyTest(i){\n var obj = {}\n switch(i){\n case 187://Backspace (Using the +,= key as backspace to prevent having to overide browser functions)\n return {'btn-num-back':1}\n break;\n case 13://Enter\n return {'btn-act-enter':1}\n break;\n case 37://Key left.\n return {'btn-nav-left':1}\n break;\n case 38://Key up.\n return {'btn-nav-up':1}\n break;\n case 39://Key right.\n return {'btn-nav-right':1}\n break;\n case 40://Key down.\n return {'btn-nav-down':1}\n break;\n case 46://Delete\n return {'btn-act-reset':1}\n break;\n case 48://0\n case 96://(NumPad)\n return {'btn-num-0':1}\n break;\n case 49://1\n case 97://(NumPad)\n return {'btn-num-1':1}\n break;\n case 50://2\n case 98://(NumPad)\n return {'btn-num-2abc':1}\n break;\n case 51://3\n case 99://(NumPad)\n return {'btn-num-3def':1}\n break;\n case 52://4\n case 100://(NumPad)\n return {'btn-num-4ghi':1}\n break;\n case 53://5\n case 101://(NumPad)\n return {'btn-num-5jkl':1}\n break;\n case 54://6\n case 102://(NumPad)\n return {'btn-num-6mno':1}\n break;\n case 55://7\n case 103://(NumPad)\n return {'btn-num-7pqrs':1}\n break;\n case 56://8\n case 104://(NumPad)\n return {'btn-num-8tuv':1}\n break;\n case 57://9\n case 105://(NumPad)\n return {'btn-num-9wxyz':1}\n break;\n case 190://.\n case 110://(NumPad)\n return {'btn-num-period':1}\n break;\n default: \n console.log(i, 'No action for this keyCode')\n break;\n }\n }", "function whenKeyDown(k) {\r\n switch (k) {\r\n case \"2\":\r\n case \"x\": \r\n case \"s\":\r\n case \"Down\":\r\n case \"ArrowDown\":\r\n moveDown();\r\n break;\r\n case \"8\":\r\n case \"w\": \r\n case \"Up\":\r\n case \"ArrowUp\":\r\n moveUp();\r\n break;\r\n case \"4\":\r\n case \"a\": \r\n case \"Left\":\r\n case \"ArrowLeft\":\r\n moveLeft();\r\n break;\r\n case \"6\":\r\n case \"d\": \r\n case \"Right\":\r\n case \"ArrowRight\":\r\n moveRight();\r\n break;\r\n case \"7\":\r\n case \"q\":\r\n moveUpLeft();\r\n break; \r\n case \"9\":\r\n case \"e\":\r\n moveUpRight();\r\n break; \r\n case \"1\":\r\n case \"z\":\r\n moveDownLeft();\r\n break; \r\n case \"3\":\r\n case \"c\":\r\n moveDownRight();\r\n break; \r\n case \" \":\r\n // pickup\r\n break;\r\n }\r\n}", "function keyTyped() {\n console.log(key);\n //simple screen navigation\n \n //check if can move on\n if ((currentScreen.toNextKey != null && !hasText && \n !currentScreen.name.includes(\"comic\")) || \n (currentScreen.name.includes(\"comic\") && \n currentScreen.comicEnd)){\n //check if correct key\n if ( key.toLowerCase() === currentScreen.toNextKey){\n nextScreen();\n }\n }\n \n //do not allow control access prior to first state two screen\n if (canAccessControls && key.toLowerCase() === 'i' && currentScreen.name != \"controls\"){\n //Save current screen state\n //de-increment automatic increments\n if(hasText){\n hasText = false;\n w[wendyCounter].counter--;\n }\n else if(!hasText && currentScreen.hasWendy){\n wendyCounter--;\n //w[wendyCounter].counter--;\n }\n \n //controls is screen index 2\n screensList[2].next = currentScreen; \n currentScreen = screensList[2]; \n \n if (debug) {\n console.log(\"Accessing controls...\");\n console.log(screensList[2].next.name);\n console.log(\"was the previous screen.\");\n }\n drawAgain = true;\n }\n}", "handleInput(key) {\n this.keyCode = key;\n switch (key) {\n case \"esc\":\n if (this.state == \"running\") {\n this.changeState(\"paused\", this.bugsSpeeds);\n }\n else if (this.state == \"paused\") {\n this.changeState(\"running\", this.bugsSpeeds);\n }\n break;\n \n case \"enter\":\n if (this.state == \"stopped\") {\n this.changeState('running', this.bugsSpeeds);\n } else {\n if ((this.state == 'lost')||(this.state == 'won')) {\n this.changeState('stopped', this.bugsSpeeds);\n this.initGame();\n this.life.numberOfThis = 5;\n this.gemCounter.numberOfThis = 0;\n this.keyCounter.numberOfThis = 0;\n this.player.lifes = 5;\n this.player.keys = 0;\n this.player.x = this.player.startX;\n this.player.y = this.player.startY;\n }\n }\n break;\n\n case 'space':\n if (this.state == 'stopped') {\n (this.currentSprite < this.players.length-1) ? this.currentSprite++ : this.currentSprite = 0;\n this.player.sprite = this.players[this.currentSprite];\n this.heroPlayer.sprite = this.players[this.currentSprite];\n };\n break;\n \n case 'l':\n if (this.state == 'stopped') {\n (this.levelCount < this.levels.length-1) ? this.levelCount++ : this.levelCount = 0;\n this.level = this.levels[this.levelCount];\n this.initGame();\n };\n break;\n \n // Not a game menu call the Player's method\n default:\n if (this.state == \"running\") this.player.move(key);\n break;\n }\n }", "function operatorButtons(input) {\n // 1) Check if array is already populated (perform calculation without = button)...\n if (operationArray.length > 0) {\n \n // if no new number entered don't allow to continue...\n if (doubleOperatorCheck == 1 && topLine.textContent == \"\") {\n return;\n }\n\n // push entered number to 3rd array element\n operationArray.push(outputNum);\n\n // clear topline text\n topLine.textContent = '';\n\n // calculate and display answer\n outputNum = round(operate(operationArray));\n display.textContent = outputNum;\n\n // set array first value to answer\n operationArray = [outputNum, input];\n\n // store operator for next calculation\n storedOperator = input;\n \n // don't allow another operator to be passed until new number entered\n doubleOperatorCheck = 1;\n\n // 2) Otherwise prepare for first calculation...\n } else {\n // push entered number and operator to array\n operationArray.push(outputNum);\n operationArray.push(input);\n\n // add number and operator to topline\n topLine.textContent = `${outputNum} ${input}`;\n\n // reset bottom display \n outputNum = \"\";\n display.textContent = 0;\n }\n}", "function assignKeys() {\n\t$snake.keydown(function(key) {\n\t\tkey.preventDefault();\n\t\t\n\t\tswitch(key.which) {\n\n\t\tcase 37: //left arrow\n\t\t\tsnake.nextdir = DIRS.LEFT;\n\t\t\tbreak;\n\t\tcase 38: // up arrow\n\t\t\tsnake.nextdir = DIRS.UP;\n\t\t\tbreak;\n\t\tcase 39: // right arrow\n\t\t\tsnake.nextdir = DIRS.RIGHT;\n\t\t\tbreak;\n\t\tcase 40: //down arrow\n\t\t\tsnake.nextdir = DIRS.DOWN;\n\t\t\tbreak;\n\t\t\t\n\t\tcase 187: //=+\n\t\t\tadjustSpeed(10);\n\t\t\tbreak;\n\t\tcase 189: ///-_\n\t\t\tadjustSpeed(-10);\n\t\t\tbreak;\n\t\tcase 83: //S\n\t\t\tinputSpeed();\n\t\t\tbreak;\n\t\tcase 32: // space //80: //P\n\t\t\ttogglePause();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t});\n}", "function keyTyped(){\n if(key === 'q'){\n serialDatas[0][0] = 1;\n }\n if(key === 'a'){\n serialDatas[0][1] = 1;\n }\n if(key === 'w'){\n serialDatas[1][0] = 1;\n }\n if(key === 'e'){\n serialDatas[2][0] = 1;\n }\n if(key === 'r'){\n serialDatas[3][0] = 1;\n }\n}", "function reorderPlayers() {\n if (vm.competition.type === 'versus') {\n reorderVersusPlayers();\n } else if (vm.competition.type === 'pyramid') {\n reorderPyramidPlayers();\n }\n vm.disableSubmit = false;\n }", "handleKeyDown(e){\n let key = e.which;\n switch(key){\n case 87:\n merge(this.actions, {up: true, down: false});\n break;\n case 68:\n merge(this.actions, {right: true});\n break;\n case 65:\n merge(this.actions, {left: true});\n break;\n case 83:\n merge(this.actions, {down: true, up: false});\n break;\n case 84:\n merge(this.actions, {shoot: true});\n break;\n }\n }", "function keyboardSetup() {\n for (let letters of keyboard) {\n letters.classList.remove(\"chosen\", \"wrong\");\n letters.disabled = false;\n }\n}", "function keyPressed() {\r\n if (game.state === 0) {\r\n if (key === 'c') {\r\n for (i = 0; i < length; i++) {\r\n for (j = 0; j < length; j++) {\r\n board[i][j] = state.empty;\r\n }\r\n }\r\n }\r\n for (k = 1; k < 10; k++) {\r\n if (key === char(48 + k)) {\r\n length = k;\r\n board = make2DMatrix(length, length);\r\n }\r\n }\r\n }\r\n if (key === 'p') {\r\n game.state = 1 - game.state;\r\n }\r\n}", "function updateGamepads(){\n var list = ensureArray(getGamepads.call(navigator)),\n current = gamepads.value,\n hasChanges = false;\n\n for (var i=0, l1=list.length, l2=current.length; i<l1 || i<l2; i++) {\n var left = current[i],\n right = list[i];\n if (!left) {\n hasChanges = true;\n current.push(gamepad(right));\n } else if (!right) {\n hasChanges = true;\n current.splice(i, 1);\n } else if (left.id != right.id) {\n hasChanges = true;\n current[i] = gamepad(right);\n } else {\n // TODO: check if updating objects in place is OK with Elm\n // TODO: Also update sub-items in place if OK to avoid GC\n if (!listArrayCmp(left.axes, right.axes, floatEq)) {\n hasChanges = true;\n left.axes = axes(right.axes);\n }\n if (!listArrayCmp(left.buttons, right.buttons, buttonEq)) {\n hasChanges = true;\n left.buttons = buttons(right.buttons);\n }\n }\n }\n\n if (hasChanges) {\n localRuntime.notify(gamepads.id, gamepads.value);\n }\n\n if (current.length > 0) {\n scheduleOne(updateGamepads);\n }\n }", "advanceTurnOrder() {\n super.updatePlayerScore(this.redTurnOrder[0], \"Red\");\n super.updatePlayerScore(this.blueTurnOrder[0], \"Blue\");\n const lastPlayer = this.redTurnOrder.shift();\n this.redTurnOrder.push(lastPlayer);\n const lastPlayer2 = this.blueTurnOrder.shift();\n this.blueTurnOrder.push(lastPlayer2);\n }", "function input() {\n if(65 in keysDown) {\n if (getTile((player.x - player.speed) + 1, player.y + 16) !== \"1\") { //If player runs into a wall, they will not be allowed to go through it.\n player.x -= 3; //when \"A\" is pressed on keyboard, move player 3 pixels to left.\n }\n }\n if(68 in keysDown) {\n if (getTile(((player.x + player.width) + player.speed) - 1, player.y + 16) !== \"1\") { //If player runs into a wall, they will not be allowed to go through it.\n player.x += 3; //when \"D\" is pressed on keyboard, move player 3 pixels to right.\n }\n }\n if(87 in keysDown && player.yke === 0) {\n if(getTile(player.x, player.y -1) !== \"1\" && getTile(player.x + 32, player.y -1) !== \"1\") {\n player.yke += 8;\n }\n } \n}", "physicalKeyFunction(event) {\n let keyboard = document.getElementsByClassName(\"key\");\n if (event.keyCode >= 65 && event.keyCode <= 90) {\n for (let i = 0; i < keyboard.length; i++) {\n if (\n keyboard[i].textContent ===\n String.fromCharCode(event.keyCode).toLowerCase()\n ) {\n game.handleInteraction(keyboard[i]);\n }\n }\n }\n }", "function addKeyboardEvents(){\n\t// Arrow keys and WASD both work for input\n\tdocument.addEventListener(\"keydown\", function(e){\n\t\tswitch(e.keyCode){\n\t\t\t// Up\n\t\t\tcase 87:\n\t\t\tcase 38:\n\t\t\t\tgs.player.isPressingUp = true;\n\t\t\t\tbreak;\n\t\t\t// Down\n\t\t\tcase 83:\n\t\t\tcase 40:\n\t\t\t\tgs.player.isPressingDown = true;\n\t\t\t\tbreak;\n\t\t\t// Left\n\t\t\tcase 65:\n\t\t\tcase 37:\n\t\t\t\tgs.player.isPressingLeft = true;\n\t\t\t\tbreak;\n\t\t\t// Right\n\t\t\tcase 68:\n\t\t\tcase 39:\n\t\t\t\tgs.player.isPressingRight = true;\n\t\t\t\tbreak;\n\t\t\t// E\n\t\t\tcase 69:\n\t\t\t\tif (wm.gameMode === \"Scavenge\"){\n\t\t\t\t\tgs.enterBuilding();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t// I\n\t\t\tcase 73:\n\t\t\t\tif (wm.gameMode === \"Scavenge\"){\n\t\t\t\t\twm.gameMode = \"Inventory\";\n\t\t\t\t} else if (wm.gameMode === \"Inventory\"){\n\t\t\t\t\twm.gameMode = \"Scavenge\";\n\t\t\t\t}\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t}, false);\n\tdocument.addEventListener(\"keyup\", function(e){\n\t\tswitch(e.keyCode){\n\t\t\t// Up\n\t\t\tcase 87:\n\t\t\tcase 38:\n\t\t\t\tgs.player.isPressingUp = false;\n\t\t\t\tbreak;\n\t\t\t// Down\n\t\t\tcase 83:\n\t\t\tcase 40:\n\t\t\t\tgs.player.isPressingDown = false;\n\t\t\t\tbreak;\n\t\t\t// Left\n\t\t\tcase 65:\n\t\t\tcase 37:\n\t\t\t\tgs.player.isPressingLeft = false;\n\t\t\t\tbreak;\n\t\t\t// Right\n\t\t\tcase 68:\n\t\t\tcase 39:\n\t\t\t\tgs.player.isPressingRight = false;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\n\t}, false);\n\n\t$(\"canvas\")[0].addEventListener(\"click\", function(e){\n\t\tif (wm.gameMode === \"Base\" || \n\t\t\t\twm.gameMode === \"Upgrade\" ||\n\t\t\t\twm.gameMode === \"Dialog\"){\n\t\t\twm.handleMousePress($(\"#canvas\")[0].getContext(\"2d\"), new Coord(e.clientX, e.clientY));\n\t\t}\n\t}, false);\n}", "preStep() {\n if (this.controls) {\n if (this.controls.activeInput.up) {\n this.sendInput('up', { movement: true });\n }\n\n if (this.controls.activeInput.left) {\n this.sendInput('left', { movement: true });\n }\n\n if (this.controls.activeInput.right) {\n this.sendInput('right', { movement: true });\n }\n\n if (this.controls.activeInput.down) {\n this.sendInput('down', { movement: true });\n }\n }\n }", "function input(e){\n\tlet code = e.keyCode;\n\tif(code == 38) // Up arrow\n\t{\n\t\tif(!started)\n\t\t{\n\t\t\tstarted = true;\n\t\t\tif(result != \"\")\n\t\t\t{\n\t\t\t\tAI.points = 0;\n\t\t\t\tplayer.points = 0;\n\t\t\t\tdocument.getElementById('computerScore').innerHTML = AI.points;\n\t\t\t\tdocument.getElementById('userScore').innerHTML = player.points;\n\t\t\t\tstressLevel = 50;\n\t\t\t\tstressLevelSystem();\n\t\t\t\tfor(i = 0; i < universityHidden.length; i++) universityHidden[i] = true;\n\t\t\t\tfor(i = 0; i < lifeHidden.length; i++) lifeHidden[i] = true;\n\t\t\t\tresult = \"\";\n\t\t\t}\n\t\t\tdocument.getElementById('gameInfo').style.color = 'rgba(0,0,0,0)';\n\t\t}\n\n\t\tplayer.vel = -10;\n\t}\n\telse if(code == 40) // Down arrow\n\t{\n\t\tif(!started)\n\t\t{\n\t\t\tstarted = true;\n\t\t\tif(result != \"\")\n\t\t\t{\n\t\t\t\tAI.points = 0;\n\t\t\t\tplayer.points = 0;\n\t\t\t\tdocument.getElementById('computerScore').innerHTML = AI.points;\n\t\t\t\tdocument.getElementById('userScore').innerHTML = player.points;\n\t\t\t\tstressLevel = 50;\n\t\t\t\tstressLevelSystem();\n\t\t\t\tfor(i = 0; i < universityHidden.length; i++) universityHidden[i] = true;\n\t\t\t\tfor(i = 0; i < lifeHidden.length; i++) lifeHidden[i] = true;\n\t\t\t\tresult = \"\";\n\t\t\t}\n\t\t\tdocument.getElementById('gameInfo').style.color = 'rgba(0,0,0,0)';\n\t\t}\n\t\tplayer.vel = 10;\n\t}\n}", "function getSetUpInformation() {\n let playerCount = getUserInput(\"How many players will there be? You can only have 1-4 players. \");\n let playerNameArray = getPlayerNames(playerCount);\n // let playerOrderArray = determinPlayerOrder(playerNameArray, playerCount);\n let firstP = determineLowRoll(playerNameArray, playerCount);\n let orderArray = setArrayOrder(playerNameArray, firstP);\n return orderArray;\n}", "function onKeyDown(event){\n var key = (event.keyCode) ? event.keyCode : event.which;\n\n if (currentGameState === GameState.IN_GAME) {\n switch (key) {\n case String('W').charCodeAt():\n case String('A').charCodeAt():\n case String('S').charCodeAt():\n case String('D').charCodeAt():\n case String('Q').charCodeAt():\n case String('E').charCodeAt():\n case String(' ').charCodeAt():\n case 37: // Left arrow\n case 38: // Up arrow\n case 39: // Right arrow\n case 40: // Down arrow\n if(pressedKeysArray.indexOf(key) == -1) {\n pressedKeysArray.push(key);\n }\n }\n }\n}", "function userInput(field){\n let colHeight = 0;\n let rowLength = 0;\n let currentHeight = 0;\n let currentLength = 0;\n let pField = field;\n let gameStatus = true\n // for loop to get the field height and width\n for (let i=1; i <= pField.length; i++){\n // console.log(i)\n if (i === pField.length){\n colHeight = i;\n for (let j in pField[i-1]){\n rowLength++\n }\n }\n }\n while(gameStatus === true){\n\n clear();\n console.log(pField);\n let moving = prompt(\"Select your move. (u for Up, d for down, l for left and r for right==> \");\n \n // console.log(moving)\n // console.log(rowLength)\n // console.log(colHeight)\n if (moving.toLowerCase() === \"u\"){\n currentHeight -= 1\n gameStatus = checkStatus(currentHeight, currentLength, colHeight, rowLength, pField)\n // return gameStatus\n }\n else if(moving.toLowerCase() === \"d\"){\n currentHeight += 1\n gameStatus = checkStatus(currentHeight, currentLength, colHeight, rowLength, pField)\n // return gameStatus\n }\n else if(moving.toLowerCase() === \"l\"){\n currentLength -= 1\n gameStatus = checkStatus(currentHeight, currentLength, colHeight, rowLength, pField)\n // return gameStatus\n }\n else if(moving.toLowerCase() === \"r\"){\n currentLength += 1\n gameStatus = checkStatus(currentHeight, currentLength, colHeight, rowLength, pField) \n }\n\n } \n // console.log(gameStatus)\n}", "function zzt_KeyDown(e) {\n\t\tswitch (e.which) {\n\t\t\tcase 27: PAD_ESC=1; break;\n\t\t\tcase 13: PAD_ENTER=1; break;\n\t\t\tcase 33: PAD_PGUP=1; break;\n\t\t\tcase 34: PAD_PGDOWN=1; break;\n\t\t\t// down\n\t\t\tcase 40: PAD_DOWN=1; break;\n\t\t\t// up\n\t\t\tcase 38: PAD_UP=1; break;\n\t\t\t// left\n\t\t\tcase 37: PAD_LEFT=1; break;\n\t\t\t// right\n\t\t\tcase 39: PAD_RIGHT=1; break;\n\t\t\tcase 16: PAD_SHIFT=1; break;\n\t\t\tcase 80: PAD_PAUSE=1; break;\n\t\t\tdefault:\n\t\t\t\tdebug.log(e.which); break; \n\t\t}\n\n\t\tswitch(ZZT_STATE) {\n\t\t\tcase ZZT_PAUSE:\n\t\t\t\tif(PAD_UP || PAD_DOWN || PAD_LEFT || PAD_RIGHT) {\n\t\t\t\t\tZZT_STATE=ZZT_GAME;\n\t\t\t\t\tzzt_KeyDown(e);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase ZZT_MESSAGE:\n\t\t\t\tvar linesmsg = CountLines(MESSAGE_DATA);\n\t\t\t\tif(PAD_UP) MESSAGE_CURRLINE--;\n\t\t\t\tif(PAD_DOWN) MESSAGE_CURRLINE++;\n\t\t\t\tif(PAD_PGUP) MESSAGE_CURRLINE-=14;\n\t\t\t\tif(PAD_PGDOWN) MESSAGE_CURRLINE+=14;\n\t\t\t\tif(MESSAGE_CURRLINE<0) MESSAGE_CURRLINE=0;\n\t\t\t\tif(MESSAGE_CURRLINE>linesmsg-15) MESSAGE_CURRLINE=linesmsg-15;\n\t\t\t\tif(PAD_ESC) MESSAGE_STATE=STATE_MESSAGE_CLOSE;\n\t\t\t\tif(PAD_ENTER) {\n\t\t\t\t\tif(SelectMenu()==1) MESSAGE_STATE=STATE_MESSAGE_CLOSE;\n\t\t\t\t\tPAD_ENTER = 0;\n\t\t\t\t}\n\t\t\t\tDrawMessage();\n\t\t\t\tbreak;\n\t\t\tcase ZZT_GAME:\n\t\t\t\tif(currentboard!=0) {\n\t\t\t\t\tif(PAD_PAUSE==1) {\n\t\t\t\t\t\tZZT_STATE=ZZT_PAUSE;\t\n\t\t\t\t\t}\n\t\t\t\t\t//player\n\t\t\t\t\tif(PAD_DOWN==1 || PAD_UP==1) {\n\t\t\t\t\t\tif(PAD_SHIFT==1) Template_Player.Shoot(0,0,(PAD_DOWN-PAD_UP),0);\n\t\t\t\t\t\telse MoveObject(0,0,PAD_DOWN-PAD_UP);\n\t\t\t\t\t} else if(PAD_LEFT==1 || PAD_RIGHT==1) {\n\t\t\t\t\t\tif(PAD_SHIFT==1) Template_Player.Shoot(0,(PAD_RIGHT-PAD_LEFT),0,0);\n\t\t\t\t\t\telse MoveObject(0,PAD_RIGHT-PAD_LEFT,0);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}", "keypadClick(e) {\n let pressedButton = e.target.innerHTML;\n if (this.state.newNumberFlag === true && this.state.operator === \"equals\") {\n this.setState({\n storedValue: \"0\"\n //operator: \"\",\n });\n }\n if (this.state.number === \"0\" || this.state.newNumberFlag === true) {\n this.setState(\n (prevState, props) => {\n return {\n number: pressedButton,\n newNumberFlag: false\n };\n },\n () => {\n this.updateChainedText(pressedButton, false);\n }\n );\n }\n else {\n let newNumber = this.state.number + pressedButton;\n newNumber = checkLengthOfText(newNumber, 10);\n /*\n this.setState({\n number: newNumber,\n newNumberFlag: false,\n });\n this.updateChainedText(pressedButton);\n */\n\n this.setState(\n (prevState, props) => {\n return {\n number: newNumber,\n newNumberFlag: false\n };\n },\n () => {\n this.updateChainedText(pressedButton);\n }\n );\n }\n }", "function respondToKeyPress(event) {\n\n // Determine which key was pressed and move in the respective direction\n var code = event.keyCode;\n // DO NOTHING IF THE KEY IS REPEATEDLY PRESSED WITH NO RELEASE\n if(keysPressed.indexOf(code) < 0) { // code is not already in the array\n switch (code) {\n case 16:\n // USER PRESSED SHIFT, CRUISE CONTROL TOGGLE\n if(forceMove === true){\n forceMove = false;\n } else {\n forceMove = true;\n }\n break;\n case 65:\n // USER PRESSED A\n changeShipDirDev(\"left\", code);\n break;\n case 87:\n // USER PRESSED W\n changeShipDirDev(\"up\", code);\n break;\n case 68:\n // USER PRESSED D\n changeShipDirDev(\"right\", code);\n break;\n case 83:\n // USER PRESSED S\n changeShipDirDev(\"down\", code);\n break;\n case 66:\n // USER PRESSED B\n // SHOOT A BULLET FROM THE TIP OF THE SHIP\n if (bulletsConsumed < bulletLimitDev) {\n if (playerShipDev.dirSpaceship === \"up\") {\n if (currentMutedState() !== true)\n bulletFireAudio.play();\n dirBulletDev = \"up\"\n velBulletDev = 2 * playerShipDev.velSpaceship;\n xBulletDev = playerShipDev.xSpaceship + 2;\n yBulletDev = playerShipDev.ySpaceship;\n } else if (playerShipDev.dirSpaceship === \"right\") {\n if (currentMutedState() !== true)\n bulletFireAudio.play();\n dirBulletDev = \"right\"\n velBulletDev = 2 * playerShipDev.velSpaceship;\n xBulletDev = playerShipDev.xSpaceship + 7;\n yBulletDev = playerShipDev.ySpaceship + 2;\n } else if (playerShipDev.dirSpaceship === \"down\") {\n if (currentMutedState() !== true)\n bulletFireAudio.play();\n dirBulletDev = \"down\"\n velBulletDev = 2 * playerShipDev.velSpaceship;\n xBulletDev = playerShipDev.xSpaceship + 2;\n yBulletDev = playerShipDev.ySpaceship + 7;\n } else if (playerShipDev.dirSpaceship === \"left\") {\n if (currentMutedState() !== true)\n bulletFireAudio.play();\n dirBulletDev = \"left\"\n velBulletDev = 2 * playerShipDev.velSpaceship;\n xBulletDev = playerShipDev.xSpaceship;\n yBulletDev = playerShipDev.ySpaceship + 2;\n }\n\n bulletDev = new bullet(xBulletDev, yBulletDev, dirBulletDev, velBulletDev);\n // SET THE BULLET INTO THE ARRAY OF BULLETS\n bulletListDev.push(bulletDev);\n bulletsConsumed++;\n }\n else {\n console.log(\"No bullets remaining\");\n }\n break;\n case 82:\n // USER PRESSED 'R' for RESET\n pauseGameOfLifeDev();\n initGameOfLifeDev();\n break;\n case 80:\n // USER PRESSED 'P' for PAUSE\n showGamePaused();\n break;\n // ARROW KEYS AND SPACE HANDLERS ARE THE SAME AS WASD AND B\n case 37:\n // USER PRESSED LEFT ARROW\n changeShipDirDev(\"left\", code);\n break;\n case 38:\n // USER PRESSED UP ARROW\n changeShipDirDev(\"up\", code);\n break;\n case 39:\n // USER PRESSED RIGHT ARROW\n changeShipDirDev(\"right\", code);\n break;\n case 40:\n // USER PRESSED DOWN ARROW\n changeShipDirDev(\"down\", code);\n break;\n case 32:\n // USER PRESSED SPACE\n // SHOOT A BULLET FROM THE TIP OF THE SHIP\n if (bulletsConsumed < bulletLimitDev) {\n if (playerShipDev.dirSpaceship === \"up\") {\n if (currentMutedState() !== true)\n bulletFireAudio.play();\n dirBulletDev = \"up\"\n velBulletDev = 2 * playerShipDev.velSpaceship;\n xBulletDev = playerShipDev.xSpaceship + 2;\n yBulletDev = playerShipDev.ySpaceship;\n } else if (playerShipDev.dirSpaceship === \"right\") {\n if (currentMutedState() !== true)\n bulletFireAudio.play();\n dirBulletDev = \"right\"\n velBulletDev = 2 * playerShipDev.velSpaceship;\n xBulletDev = playerShipDev.xSpaceship + 7;\n yBulletDev = playerShipDev.ySpaceship + 2;\n } else if (playerShipDev.dirSpaceship === \"down\") {\n if (currentMutedState() !== true)\n bulletFireAudio.play();\n dirBulletDev = \"down\"\n velBulletDev = 2 * playerShipDev.velSpaceship;\n xBulletDev = playerShipDev.xSpaceship + 2;\n yBulletDev = playerShipDev.ySpaceship + 7;\n } else if (playerShipDev.dirSpaceship === \"left\") {\n if (currentMutedState() !== true)\n bulletFireAudio.play();\n dirBulletDev = \"left\"\n velBulletDev = 2 * playerShipDev.velSpaceship;\n xBulletDev = playerShipDev.xSpaceship;\n yBulletDev = playerShipDev.ySpaceship + 2;\n }\n\n bulletDev = new bullet(xBulletDev, yBulletDev, dirBulletDev, velBulletDev);\n // SET THE BULLET INTO THE ARRAY OF BULLETS\n bulletListDev.push(bulletDev);\n bulletsConsumed++;\n }\n else {\n console.log(\"No bullets remaining\");\n }\n break;\n default:\n console.log(\"Pressed an invalid key\");\n }\n // set the new lastPressed\n lastPressed = code;\n }\n}", "function letterPressedLogic() {\n let letter = buttonP.target.value;\n switch (letter) {\n case 'a':\n handleLetterPress('a');\n break;\n case 'b':\n handleLetterPress('b');\n break;\n case 'c':\n handleLetterPress('c');\n break;\n case 'd':\n handleLetterPress('d');\n break;\n case 'e':\n handleLetterPress('e');\n break;\n case 'f':\n handleLetterPress('f');\n break;\n case 'g':\n handleLetterPress('g');\n break;\n case 'h':\n handleLetterPress('h');\n break;\n case 'i':\n handleLetterPress('i');\n break;\n case 'j':\n handleLetterPress('j');\n break;\n case 'k':\n handleLetterPress('k');\n break;\n case 'l':\n handleLetterPress('l');\n break;\n case 'm':\n handleLetterPress('m');\n break;\n case 'n':\n handleLetterPress('n');\n break;\n case 'o':\n handleLetterPress('o');\n break;\n case 'p':\n handleLetterPress('p');\n break;\n case 'q':\n handleLetterPress('q');\n break;\n case 'r':\n handleLetterPress('r');\n break;\n case 's':\n handleLetterPress('s');\n break;\n case 't':\n handleLetterPress('t');\n break;\n case 'u':\n handleLetterPress('u');\n break;\n case 'v':\n handleLetterPress('v');\n break;\n case 'w':\n handleLetterPress('w');\n break;\n case 'x':\n handleLetterPress('x');\n break;\n case 'y':\n handleLetterPress('y');\n break;\n case 'z':\n handleLetterPress('z');\n break;\n default:\n console.log(\"Invalid character entered. Ignoring...\")\n }\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}", "function setupKeypad() {\n var $keypad = $(\"<div class = 'keypad'></div>\"); // container\n var $keypadCode = $(\"<div class = 'keypad-code'>0000</div>\"); // digit display\n $keypad.append($keypadCode);\n // create all the buttons\n for (let i = 1; i < 11; i++) {\n if (i === 10) {\n var $keypadBtn = $(`<div class = \"keypad-btn\" onclick=\"addCode('0')\">0</div>`);\n } else {\n var $keypadBtn = $(`<div class = 'keypad-btn' onclick=\"addCode('${i}')\">${i}</div>`);\n }\n $keypad.append($keypadBtn);\n }\n $body.append($keypad.hide()); // add it to the body and hide it\n}", "function getAIMovementKeys() {\n let random_value = Math.floor(Math.random() * 50);\n\n switch (random_value) {\n case 0:\n\n if (ai_movement_x == 1) {\n ai_movement_x = 0; \n ai_movement_y = 1;\n } else {\n ai_movement_x = -1; \n ai_movement_y = 0;\n }\n break;\n case 1:\n if (ai_movement_y == 1) {\n ai_movement_x = -1; \n ai_movement_y = 0;\n } else {\n ai_movement_x = 0; \n ai_movement_y = -1;\n }\n break;\n case 2:\n if (ai_movement_x == -1) {\n ai_movement_x = 0;\n ai_movement_y = 1;\n } else {\n ai_movement_x = 1;\n ai_movement_y = 0;\n }\n \n break;\n case 3:\n if (ai_position_y == -1) {\n ai_movement_x = 1; \n ai_movement_y = 0;\n } else {\n ai_movement_x = 0; \n ai_movement_y = 1;\n }\n break;\n }\n }", "function inputGuess() {\n var currentGuess = \"000\";\n\tvar currentGuessArray = [];\n\tvar exactPlace = 0;\n var wrongPlace = 0;\n // Get the value of the input field with id=\"guessEntered\"\n currentGuess = pad(document.getElementById(\"guessEntered\").value,3);\n\t// Make current guess into array\n\tcurrentGuessArray = currentGuess.split(\"\");\n // Add the current guess to the end of the array of guesses\n\tarrayOfGuesses.push(currentGuess);\n\t// Calculate number of matches in exact place\n\texactPlace = (Number(combination[0] == currentGuessArray[0]) + Number(combination[1] == currentGuessArray[1]) + Number(combination[2] == currentGuessArray[2]));\n\twrongPlace = (Number(combination[0] == currentGuessArray[1]) + Number(combination[0] == currentGuessArray[2]) + Number(combination[1] == currentGuessArray[0]) + Number(combination[1] == currentGuessArray[2]) + Number(combination[2] == currentGuessArray[0]) + Number(combination[2] == currentGuessArray[1]));\n\t\n\t// If currentGuess is equal to the Target Number, end with Win else provide stats or end with Lose.\t\n switch(Number(currentGuess == combination) * 2 + \n\t\t(Number(guessesRemain != 1))) {\n case 0:\n\t\t\tguessesRemain--;\n\t\t\tguessListText = currentGuess.concat(\"&nbsp;&nbsp;\", \"<span class=\\\"exactplace\\\">\", exactPlace, \"</span>&nbsp;<span class=\\\"wrongplace\\\">\", wrongPlace, \"</span><br>\", guessListText);\n\t\t\tdocument.getElementById(\"response\").innerHTML = \"Sorry, you're out of guesses. The combination was \" + combination + \". Please refresh the page to try a new game.\";\n\t\t\tdocument.getElementById(\"guessList\").innerHTML = guessListText;\n\t\t\tbreak;\n\t\tcase 1:\n\t\t guessesRemain--;\n guessListText = currentGuess.concat(\"&nbsp;&nbsp;\", \"<span class=\\\"exactplace\\\">\", exactPlace, \"</span>&nbsp;<span class=\\\"wrongplace\\\">\", wrongPlace, \"</span><br>\", guessListText);\n\t document.getElementById(\"response\").innerHTML = \"Try again.\";\n document.getElementById(\"guessList\").innerHTML = guessListText;\n\t\t\tbreak;\n\t\tcase 2:\n\t\tcase 3:\n guessesRemain--;\n\t\t\tguessListText = currentGuess.concat(\"&nbsp;&nbsp;\", \"<span class=\\\"exactplace\\\">\", exactPlace, \"</span>&nbsp;<span class=\\\"wrongplace\\\">\", wrongPlace, \"</span><br>\", guessListText);\n\t\t\tdocument.getElementById(\"response\").innerHTML = \"You guessed it!\";\n\t\t\tdocument.getElementById(\"guessList\").innerHTML = guessListText;\n\t\t\tbreak;\n\t\tdefault:\n\t\t document.getElementById(\"response\").innerHTML = \"Wow. Something weird happened. Please notify the game designer.\";\n\t\t\tbreak;\n\t}\n\tdocument.getElementById(\"remaining\").innerHTML = \"Guesses remaining: \" + guessesRemain;\n}", "function updatePressedButtons() {\n // Sort the array.\n pressedButtons.sort();\n\n // Join all letters and uppercase string.\n var result = pressedButtons.join(\"\").toUpperCase();\n\n window.Elemu.select(\".pressedKeys\", function (elem) {\n elem.innerHTML = \"(-\" + result + \"-)\";\n });\n }", "function resetPadMovement() {\n if (easy) {\n p1PadMove = 6;\n p2PadMove = 6;\n }\n\n if (medium) {\n p1PadMove = 7;\n p2PadMove = 7;\n }\n\n if (hard) {\n p1PadMove = 10;\n p2PadMove = 10;\n }\n}", "function playerMove( e, obj ) {\n var s = e.key.toLowerCase();\n //move left\n if( s == \"arrowleft\" ) {\n if( gridCellEmpty( obj.i-1, obj.j ) ) {\n putObjInCell( obj, obj.i-1, obj.j );\n //don't want to get input again until it's our turn again\n engine.unbindEvents( agents[currentAgent] );\n incrementCurrentAgent();\n }\n }\n //move right\n else if ( s == \"arrowright\" ) {\n if( gridCellEmpty( obj.i+1, obj.j ) ) {\n putObjInCell( obj, obj.i+1, obj.j );\n //don't want to get input again until it's our turn again\n engine.unbindEvents( agents[currentAgent] );\n incrementCurrentAgent();\n }\n }\n //move up\n else if ( s == \"arrowup\" ) {\n if( gridCellEmpty( obj.i, obj.j-1 ) ) {\n putObjInCell( obj, obj.i, obj.j-1 );\n //don't want to get input again until it's our turn again\n engine.unbindEvents( agents[currentAgent] );\n incrementCurrentAgent();\n }\n }\n //move down\n else if ( s == \"arrowdown\" ) {\n if( gridCellEmpty( obj.i, obj.j+1 ) ) {\n putObjInCell( obj, obj.i, obj.j+1 );\n //don't want to get input again until it's our turn again\n engine.unbindEvents( agents[currentAgent] );\n incrementCurrentAgent();\n }\n }\n else if ( s == \" \" ) {\n //pass your turn\n //don't want to get input again until it's our turn again\n engine.unbindEvents( agents[currentAgent] );\n incrementCurrentAgent();\n }\n}", "function assignKeyboardPainter(evt) {\n if (evt.defaultPrevented) {\n return; // Do nothing if the event was already processed\n }\n switch (evt.keyCode) {\n case 66:\n document\n .getElementById(pegBoard[currentTurn][keyCounter].id)\n .classList.add(\"bluePeg\");\n pegBoard[currentTurn][keyCounter].color = \"bluePeg\";\n document\n .getElementById(pegBoard[currentTurn][keyCounter].id)\n .classList.remove(\"activePeg\", \"emptyPeg\");\n keyCounter++;\n break;\n case 77:\n document\n .getElementById(pegBoard[currentTurn][keyCounter].id)\n .classList.add(\"magentaPeg\");\n pegBoard[currentTurn][keyCounter].color = \"magentaPeg\";\n document\n .getElementById(pegBoard[currentTurn][keyCounter].id)\n .classList.remove(\"activePeg\", \"emptyPeg\");\n keyCounter++;\n break;\n case 71:\n document\n .getElementById(pegBoard[currentTurn][keyCounter].id)\n .classList.add(\"greenPeg\");\n pegBoard[currentTurn][keyCounter].color = \"greenPeg\";\n document\n .getElementById(pegBoard[currentTurn][keyCounter].id)\n .classList.remove(\"activePeg\", \"emptyPeg\");\n keyCounter++;\n break;\n case 79:\n document\n .getElementById(pegBoard[currentTurn][keyCounter].id)\n .classList.add(\"orangePeg\");\n pegBoard[currentTurn][keyCounter].color = \"orangePeg\";\n document\n .getElementById(pegBoard[currentTurn][keyCounter].id)\n .classList.remove(\"activePeg\", \"emptyPeg\");\n keyCounter++;\n break;\n case 87:\n if (newColors.length > 4) {\n document\n .getElementById(pegBoard[currentTurn][keyCounter].id)\n .classList.add(\"whitePeg\");\n pegBoard[currentTurn][keyCounter].color = \"whitePeg\";\n document\n .getElementById(pegBoard[currentTurn][keyCounter].id)\n .classList.remove(\"activePeg\", \"emptyPeg\");\n keyCounter++;\n }\n break;\n case 82:\n if (newColors.length > 4) {\n document\n .getElementById(pegBoard[currentTurn][keyCounter].id)\n .classList.add(\"redPeg\");\n pegBoard[currentTurn][keyCounter].color = \"redPeg\";\n document\n .getElementById(pegBoard[currentTurn][keyCounter].id)\n .classList.remove(\"activePeg\", \"emptyPeg\");\n keyCounter++;\n }\n break;\n case 13:\n // if (game is not won)\n runCheckGuessButton();\n // else reset game\n default:\n return; // Quit when this doesn't handle the key event.\n }\n if (keyCounter > boardCells) {\n setTimeout(function() {\n if (keyCounter > boardCells) {\n Materialize.toast(`Press return to submit your guess.`, 2000);\n } else {\n clearTimeout()\n }\n }, 4000);\n }\n // evt.preventDefault();\n}", "function order() {\r\n\tvar div = document.createElement(\"div\");\r\n\tvar select = document.createElement(\"select\");\r\n\r\n\tif(number !== 0) {\r\n\t\tdefaultChoice = this.value;\r\n\t} \r\n\r\n\t// When an option is changed, reset all choices\r\n\tif((number !== 0) && (this.parentNode.firstChild !== this.parentNode.parentNode.lastChild.lastChild)) {\r\n\t\twhile(this.parentNode.parentNode.lastChild !== this.parentNode) {\r\n\t\t\tthis.parentNode.parentNode.removeChild(this.parentNode.parentNode.lastChild);\r\n\t\t\tif(formCreated) {\r\n\t\t\t\tclearForm();\r\n\t\t\t}\r\n\t\t}\t// End While\r\n\t}\t// End If\r\n\r\n\t// While the last question is being selected and wants to change, it removes the form and choices too.\r\n\tif((number != 0) && (formCreated)) {\r\n\t\tclearForm();\r\n\t}\r\n\r\n //If the last question is changed remove the form and create a new one according to the data\r\n if((number !== 0) && (defaultChoice == this[0].value)) {\r\n\t clearForm();\r\n }\r\n\r\n\t//If the last question is changed, remove the form and create a new one according to the data\r\n\telse if(pokemon[defaultChoice] == undefined) {\r\n\t\tcreateForm();\r\n\t}\r\n\telse {\r\n\t\tcreateSelectOptions(select, div);\r\n\t\tselect.onchange = order;\r\n\t\tdiv.appendChild(select);\r\n\t\tdocument.getElementById(\"orderPokemon\").appendChild(div);\r\n\t\tnumber++;\t// To move to the next choice\r\n\t}\r\n}", "function gameParser(input) {\n TicTacToe.mostRecentCommand = input;\n // console.log(\"GAMEPARSER input: \" + input);\n var inputArray = input.slice(4).split('-');\n // console.log(inputArray);\n var actionParams = eval(\"ttt.\".concat(inputArray[0], \".params\"));\n // console.log(actionParams);\n gameParamString = \"\";\n for (i = 1; i < actionParams + 1; i++) {\n if (i == actionParams) {\n gameParamString = gameParamString.concat(\"'\", inputArray[i], \"'\");\n } else {\n gameParamString = gameParamString.concat(\"'\", inputArray[i], \"',\");\n }\n }\n // console.log(gameParamString);\n eval(\"ttt.\".concat(inputArray[0], \".action(\" + gameParamString + \")\"));\n}", "function set_pa1() {\n\t\t\t\tif (pArr[0].value === false && incrementor < 3) {\n\t\t\tlet x = document.getElementById(\"pa1\");\n\t\t\tx.className = \"set\";\t\t\t\n\t\t\tpArr[0].value = true;\n incrementor ++;\n if (incrementor === 3) {\n\t\tplayGame();}\n\t\t\t}}", "function GamepadControls(game, controls, UpdateInt, UpdateIntPause, Keyboard, SaveGame) {\n\t\t\t\t\t_classCallCheck(this, GamepadControls);\n\n\t\t\t\t\t_get(Object.getPrototypeOf(GamepadControls.prototype), 'constructor', this).call(this, game, controls, UpdateInt, UpdateIntPause, Keyboard, SaveGame);\n\n\t\t\t\t\t// xboxCodeObj is used to describe which code triggers which command, is filled at GamepadControls and used to create final code mappings\n\t\t\t\t\tthis.xboxCodeObj = {\n\t\t\t\t\t\t'buttonJump': [0], // A\n\t\t\t\t\t\t'buttonFire': [2], // X\n\t\t\t\t\t\t'buttonDefend': [1], // B\n\t\t\t\t\t\t'action': [3], // Y\n\t\t\t\t\t\t'prevItem': [4, 6, 12, 14], // LB, LT, digit. right, digit. up\n\t\t\t\t\t\t'nextItem': [5, 7, 13, 15], // RB, RT, digit. left, digt. down\n\t\t\t\t\t\t'pause': [8, 9, 16], // select, start, xbox btn\n\t\t\t\t\t\t'cursorsX': [0], // Left x\n\t\t\t\t\t\t'cursorsY': [1], // Left y\n\t\t\t\t\t\t'fireX': [2], // Right x\n\t\t\t\t\t\t'fireY': [3] // Right y\n\t\t\t\t\t};\n\t\t\t\t\tthis.setDefaultCodeObj();\n\t\t\t\t\t/*\r\n // resulting code maps\r\n this.buttonMap = new Map([\r\n \t[0, this._getCommand('buttonJump.isDown')], // A\r\n \t[2, this._getCommand('buttonFire.isDown')], // X\r\n \t[1, this._getCommand('buttonDefend.isDown')], // B\r\n \t[3, this._getCommand('inventory.action.isDown')], // Y\r\n \t// prevItem\r\n \t[4, this._getCommand('inventory.prevItem.isDown')], // LB\r\n \t[6, this._getCommand('inventory.prevItem.isDown')], // LT\r\n \t[12, this._getCommand('inventory.prevItem.isDown')], // digit. right\r\n \t[14, this._getCommand('inventory.prevItem.isDown')], // digit. up\r\n \t// nextItem\r\n \t[5, this._getCommand('inventory.nextItem.isDown')], // RB\r\n \t[7, this._getCommand('inventory.nextItem.isDown')], // RT\r\n \t[13, this._getCommand('inventory.nextItem.isDown')], // digit. left\r\n \t[15, this._getCommand('inventory.nextItem.isDown')], // digt. down\r\n \t// pause\r\n \t[8, this._getCommand('pause.isDown')], // select\r\n \t[9, this._getCommand('pause.isDown')], // start\r\n \t[16, this._getCommand('pause.isDown')] // xbox btn\r\n ]);\r\n this.leftAxisMap = new Map([\r\n \t[0, [[this._getCommand('cursors.left.isDown'), this._getCommand('cursors.right.isDown'), this._getCommand('buttonRun.isDown')], [this.minDistance, this.minDistance, this.minRunDistance]]], // Left x\r\n \t[1, [[this._getCommand('cursors.up.isDown'), this._getCommand('cursors.down.isDown')], [this.minDistance, this.minDistance]]] // Left y\r\n ]);\r\n this.rightAxisMap = new Map([\r\n \t[2, [[this._getCommand('fireTempG.left.isDown'), this._getCommand('fireTempG.right.isDown')], [this.minFireDistance, this.minFireDistance], [this._getCommand('fire.left.isDown'), this._getCommand('fire.right.isDown')]]], // Right x\r\n \t[3, [[this._getCommand('fireTempG.up.isDown'), this._getCommand('fireTempG.down.isDown')], [this.minFireDistance, this.minFireDistance], [this._getCommand('fire.up.isDown'), this._getCommand('fire.down.isDown')]]] // Right y\r\n ]);\r\n */\n\t\t\t\t}", "function move(event){\n var lastGame = [];\n for(var i=0; i<GAME.length; i++){\n lastGame.push(GAME[i].slice());\n }\n if(event.keyCode == 37){\n for(var i=0; i<GAME.length; i++){\n GAME[i] = joinRow(GAME[i]);\n }\n }\n else if(event.keyCode == 38){\n for(var i=0; i<GAME[0].length; i++){\n var column = [];\n for(var j=0; j<GAME.length; j++){\n column.push(GAME[j][i]);\n }\n column = joinRow(column);\n for(var j=0; j<column.length; j++){\n GAME[j][i] = column[j];\n }\n }\n }\n else if(event.keyCode == 39){\n for(var i=0; i<GAME.length; i++){\n var row = [];\n for(var j=GAME[i].length-1; j>=0; j--){\n row.push(GAME[i][j]);\n }\n row = joinRow(row);\n GAME[i] = [];\n for(var j=row.length-1; j>=0; j--){\n GAME[i].push(row[j]);\n }\n }\n }\n else if(event.keyCode == 40){\n for(var i=0; i<GAME[0].length; i++){\n var column = [];\n for(var j=GAME.length-1; j>=0; j--){\n column.push(GAME[j][i]);\n }\n column = joinRow(column);\n for(var j=column.length-1; j>=0; j--){\n GAME[j][i] = column[column.length-1-j];\n }\n }\n }\n if(!arrayComp2D(lastGame, GAME)){\n add();\n showGame();\n }\n}", "function keyPressed(e) {\n if (e.keyCode == 90) {\n controlBlock.ascend = true;\n } else if (e.keyCode == 83) {\n controlBlock.descend = true;\n }\n\n if (e.keyCode == 38) {\n opponentBlock.ascend = true;\n } else if (e.keyCode == 40) {\n opponentBlock.descend = true;\n }\n}", "function answerOrder() {\n if (order==1) {\n document.getElementById(\"top\").textContent = window[currentSong + \"h\"].realTitle;\n document.getElementById(\"middle\").textContent = window[currentSong + \"h\"].incorrect1;\n document.getElementById(\"bottom\").textContent = window[currentSong + \"h\"].incorrect2;\n } else if (order==2) {\n document.getElementById(\"top\").textContent = window[currentSong + \"h\"].incorrect1;\n document.getElementById(\"middle\").textContent = window[currentSong + \"h\"].realTitle;\n document.getElementById(\"bottom\").textContent = window[currentSong + \"h\"].incorrect2;\n } else {\n document.getElementById(\"top\").textContent = window[currentSong + \"h\"].incorrect1;\n document.getElementById(\"middle\").textContent = window[currentSong + \"h\"].incorrect2;\n document.getElementById(\"bottom\").textContent = window[currentSong + \"h\"].realTitle;\n\n }\n}", "function updateOrder(){\n\t\t\telement.find(\"li\").each(function(i){\n\t\t\t\ti++;\n\t\t\t\tvar li = $(this);\n\t\t\t\tli.find(\"input.order\").val(i);\n\t\t\t});\n\t\t}", "function move(e){\r\n // Turns 4x4 grid into 1x16 array\r\n let flatGame = [...gameBoard[0], ...gameBoard[1], ...gameBoard[2], ...gameBoard[3]];\r\n if (e.code === \"ArrowUp\"){\r\n rotateGrid(gameBoard);\r\n addRightwards(gameBoard);\r\n rotateGrid(gameBoard);\r\n rotateGrid(gameBoard);\r\n rotateGrid(gameBoard);\r\n validateMove(flatGame);\r\n } else if (e.code === \"ArrowDown\"){\r\n rotateGrid(gameBoard);\r\n rotateGrid(gameBoard);\r\n rotateGrid(gameBoard);\r\n addRightwards(gameBoard);\r\n rotateGrid(gameBoard);\r\n validateMove(flatGame);\r\n } else if (e.code === \"ArrowLeft\"){\r\n rotateGrid(gameBoard);\r\n rotateGrid(gameBoard);\r\n addRightwards(gameBoard);\r\n rotateGrid(gameBoard);\r\n rotateGrid(gameBoard);\r\n validateMove(flatGame);\r\n } else if (e.code === \"ArrowRight\"){\r\n addRightwards(gameBoard);\r\n validateMove(flatGame);\r\n } else {\r\n console.log(\"Invalid key\");\r\n }\r\n updateTiles();\r\n // Checks that the game is over\r\n gameOver();\r\n}", "function updateGame(key) {\r\n\tif(key.keyCode == 37)\r\n\t{\r\n\t\tif(playerLocation[0] >= 2)\r\n\t\t{\r\n\t\tplayerLocation[0] = playerLocation[0] - 1;\r\n\t\t}\r\n\t}\r\n\tif(key.keyCode == 38) {\r\n\t\tif(playerLocation[1] >= 2)\r\n\t\t{\r\n\t\tplayerLocation[1] = playerLocation [1] - 1;\r\n\t\t}\r\n\t}\r\n\tif(key.keyCode == 39) {\r\n\t\tif(playerLocation[0] <= 9)\r\n\t\t{\r\n\t\tplayerLocation[0] = playerLocation [0] + 1;\r\n\t\t}\r\n\t}\r\n\tif(key.keyCode == 40) {\r\n\t\tif(playerLocation[1] <=9)\r\n\t\t{\r\n\t\tplayerLocation[1] = playerLocation [1] + 1;\r\n\t\t}\r\n\t}\r\n\tdocument.getElementById('playerLocation').innerHTML = playerLocation;\r\n}", "scangamepads() {\n var gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\n for (var i = 0; i < gamepads.length; i++) {\n if (gamepads[i]) {\n if (!(gamepads[i].index in this.controllers)) {\n this.addGamepad(gamepads[i]);\n } else {\n this.controllers[gamepads[i].index] = gamepads[i];\n }\n }\n }\n }", "registerPlayerEvent() {\n document.addEventListener('keydown', (event) => {\n const keyCode = event.keyCode;\n switch (keyCode) {\n case UP: //z\n this.moveUp = true;\n this.orientation['Y'] = 'up';\n break;\n case DOWN: //s\n this.orientation['Y'] = 'down';\n this.moveDown = true;\n break;\n case RIGHT: //d\n this.orientation['X'] = 'right';\n this.moveRight = true;\n break;\n case LEFT: //q\n this.orientation['X'] = 'left';\n this.moveLeft = true;\n break;\n case SPACE: //spaceBar\n // this.isShooting = true;\n this.inventory.currentGun.isShooting = true;\n break;\n case 69: //spaceBar\n }\n this.keypressed[keyCode] = true;\n }\n );\n\n\n document.addEventListener('keyup', (event) => {\n const keyCode = event.keyCode;\n\n switch (keyCode) {\n case UP: //z\n this.lastKeyPressed = keyCode;\n this.moveUp = false;\n break;\n case DOWN: //s\n this.lastKeyPressed = keyCode;\n this.moveDown = false;\n break;\n case RIGHT: //d\n this.lastKeyPressed = keyCode;\n this.moveRight = false;\n break;\n case LEFT: //q\n this.lastKeyPressed = keyCode;\n this.moveLeft = false;\n break;\n case SPACE: //spaceBar\n // this.isShooting = false;\n this.inventory.currentGun.isShooting = false;\n this.keypressed[keyCode] = false; //Wtf ?\n break;\n }\n this.keypressed[keyCode] = false;\n }\n )\n }", "function inputKeyUp(e) {\n e.which = e.which || e.keyCode;\n if(e.which == 13) {\n testString = document.getElementById(\"input\").value;\n\t\tdocument.getElementById(\"reversal\");\n\t\tdocument.getElementById(\"alphabetical\");\n\t\tdocument.getElementById(\"palindrome\");\n\t\treversal(testString);\n\t\talphabits(testString);\n\t\tpalindrome(testString);\n }\n}", "handleKeyDown(event) {\n const { selectionStart, selectionEnd } = event.target;\n // Tab is pressed (first loop)\n if (\n event.key === \"Tab\" &&\n !event.shiftKey &&\n selectionStart < this.props.limitLength &&\n this.state.tabbedOut === false\n ) {\n event.preventDefault();\n const diff = this.findDelta(event);\n this.setState((prevState) => ({\n inputVal:\n prevState.inputVal.substring(0, selectionStart) +\n \"\\t\".repeat(diff) +\n prevState.inputVal.substring(selectionEnd),\n }));\n }\n // Tab is pressed after looping\n else if (\n event.key === \"Tab\" &&\n !event.shiftKey &&\n selectionStart < this.props.limitLength &&\n this.state.tabbedOut === true\n ) {\n event.preventDefault();\n const diff = this.findDelta(event);\n event.target.selectionStart = event.target.selectionEnd =\n selectionStart + diff;\n }\n // Tab is pressed at very end of input\n else if (\n event.key === \"Tab\" &&\n !event.shiftKey &&\n selectionStart >= this.props.limitLength\n ) {\n event.preventDefault();\n event.target.selectionStart = event.target.selectionEnd = 0;\n this.setState({ tabbedOut: true });\n }\n /* still working on this, not sure if required */\n // Shift + Tab is pressed\n else if (\n event.key === \"Tab\" &&\n event.shiftKey &&\n selectionStart <= this.props.problem.length &&\n selectionStart > 0\n ) {\n event.preventDefault();\n /*let diff = this.findDeltaReverse(event);\n if (diff === 0) {\n event.target.selectionStart = event.target.selectionEnd = 0;\n } else {\n event.target.selectionStart = event.target.selectionEnd =\n selectionStart - diff;\n }*/\n }\n // Shift + Tab at 0 and with no content\n else if (\n event.key === \"Tab\" &&\n event.shiftKey &&\n selectionStart === 0 &&\n this.state.tabbedOut === false\n ) {\n event.preventDefault();\n }\n // Shift + Tab at 0 with previous content\n else if (\n event.key === \"Tab\" &&\n event.shiftKey &&\n selectionStart === 0 &&\n this.state.tabbedOut === true\n ) {\n event.preventDefault();\n event.target.selectionStart = event.target.selectionEnd = this.props.limitLength;\n }\n }", "function getInput(e) {\n\tif(!e) { var e = window.event; }\n\t\n\t// Preventing the defult browser controls to prevent unwanted scrolling.\n\te.preventDefault();\n\t\n\tif(isGameOver != true) {\n\t\tswitch(e.keyCode) {\n\t\t\t\n\t\t\t// 2 different keycodes so both arrows and WASD work for moving pieces.\n\t\t\tcase 65: {}\n\t\t\tcase 37: \n\t\t\tif(checkMove(ourPiece.gridX - 1, ourPiece.gridY, ourPiece.curState)) {\n\t\t\t\tourPiece.gridX--;\n\t\t\t}\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 68: {}\n\t\t\tcase 39:\n\t\t\tif(checkMove(ourPiece.gridX + 1, ourPiece.gridY, ourPiece.curState)) {\n\t\t\t\tourPiece.gridX++;\n\t\t\t}\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 87: {}\n\t\t\tcase 38:\n\t\t\t{\n\t\t\tvar newState = ourPiece.curState - 1;\n\t\t\t\n\t\t\tif(newState < 0) \n\t\t\t\tnewState = ourPiece.states.length - 1;\n\t\t\t\n\t\t\t\n\t\t\tif(checkMove(ourPiece.gridX, ourPiece.gridY, newState)) \n\t\t\t\tourPiece.curState = newState;\n\t\t\t}\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 83: {}\t\n\t\t\tcase 40:\n\t\t\tif(checkMove(ourPiece.gridX, ourPiece.gridY + 1, ourPiece.curState)) {\n\t\t\t\tourPiece.gridY++;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}\n\telse {\n\t\t// If game is over send score to highscore update function and inform player of his achievings and ask if he wants to play again.\n\t\tupdateHiScore(score);\n\t\tvar newGame = prompt(\"You got \" + currentLines + \" lines. \\nYour score was: \" + score + \"\\nStart new game? (y/n)\");\n\t\tif(newGame === \"y\") {\n\t\t\tinitGame();\n\t\t} \n\t}\n}", "function keyUp() {\n for (let i = 0; i < 4; i++) {\n //Merging all like\n if (board[0 + i] == board[4 + i] && board[0 + i] != 0) {\n currentScore += board[0 + i]\n board[0 + i] += board[4 + i]\n if (board[8 + i] == board[12 + i]) {\n currentScore += board[4 + i]\n board[4 + i] = board[8 + i] + board[12 + i]\n board[8 + i] = 0\n board[12 + i] = 0\n }\n else {\n board[4 + i] = board[8 + i]\n board[8 + i] = board[12 + i]\n board[12 + i] = 0\n }\n }\n else if (board[0 + i] == board[8 + i] && board[0 + i] != 0 && board[4 + i] == 0) {\n currentScore += board[0 + i]\n board[0 + i] += board[8 + i]\n board[4 + i] = board[12 + i]\n board[8 + i] = 0\n board[12 + i] = 0\n }\n else if (board[0 + i] == board[12 + i] && board[0 + i] != 0 && board[4 + i] == 0 && board[8 + i] == 0) {\n currentScore += board[0 + i]\n board[0 + i] += board[12 + i]\n board[4 + i] = 0\n board[8 + i] = 0\n board[12 + i] = 0\n }\n else if (board[4 + i] == board[8 + i] && board[4 + i] != 0) {\n currentScore += board[4 + i]\n board[4 + i] += board[8 + i]\n board[8 + i] = board[12 + i]\n board[12 + i] = 0\n }\n else if (board[4 + i] == board[12 + i] && board[4 + i] != 0 && board[8 + i] == 0) {\n currentScore += board[4 + i]\n board[4 + i] += board[12 + i]\n board[8 + i] = 0\n board[12 + i] = 0\n }\n else if (board[8 + i] == board[12 + i] && board[8 + i] != 0) {\n currentScore += board[8 + i]\n board[8 + i] += board[12 + i]\n board[12 + i] = 0\n }\n //Removing Zero and shifting\n for (let j = 0; j < 3; j++) {\n if (board[i + 0] == 0) {\n board[i + 0] = board[i + 4]\n board[i + 4] = board[i + 8]\n board[i + 8] = board[i + 12]\n board[i + 12] = 0\n }\n if (board[i + 4] == 0) {\n board[i + 4] = board[i + 8]\n board[i + 8] = board[i + 12]\n board[i + 12] = 0\n }\n if (board[i + 8] == 0) {\n board[i + 8] = board[i + 12]\n board[i + 12] = 0\n }\n }\n }\n}", "update() {\n if (this.scene.input.gamepad.total) {\n this.pad =\n this.scene.input.gamepad.getPad(0) || this.scene.input.gamepad.pad1;\n }\n }", "InitInput()\n {\n this.keycodeA = this.scene.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.A);\n this.keycodeD = this.scene.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.D);\n this.keycodeW =this.scene.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.W);\n this.keycodeSpace = this.scene.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.SPACE);\n this.damage = this.scene.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.Y);\n this.keycodeShift = this.scene.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.SHIFT);\n this.recoverLetter = this.scene.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.X);\n }", "setupKeys () {\n this.inputKeys[this.keyMap['job']].onDown.add(() => {\n this.selectionMode = 'job';\n });\n\n this.inputKeys[this.keyMap['info']].onDown.add(() => {\n this.selectionMode = 'info';\n });\n }", "function keyTyped(){\n if(playY > 0){\n if(key === \"w\"){\n playY --;\n grid[playY][playX]=2;\n }\n }\n if (playY < cols-1){\n if (key === \"s\"){\n playY ++;\n grid[playY][playX]=2;\n }\n }\n if (playX < cols-1 ){\n if (key === \"d\"){\n playX ++;\n grid[playY][playX]=2;\n }\n }\n if (playX > 0){\n if (key === \"a\"){\n playX --;\n grid[playY][playX]=2;\n }\n //////////////////////////////////////////////////////////\n //player 2\n //you must move the 1st player to be able to move player 2\n\n if(play2Y > 0){\n if(key === \"i\"){\n play2Y --;\n grid[play2Y][play2X]=3;\n }\n }\n if (play2Y < cols-1){\n if (key === \"k\"){\n play2Y ++;\n grid[play2Y][play2X]=3;\n }\n }\n if (play2X < cols-1 ){\n if (key === \"l\"){\n play2X ++;\n grid[play2Y][play2X]=3;\n }\n }\n if (play2X > 0){\n if (key === \"j\"){\n play2X --;\n grid[play2Y][play2X]=3;\n }\n }\n }\n}", "handlePCInputKeyDown(ev){\n EventUtils.filterNumericInput(ev)\n }", "function registerInputsRight() {\n inputRightIds['j'] = myKeyboard.registerHandler(function() {\n model.moveSingleDown();\n },\n 'j', false\n );\n inputRightIds['u'] = myKeyboard.registerHandler(function() {\n model.moveSingleUp();\n },\n 'u', false\n );\n\n inputRightIds['k'] = myKeyboard.registerHandler(function(elapsedTime) {\n model.moveRepeatDown(elapsedTime);\n },\n 'k', true\n );\n inputRightIds['i'] = myKeyboard.registerHandler(function(elapsedTime) {\n model.moveRepeatUp(elapsedTime);\n },\n 'i', true\n );\n\n inputRightIds['l'] = myKeyboard.registerHandler(function() {\n model.moveRepeatTimedDown();\n },\n 'l', true, 250\n );\n inputRightIds['o'] = myKeyboard.registerHandler(function() {\n model.moveRepeatTimedUp();\n },\n 'o', true, 250\n );\n }", "keyCommands(){\n let ret = \"\"\n \n if(this.keyDirection === 38){\n console.log(this.count, this.prevCom.length)\n }\n ret = this.prevCom[this.prevCom.length - this.count];\n this.count++;\n if (this.count >= this.prevCom.length){\n this.count = this.prevCom.length;\n \n if(this.count <=1){\n ret = \"\";\n }\n \n }\n if(this.keyDirection === 40){\n this.count--;\n if (this.count <= 1){\n this.count = 1;\n ret = \"\";\n }\n ret = this.prevCom[this.prevCom.length- this.count];\n \n }\n return ret;\n }", "processUserInput() {\n this.state.clearControllers();\n this.state.flags[Defines.INPUT] = false;\n this.state.flags[Defines.HADMATCH] = false;\n this.state.vars[Defines.UNKNOWN_WORD] = 0;\n this.state.vars[Defines.LAST_CHAR] = 0;\n\n // If opening of the menu was \"triggered\" in the last cycle, we open it now before processing the rest of the input.\n if (this.state.menuOpen) {\n this.menu.menuInput();\n }\n\n // F12 shows the priority and control screens.\n if (this.userInput.keys[123] && !userInput.oldKeys[123]) {\n while (this.userInput.keys[123]);\n this.commands.showPriorityScreen();\n }\n\n // Handle arrow keys.\n if (this.state.userControl) {\n if (this.state.holdKey) {\n // In \"hold key\" mode, the ego direction directly reflects the direction key currently being held down.\n let direction = 0;\n if (this.userInput.Keys[38]) direction = 1; // UP\n if (this.userInput.Keys[33]) direction = 2; // PAGEUP\n if (this.userInput.Keys[39]) direction = 3; // RIGHT\n if (this.userInput.Keys[34]) direction = 4; // PAGEDOWN\n if (this.userInput.Keys[40]) direction = 5; // DOWN\n if (this.userInput.Keys[35]) direction = 6; // END\n if (this.userInput.Keys[37]) direction = 7; // LEFT\n if (this.userInput.Keys[36]) direction = 8; // HOME\n this.state.vars[Defines.EGODIR] = direction;\n }\n else {\n // Whereas in \"release key\" mode, the direction key press will toggle movement in that direction.\n let direction = 0;\n if (this.userInput.keys[38] && !this.userInput.oldKeys[38]) direction = 1; // UP\n if (this.userInput.keys[33] && !this.userInput.oldKeys[33]) direction = 2; // PAGEUP\n if (this.userInput.keys[39] && !this.userInput.oldKeys[39]) direction = 3; // RIGHT\n if (this.userInput.keys[34] && !this.userInput.oldKeys[34]) direction = 4; // PAGEDOWN\n if (this.userInput.keys[40] && !this.userInput.oldKeys[40]) direction = 5; // DOWN\n if (this.userInput.keys[35] && !this.userInput.oldKeys[35]) direction = 6; // END\n if (this.userInput.keys[37] && !this.userInput.oldKeys[37]) direction = 7; // LEFT\n if (this.userInput.keys[36] && !this.userInput.oldKeys[36]) direction = 8; // HOME\n if (direction > 0) {\n this.state.vars[Defines.EGODIR] = (this.state.vars[Defines.EGODIR] == direction ? 0 : direction);\n }\n }\n }\n\n // Check all waiting characters.\n let ch;\n while ((ch = this.userInput.getKey()) > 0) {\n // Check controller matches. They take precedence.\n if (this.state.keyToControllerMap.has(ch)) {\n this.state.controllers[this.state.keyToControllerMap[ch]] = true;\n }\n else if ((ch >= (0x80000 + 'A'.charCodeAt(0))) && (ch <= (0x80000 + 'Z'.charCodeAt(0))) && \n (this.state.keyToControllerMap.has(0x80000 + String.fromCharCode(ch - 0x80000).toLowerCase().charCodeAt(0)))) {\n // We map the lower case alpha chars in the key map, so check for upper case and convert to\n // lower when setting controller state. This allows for if the user has CAPS LOCK on.\n this.state.controllers[this.state.keyToControllerMap[0x80000 + String.fromCharCode(ch - 0x80000).toLowerCase().charCodeAt(0)]] = true;\n }\n else if ((ch & 0xF0000) == 0x80000) // Standard char from a keypress event. \n {\n this.state.vars[Defines.LAST_CHAR] = (ch & 0xff);\n\n if (this.state.acceptInput) {\n // Handle normal characters for user input line.\n if ((this.state.strings[0].length + (this.state.cursorCharacter != '' ? 1 : 0) + this.state.currentInput.length) < Defines.MAXINPUT)\n {\n this.state.currentInput += String.fromCharCode(ch & 0xff);\n }\n }\n }\n else if ((ch & 0xFF) == ch) // Unmodified Keys value, i.e. there is no modifier. \n {\n this.state.vars[Defines.LAST_CHAR] = (ch & 0xff);\n\n if (this.state.acceptInput) {\n // Handle enter and backspace for user input line.\n switch (ch) {\n case 13: // ENTER\n if (this.state.currentInput.length > 0)\n {\n this.parser.parse(this.state.currentInput);\n this.state.lastInput = this.state.currentInput;\n this.state.currentInput = '';\n }\n while (this.userInput.keys[13]) { /* Wait until ENTER released */ }\n break;\n\n case 8: // BACK\n if (this.state.currentInput.length > 0) {\n this.state.currentInput = this.state.currentInput.slice(0, -1);\n }\n break;\n }\n }\n }\n }\n }", "function populateAnswerKey() {\n // order array get shuffled.\n // Index of value 0 is where correct answer will populate on page.\n shuffle(questionOrder);\n // console.log(questionOrder);\n answerKey[questionCount] = questionOrder.indexOf(0);\n // console.log(answerKey);\n}", "function jTAC_StdNumberCmds(cmdKeys, fp) {\r\n cmdKeys.push(\r\n {commandName: \"NextBy1\", keyCode: 38 }, // up arrow\r\n {commandName: \"PrevBy1\", keyCode: 40 }); // down arrow\r\n if (fp) {\r\n cmdKeys.push(\r\n {commandName: \"NextByPt1\", keyCode: 38, ctrl: true }, // Page up\r\n {commandName: \"PrevByPt1\", keyCode: 40, ctrl: true}) // Page down\r\n }\r\n return cmdKeys;\r\n}", "function setMovement(keys) {\r\n switch (keys) {\r\n case \"ArrowUp\":\r\n\r\n inputDirection.x = 0;\r\n inputDirection.y = -1;\r\n break;\r\n case \"ArrowDown\":\r\n\r\n inputDirection.x = 0;\r\n inputDirection.y = 1;\r\n break;\r\n case \"ArrowLeft\":\r\n\r\n inputDirection.x = -1;\r\n inputDirection.y = 0;\r\n break;\r\n case \"ArrowRight\":\r\n\r\n inputDirection.x = 1;\r\n inputDirection.y = 0;\r\n break;\r\n case \"Enter\":\r\n inputDirection.x = 0;\r\n inputDirection.y = 0;\r\n break;\r\n }\r\n\r\n}", "function handleKeyInput() {\n\t\t\tif(keys.isPressed(keyCodes.UP) && !(\"UP\" in keyBurns) && selectedLane > 0 && timeSinceSelection <= 0) {\n\t\t\tselectedLane--;\n\t\t\tlanes[selectedLane+1].unhighlight();\n\t\t\tlanes[selectedLane].highlight();\n\t\t\tcar.moveTo(lanes[selectedLane].getYCenter());\n\t\t\tkeyBurns[\"UP\"] = 10;\n\t\t}\n\t\telse if(keys.isPressed(keyCodes.DOWN) && !(\"DOWN\" in keyBurns) && selectedLane < 3 && timeSinceSelection <= 0) {\n\t\t\tselectedLane++;\n\t\t\tlanes[selectedLane-1].unhighlight();\n\t\t\tlanes[selectedLane].highlight();\n\t\t\tcar.moveTo(lanes[selectedLane].getYCenter());\n\t\t\tkeyBurns[\"DOWN\"] = 10;\n\t\t}\n\t\tif(keys.isPressed(keyCodes.SPACE) && !(\"SPACE\" in keyBurns) && selectedLane >= 0 && selectedLane <= 3 && timeSinceSelection <= 0) {\n\t\t\tif(gameStarted) {\n\t\t\t\tif(lanes[selectedLane].getAnswer() == question.term)\n\t\t\t\t\thandleCorrectAnswer();\n\t\t\t\telse handleIncorrectAnswer();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif(selectedLane == 3)\n\t\t\t\t\tstartGame();\n\t\t\t}\n\t\t\tcar.moveTo(lanes[selectedLane].getYCenter());\n\t\t\tkeyBurns[\"SPACE\"] = 15;\n\t\t}\n\t\tfor(var i in keyBurns) {\n\t\t\tkeyBurns[i]--;\n\t\t\tif(keyBurns[i] == 0)\n\t\t\t\tdelete keyBurns[i];\n\t\t}\n\t}", "startGame() {\r\n // Add value attr to qwerty button elements\r\n const keyButtons = document.querySelectorAll(`button.key`);\r\n for (let i = 0; i < keyButtons.length; i++) {\r\n keyButtons[i].value = keyButtons[i].textContent;\r\n }\r\n // hide screen overlay\r\n const overlay = document.querySelector('#overlay');\r\n overlay.style.display = 'none';\r\n // call getRandomPhrase() to get phrase from array, store in activePhrase\r\n this.activePhrase = this.getRandomPhrase();\r\n // add the phrase to gameboard w/ addPhraseToDisplay()\r\n this.activePhrase.addPhraseToDisplay();\r\n\r\n }" ]
[ "0.649522", "0.6433406", "0.6014376", "0.6013471", "0.58738744", "0.5836327", "0.5830031", "0.5792323", "0.5785564", "0.57520384", "0.572038", "0.57070404", "0.57055527", "0.5665696", "0.5656995", "0.56430066", "0.56107724", "0.56047666", "0.55956495", "0.55859685", "0.55742824", "0.55618846", "0.5550684", "0.55367166", "0.5532269", "0.55278975", "0.54796034", "0.547278", "0.54668635", "0.5454123", "0.5444195", "0.5424418", "0.54019123", "0.54011035", "0.5384861", "0.5373041", "0.5356985", "0.5354302", "0.531588", "0.53139126", "0.53068775", "0.530364", "0.530302", "0.52891064", "0.5276795", "0.52654505", "0.52612484", "0.525251", "0.52517927", "0.52483857", "0.5238531", "0.52309304", "0.5228156", "0.52265924", "0.5225376", "0.5209308", "0.5208202", "0.52039075", "0.51972014", "0.51957273", "0.51874655", "0.5187008", "0.5184113", "0.51791865", "0.5177356", "0.51677865", "0.5164976", "0.5163549", "0.5149796", "0.5147541", "0.514465", "0.51362866", "0.5129704", "0.51295877", "0.51259947", "0.51135415", "0.5111456", "0.51082164", "0.5105962", "0.51055694", "0.51032686", "0.5098327", "0.5098236", "0.5092899", "0.50927496", "0.50924724", "0.5091039", "0.5089209", "0.5087853", "0.50832915", "0.5078435", "0.50746214", "0.5072269", "0.5070615", "0.5069351", "0.5059545", "0.50554085", "0.50540715", "0.5048861", "0.50457025" ]
0.6197832
2
Convert Markdown to HTML Markup
function markdownToMarkup(markdown, callback) { var url = githubRepoActionURL(['markdown']) + '?mode=gfm'; request.post({ url: url, json: { text: markdown } }, handleResponse(200, true, function(err, markup) { if (err) { return callback(err); } callback(null, markup); })); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function convertHTMLtoMarkdown() {\n\n}", "function md2html (md) {\n return mdit.render(md)\n}", "transformMarkdown(params) {\n if (!params.markdown) {\n return { __html: '' };\n }\n return { __html: markdownIt.render(params.markdown) };\n }", "function mdToHtml(input) {\n let rule = myna.allRules['markdown.document'];\n let ast = myna.parse(rule, input);\n return mdAstToHtml(ast, []).join(\"\");\n}", "convertToHTML(text) {\n var textHTML = marked(text, { sanitize: true });\n var markupHTML = {\n __html: textHTML\n };\n return markupHTML;\n }", "function convertMarkdown(md, node, intoSpan) {\n var marker = '%converted%';\n while (node.outerHTML.indexOf(marker) >= 0) { marker += '%' };\n var saved = [];\n function save(html) {\n return '<p>' + marker + saved.push(html) + '</p>';\n }\n \n var needsConversion = false;\n var children = Array.prototype.map.call(node.childNodes, function(node) {\n if (node.nodeType == Node.TEXT_NODE) {\n // only need to call Markdown converter when there is text to convert\n needsConversion = needsConversion || /\\S/.test(node.textContent);\n return node.textContent;\n }\n if (node.nodeType == Node.COMMENT_NODE) {\n return '\\n';\n }\n if (node.classList.contains('no-markdown') || node.tagName == 'OBJECT') {\n return save(node.outerHTML);\n }\n if (node.tagName == 'BR') {\n return node.outerHTML;\n }\n return save(node.outerHTML.replace(node.innerHTML,\n convertMarkdown(md, node, [\n 'SPAN', 'EM', 'STRONG', 'STRIKE', 'CODE', 'SUB', 'SUP'\n ].indexOf(node.tagName) >= 0).trim()));\n });\n var text = children.join('');\n var html = needsConversion ? md.makeHtml((intoSpan ? '# ' : '') + text) : text;\n if (intoSpan) {\n html = html.replace(/<h1>(.*)<\\/h1>/, '$1');\n }\n \n saved.forEach(function(result, idx) {\n html = html.replace('<p>' + marker + (idx+1) + '</p>', result);\n });\n \n //if (needsConversion) {\n // console.log('convert', children, '\\u2192', html);\n //} else {\n // console.log('-------', children, '\\u2713', html);\n //}\n return html;\n}", "function markdown(markdown) {\n return mdast()\n .use([stripBadges, squeezeParagraphs, highlight, html])\n .process(markdown)\n}", "function PostToHTML(relpath, markdown_body) {\n var callback = function (text) {\n\n /* circumvent github's auto-meta parsing */\n text = text.replace(\"(((\",'---');\n text = text.replace(\")))\",'---');\n\n /* write some HTML to format the data */\n var body = document.getElementById(markdown_body);\n var post_head = document.createElement('div');\n var post_body = document.createElement('div');\n body.appendChild(post_head);\n body.appendChild(post_body);\n\n if ((isBlank(text)) || (text == null) || (text == 'null') || (typeof text === 'undefined')) {\n post_head.innerHTML = 'Unable to load text for: '+relpath;\n return;\n }\n\n /* parse YAML header */\n var obj = jsyaml.loadFront(text)\n\n /* check for post meta data */\n var date = typeof obj.Date !== 'undefined' ? obj.Date.toDateString() : '';\n var author = typeof obj.Author !== 'undefined' ? obj.Author : '';\n var summary = typeof obj.Summary !== 'undefined' ? obj.Summary : '';\n var title = typeof obj.Title !== 'undefined' ? obj.Title : '';\n\n /* write some HTML to format the data */\n post_head.innerHTML = '<b>'+title+'</b><br> &nbsp; &nbsp; '+author+\n ' | <small>'+date+'</small><br><br>';\n\n /* convert the unparsed content as markdown */\n post_body.innerHTML = Showdown(obj.__content);\n $('.linenums').removeClass('linenums');\n prettyPrint();\n };\n getFile(relpath, callback);\n}", "function renderMarkdown(text) {\n var converter = new showdown.Converter({tables: true, strikethrough: true});\n document.getElementById(\"post-content\").innerHTML = converter.makeHtml(text);\n loadMathJax()\n document.querySelectorAll('pre code').forEach((block) => {\n hljs.highlightBlock(block);\n });\n}", "function ConvertToHtml(text) {\n\tlet md = GetMarkdownIt();\n\tlet body = md.render(text);\n\tlet view = {\n\t\tstyle: style,\n\t\tcontent: body\n\t};\n\t// Compile the template\n\treturn mustache.render(template, view);\n}", "function markdown(text, ex, tag) {\n\t\tvar regex = new RegExp(ex, 'gm');\n\t\tvar subst = '<' + tag + '>$1</' + tag + '>';\n\t\treturn text.replace(regex, subst);\n\t}", "function PrettyMarkdownTextToHTML(text, markdown_div)\n{\n html = Showdown(text);\n fillDiv(html, markdown_div);\n $('.linenums').removeClass('linenums');\n prettyPrint();\n}", "function saveChanges() {\n convertHTMLtoMarkdown();\n}", "preprocess(markdown) {\n return markdown;\n }", "function renderMarkdown(options) {\n // Unpack the options.\n var host = options.host, source = options.source, trusted = options.trusted, sanitizer = options.sanitizer, resolver = options.resolver, linkHandler = options.linkHandler, latexTypesetter = options.latexTypesetter, shouldTypeset = options.shouldTypeset;\n // Clear the content if there is no source.\n if (!source) {\n host.textContent = '';\n return Promise.resolve(undefined);\n }\n // Separate math from normal markdown text.\n var parts = latex_1.removeMath(source);\n // Render the markdown and handle sanitization.\n return Private.renderMarked(parts['text']).then(function (content) {\n // Restore the math content in the rendered markdown.\n content = latex_1.replaceMath(content, parts['math']);\n // Santize the content it is not trusted.\n if (!trusted) {\n content = sanitizer.sanitize(content);\n }\n // Set the inner HTML of the host.\n host.innerHTML = content;\n if (host.getElementsByTagName('script').length > 0) {\n console.warn('JupyterLab does not execute inline JavaScript in HTML output');\n }\n // TODO arbitrary script execution is disabled for now.\n // Eval any script tags contained in the HTML. This is not done\n // automatically by the browser when script tags are created by\n // setting `innerHTML`. The santizer should have removed all of\n // the script tags for untrusted source, but this extra trusted\n // check is just extra insurance.\n // if (trusted) {\n // // TODO really want to run scripts?\n // Private.evalInnerHTMLScriptTags(host);\n // }\n // Handle default behavior of nodes.\n Private.handleDefaults(host);\n // Apply ids to the header nodes.\n Private.headerAnchors(host);\n // Patch the urls if a resolver is available.\n var promise;\n if (resolver) {\n promise = Private.handleUrls(host, resolver, linkHandler);\n }\n else {\n promise = Promise.resolve(undefined);\n }\n // Return the rendered promise.\n return promise;\n }).then(function () {\n if (shouldTypeset && latexTypesetter) {\n latexTypesetter.typeset(host);\n }\n });\n}", "function MarkdownToHTML(relpath, markdown_div)\n{\n var callback = function (text) {\n html = Showdown(text);\n fillDiv(html, markdown_div);\n $('.linenums').removeClass('linenums');\n prettyPrint();\n };\n getFile(relpath, callback);\n}", "function markdownwiki(options) {\n options = options || {};\n // Enable HTML tags in source\n options.html = options.html == null ? true : options.html;\n // Autoconvert URL-like text to links\n options.linkify = options.linkify == null ? true : options.linkify;\n // Enable some language-neutral replacement + quotes beautification\n options.typographer = options.typographer == null ? true : options.typographer;\n // Convert '\\n' in paragraphs into <br>\n options.breaks = options.breaks == null ? false : options.breaks;\n // jquery container name where to output the md content. default to \".result-html\"\n options.container_name = options.container_name == null ? '.result-html' : options.container_name;\n \n\n // code block highlighter\n if (options.highlight == null) {\n options.highlight = function (str, lang) {\n if (lang && window.hljs.getLanguage(lang)) {\n try {\n return hljs.highlight(lang, str, true).value;\n } catch (__) { }\n }\n return ''; // use external default escaping\n };\n }\n\n // private : internal markdown it renderer. \n var md = window.markdownit(options).use(window.markdownit_wikicmd_plugin);\n\n var mdwiki = {};\n var editor;\n\n var GetEditorText;\n\n // force render a given text\n mdwiki.render = function (text) {\n md.render(text);\n }\n\n // update the content of markdown whenever the editor is changed\n mdwiki.bindToCodeMirrorEditor = function(editor_) {\n editor = editor_;\n GetEditorText = function() {\n return editor && editor.getValue();\n }\n // Setup listeners\n editor.on(\"change\", mdwiki.updateResult);\n }\n\n // NOT tested: update the content of markdown whenever the editor is changed\n mdwiki.bindToAceEditor = function (editor_) {\n editor = editor_;\n GetEditorText = function () {\n return editor && editor.session.getValue();\n }\n // Setup listeners\n editor.on(\"change\", mdwiki.updateResult);\n }\n \n // update result from current editor, this is usually called automatically whenever editor content changed. \n mdwiki.updateResult = function () {\n var source = GetEditorText && GetEditorText();\n $(options.container_name).html(md.render(source));\n }\n return mdwiki;\n}", "function convertHTMLtoMarkdown(tag, html) {\n if (tag === 'a') {\n /*\n Make sure we do *not* convert HTML links that are inside of MD links.\n Otherwise we'll have problems like issue #69.\n We're going to use a regex that mimics a negative lookbehind. For details see: http://blog.stevenlevithan.com/archives/mimic-lookbehind-javascript\n Here's an attempt at an explanation of the regex:\n ( // begin optional prefix capture group\n (?:\\]\\([^\\)]*) // match an unclosed URL portion of a MD link -- like \"...](...\"\n |(?:\\[[^\\]]*) // match an unclosed name portion of a MD link -- like \"...[...\"\n )? // capture group is optional so that we do the \"negative\" lookbehind -- that is, we can match links that are *not* preceded by the stuff we *don't* want\n <a\\s[^>]*href=\"([^\"]*)\"[^>]*>(.*?)<\\/a> // an HTML link\n Then the replace callback looks like this:\n return $1 ? $0 : '['+$3+']('+$2+')'\n So, if the first capture group is matched (i.e., $1 has value), then we've\n matched the bad thing -- the indication that the HTML is inside a MD link.\n In that case, we don't modify anything. Otherwise we use our other capture\n groups to create the desired MD link.\n */\n html = html.replace(\n /((?:\\]\\([^\\)]*)|(?:\\[[^\\]]*))?<a\\s[^>]*href=\"([^\"]*)\"[^>]*>(.*?)<\\/a>/ig,\n function($0, $1, $2, $3) {\n return $1 ? $0 : '['+$3+']('+$2+')';\n });\n }\n else {\n throw new Error('convertHTMLtoMarkdown: ' + tag + ' is not a supported tag');\n return;\n }\n\n return html;\n }", "function parse(){\n let lines = editor.innerText.split(\"\\n\");\n let newText = \"\";\n\n lines.forEach(line => {\n let sub;\n let lineContent = line.split(\" \");\n let markdownTag = lineContent[0];\n \n if (markdownTags.includes(markdownTag)) {\n lineContent.shift();\n sub = lineContent.join(\" \");\n\n switch (markdownTag) {\n case \"#\":\n newText += \"<h1>\" + sub + \"</h2>\";\n break;\n \n case \"##\":\n newText += \"<h2>\" + sub + \"</h2>\";\n break;\n\n case \"###\":\n newText += \"<h3>\" + sub + \"</h3>\";\n break;\n\n case \"####\":\n newText += \"<h4>\" + sub + \"</h5>\";\n break;\n }\n }\n else{\n newText += line + \"<br>\";\n }\n //newText += \"<br>\";\n });\n\n copyAsPlainText(newText);\n}", "function markdown(hljs) {\n const INLINE_HTML = {\n begin: '<', end: '>',\n subLanguage: 'xml',\n relevance: 0\n };\n const HORIZONTAL_RULE = {\n begin: '^[-\\\\*]{3,}', end: '$'\n };\n const CODE = {\n className: 'code',\n variants: [\n // TODO: fix to allow these to work with sublanguage also\n { begin: '(`{3,})(.|\\\\n)*?\\\\1`*[ ]*', },\n { begin: '(~{3,})(.|\\\\n)*?\\\\1~*[ ]*', },\n // needed to allow markdown as a sublanguage to work\n { begin: '```', end: '```+[ ]*$' },\n { begin: '~~~', end: '~~~+[ ]*$' },\n { begin: '`.+?`' },\n {\n begin: '(?=^( {4}|\\\\t))',\n // use contains to gobble up multiple lines to allow the block to be whatever size\n // but only have a single open/close tag vs one per line\n contains: [\n { begin: '^( {4}|\\\\t)', end: '(\\\\n)$' }\n ],\n relevance: 0\n }\n ]\n };\n const LIST = {\n className: 'bullet',\n begin: '^[ \\t]*([*+-]|(\\\\d+\\\\.))(?=\\\\s+)',\n end: '\\\\s+',\n excludeEnd: true\n };\n const LINK_REFERENCE = {\n begin: /^\\[[^\\n]+\\]:/,\n returnBegin: true,\n contains: [\n {\n className: 'symbol',\n begin: /\\[/, end: /\\]/,\n excludeBegin: true, excludeEnd: true\n },\n {\n className: 'link',\n begin: /:\\s*/, end: /$/,\n excludeBegin: true\n }\n ]\n };\n const LINK = {\n begin: '\\\\[.+?\\\\][\\\\(\\\\[].*?[\\\\)\\\\]]',\n returnBegin: true,\n contains: [\n {\n className: 'string',\n begin: '\\\\[', end: '\\\\]',\n excludeBegin: true,\n returnEnd: true,\n relevance: 0\n },\n {\n className: 'link',\n begin: '\\\\]\\\\(', end: '\\\\)',\n excludeBegin: true, excludeEnd: true\n },\n {\n className: 'symbol',\n begin: '\\\\]\\\\[', end: '\\\\]',\n excludeBegin: true, excludeEnd: true\n }\n ],\n relevance: 10\n };\n const BOLD = {\n className: 'strong',\n contains: [],\n variants: [\n {begin: /_{2}/, end: /_{2}/ },\n {begin: /\\*{2}/, end: /\\*{2}/ }\n ]\n };\n const ITALIC = {\n className: 'emphasis',\n contains: [],\n variants: [\n { begin: /\\*(?!\\*)/, end: /\\*/ },\n { begin: /_(?!_)/, end: /_/, relevance: 0},\n ]\n };\n BOLD.contains.push(ITALIC);\n ITALIC.contains.push(BOLD);\n\n var CONTAINABLE = [\n INLINE_HTML,\n LINK\n ];\n\n BOLD.contains = BOLD.contains.concat(CONTAINABLE);\n ITALIC.contains = ITALIC.contains.concat(CONTAINABLE);\n\n CONTAINABLE = CONTAINABLE.concat(BOLD,ITALIC);\n\n const HEADER = {\n className: 'section',\n variants: [\n {\n begin: '^#{1,6}',\n end: '$',\n contains: CONTAINABLE\n },\n {\n begin: '(?=^.+?\\\\n[=-]{2,}$)',\n contains: [\n { begin: '^[=-]*$' },\n { begin: '^', end: \"\\\\n\", contains: CONTAINABLE },\n ]\n }\n ]\n };\n\n const BLOCKQUOTE = {\n className: 'quote',\n begin: '^>\\\\s+',\n contains: CONTAINABLE,\n end: '$',\n };\n\n return {\n name: 'Markdown',\n aliases: ['md', 'mkdown', 'mkd'],\n contains: [\n HEADER,\n INLINE_HTML,\n LIST,\n BOLD,\n ITALIC,\n BLOCKQUOTE,\n CODE,\n HORIZONTAL_RULE,\n LINK,\n LINK_REFERENCE\n ]\n };\n}", "function markdown(hljs) {\n const INLINE_HTML = {\n begin: '<', end: '>',\n subLanguage: 'xml',\n relevance: 0\n };\n const HORIZONTAL_RULE = {\n begin: '^[-\\\\*]{3,}', end: '$'\n };\n const CODE = {\n className: 'code',\n variants: [\n // TODO: fix to allow these to work with sublanguage also\n { begin: '(`{3,})(.|\\\\n)*?\\\\1`*[ ]*', },\n { begin: '(~{3,})(.|\\\\n)*?\\\\1~*[ ]*', },\n // needed to allow markdown as a sublanguage to work\n { begin: '```', end: '```+[ ]*$' },\n { begin: '~~~', end: '~~~+[ ]*$' },\n { begin: '`.+?`' },\n {\n begin: '(?=^( {4}|\\\\t))',\n // use contains to gobble up multiple lines to allow the block to be whatever size\n // but only have a single open/close tag vs one per line\n contains: [\n { begin: '^( {4}|\\\\t)', end: '(\\\\n)$' }\n ],\n relevance: 0\n }\n ]\n };\n const LIST = {\n className: 'bullet',\n begin: '^[ \\t]*([*+-]|(\\\\d+\\\\.))(?=\\\\s+)',\n end: '\\\\s+',\n excludeEnd: true\n };\n const LINK_REFERENCE = {\n begin: /^\\[[^\\n]+\\]:/,\n returnBegin: true,\n contains: [\n {\n className: 'symbol',\n begin: /\\[/, end: /\\]/,\n excludeBegin: true, excludeEnd: true\n },\n {\n className: 'link',\n begin: /:\\s*/, end: /$/,\n excludeBegin: true\n }\n ]\n };\n const LINK = {\n begin: '\\\\[.+?\\\\][\\\\(\\\\[].*?[\\\\)\\\\]]',\n returnBegin: true,\n contains: [\n {\n className: 'string',\n begin: '\\\\[', end: '\\\\]',\n excludeBegin: true,\n returnEnd: true,\n relevance: 0\n },\n {\n className: 'link',\n begin: '\\\\]\\\\(', end: '\\\\)',\n excludeBegin: true, excludeEnd: true\n },\n {\n className: 'symbol',\n begin: '\\\\]\\\\[', end: '\\\\]',\n excludeBegin: true, excludeEnd: true\n }\n ],\n relevance: 10\n };\n const BOLD = {\n className: 'strong',\n contains: [],\n variants: [\n {begin: /_{2}/, end: /_{2}/ },\n {begin: /\\*{2}/, end: /\\*{2}/ }\n ]\n };\n const ITALIC = {\n className: 'emphasis',\n contains: [],\n variants: [\n { begin: /\\*(?!\\*)/, end: /\\*/ },\n { begin: /_(?!_)/, end: /_/, relevance: 0},\n ]\n };\n BOLD.contains.push(ITALIC);\n ITALIC.contains.push(BOLD);\n\n var CONTAINABLE = [\n INLINE_HTML,\n LINK\n ];\n\n BOLD.contains = BOLD.contains.concat(CONTAINABLE);\n ITALIC.contains = ITALIC.contains.concat(CONTAINABLE);\n\n CONTAINABLE = CONTAINABLE.concat(BOLD,ITALIC);\n\n const HEADER = {\n className: 'section',\n variants: [\n {\n begin: '^#{1,6}',\n end: '$',\n contains: CONTAINABLE\n },\n {\n begin: '(?=^.+?\\\\n[=-]{2,}$)',\n contains: [\n { begin: '^[=-]*$' },\n { begin: '^', end: \"\\\\n\", contains: CONTAINABLE },\n ]\n }\n ]\n };\n\n const BLOCKQUOTE = {\n className: 'quote',\n begin: '^>\\\\s+',\n contains: CONTAINABLE,\n end: '$',\n };\n\n return {\n name: 'Markdown',\n aliases: ['md', 'mkdown', 'mkd'],\n contains: [\n HEADER,\n INLINE_HTML,\n LIST,\n BOLD,\n ITALIC,\n BLOCKQUOTE,\n CODE,\n HORIZONTAL_RULE,\n LINK,\n LINK_REFERENCE\n ]\n };\n}", "function markdown(hljs) {\n const INLINE_HTML = {\n begin: /<\\/?[A-Za-z_]/,\n end: '>',\n subLanguage: 'xml',\n relevance: 0\n };\n const HORIZONTAL_RULE = {\n begin: '^[-\\\\*]{3,}',\n end: '$'\n };\n const CODE = {\n className: 'code',\n variants: [// TODO: fix to allow these to work with sublanguage also\n {\n begin: '(`{3,})[^`](.|\\\\n)*?\\\\1`*[ ]*'\n }, {\n begin: '(~{3,})[^~](.|\\\\n)*?\\\\1~*[ ]*'\n }, // needed to allow markdown as a sublanguage to work\n {\n begin: '```',\n end: '```+[ ]*$'\n }, {\n begin: '~~~',\n end: '~~~+[ ]*$'\n }, {\n begin: '`.+?`'\n }, {\n begin: '(?=^( {4}|\\\\t))',\n // use contains to gobble up multiple lines to allow the block to be whatever size\n // but only have a single open/close tag vs one per line\n contains: [{\n begin: '^( {4}|\\\\t)',\n end: '(\\\\n)$'\n }],\n relevance: 0\n }]\n };\n const LIST = {\n className: 'bullet',\n begin: '^[ \\t]*([*+-]|(\\\\d+\\\\.))(?=\\\\s+)',\n end: '\\\\s+',\n excludeEnd: true\n };\n const LINK_REFERENCE = {\n begin: /^\\[[^\\n]+\\]:/,\n returnBegin: true,\n contains: [{\n className: 'symbol',\n begin: /\\[/,\n end: /\\]/,\n excludeBegin: true,\n excludeEnd: true\n }, {\n className: 'link',\n begin: /:\\s*/,\n end: /$/,\n excludeBegin: true\n }]\n };\n const URL_SCHEME = /[A-Za-z][A-Za-z0-9+.-]*/;\n const LINK = {\n variants: [// too much like nested array access in so many languages\n // to have any real relevance\n {\n begin: /\\[.+?\\]\\[.*?\\]/,\n relevance: 0\n }, // popular internet URLs\n {\n begin: /\\[.+?\\]\\(((data|javascript|mailto):|(?:http|ftp)s?:\\/\\/).*?\\)/,\n relevance: 2\n }, {\n begin: concat$2(/\\[.+?\\]\\(/, URL_SCHEME, /:\\/\\/.*?\\)/),\n relevance: 2\n }, // relative urls\n {\n begin: /\\[.+?\\]\\([./?&#].*?\\)/,\n relevance: 1\n }, // whatever else, lower relevance (might not be a link at all)\n {\n begin: /\\[.+?\\]\\(.*?\\)/,\n relevance: 0\n }],\n returnBegin: true,\n contains: [{\n className: 'string',\n relevance: 0,\n begin: '\\\\[',\n end: '\\\\]',\n excludeBegin: true,\n returnEnd: true\n }, {\n className: 'link',\n relevance: 0,\n begin: '\\\\]\\\\(',\n end: '\\\\)',\n excludeBegin: true,\n excludeEnd: true\n }, {\n className: 'symbol',\n relevance: 0,\n begin: '\\\\]\\\\[',\n end: '\\\\]',\n excludeBegin: true,\n excludeEnd: true\n }]\n };\n const BOLD = {\n className: 'strong',\n contains: [],\n variants: [{\n begin: /_{2}/,\n end: /_{2}/\n }, {\n begin: /\\*{2}/,\n end: /\\*{2}/\n }]\n };\n const ITALIC = {\n className: 'emphasis',\n contains: [],\n variants: [{\n begin: /\\*(?!\\*)/,\n end: /\\*/\n }, {\n begin: /_(?!_)/,\n end: /_/,\n relevance: 0\n }]\n };\n BOLD.contains.push(ITALIC);\n ITALIC.contains.push(BOLD);\n let CONTAINABLE = [INLINE_HTML, LINK];\n BOLD.contains = BOLD.contains.concat(CONTAINABLE);\n ITALIC.contains = ITALIC.contains.concat(CONTAINABLE);\n CONTAINABLE = CONTAINABLE.concat(BOLD, ITALIC);\n const HEADER = {\n className: 'section',\n variants: [{\n begin: '^#{1,6}',\n end: '$',\n contains: CONTAINABLE\n }, {\n begin: '(?=^.+?\\\\n[=-]{2,}$)',\n contains: [{\n begin: '^[=-]*$'\n }, {\n begin: '^',\n end: \"\\\\n\",\n contains: CONTAINABLE\n }]\n }]\n };\n const BLOCKQUOTE = {\n className: 'quote',\n begin: '^>\\\\s+',\n contains: CONTAINABLE,\n end: '$'\n };\n return {\n name: 'Markdown',\n aliases: ['md', 'mkdown', 'mkd'],\n contains: [HEADER, INLINE_HTML, LIST, BOLD, ITALIC, BLOCKQUOTE, CODE, HORIZONTAL_RULE, LINK, LINK_REFERENCE]\n };\n}", "function markdown(hljs) {\n const INLINE_HTML = {\n begin: /<\\/?[A-Za-z_]/,\n end: '>',\n subLanguage: 'xml',\n relevance: 0\n };\n const HORIZONTAL_RULE = {\n begin: '^[-\\\\*]{3,}',\n end: '$'\n };\n const CODE = {\n className: 'code',\n variants: [\n // TODO: fix to allow these to work with sublanguage also\n {\n begin: '(`{3,})[^`](.|\\\\n)*?\\\\1`*[ ]*'\n },\n {\n begin: '(~{3,})[^~](.|\\\\n)*?\\\\1~*[ ]*'\n },\n // needed to allow markdown as a sublanguage to work\n {\n begin: '```',\n end: '```+[ ]*$'\n },\n {\n begin: '~~~',\n end: '~~~+[ ]*$'\n },\n {\n begin: '`.+?`'\n },\n {\n begin: '(?=^( {4}|\\\\t))',\n // use contains to gobble up multiple lines to allow the block to be whatever size\n // but only have a single open/close tag vs one per line\n contains: [\n {\n begin: '^( {4}|\\\\t)',\n end: '(\\\\n)$'\n }\n ],\n relevance: 0\n }\n ]\n };\n const LIST = {\n className: 'bullet',\n begin: '^[ \\t]*([*+-]|(\\\\d+\\\\.))(?=\\\\s+)',\n end: '\\\\s+',\n excludeEnd: true\n };\n const LINK_REFERENCE = {\n begin: /^\\[[^\\n]+\\]:/,\n returnBegin: true,\n contains: [\n {\n className: 'symbol',\n begin: /\\[/,\n end: /\\]/,\n excludeBegin: true,\n excludeEnd: true\n },\n {\n className: 'link',\n begin: /:\\s*/,\n end: /$/,\n excludeBegin: true\n }\n ]\n };\n const URL_SCHEME = /[A-Za-z][A-Za-z0-9+.-]*/;\n const LINK = {\n variants: [\n // too much like nested array access in so many languages\n // to have any real relevance\n {\n begin: /\\[.+?\\]\\[.*?\\]/,\n relevance: 0\n },\n // popular internet URLs\n {\n begin: /\\[.+?\\]\\(((data|javascript|mailto):|(?:http|ftp)s?:\\/\\/).*?\\)/,\n relevance: 2\n },\n {\n begin: concat(/\\[.+?\\]\\(/, URL_SCHEME, /:\\/\\/.*?\\)/),\n relevance: 2\n },\n // relative urls\n {\n begin: /\\[.+?\\]\\([./?&#].*?\\)/,\n relevance: 1\n },\n // whatever else, lower relevance (might not be a link at all)\n {\n begin: /\\[.+?\\]\\(.*?\\)/,\n relevance: 0\n }\n ],\n returnBegin: true,\n contains: [\n {\n className: 'string',\n relevance: 0,\n begin: '\\\\[',\n end: '\\\\]',\n excludeBegin: true,\n returnEnd: true\n },\n {\n className: 'link',\n relevance: 0,\n begin: '\\\\]\\\\(',\n end: '\\\\)',\n excludeBegin: true,\n excludeEnd: true\n },\n {\n className: 'symbol',\n relevance: 0,\n begin: '\\\\]\\\\[',\n end: '\\\\]',\n excludeBegin: true,\n excludeEnd: true\n }\n ]\n };\n const BOLD = {\n className: 'strong',\n contains: [],\n variants: [\n {\n begin: /_{2}/,\n end: /_{2}/\n },\n {\n begin: /\\*{2}/,\n end: /\\*{2}/\n }\n ]\n };\n const ITALIC = {\n className: 'emphasis',\n contains: [],\n variants: [\n {\n begin: /\\*(?!\\*)/,\n end: /\\*/\n },\n {\n begin: /_(?!_)/,\n end: /_/,\n relevance: 0\n }\n ]\n };\n BOLD.contains.push(ITALIC);\n ITALIC.contains.push(BOLD);\n\n let CONTAINABLE = [\n INLINE_HTML,\n LINK\n ];\n\n BOLD.contains = BOLD.contains.concat(CONTAINABLE);\n ITALIC.contains = ITALIC.contains.concat(CONTAINABLE);\n\n CONTAINABLE = CONTAINABLE.concat(BOLD, ITALIC);\n\n const HEADER = {\n className: 'section',\n variants: [\n {\n begin: '^#{1,6}',\n end: '$',\n contains: CONTAINABLE\n },\n {\n begin: '(?=^.+?\\\\n[=-]{2,}$)',\n contains: [\n {\n begin: '^[=-]*$'\n },\n {\n begin: '^',\n end: \"\\\\n\",\n contains: CONTAINABLE\n }\n ]\n }\n ]\n };\n\n const BLOCKQUOTE = {\n className: 'quote',\n begin: '^>\\\\s+',\n contains: CONTAINABLE,\n end: '$'\n };\n\n return {\n name: 'Markdown',\n aliases: [\n 'md',\n 'mkdown',\n 'mkd'\n ],\n contains: [\n HEADER,\n INLINE_HTML,\n LIST,\n BOLD,\n ITALIC,\n BLOCKQUOTE,\n CODE,\n HORIZONTAL_RULE,\n LINK,\n LINK_REFERENCE\n ]\n };\n}", "function markdown(hljs) {\n const INLINE_HTML = {\n begin: /<\\/?[A-Za-z_]/,\n end: '>',\n subLanguage: 'xml',\n relevance: 0\n };\n const HORIZONTAL_RULE = {\n begin: '^[-\\\\*]{3,}',\n end: '$'\n };\n const CODE = {\n className: 'code',\n variants: [\n // TODO: fix to allow these to work with sublanguage also\n {\n begin: '(`{3,})[^`](.|\\\\n)*?\\\\1`*[ ]*'\n },\n {\n begin: '(~{3,})[^~](.|\\\\n)*?\\\\1~*[ ]*'\n },\n // needed to allow markdown as a sublanguage to work\n {\n begin: '```',\n end: '```+[ ]*$'\n },\n {\n begin: '~~~',\n end: '~~~+[ ]*$'\n },\n {\n begin: '`.+?`'\n },\n {\n begin: '(?=^( {4}|\\\\t))',\n // use contains to gobble up multiple lines to allow the block to be whatever size\n // but only have a single open/close tag vs one per line\n contains: [\n {\n begin: '^( {4}|\\\\t)',\n end: '(\\\\n)$'\n }\n ],\n relevance: 0\n }\n ]\n };\n const LIST = {\n className: 'bullet',\n begin: '^[ \\t]*([*+-]|(\\\\d+\\\\.))(?=\\\\s+)',\n end: '\\\\s+',\n excludeEnd: true\n };\n const LINK_REFERENCE = {\n begin: /^\\[[^\\n]+\\]:/,\n returnBegin: true,\n contains: [\n {\n className: 'symbol',\n begin: /\\[/,\n end: /\\]/,\n excludeBegin: true,\n excludeEnd: true\n },\n {\n className: 'link',\n begin: /:\\s*/,\n end: /$/,\n excludeBegin: true\n }\n ]\n };\n const URL_SCHEME = /[A-Za-z][A-Za-z0-9+.-]*/;\n const LINK = {\n variants: [\n // too much like nested array access in so many languages\n // to have any real relevance\n {\n begin: /\\[.+?\\]\\[.*?\\]/,\n relevance: 0\n },\n // popular internet URLs\n {\n begin: /\\[.+?\\]\\(((data|javascript|mailto):|(?:http|ftp)s?:\\/\\/).*?\\)/,\n relevance: 2\n },\n {\n begin: concat(/\\[.+?\\]\\(/, URL_SCHEME, /:\\/\\/.*?\\)/),\n relevance: 2\n },\n // relative urls\n {\n begin: /\\[.+?\\]\\([./?&#].*?\\)/,\n relevance: 1\n },\n // whatever else, lower relevance (might not be a link at all)\n {\n begin: /\\[.+?\\]\\(.*?\\)/,\n relevance: 0\n }\n ],\n returnBegin: true,\n contains: [\n {\n className: 'string',\n relevance: 0,\n begin: '\\\\[',\n end: '\\\\]',\n excludeBegin: true,\n returnEnd: true\n },\n {\n className: 'link',\n relevance: 0,\n begin: '\\\\]\\\\(',\n end: '\\\\)',\n excludeBegin: true,\n excludeEnd: true\n },\n {\n className: 'symbol',\n relevance: 0,\n begin: '\\\\]\\\\[',\n end: '\\\\]',\n excludeBegin: true,\n excludeEnd: true\n }\n ]\n };\n const BOLD = {\n className: 'strong',\n contains: [],\n variants: [\n {\n begin: /_{2}/,\n end: /_{2}/\n },\n {\n begin: /\\*{2}/,\n end: /\\*{2}/\n }\n ]\n };\n const ITALIC = {\n className: 'emphasis',\n contains: [],\n variants: [\n {\n begin: /\\*(?!\\*)/,\n end: /\\*/\n },\n {\n begin: /_(?!_)/,\n end: /_/,\n relevance: 0\n }\n ]\n };\n BOLD.contains.push(ITALIC);\n ITALIC.contains.push(BOLD);\n\n let CONTAINABLE = [\n INLINE_HTML,\n LINK\n ];\n\n BOLD.contains = BOLD.contains.concat(CONTAINABLE);\n ITALIC.contains = ITALIC.contains.concat(CONTAINABLE);\n\n CONTAINABLE = CONTAINABLE.concat(BOLD, ITALIC);\n\n const HEADER = {\n className: 'section',\n variants: [\n {\n begin: '^#{1,6}',\n end: '$',\n contains: CONTAINABLE\n },\n {\n begin: '(?=^.+?\\\\n[=-]{2,}$)',\n contains: [\n {\n begin: '^[=-]*$'\n },\n {\n begin: '^',\n end: \"\\\\n\",\n contains: CONTAINABLE\n }\n ]\n }\n ]\n };\n\n const BLOCKQUOTE = {\n className: 'quote',\n begin: '^>\\\\s+',\n contains: CONTAINABLE,\n end: '$'\n };\n\n return {\n name: 'Markdown',\n aliases: [\n 'md',\n 'mkdown',\n 'mkd'\n ],\n contains: [\n HEADER,\n INLINE_HTML,\n LIST,\n BOLD,\n ITALIC,\n BLOCKQUOTE,\n CODE,\n HORIZONTAL_RULE,\n LINK,\n LINK_REFERENCE\n ]\n };\n}", "function generateMarkdown(data) {\n return `\n # Title \n ${data.title}\n \n \n # Table of contents\n 1. [Description](#description)\n 2. [Installation](#installation)\n 3. [Usage](#usage)\n 4. [Contribution](#contribution)\n 5. [Testing](#testing)\n 6. [Licensing](#licensing)\n 7. [Questions](#questions)\n \n \n \n\n \n## Description <a name=\"description\"></a>\n${data.description}\n\n## Installation <a name=\"installation\"></a>\n${data.installation}\n\n## Usage <a name=\"usage\"></a>\n${data.usage}\n\n## Contribution <a name=\"contribution\"></a>\n${data.contribution}\n\n## Testing <a name=\"testing\"></a>\n${data.testing}\n\n## Licensing <a name=\"licensing\"></a>\n${data.licensing}\n\n## Questions <a name=\"questions\"></a>\n<https://github.com/${data.questions}>\n\n## Questionss\n<${data.questionss}>\n`;\n}", "function Markdown($sanitize, showdownService) {\n return {\n restrict: 'A',\n link: function (scope, element, attrs) {\n if (attrs.markdown) {\n var converter = showdownService.getConverter();\n scope.$watch(attrs.markdown, function (newVal) {\n var html = newVal ? $sanitize(converter.makeHtml(newVal)) : '';\n element.html(html);\n });\n }\n }\n };\n}", "function generateMarkdown(data) {`\n## Project Title\n\n# ${data.title}\n\n## Project Description\n${data.description}\n\n## Project Link\n${data.project-link}\n\n## :brain: Table Of Contents (TOC)\n1. [Installation](#installation)\n2. [Usage](#usage)\n3. [License](#license)\n4. [Contributing](#contributing)\n5. [Tech](#tech)\n6. [Tests](#tests)\n\n${data.tableOfContents}\n\n## Installation\n\n${data.installation}\n\n## Usage\n\n${data.usage}\n\n${data.photos}\n\n## License\n\n${data.license}\n[![GitHub license] (https://img.shields.io/github/license/Naereen/StrapDown.js.svg)](https://github.com/Naereen/StrapDown.js/blob/master/LICENSE)\n\n## Contributing\n${data.contributers}\n\n## Tech\n${data.technologies}\n\n## Tests\n${data.tests}\n\n## Questions\n${data.questions}\n${data.contact}\n\n`;\n}", "function convertMarkdownToHtml(data, string) {\r\n\t//convert markdown to html\r\n\tif (string === \"answer\") {\r\n\t\tvar converter = new showdown.Converter(),\r\n\t\t text = faqData[i].markdownAnswer,\r\n\t\t html = converter.makeHtml(text);\r\n\t\t return html\r\n\t} else {\r\n\t\tvar converter = new showdown.Converter(),\r\n\t\t text = faqData[i].markdownQuestion,\r\n\t\t html = converter.makeHtml(text);\r\n\t\t return html\r\n\t}\r\n}", "function generateMarkdown(data) {\n return `\n # Project Title\n <h1 align=\"center\">${data.title} 👋</h1>\n\n <p align=\"center\">\n <img src=\"https://img.shields.io/github/repo-size/MichaelPappas2662/ReadMeGenerator\" />\n <img src=\"https://img.shields.io/github/languages/top/MichaelPappas2662/ReadMeGenerator\" />\n <img src=\"https://img.shields.io/github/issues/MichaelPappas2662/ReadMeGenerator\" />\n <img src=\"https://img.shields.io/github/last-commit/MichaelPappas2662/ReadMeGenerator\" > \n</p>\n\n<p align=\"center\">\n <img src=\"https://img.shields.io/badge/Javascript-yellow\" />\n <img src=\"https://img.shields.io/badge/jQuery-blue\" />\n <img src=\"https://img.shields.io/badge/-node.js-green\" />\n <img src=\"https://img.shields.io/badge/-inquirer-red\" >\n <img src=\"https://img.shields.io/badge/-screencastify-lightgrey\" />\n <img src=\"https://img.shields.io/badge/-json-orange\" />\n</p>\n\n\n # Description\n ${renderLicenseBadge(data.license)}\n\n ${data.description}\n # Table of Contents \n * [Installation](#-Installation)\n * [Usage](#-Usage)\n * [License](#-Installation)\n * [Contributing](#-Contributing)\n * [Tests](#-Tests)\n * [Questions](#-Contact-Information)\n \n # Installation\n ${data.installation}\n # Usage\n ${data.usage}\n # License \n ${renderLicenseSection(data.license)}\n # Contributing \n ${data.contribute}\n # Tests\n ${data.tests}\n # Contact Information \n ![Developer Profile Picture](${data.avatar_url}) \n * GitHub Username: ${data.username}\n * Contact Email: ${data.userEmail}\n \n`;\n}", "function process(data) {\n // Translate markdown to html\n return markedAsync(data.content, markedOptions)\n .then(function(html){\n data.html = html;\n if (data.summary) {\n data.summary = data.summary.substr(0, MAX_SUMMARY_LENGTH);\n } else {\n // Cut out the summary\n var cleaned = html.replace(/<[^>]*>/g, '')\n // Treat the Chinese char as double\n , count = MAX_SUMMARY_LENGTH\n , index = -1;\n while (count > 0) {\n if (cleaned.charCodeAt(index += 1) > 0x4dff) {\n count -= 2;\n } else {\n count -= 1;\n }\n }\n data.summary = cleaned.substr(0, index);\n }\n });\n}", "function RenderedMarkdown(options) {\n var _this = _super.call(this, options) || this;\n _this._rendered = false;\n _this._urlResolved = null;\n _this.addClass(MARKDOWN_CLASS);\n // Initialize the marked library if necessary.\n Private.initializeMarked();\n var source = Private.getSource(options);\n var parts = _1.removeMath(source);\n // Add the markdown content asynchronously.\n marked(parts['text'], function (err, content) {\n if (err) {\n console.error(err);\n return;\n }\n content = _1.replaceMath(content, parts['math']);\n if (!options.model.trusted) {\n content = options.sanitizer.sanitize(content);\n }\n Private.appendHtml(_this.node, content);\n if (options.resolver) {\n _this._urlResolved = Private.handleUrls(_this.node, options.resolver, options.linkHandler);\n }\n Private.headerAnchors(_this.node);\n _this.fit();\n _this._rendered = true;\n if (_this.isAttached) {\n if (_this._urlResolved) {\n _this._urlResolved.then(function () { _1.typeset(_this.node); });\n }\n else {\n _1.typeset(_this.node);\n }\n }\n });\n return _this;\n }", "function generateMarkdown(data) {\n return `# ${data.title}\n\n## Table Of Contents \n * [Description](#description)\n * [Installation](#installation) \n * [Usage](#usage) \n * [License](#license) \n * [Contribution](#contribution)\n * [Testing](#testing)\n * [Questions](#questions)\n\n## Visual Presentation\n\nvideo:\n\nhttps://drive.google.com/file/d/1DCuXCwPPzWO1wcOrtFcD3mUfUTQAY8QF/view\n\nScreenshot:\n\n<img width=\"721\" alt=\"Terminal Input\" src=\"https://user-images.githubusercontent.com/82979870/123585993-f035f180-d798-11eb-91f2-1cc9f12b6acd.png\">\n \n## Description\n ${data.description}\n\n## Installation\n ${data.installation}\n\n## Usage\n ${data.usage}\n\n## License \n ${renderLicenseBadge(data.license)} \n ${renderLicenseLink(data.license)}\n ${renderLicenseSection(data.license)}\n\n## Contribution\n ${data.contribution}\n\n## Test\n ${data.test}\n\n## Questions\n * For further information, please send email to ${data.email}\n * Check for details on Github at [${data.github}](https://github.com/${\n data.github\n })\n`;\n}", "function mdAstToHtml(ast, lines) {\n if (lines == undefined)\n lines = [];\n\n // Adds each element of the array as markdown \n function addArray(ast) {\n for (let child of ast)\n mdAstToHtml(child, lines);\n return lines;\n }\n\n // Adds tagged content \n function addTag(tag, ast, newLine) {\n lines.push(startTag(tag));\n if (ast instanceof Array)\n addArray(ast); \n else\n mdAstToHtml(ast, lines);\n lines.push(endTag(tag));\n if (newLine)\n lines.push('\\r\\n');\n return lines;\n }\n\n function addLink(url, ast) {\n lines.push(startTag('a', { href:url }));\n addArray(ast.children);\n lines.push(endTag('a')) ;\n return lines;\n }\n\n function addImg(url) {\n lines.push(startTag('img', { src:url }));\n lines.push(endTag('img')) ;\n return lines;\n }\n\n switch (ast.name)\n {\n case \"heading\": \n {\n let headingLevel = ast.children[0];\n let restOfLine = ast.children[1];\n let h = headingLevel.allText.length;\n switch (h)\n {\n case 1: return addTag(\"h1\", restOfLine, true); \n case 2: return addTag(\"h2\", restOfLine, true); \n case 3: return addTag(\"h3\", restOfLine, true); \n case 4: return addTag(\"h4\", restOfLine, true); \n case 5: return addTag(\"h5\", restOfLine, true); \n case 6: return addTag(\"h6\", restOfLine, true); \n default: throw \"Heading level must be from 1 to 6\"\n }\n }\n case \"paragraph\": \n return addTag(\"p\", ast.children, true);\n case \"unorderedList\":\n return addTag(\"ul\", ast.children, true);\n case \"orderedList\":\n return addTag(\"ol\", ast.children, true);\n case \"unorderedListItem\":\n return addTag(\"li\", ast.children, true);\n case \"orderedListItem\":\n return addTag(\"li\", ast.children, true);\n case \"inlineUrl\":\n return addTag(ast.allText, ast.allText);\n case \"bold\":\n return addTag(\"b\", ast.children);\n case \"italic\":\n return addTag(\"i\", ast.children);\n case \"code\":\n return addTag(\"code\", ast.children);\n case \"codeBlock\":\n return addTag(\"pre\", ast.children);\n case \"quote\":\n return addTag(\"blockquote\", ast.children, true);\n case \"link\":\n return addLink(ast.children[1].allText, ast.children[0]);\n case \"image\":\n return addImg(ast.children[0]);\n default:\n if (ast.isLeaf)\n lines.push(ast.allText);\n else \n ast.children.forEach(function(c) { mdAstToHtml(c, lines); });\n }\n return lines;\n}", "function _markdownToHtml(response) {\n const parser = new Remarkable('commonmark');\n docsEl.innerHTML = parser.render(response);\n}", "function MarkdownView() {\n\n this.compile = function (template) {\n return function (context) {\n var html = Marked(template, context);\n return `<link rel=\"stylesheet\" href=\"/assets/github-markdown.css\">\n <style>\n .markdown-body {\n box-sizing: border-box;\n min-width: 200px;\n max-width: 980px;\n margin: 0 auto;\n padding: 45px;\n }\n </style>\n <article class=\"markdown-body\">\n ${html}\n </article>`;\n };\n };\n}", "function generateMarkdown(root) {\n var sass = sass_1.generateSass(root);\n /*\n let css = nodeSass.renderSync({\n data: sass\n })\n */\n var css = { css: \"\" };\n var outp = \"<style>.preview { position: relative; } \" + css.css + \"</style>\\n\\n\";\n var ind = 0;\n var blocks = root.blocks;\n var blocksLen = blocks.length;\n for (var i = 0; i < blocksLen; i++) {\n var block = blocks[i];\n // open block\n outp += \"# Block: \" + block.name + \"\\n\";\n ind++;\n outp += '\\n';\n outp += \"<div class=\\\"preview\\\">\\n\";\n outp += \" <div class=\\\"\" + block.name + \"\\\">\\n\";\n var elements = block.elements;\n var elementsLen = elements.length;\n for (var j = 0; j < elementsLen; j++) {\n var element = elements[j];\n // Open element\n outp += \" <div class=\\\"\" + element.name + \"\\\">\\n\";\n outp += \" </div>\\n\";\n }\n outp += ' </div>\\n';\n outp += '</div>\\n';\n outp += '\\n';\n if (block.rules !== undefined && block.rules.length !== 0) {\n // Print block properties\n outp += rules(\".\" + block.name, block.rules, ind);\n }\n // Elements\n for (var j = 0; j < elementsLen; j++) {\n var element = elements[j];\n // Open element\n outp += \"## Element: \" + element.name + \" \\n\\n\";\n outp += rules(\".\" + block.name + \" .\" + element.name, element.rules, ind);\n outp += modifiers(element.modifiers, \"\" + element.name, 3);\n }\n outp += modifiers(block.modifiers, block.name, 2);\n }\n return outp;\n}", "initStateMarkdown() {\n let pageContent = '';\n\n const rawText = document.getElementById('raw-text-original');\n if (rawText) {\n pageContent = rawText.innerHTML;\n }\n const markdown = entities.decodeHTML(pageContent);\n\n this.state.markdown = markdown;\n }", "function MarkdownView() {\r\n\r\n this.compile = function (template) {\r\n return function (context) {\r\n var html = Marked(template, context);\r\n return `<link rel=\"stylesheet\" href=\"/assets/github-markdown.css\">\r\n <style>\r\n .markdown-body {\r\n box-sizing: border-box;\r\n min-width: 200px;\r\n max-width: 980px;\r\n margin: 0 auto;\r\n padding: 45px;\r\n }\r\n </style>\r\n <article class=\"markdown-body\">\r\n ${html}\r\n </article>`;\r\n };\r\n };\r\n}", "function previewMarkdown(){\n var htmlText=marked(editor.value); //convert markdown to html\n var preview=document.querySelector(\"#preview\"); //get the preview pane handle\n //create a react element\n var e=React.createElement.apply('React',['div',{dangerouslySetInnerHTML:{__html: htmlText}}]);\n //render html\n ReactDOM.render(e,preview);\n }", "function convert() {\n let text = input.value;\n let converted = markConvert.makeHtml(text);\n myOutput.innerHTML = converted;\n}", "function parseHtml(lines, replacements, postHeader) {\n // Convert from markdown\n var body = postFormatter.performMetadataReplacements(replacements, marked(lines));\n // Perform replacements\n var header = postFormatter.performMetadataReplacements(replacements, postFormatter.headerSource);\n // Concatenate HTML\n return header + postHeader + body + postFormatter.footerSource;\n }", "function generateMarkdown(data) {\n console.log(data)\n\nreturn `\n# ${data.title} \n \n![license](https://img.shields.io/badge/License-${data.license.split(' ').join('%20')}-blue?style=for-the-badge)\n\n \n## Description\n${data.description}\n\n${data.motivation}\n\n\n## Table of Contents\n \n* [Description](#description)\n* [Features](#features)\n* [Languages](#languages)\n* [Link](#link)\n* [Usage](#usage)\n* [Installation](#installation)\n* [Screenshots](#screenshots)\n* [Questions](#questions)\n* [License](#license)\n${contributeLink(data.contribute)}\n${testLink(data.test)}\n\n\n${generateFeatures(data.features)}\n \n\n## Languages\n\n${data.languages.join(', ')}\n\n\n## Link \n\n[${data.title} Deployed Page](${data.link})\n\n\n## Usage\n\n${data.usage}\n\n\n${generateInstructions(data.instructions)}\n\n\n${generatePics(data.screenShot)}\n\n## Credits\n\n${generateAuthors(data.authors)}\n\n\n## Questions\n\nFind my [GitHub Link](${data.userGithub}) here!\n \nIf you have any questions send me an email at [${data.email}](mailto:${data.email})\n\n\n## License\n\nThis project is covered under ${data.license}\n\n\n${generateContribute(data.contribute)}\n \n\n${generateTest(data.test)}\n\n`;\n}", "function generateMarkdown(data) {\n return `# ${data.title}\n## Table of Contents\n## 1.[Installation](#installation)\n## 2.[Usage](#usage)\n## 3.[License](#license)\n## 4.[Contributing](#contributing)\n## 5.[Tests](#tests)\n## 6.[Questions](#questions)\n## 7.[Description](#description)\n \n<a name=\"installation\"></a>\n# Installation\n${data.install}\n\n<a name=\"usage\"></a>\n# Usage\n${data.usage}\n\n<a name=\"license\"></a>\n# License\n${data.badge}\n\n<a name=\"contributing\"></a>\n# Contributing\n${data.contributors}\n\n<a name=\"tests\"></a>\n# Tests\n${data.tests}\n\n<a name=\"questions\"></a>\n# Questions\n* ${data.Email}\n* https://github.com/${data.Github}\n\n<a name=\"description\"></a>\n# Description\n${data.description}\n\n`\n}", "function generateMarkdown(data) {\n let { title, description, github, email, repo, installation, usage, license, contributing, tests } = data;\n \n let tableOfContents = `## Table of contents\n<hr>\n\n<!--ts-->\n* [Table of contents](#table-of-contents)\\n`;\n tableOfContents += (description.length > 0) ? \"* [Description](#description)\\n\" : \"\";\n tableOfContents += (installation.length > 0) ? \"* [Installation](#installation)\\n\" : \"\";\n tableOfContents += (usage.length > 0) ? \"* [Usage](#usage)\\n\" : \"\";\n tableOfContents += (contributing.length > 0) ? \"* [Contributing](#contributing)\\n\" : \"\";\n tableOfContents += (tests.length > 0) ? \"* [Tests](#tests)\\n\" : \"\";\n tableOfContents += \"* [Questions](#questions)\\n\";\n tableOfContents += \"* [License](#license)\\n\";\n tableOfContents += `<!--te-->`;\n\n\n return `[![Enhancements](https://img.shields.io/github/issues/${github}/${repo}/enhancement.svg)](https://github.com/${github}/${repo}/issues?q=is%3Aopen+is%3Aissue+label%3Aenhancement+sort%3Areactions-%2B1-desc)\n[![Bugs](https://img.shields.io/github/issues/${github}/${repo}/bug.svg)](https://github.com/${github}/${repo}/issues?utf8=✓&q=is%3Aissue+is%3Aopen+label%3Abug)\n![License](https://img.shields.io/badge/License-${license.replace(\" \", \"%20\")}-green?style=flat-square.svg)\n\n# ${title}\n\n${tableOfContents}\n\n${description.length > 0 ? \"## Description\" + \"\\n\\n<p>\" + description.replace(/\\n/g, \"\\n\\n\") + \"</p>\\n\\n\" : \"\"}${installation.length > 0 ? \"## Installation\" + \"\\n\\n<p>\" + installation.replace(/\\n/g, \"\\n\\n\") + \"</p>\\n\\n\" : \"\"}${usage.length > 0 ? \"## Usage\" + \"\\n\\n<p>\" + usage.replace(/\\n/g, \"\\n\\n\") + \"</p>\\n\\n\" : \"\"}${tests.length > 0 ? \"## Tests\" + \"\\n\\n<p>\" + tests.replace(/\\n/g, \"\\n\\n\") + \"</p>\\n\\n\" : \"\"}\n\n## Questions\n\n<p>Contact me at <a href=\"mailto:${email}\">${email}</a> or checkout my GitHub Profile at <a href=\"https://github.com/${github}\">${github}</a>.</p>\n\n${contributing.length > 0 ? \"## Contributing\" + \"\\n\\n<p>\" + contributing.replace(/\\n/g, \"\\n\\n\") + \"</p>\\n\\n\" : \"\"}${license.length > 0 ? \"## License\" + \"\\n\\n<p>\" + license.replace(/\\n/g, \"\\n\\n\") + \"</p>\\n\\n\" : \"\"}\n`;\n}", "function loadHTML(data) {\n var readmeHTML = marked(data); //Render README from markdown to HTML\n var target = document.getElementById(\"readme\");\n target.innerHTML = readmeHTML;\n}", "function generateMarkdown({ title, description, installation, usage, contributing, tests, license, email, github }) {\n return `\n## ${title}\n\n## Description\n\n${description}\n\n\n${renderLicenseBadge(license)}\n\n## Table of Contents\n1. [Description](#description)\n2. [Installation](#installation)\n3. [Usage](#usage)\n4. [Contributing](#contributing)\n5. [Tests](#tests)\n6. [Questions](#questions)\n\n## Installation\n\n${installation}\n\n## Usage\n\n${usage}\n\n## Contributing\n\n${contributing}\n\n## Tests\n\n${tests}\n\n## Licenses\n\n${renderLicenseLink(license)}\n${renderLicenseSection(license)}\n\n## Questions\nPlease check out my [github profile](${github}) for more questions on the methodology and what have you.\nI can also be addressed at [${email}](${email}) for direct requests.\n`;\n\n}", "function generateMarkdown(data) {\n return `\n ## Github\n ${data.Github}\n\n ## Email\n ${data.email}\n\n ## URL\n ${data.url}\n\n ## Title\n ${data.title}\n\n ## Description\n ${data.description}\n\n ## Table of Contents \n\n * [Description](#Description)\n * [License](#License)\n * [Installation](#Install)\n * [Test](#Test)\n * [Questions](#Questions)\n * [Contributing](#Contributing)\n\n ## License\n ${data.license} <br />\n ${badgeChange(data.license)} \n \n\n ## Install\n ${data.install}\n\n ## Test\n ${data.test}\n\n ## Questions\n ${data.questions}\n\n ## Contributing\n ${data.contributing}\n \n \n`;\n}", "function generateMarkdown(data) {\n return `\n# ${data.title}\n \n## License:\n![license](https://img.shields.io/badge/license-MIT-blue)\n \n\n## Table of Contents\n* [Description](#description)\n* [Usage](#usage)\n* [Contribution](#contribution)\n* [Installation](#installation)\n* [Questions](#questions)\n* [License](#license)\n \n\n\n## Description\n${data.description}\n\n## Usage\n${data.usage}\n\n## Contribution\n${data.contribution}\n\n## Installation\n${data.installation}\n\n## Questions\nPlease contact me at:\n\ngitHub:[${data.gitHub}](https://github.com/dtm5169)\nEmail:[${data.email}]([email protected])\n\n## License\n${data.license} \n\n\n\n`;\n}", "function $84964f0d2be25bfb$var$markdown(hljs) {\n const INLINE_HTML = {\n begin: /<\\/?[A-Za-z_]/,\n end: \">\",\n subLanguage: \"xml\",\n relevance: 0\n };\n const HORIZONTAL_RULE = {\n begin: \"^[-\\\\*]{3,}\",\n end: \"$\"\n };\n const CODE = {\n className: \"code\",\n variants: [\n // TODO: fix to allow these to work with sublanguage also\n {\n begin: \"(`{3,})[^`](.|\\\\n)*?\\\\1`*[ ]*\"\n },\n {\n begin: \"(~{3,})[^~](.|\\\\n)*?\\\\1~*[ ]*\"\n },\n // needed to allow markdown as a sublanguage to work\n {\n begin: \"```\",\n end: \"```+[ ]*$\"\n },\n {\n begin: \"~~~\",\n end: \"~~~+[ ]*$\"\n },\n {\n begin: \"`.+?`\"\n },\n {\n begin: \"(?=^( {4}|\\\\t))\",\n // use contains to gobble up multiple lines to allow the block to be whatever size\n // but only have a single open/close tag vs one per line\n contains: [\n {\n begin: \"^( {4}|\\\\t)\",\n end: \"(\\\\n)$\"\n }\n ],\n relevance: 0\n }\n ]\n };\n const LIST = {\n className: \"bullet\",\n begin: \"^[ \t]*([*+-]|(\\\\d+\\\\.))(?=\\\\s+)\",\n end: \"\\\\s+\",\n excludeEnd: true\n };\n const LINK_REFERENCE = {\n begin: /^\\[[^\\n]+\\]:/,\n returnBegin: true,\n contains: [\n {\n className: \"symbol\",\n begin: /\\[/,\n end: /\\]/,\n excludeBegin: true,\n excludeEnd: true\n },\n {\n className: \"link\",\n begin: /:\\s*/,\n end: /$/,\n excludeBegin: true\n }\n ]\n };\n const URL_SCHEME = /[A-Za-z][A-Za-z0-9+.-]*/;\n const LINK = {\n variants: [\n // too much like nested array access in so many languages\n // to have any real relevance\n {\n begin: /\\[.+?\\]\\[.*?\\]/,\n relevance: 0\n },\n // popular internet URLs\n {\n begin: /\\[.+?\\]\\(((data|javascript|mailto):|(?:http|ftp)s?:\\/\\/).*?\\)/,\n relevance: 2\n },\n {\n begin: $84964f0d2be25bfb$var$concat(/\\[.+?\\]\\(/, URL_SCHEME, /:\\/\\/.*?\\)/),\n relevance: 2\n },\n // relative urls\n {\n begin: /\\[.+?\\]\\([./?&#].*?\\)/,\n relevance: 1\n },\n // whatever else, lower relevance (might not be a link at all)\n {\n begin: /\\[.+?\\]\\(.*?\\)/,\n relevance: 0\n }\n ],\n returnBegin: true,\n contains: [\n {\n className: \"string\",\n relevance: 0,\n begin: \"\\\\[\",\n end: \"\\\\]\",\n excludeBegin: true,\n returnEnd: true\n },\n {\n className: \"link\",\n relevance: 0,\n begin: \"\\\\]\\\\(\",\n end: \"\\\\)\",\n excludeBegin: true,\n excludeEnd: true\n },\n {\n className: \"symbol\",\n relevance: 0,\n begin: \"\\\\]\\\\[\",\n end: \"\\\\]\",\n excludeBegin: true,\n excludeEnd: true\n }\n ]\n };\n const BOLD = {\n className: \"strong\",\n contains: [],\n variants: [\n {\n begin: /_{2}/,\n end: /_{2}/\n },\n {\n begin: /\\*{2}/,\n end: /\\*{2}/\n }\n ]\n };\n const ITALIC = {\n className: \"emphasis\",\n contains: [],\n variants: [\n {\n begin: /\\*(?!\\*)/,\n end: /\\*/\n },\n {\n begin: /_(?!_)/,\n end: /_/,\n relevance: 0\n }\n ]\n };\n BOLD.contains.push(ITALIC);\n ITALIC.contains.push(BOLD);\n let CONTAINABLE = [\n INLINE_HTML,\n LINK\n ];\n BOLD.contains = BOLD.contains.concat(CONTAINABLE);\n ITALIC.contains = ITALIC.contains.concat(CONTAINABLE);\n CONTAINABLE = CONTAINABLE.concat(BOLD, ITALIC);\n const HEADER = {\n className: \"section\",\n variants: [\n {\n begin: \"^#{1,6}\",\n end: \"$\",\n contains: CONTAINABLE\n },\n {\n begin: \"(?=^.+?\\\\n[=-]{2,}$)\",\n contains: [\n {\n begin: \"^[=-]*$\"\n },\n {\n begin: \"^\",\n end: \"\\\\n\",\n contains: CONTAINABLE\n }\n ]\n }\n ]\n };\n const BLOCKQUOTE = {\n className: \"quote\",\n begin: \"^>\\\\s+\",\n contains: CONTAINABLE,\n end: \"$\"\n };\n return {\n name: \"Markdown\",\n aliases: [\n \"md\",\n \"mkdown\",\n \"mkd\"\n ],\n contains: [\n HEADER,\n INLINE_HTML,\n LIST,\n BOLD,\n ITALIC,\n BLOCKQUOTE,\n CODE,\n HORIZONTAL_RULE,\n LINK,\n LINK_REFERENCE\n ]\n };\n}", "function generateMarkdown(data) {\n return `# ${data.title}\n\n## Description\n\n${data.description}\n\n## Table of Contents\n\n* [Description](#description)\n* [Installation](#installation)\n* [Contributors](#contributors)\n* [Test](#test)\n* [Username](#username)\n* [Email](#email)\n* [Questions](#questions)\n \n## Installation\n\n${data.installation}\n\n## Contributors\n\n${data.contributors}\n\n## Test\n\n${data.test}\n\n## Username\n\n${data.username}\n\n## Email\n\n${data.email}\n\n## Questions\n\n${data.questions}\n<br>\nGithub link: https://github.com/${data.username} \\t Email: ${data.email}\n`;\n}", "function generateMarkdown(data) {\n return `# ${data.title}\n \n#### Table of Contents\n1. [Description](#description)\n2. [Installation](#installation)\n3. [Usage](#usage)\n4. [Credits](#credits)\n5. [License](#license)\n6. [Questions](#questions)\n## Description\n* ${data.description}\n## Installation \n* ${data.installation}\n## Usage \n* ${data.usage}\n## Credits\n* ${data.credits}\n${renderLicenseSection()}\n${renderLicenseBadge()}\n${renderLicenseLink()}\n\n## Questions\n* For additional help or if you would like to contribute to this project reach out to me at ${data.email}\n* Follow me on Github at [${data.github}](http://github.com/${data.github})`;\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 convertToMarkdown(jira) {\n var md = J2M.toM(jira);\n return md;\n}", "function generateMarkdown(data) {\n return `# ${data.Title}\n\n ## Table of Contents\n 1) [Description](#description)\n 2) [Installation](#installation)\n 3) [Usage](#usage)\n 4) [Contributing](#contributing)\n 5) [Tests](#tests)\n 6) [License](#license)\n 7) [Questions](#questions)\n\n ## Description \n ${data.Description}\n\n ## Installation\n ${data.Installation}\n\n ## Usage\n ${data.Usage}\n\n ## Contributing\n ${data.Contributors}\n\n ## Tests\n ${data.Test}\n\n ## License\n ${renderLicenseBadge(data.License)} \n \n ${data.License}\n\n ${renderLicenseSection(data.License)}\n\n ## Questions\n\n Contact via GitHub:\n [link]{https://github.com/${data.GitHub}}\n\n AND/OR\n\n Contact via email:\n [Email:][mailto:${data.Email}]\n`;\n}", "function markdownDescription(text) { }", "function generateMarkdown(data) {\n return `\n![Licence](https://img.shields.io/badge/LICENSE${data.license}-skyblue)\n# ${data.projectTitle}\n# Description\n${data.description}\n# Table Of Contents\n${data.contents}\n * [Description](#description)\n * [Installation](#installation)\n * [Usage](#usage)\n * [License](#license)\n * [Contributing](#contributing)\n * [Tests](#tests)\n * [Questions](#questions)\n# Installation\n${data.installation}\n# Usage\n${data.usage}\n# Licence \n${data.license}\n# Contributors\n${data.contribute}\n# Test \n${data.test}\n# Questions \n${data.question}<br>\nFor more information you can check my Github account ${data.gitHub}(https://github.com/${data.gitHub}).<br>\nPlease don't hesitate to ask questions you can email me at ${data.email}.\n`\n}", "function generateMarkdown(data) {\n return `\n ## Table of Contents \n ----\n * [Description]\n * [Installation]\n * [License]\n * [Contact]\n \n\n # Description\n ## Title ${data.title}\n ## Project Description ${data.projectDescription}\n ## Image ${data.image}\n ## Git Hub Link ${data.githubLink}\n\n # Installation\n ## Installation instructions ${data.installInfo} \n ## How to use ${data.usageInput}\n\n # License \n ## What type of licensesing does this project fall under\n ## ${data.license}\n\n # Contact and Questions\n ## Creator ${data.name}\n ## Email ${data.email}\n ## Other ${data.otherContact}\n ## Contributors ${data.contributInput}\n\n`;\n}", "function generateMarkdown(answer) {\n\treturn `# ${answer.title}\n## Description\n${answer.description}\n## Table of Contents\n1. [Installation](#installation)\n2. [Usage](#usage)\n\t1. [Testing](#test)\n3. [Contribution](#contribution)\n4. [Contact Me](#contact)\n5. [License](#license)\n## Installation <a name=\"installation\"></a>\n\\`\\`\\`bash\n${answer.installation}\n\\`\\`\\`\n## Usage <a name=\"usage\"></a>\n${answer.usage}\nTo run the tests: <a name=\"test\"></a>\n\\`\\`\\`bash\n${answer.test}\n\\`\\`\\`\n## Contribution <a name=\"contribution\"></a>\n${answer.contributing}\n## Have a question? <a name=\"contact\"></a>\n[Github Account](https://github.com/${answer.github})\nEmail me at ${answer.email}\n## License \n${renderLicenseBadge(answer.license)}\n\n`;\n}", "function generateMarkdown(data) {\n return `\n # ${data.project}\n ${renderLicenseBadge(data.license)}\n \n ## Table of Contents\n [Description](#description)\\n\n [Installation](#installation)\\n\n [Usage](#usage)\\n\n [License](#license)\\n\n [Contributing](#contributing)\\n\n [Tests](#tests)\\n\n [Questions?](#questions-?)\\n\n\n ## Description\n ${data.description}\n\n\n ## Installation \n ${data.instructions}\n\n ## Usage\n ${data.usage}\n\n ## License\n ${renderLicenseSection(data.license)}\n\n ## Contributing\n ${data.contribution}\n\n ## Tests\n ${data.test}\n\n ## Questions?\n Github Profile: https://github.com/${data.github} \\n\n Email me: [${data.email}](mailto:${data.email})\n\n\n\n`;\n}", "function generateMarkdown() {\n var markdownText = (\n ArtemisMarkdown.generateTextHintExplanation(vm.question) +\n \"\\n\\n\" +\n vm.question.answerOptions.map(function (answerOption) {\n return (\n (answerOption.isCorrect ? \"[x]\" : \"[ ]\") + \" \" +\n ArtemisMarkdown.generateTextHintExplanation(answerOption)\n );\n }).join(\"\\n\")\n );\n editor.setValue(markdownText);\n editor.clearSelection();\n }", "function generateMarkdown(data) {\n return `# ${data.title}\n \n ## Description\n ${data.Description}\n \n ## License\n under${data.License}license\n ![github license](https://img.shields.io/badge/%3Clicense%3E-%3CMIT%3E-brightgreen%3E\t\n )\n \n \n ## Table of contents\n ${data.TableOfContents}\n \n ## Installation\n ${data.Installation}\n \n ## Usage\n ${data.Usage}\n \n ## Credits\n ${data.Credits}\n \n ## Test\n ${data.Test}\n \n ## Questions\n ${data.Questions}\n \n ## Username\n ${data.Username}\n \n ## Email\n ${data.Email}\n \n `;\n }", "function generateMarkdown(data) {\n return `\n# ${data.Title}\nhttps://github.com/emilyepozzi/Readme-Generator\n\n## Description\n${data.Description}\n\n# Table of Contents\n* [Installation](#installation)\n* [Usage](#usage)\n* [License](#license)\n* [Contributing](#contributing)\n* [Tests](#tests)\n* [Username](#username)\n\n# Installation\n${data.Installation}\n\n# Usage\n${data.Usage}\n\n# License\n${renderLicenseBadge(data.License)}\n\n## The Main Contributor in this application :\n${data.Contributing}\n\n# Command needed to test this app in terminal :\n${data.Tests}\n\n# Username Information \n${data.Username}\n\n## Contact Inquiry Questions :\n[My personal GitHub Page](https://github.com/emilyepozzi)\n\n `\n}", "function generateMarkdown(data) {\n return `# ${data.title}\n${generateLicenseBadge(data)}\n\n## Description\n${data.description}\n\n## Table of Contents\n${generateTableOfContents(data)}\n${generateInstall(data)}\n${generateUsage(data)}\n${generateFeatures(data)}\n${generateContributing(data)}\n${generateTests(data)}\n${generateLicense(data)}\n${generateDevCredits(data)}\n\n## Questions, Comments, Suggestions\nPlease email [${data.contactPerson}](mailto:${data.contactEmail}) with any questions, to report any bugs, or to make any feature suggestions. You can also [contact ${data.contactPerson} on GitHub](https://www.github.com/${data.contactGitHub}/).\n\nThis README was generated by [Ryan R. Campbell's](https://www.github.com/rrcampbell-exe/) [README Generator](https://github.com/rrcampbell-exe/readme-generator).`\n}", "function markdownRender(userprefs, htmlToText, markdownToHtml,\n syntaxHighlighter, html, targetDocument, url) {\n var extractedText, markedOptions, keepTags, i, processed;\n\n processed = preprocessHtml(html, url);\n\n extractedText = htmlToText(processed.html, {allowTrailingWhitespace: true});\n\n function mathify(mathcode) {\n return userprefs['math-value']\n .replace(/\\{mathcode\\}/ig, mathcode)\n .replace(/\\{urlmathcode\\}/ig, encodeURIComponent(mathcode));\n }\n\n markedOptions = {\n gfm: true,\n pedantic: false,\n sanitize: false,\n tables: true,\n smartLists: true,\n breaks: true,\n smartypants: true,\n langPrefix: 'language-',\n math: userprefs['math-enabled'] ? mathify : null,\n highlight: function(codeText, codeLanguage) {\n return highlightSyntax(\n targetDocument,\n syntaxHighlighter,\n codeText,\n codeLanguage); }\n };\n\n var renderedMarkdown = markdownToHtml(extractedText, markedOptions);\n\n // Re-insert the excluded content that we removed in preprocessHtml\n html = postprocessHtml(renderedMarkdown, processed);\n\n return html;\n }", "function GetMarkdownIt() {\n\tlet md = new markdownIt({\n\t\thtml: true,\n\t\tbreaks: true,\n\t\txhtmlOut: true,\n\t\t// Handle code snippet highlighting, we can catch this error as it will\n\t\t// be correctly handled by markdown-it\n\t\thighlight: function (str, lang) {\n\t\t\tif (lang && hljs.getLanguage(lang)) {\n\t\t\t\ttry {\n\t\t\t\t\treturn hljs.highlight(lang, str).value;\n\t\t\t\t} catch (__) { }\n\t\t\t}\n\t\t\treturn ''; // use external default escaping\n\t\t}\n\t})\n\t// Import headers to ensure that the IDs are escaped\n\tmd.use(require('markdown-it-named-headers'), {\n\t\tslugify: Slug\n\t});\n\n\treturn md;\n}", "function generateMarkdown(answers) {\n return `\n \n# ${answers.title}\n\n\n![badge](https://img.shields.io/badge/license-${answers.license}-brightgreen)<br />\n\n\n\n## Table of Contents\n\n* [Project Description](#project-description)\n* [Installation Instructions](#installation-instructions)\n* [Contribution Guidelines](#contribution-guidelines)\n* [Test Instructions](#test-instructions)\n* [License](#license)\n* [Questions](#questions)\n\n## Project Description <a id=\"project-description\"></a>\n${answers.description}\n\n## Installation Instructions <a id=\"installation-instructions\"></a>\n${answers.installation}\n\n## Contribution <a id=\"contribution-guidelines\"></a>\n${answers.contribution}\n\n## Test Instructions <a id=\"test-instructions\"></a>\n${answers.test}\n\n## License <a id=\"license\"></a>\n![badge](https://img.shields.io/badge/license-${answers.license}-brightgreen)<br />\nThis application is covered by ${answers.license}.\n\n## Questions <a id=\"questions\"></a>\nPlease reach out if you have any questions by emailing ${answers.email}. \n<br /><br />\nGithub Account: [${answers.username}](https://github.com/${answers.username})<br />\n`;\n}", "function generateMarkdown(data) {\n console.log(data);\n return `\n # **${data.title}**\n ${renderLicenseBadge(data.license)} \n\n ## Table of Contents\n 1. [Description](#description)\n 2. [Installation](#installation)\n 3. [Project Usage](#Project-Usage)\n 4. [License Information](#License-Information)\n 5. [Contributors](#Project-Contributors)\n 6. [Testing Instructions](#Testing-Instructions )\n 7. [Contact Info](#Questions)\n \n ## Description\n ${data.description}\n\n ## Installation\n ${data.installation}\n\n ## Project Usage \n ${data.usage}\n\n ## License Information\n ${renderLicenseSection(data.license)}\n\n ## Project Contributors \n ${data.contributing}\n\n ## Testing Instructions \n ${data.tests}\n \n ## Questions?\n ### Please find my contact information below to reach out! \n\n [![Gmail](https://img.shields.io/badge/Gmail-D14836?style=for-the-badge&logo=gmail&logoColor=white)](mailto:${data.emailaddress}) [![Github](https://img.shields.io/badge/GitHub-100000?style=for-the-badge&logo=github&logoColor=white)](https://github.com/${data.github}) \n\n `\n ;\n}", "function generateMarkdown(data) {\n return `# ${data.title}\n ## GitHub: ${data.github}\n ## Description\n ${data.description}\n ## Table of Contents\n\n\n * [Installation](#installation)\n * [Testing](#test)\n * [Usage](#usage)\n ${renderLicenseLink(data.license)}\n\n ## Installation\n The ${data.installation} command should be run to install dependencies.\n\n ## Test\n The ${data.test} command should be run to run tests\n\n ## Usage\n ${data.usage}\n\n ${renderLicenseSection(data.license)}\n This project utilizes the ${data.license} license.\n ${renderLicenseBadge(data.license)}\n ## Contributing\n ${data.contributing}\n \n ## Questions\n If you have any questions, you can contact me via email: ${\n data.email\n }. You can also see my code and contact me on Github: [${\n data.github\n }](https://www.github.com/${data.github}) \n`;\n}", "function convert() {\n\t\tlet result = mdTableToHTML(textarea.val())\n\t\tdivRenderOutput.html(result.html)\n\t\ttextareaHTMLOutput.val(result.htmlString)\n\t}", "function generateMarkdown(data) {\n return `# ${data.name}\n# Table of Contents: \n * [Title](#title)\n * [Description](#description)\n * [Installation](#installation)\n * [Usage](#usage)\n * [Contribution](#contribution)\n * [Tests](#tests)\n * [Questions](#questions)\n * [License](#license)\n * [Email](#email)\n * [GitHub](#github)\n\n# Title: \n${data.title}\n\n# Description:\n${data.description}\n---\n# Installation:\n${data.installation}\n\n# Usage:\n${data.usage}\n\n# Contribution:\n${data.contributors}\n\n# Tests:\n${data.test}\n\n# Questions:\n${data.questions}\n\n# License:\n${badge(data.license)}\n\n# Email:\n${data.email}\n\n# GitHub:\n${data.github}`\n}", "function generateMarkdown(data) {\n return `\n # ${data.title}\n \n ## Project Description\n\n ${data.desc}\n\n ## Table of Contents\n\n [Installation](#installation)\n\n [Usage](#usage)\n\n [License](#license)\n\n [Contributing](#contributing)\n\n [Tests](#testing)\n \n [Questions/Contact](#questions)\n\n ## Installation\n\n Run the following command to install all dependancies for this project:\n\n ~~~\n ${data.installation}\n ~~~\n\n ## Usage\n\n ${data.usage}\n\n ## License\n\n ${renderLicenseBadge(data.license)}\n\n ${renderLicenseSection(data.license)}\n\n ${renderLicenseLink(data.license)}\n\n ## Contributing\n\n ${data.contributing}\n\n ## Testing\n\n Run the following command to test this project:\n\n ~~~\n ${data.test}\n ~~~\n\n ## Questions\n\n If you have any questions, comments, or concerns about this project, you can reach me at the following links:\n \n Email: ${data.email}\n \n GitHub: [${data.githubUser}](https://github.com/${data.githubUser})\n `;\n}", "set markdown(markdown) {\n this\n .renderMarkdown(markdown)\n .then(r => this.renderedMarkdown = r)\n }", "function generateMarkdown(data) {\n\n return `\n${generateBadges(data)}\n\n# ${data.title}\n\n## Description\n\n${data.description}\n\n## Table of Contents\n \n* [Installation](#installation)\n* [Usage](#usage)\n* [Credits](#credits)\n* [License](#license)\n* [Contributing](#contributing)\n* [Tests](#tests)\n* [Questions](#questions)\n \n## Installation\n\n${data.installation}\n\n## Usage\n\n${data.usage}\n\n## Credits\n\n${data.credits}\n\n## License\n\n${data.license}\n\n## Contributing\n\n${data.contributions}\n\n## Tests\n\n${data.tests}\n\n## Questions\n\nContact me at ${data.email}\n\nWork with me at ![${data.github}](https://github.com/${data.github})\n\nProject by ${data.name}\n\n\n\n\nThis ReadMe.md file was generated with the help of ![DevelopedByDay](https://github.com/DevelopedByDay)\n`;\n}", "function mdToHtml(Handlebars, markdownText) {\n // TODO: use precompiled templates OKTA-309852\n // eslint-disable-next-line @okta/okta-ui/no-bare-templates\n var linkTemplate = Handlebars.compile('<a href=\"{{href}}\">{{text}}</a>');\n /* eslint @okta/okta-ui/no-specific-methods: 0*/\n\n var res;\n\n if (!_underscoreWrapper.default.isString(markdownText)) {\n res = '';\n } else {\n res = Handlebars.Utils.escapeExpression(markdownText).replace(RE_LINK_JS, '').replace(RE_LINK, function (mdLink) {\n return linkTemplate({\n href: mdLink.match(RE_LINK_HREF)[1],\n text: mdLink.match(RE_LINK_TEXT)[1]\n });\n });\n }\n\n return new Handlebars.SafeString(res);\n}", "function generateMarkdown(data) {\n return `# ${data.name}\n ## Description \n${data.description}\n## Table of Contents\n*[License]\n*[test]\n*[contributors]\n*[user story]\n\n# User Story \n${data.userstory}\n# Contributors\n${data.contributors}\n# Test \n${data.test}\n#Features\n${data.features}\n# License\n${renderLicenseBadge(data.license)}\n${renderLicenseSection(data.license)}\n${renderLicenseLink(data.license)}\n`;\n}", "function generateMarkdown(data) {\n return `# ${data.Title}\n\n## Table of Contents\n* [Description](#description)\n* [Installation](#installation)\n* [Usage](#usage)\n* [Contributors](#contributors)\n* [Test](#test)\n* [Questions](#questions)\n* [License](#license)\n\n## Description\n${data.Description}\n\n## Installation \n${data.Installation}\n\n## Usage \n${data.Usage}\n\n## Contributors\n${data.Contributors}\n\n## Test\n${data.Test}\n\n## Questions\nContact me:\n\nGithub: [${data.Username}](https://github.com/${data.Username})\n\nEmail: ${data.Email}\n\n## License\n${renderLicenseBadge(data)}\n\n`;\n}", "function readmeToMarkdown() {\n\treturn src( [ 'readme.txt' ] )\n\t\t.pipe( readme( {\n\t\t\tdetails: false,\n\t\t\tscreenshot_ext: [ 'jpg', 'jpg', 'png' ], // eslint-disable-line\n\t\t\textract: {\n\t\t\t\tchangelog: 'CHANGELOG',\n\t\t\t\t'Frequently Asked Questions': 'FAQ',\n\t\t\t},\n\t\t} ) )\n\t\t.pipe( dest( '.' ) );\n}", "function generateMarkdown(data) {\n\n return `\n# ${data.title}\n\n${renderLicenseBadge(data)}<br />\n${renderLicenseLink(data)}\n \n## Description \n${data.description}\n\n## Table of Content\n- [Description](#description)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Licenses](#license)\n- [Contributing](#contributing)\n- [Test](#testApp)\n- [Questions](#questions)\n \n## Installation\n${data.installation}\n \n## Usage\n${data.usage}\n \n## License\n> ${renderLicenseSection(data)}\n \n## Contributing\n${data.contributing}\n \n## Tests\n${data.testApp}\n\n## Questions\nPlease email or reach me on GitHub if you have any questions<br />\n>Find me on GitHub: [${data.username}]('https://github.com/${data.username}')<br />\n>✉️ Email me with any additional questions: ${data.email}`;\n}", "function generateMarkdown(data) {\n return `# ${renderTitle(data.title)} ${renderLicenseBadge(data.license)}\n\n${renderTableOfContents()}\n\n## Description \n\n${renderDescriptionSection(data.description)}\n\n## Installation\n\n${renderInstallatinSection(data.installation)}\n\n## Usage\n\n${renderUsageSection(data.usage)}\n\n## Credits\n\n${renderCreditsSection(data.credits)}\n\n## License\n\n${renderLicenseSection(data.license)}\n\n## Contributing\n\n${renderContributingSection(data.contributing)}\n\n## Tests\n\n${renderTestsSection(data.tests)}\n\n## Questions\n\n${renderQuestionsSection(data.emailAddress, data.gitHubUsername)}\n\n`\n}", "function generateMarkdown(data) {\n var link = \"\";\n switch (data.license) {\n case \"MIT\":\n link =\n \"(https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\";\n break;\n case \"Mozilla Public License 2.0\":\n link =\n \"(https://img.shields.io/badge/License-MPL%202.0-brightgreen.svg)](https://opensource.org/licenses/MPL-2.0)\";\n break;\n case \"Open Database License\":\n link =\n \"(https://img.shields.io/badge/License-ODbL-brightgreen.svg)](https://opendatacommons.org/licenses/odbl/)\";\n break;\n case \"ISC\":\n link =\n \"(https://img.shields.io/badge/License-ISC-blue.svg)](https://opensource.org/licenses/ISC)\";\n }\n\n return `\n [![License: ${data.license} ]${link}\n \n # Table of contents\n [description](#description)\n\n [installation](#installation)\n\n [questions](#questions)\n\n\n # Description\n\n ${data.description}\n\n # installation\n\n This program needs ${data.installation} to be installed before being run\n\n # Questions\n\n My github is ${data.github} if you would like to check out my other repos.\n If you have any questions, please feel free to email me @${data.email}\n\n\n\n\n\n `;\n\n /**\n * the table of contents would be first, with the link for each element within brackets\n * the content of each section would be rendered using the ${} notation and populated with the response object\n * I'm not too worried about the markdown syntax, as I am just happy that I got the function to call and write to a file successfully\n */\n}", "function generateMarkdown(data) {\n\n const install = `## Installation`;\n const usageInfo = `## Usage`;\n const licenseInfo = `## License`;\n const contributorInfo = `## Contributors`;\n const testInstructions = `## Tests`;\n const questionInfo = `## Questions`;\n\n return `# ${data.title}\n ${renderLicenseBadge(data.license)}\n\n ## Github URL 🌐\n[${data.github}](https://github.com/${data.github}/)\n\n## Description 📝\n${data.description}\n \n## Table of Contents 🗒\n* [Installation](#installation)\n* [Usage](#usage)\n${renderLicenseLink(data.license)}\n* [Contributors](#contributors)\n* [Tests](#tests)\n* [Questions](#questions)\n\n${install} \\n\n\nTo Install dependencies run these commands \\n\n${data.dependencies}\n\n${usageInfo}\\n\n\nTo begin the question prompts, in the driectory containing this project, from the command line run node index.\\n Answer all of the following questions, when complete the README.md file will be generated in the dist directory.\n\n${licenseInfo}\\n\n\n${renderLicenseSection(data.license)}\n\n${contributorInfo} \\n \n\n${data.contributors}\n\n${testInstructions}\\n\n\n${data.test}\n\n${questionInfo}\\n\nFor questions about this project, please see my GitHub at [${data.github}](https://github.com/${data.github}) (Or) \\n\nContact me at ${data.email}`\n;\n}", "function generateMarkdown(data) {\n return `\n# ${data.title}\n\n ![${data.licenseResponse}](${renderLicenseBadge(data)})\n\n## Description\n${data.descript}\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [Contributions](#contributions)\n- [Testing](#testing)\n- [License](#license)\n- [Questions](#questions)\n- [Screenshots](#screenshots)\n- [Links](#links)\n\n## Installation\n${data.install}\n\n## Usage\n${data.usage}\n\n## Contributions\n${data.contrib}\n\n## Testing\n${data.test}\n\n## License\n**${renderLicenseLink(data)}**\n\n## Questions\nMy github username is: ${data.github} and the repository for this project is: ${data.repo}\n\nIf you have any questions please contact me at: ${data.email}\n\n## Screenshots\nScreenshot of the deployed project:\n\n![screenshot](${data.images})\n\n\n## Links \nLinks to the deployed project and Github Repository\n\nRepository: **${data.linkRepo}**\n\nDeployed Project: **${data.linkDeploy}**\n`;}", "function generateMarkdown(data) {\n \n return `\n #${data.title}\n\n ## Table of Contents\n ---\n * [Description](#description)\n * [Installation](#installation)\n * [Tests](#tests)\n * [Usage](#usage)\n * [Contributing](#contributing)\n * [Questions](#questions)\n * [License](#license)\n\n ## Description\n ---\n ${data.description}\n\n ## Installation\n ---\n ${data.installation}\n\n ## Tests\n ---\n ${data.tests}\n\n ## Usage\n ---\n ${data.usage}\n\n ## Contributing\n ---\n ${data.contributing}\n\n ## Questions\n ---\n https://github.com/${data.questions}\n\n ## License\n ---\n ${renderLicenseBadge(data.license)}${renderLicenseLink(data.license)}\n\n ${renderLicenseSection(data.license)}\n`\n;\n}", "function generateMarkdown(data) {\n let badges = \"https://img.shields.io/badge/license-MIT-red\";\n if (data.license == \"Apache 2.0\") {\n badges = \"https://img.shields.io/badge/license-Apache-red\";\n } else if (data.license == \"GNU\") {\n badges = \"https://img.shields.io/badge/license-GNU-red\";\n } else {\n badges = \"https://img.shields.io/badge/license-MIT-red\"\n };\n\n return `\n # Title \n ## ${data.title}\n\n ## Description\n ${data.description}\n\n # Table of Contents\n * Installation \n * Contributing \n * Tests \n * Usage \n * Questions\n\n ## Installation:\n ${data.installation} \n ## License:\n ${data.license}\n ![badge](${badges}) \n \n ## Contributors:\n ${data.contributor}\n ## Tests:\n ${data.tests}\n ## Usage:\n ${data.usage} \n ## Questions: \nIf you have any questions, you can contact the creator of this repo here: [${data.email}](mailto:${data.email})\nGitHub: https://github.com/${data.username}\n\n## Author Info\n${data.name}\n\n`;\n}", "function generateMarkdown(data) {\n\t//console.log(Object.entries(data));\n\n\treturn `\n# ${data.title} ${renderLicenseBadge(data.License)}\n\n${getSection(\"Description\", data.desc)}\n\n## Table Of Contents \n${generateTableOfContents(data)}\n\n${getSection(\"Installation\", data.Installation)}\n\n${getSection(\"Usage\", data.Usage)}\n\n${getImageRefs(data.images)}\n\n${getSection(\"Credits\", data.Credits)}\n\n${renderLicenseSection(data.License)}\n\n${getSection(\"Contributing\", data.Contributing)}\n\n${getSection(\"Tests\", data.Tests)}\n\n${getQuestionsSection(\"Questions\", data.email, data.github)}\n\n \n `;\n}", "function generateMarkdown(data) {\n//console.log(data)\n return `\n # ${data.title}\n\n ${renderLicenseBadge(data.license)}\n\n ## Description\n ${data.description}\n\n ## Table of Contents\n - [Description](#description)\n - [Installation](#installation)\n - [Usage](#usage)\n - [License](#license)\n - [Contributing](#contributing)\n - [Tests](#tests)\n - [Questions](#questions)\n\n ## Installation\n ${data.installation}\n\n ## Usage\n ${data.usage}\n\n \n ${renderLicenseSection(data.license)}\n\n\n ## Contributing\n ${data.contributing}\n\n ## Tests\n ${data.test}\n\n ## Questions\n Find me on GitHub: [${data.username}](https://github.com/${data.username})\n \n Email me with any questions: ${data.email}\n\n\n This README was generated with ❤️ by [README-generator](https://github.com/latoyadawson/readME-generator)\n `;\n}", "function transform(html, callback) {\n var convertedHtml = inky.releaseTheKraken(html, opts.cheerio);\n callback(null, convertedHtml);\n }", "saveAsMarkdown() {\n controller.saveAsMarkdown();\n }", "function generateMarkdown(data) {\n return `# ${data.title}\n\n ## Description\n ${data.description}\n\n ## Table of Contents\n * [Installation](#installation)\n * [Usage](#usage)\n * [Tests](#tests)\n * [Credits](#credits)\n * [License](#licenses)\n * [Questions](#questions)\n \n ## Installation\n ${data.installation_instructions}\n \n ## Usage\n ${data.usage_instructions}\n\n ## Tests\n ${data.tests}\n\n ## Credits\n ${data.contributors}\n\n ## Licenses\n ${renderLicenseSection(data.license)}\n ${renderLicenseBadge(data.license)}\n ${renderLicenseLink(data.license)}\n\n ## Questions\n - Github Page: ${data.github_user}\n - Email: ${data.email}\n`;\n}", "function convertMarkdownChoiceBlocks(text, convert) {\n $.each({ checkbox: '[]', radio: '()' }, function(type, chars) {\n // one choice is: open char + maybe x + close char + indented lines\n var singleChoice = '^\\\\' + chars[0] + '([ x])\\\\' + chars[1] + '(.+$(\\n .*)*)';\n var multipleChoices = '(' + singleChoice + '\\n)+';\n // find blocks of choices\n text = text.replace(new RegExp(multipleChoices, 'gm'), function(choices) {\n this.convertedChoiceBlocks = (this.convertedChoiceBlocks || 0) + 1;\n \n // convert individual choices\n var convertedChoices = 0;\n choices = choices.replace(new RegExp(singleChoice, 'gm'), function(choice, checked, label) {\n var id = 'md_converted_choice_' + this.convertedChoiceBlocks + '_' + convertedChoices++;\n var attrs = ' type=\"' + type + '\" id=\"' + id + '\"';\n if (/\\S/.test(checked)) {\n attrs += ' data-form-value=\"check\"';\n }\n if (type == 'radio') {\n // radio buttons must share the name attribute in order to enforce single selection\n attrs += ' name=\"' + 'md_converted_radio_' + this.convertedChoiceBlocks + '\"';\n }\n // de-block recursive conversion of choice label\n label = convert(label).replace(/<p>([^]*)<\\/p>/, '$1');\n return '<div class=\"' + type + '\"><label for=\"' + id + '\"><input' + attrs + '>' + label + '</label></div>';\n });\n // result of converting block is choices wrapped in a div\n return '<div class=\"form-group\">' + choices + '</div>';\n });\n });\n return text;\n}", "function draw_content(rawhtml){\n var _div4 = d3.select(\".markdown_doc\");\n _div4.html(rawhtml);\n}", "function parseMarkdown(mdText) {\n\t\tif (mdText && /^<!---mde-->\\n\\r/i.test(mdText)) {\n\t\t\tmdText = mdText.replace(\"<!---mde-->\\n\\r\", \"\");\n\t\t\tmdText = Marked(mdText);\n\t\t}\n\n\t\treturn mdText;\n\t}", "function parseMarkdown(mdText) {\n\t\tif (mdText && /^<!---mde-->\\n\\r/i.test(mdText)) {\n\t\t\tmdText = mdText.replace(\"<!---mde-->\\n\\r\", \"\");\n\t\t\tmdText = Marked(mdText);\n\t\t}\n\n\t\treturn mdText;\n\t}", "function generateMarkdown(data) {\n return `\n \n#Title\n#${data.Title}\n\n\n\n#description\n#${data.description}\n\n\n#toc\n#${data.toc}\n\n\n#install\n\\`\\`\\` \n${data.install}\n\\`\\`\\` \n\n#license\n#${data.license}\n\n\n#email\n[${data.email}](mailto:${data.email})\n\n\n\n#contributor\n#${data.contributor}\n\n\n#test\n#${data.test}\n\n\n\n#random\n#${data.random}\n\n`;\n}", "function MarkdownFileToBody(filename)\n{\n var callback = function (text) {\n //html = Showdown(text);\n fillDiv(text, gs_body_id);\n }\n getFile(filename, callback, true);\n}", "function generateMarkdown(data) {\n // console.log(data)\n const { github, licenseChoice, confirmLiveLink, liveSiteLink, siteDemoLink, ...info } = data;\n\n return `\n # ${info.projectTitle}\n\n ## Table of Contents\n - [Description](#project-description)\n - [Installation](#installation)\n - [Usage](#usage)\n - [Contribution](#contribution)\n - [Testing](#testing)\n - [Questions](#questions)\n\n\n ## Project Description\n ${info.description}\n ${renderLicenseSection(licenseChoice)} \n ${renderLinkSection(liveSiteLink)}\n ${renderDemo(siteDemoLink)}\n\n ## Installation \n ${info.installationInstructions}\n\n ## Usage \n ${info.usageInstructions}\n\n ## Contribution\n ${info.contributionInstructions}\n\n ## Testing\n ${info.testInstructions}\n\n ## Questions\n Reach out to the repo owner, [${github}](https://github.com/${github}) at ${info.questionsEmail}.\n `;\n}", "function compile_markdown(path) {\n return new Promise(function(resolve, reject) {\n fs.readFile(path, function(err, data) {\n if (err) throw err;\n // pre-compile\n data = data.toString();\n\n // compile asynced\n marked(data, function (err, content) {\n if (err) throw err;\n\n // post-compile\n content = content.toString()\n .replace(/[a-z\\-]+\\.md/gi, function($1) { return $1.replace(/.md$/i, '') + '.html' })\n .replace(/<!\\-\\- \\-\\-lang\\-ex \\-\\->/gi, '<div class=\"lang-ex\">')\n .replace(/<!\\-\\- \\-\\-lang\\-ex-end \\-\\->/gi, '</div>')\n .replace(/<p><strong>Note<\\/strong>/gi, '<p class=\"note\"><strong>Note</strong>');\n\n fs.stat('template.html', function(err, stats) {\n if (err) throw err;\n if (stats && stats.isFile()) {\n fs.readFile('template.html', function(err, template) {\n if (err) throw err;\n fs.writeFile(\n path.replace(/^src/, 'docs')\n .replace(/.md$/, '.html')\n .replace('README.html', 'docs/index.html'),\n template.toString().replace('<!-- content -->', content),\n function(err) {\n if (err) throw err;\n resolve();\n }\n );\n })\n } else {\n fs.writeFile(\n path.replace(/^src/, 'docs')\n .replace(/.md$/, '.html')\n .replace('README.html', 'docs/index.html'),\n content,\n function(err) {\n if (err) throw err;\n resolve();\n }\n );\n }\n });\n\n });\n })\n })\n}", "function generateMarkdown(data) {\n return `# ${data.title}\n${renderLicenseBadge(data.license)}\n## description\n${data.description}\n## contents\n* [installation](#installation)\n* [usage](#usage)\n* [contribution](#contribution)\n* [testing](#testing)\n* [contact](#contact)\n## installation\n${data.installation}\n## usage\n${data.usage}\n## contribution\n${data.contribution}\n## testing\n${data.testing}\n## contact\n* Github: ${data.Github}\n* email: ${data.email}\n`;\n}", "function generateMarkdown(data) {\n let licenseString = renderLicenseBadge(data.license)\n let installerString = genInstaller(data.require)\n let contributeString = giveCredit(data.contributeName)\n let testString= testInstaller(data.test)\n\n\n return `# ${data.title}\n\n## License\n\n${licenseString}\n\n## Table of Contents\n\n * [Installation](#installation)\n * [Usage](#usage)\n * [Credits](#credits)\n * [License](#license)\n \n## Description\n\n${data.description}\n\n<img src=\"demo.jpg\">\n\n## Usage\n\n${data.usage}\n\n## Installation\n\n${installerString}\n\n## Languages\n\n${data.languages}\n\n## Questions\n\n### ${data.github}\n\nhttps://github.com/${data.github}/${data.repo}\n\n## Contributing\n\n${contributeString}\n\n## Tests\n\n${testString}\n\n## Credits\n\n`;\n}", "function generateMarkdown(data) {\n return `# ${data.title}\n ${renderLicenseBadge(data.license)}\n\n ## Description\n ${data.description}\n <p>&nbsp</p>\n\n ## Table of Contents\n * [Installation](#installation)\n * [Usage](#usage)\n * [Contributing](#contributing)\n * [License](#license)\n * [Tests](#tests)\n * [Questions](#questions)\n <p>&nbsp</p>\n\n ## Installation\n To install the required dependencies, run the following command:\n \n ${data.installation}\n <p>&nbsp</p>\n\n ## Usage\n ${data.usage}\n <p>&nbsp</p>\n\n ## Contributing\n ${data.contributions}\n <p>&nbsp</p>\n \n ${renderLicenseSection(data.license)}\n\n ## Tests\n To run tests, use the following command:\n ${data.tests}\n <p>&nbsp</p>\n\n ## Questions\n If you have any questions, contact me via email at: ${data.email}.\n To view more of my work visit my Github at: [${data.github}](https://github.com/${data.github}/).\n`}" ]
[ "0.8640409", "0.74972075", "0.74428976", "0.7378501", "0.7371878", "0.72884965", "0.7280197", "0.70190054", "0.6997466", "0.69668925", "0.6957361", "0.69461393", "0.6830327", "0.6829788", "0.6823085", "0.68093866", "0.6781923", "0.6682228", "0.66651016", "0.66441953", "0.66441953", "0.6641105", "0.66233146", "0.66233146", "0.6608737", "0.6592088", "0.6589548", "0.65310717", "0.6513623", "0.6501631", "0.65003604", "0.6497479", "0.6494157", "0.6493011", "0.64884007", "0.64851344", "0.6473406", "0.64686215", "0.6439472", "0.6433269", "0.6397241", "0.63778853", "0.6369585", "0.6340046", "0.6337242", "0.6325405", "0.6324818", "0.6324516", "0.6321815", "0.62921554", "0.62909245", "0.6290916", "0.6285571", "0.6277449", "0.6266337", "0.626524", "0.62640244", "0.6260355", "0.6257198", "0.62376124", "0.62314945", "0.6230872", "0.62287927", "0.6223323", "0.62230927", "0.6218739", "0.62151814", "0.6211505", "0.61991775", "0.61988646", "0.61935174", "0.61934704", "0.61884594", "0.6186738", "0.6185002", "0.61807287", "0.61783624", "0.6178214", "0.6177421", "0.61706877", "0.61509985", "0.6149116", "0.61475253", "0.61427593", "0.6135928", "0.6134118", "0.61322314", "0.6128382", "0.612679", "0.6125544", "0.6125518", "0.61253285", "0.61253285", "0.61242056", "0.61090094", "0.6105786", "0.61044514", "0.60986847", "0.6096756", "0.60965306" ]
0.7467208
2
You are going to be given an array of integers. Your job is to take that array and find an index N where the sum of the integers to the left of N is equal to the sum of the integers to the right of N. If there is no index that would make this happen, return 1.
function findEvenIndex(arr) { let right_sum = 0, left_sum = 0; for (let i=1; i<arr.length; i++) right_sum = right_sum + arr[i]; for (let i=0, j=1; j<arr.length; i++, j++){ right_sum = right_sum - arr[j]; left_sum = left_sum + arr[i]; if (left_sum === right_sum) return i+1; } return }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findEvenIndex(arr) { \n let leftSum = 0;\n let rightSum = arr.reduce((a, b) => a + b)\n \n for (let i = 0; i < arr.length; i++) {\n \n rightSum -= arr[i];\n \n if (leftSum === rightSum) {\n return i\n }\n \n leftSum += arr[i]\n }\n return -1\n}", "function findEvenIndex(array) {\n const sum = (accu, num) => accu + num;\n \n for (let idx = 0; idx < array.length; idx++) {\n let leftSum = 0;\n let rightSum = 0;\n \n if (idx === 0) rightSum = array.slice(1).reduce(sum, 0);\n leftSum = array.slice(0, idx).reduce(sum, 0);\n rightSum = array.slice(idx + 1).reduce(sum, 0);\n \n if (rightSum === leftSum) return idx;\n }\n \n return -1;\n}", "function findEvenIndex(arr) {\n\n if (arr.length === 1) {\n return 0;\n }\n\n for (let idx = 0; idx < arr.length; idx += 1) {\n let leftSide = arr.slice(0, idx);\n let rightSide = arr.slice(idx + 1);\n\n let leftTotal = leftSide.reduce((accumulator, element) => accumulator + element, 0);\n let rightTotal = rightSide.reduce((accumulator, element) => accumulator + element, 0);\n\n if (leftTotal === rightTotal) {\n return idx;\n }\n }\n\n return -1;\n\n}", "function findEvenIndex(array) {\n for (let idx = 0; idx < array.length; idx += 1) {\n let leftArr = array.slice(0, idx);\n let rightArr = array.slice(idx + 1);\n\n let leftSum = leftArr.reduce((accum, val) => accum + val, 0);\n let rightSum = rightArr.reduce((accum, val) => accum + val, 0);\n\n if (leftSum === rightSum) {\n return idx;\n }\n }\n return -1;\n}", "function balanceIndex(arr){\n for(var i = 1; i < arr.length; i++){\n var left = 0;\n var right = 0;\n for (var leftidx = 0; leftidx < i; leftidx++){\n left += arr[leftidx];\n }\n for (var rightidx = i+1; rightidx < arr.length; rightidx++){\n right += arr[rightidx];\n }\n if (left == right){\n return i;\n }\n }\n return -1;\n}", "function findEvenIndex(arr){\n for(i = 1; i < arr.length-1; i++){\n var left = arr.slice(0,i).reduce((a,b) => a + b)\n var right = arr.slice(i+1).reduce((a,b) => a+b)\n if(left === right){\n return i\n }\n }\n return -1\n}", "function findEvenIndex(arr) {\n if (arr.length < 1 || !arr) {\n return -1;\n }\n for (let i = 0; i < arr.length; i++) {\n if (\n arr.slice(0, i).reduce((x, y) => x + y, 0) ===\n arr.slice(i + 1).reduce((x, y) => x + y, 0)\n ) {\n return i;\n }\n }\n return -1;\n}", "function findNumber(array) {\n let last = array.length + 1;\n let sumOfIndex = Math.floor((last * (last + 1)) / 2);\n let sumOfValues = array.reduce((acc, cv) => acc + cv, 0);\n\n return Math.abs(sumOfIndex - sumOfValues) || last;\n}", "function balanceIndex(arr){\n for(let i = 0; i < arr.length; i++){\n let sumLeft=0, sumRight=0;\n for(let j = 0; j < i; j++){\n sumLeft += arr[j];\n }\n for(let j=arr.length - 1; j > i; j--){\n sumRight += arr[j];\n }\n if(sumLeft === sumRight) return i;\n }\n return -1;\n}", "function findEvenIndex(arr){\r\n let answer=-1\r\n arr.forEach((el, i)=>{\r\n let left=arr.slice(0,i);\r\n let right=arr.slice(i+1);\r\n let leftSum= left.reduce((prev,curr)=>prev + curr, 0)\r\n let rightSum= right.reduce((prev,curr)=>prev + curr, 0)\r\n if(leftSum === rightSum){\r\n answer=i\r\n }\r\n })\r\n return answer\r\n }", "function equalSides(array) {\n if (array.length === 0) return -1;\n\n let leftSum = 0;\n let rightSum = array\n .filter((a, idx) => idx > 0)\n .reduce((acc, a) => acc + a, 0);\n if (array.length === 1 || leftSum === rightSum) return 0;\n\n for (let i = 1; i < array.length; i++) {\n leftSum = leftSum + array[i - 1];\n rightSum = rightSum - array[i];\n\n if (leftSum === rightSum) return i;\n }\n\n return -1;\n}", "function findEvenIndex(arr) {\n const array_sum = array => array.reduce((accumulator, currentValue) => accumulator + currentValue, 0);\n\n for (let i = 0; i <= arr.length; i++) {\n if (array_sum(arr.slice(0, i)) === array_sum(arr.slice(i + 1))) {\n return i;\n }\n }\n\n return -1;\n\n}", "function balanceIndex(arr){\n let total = arr.reduce((a,b)=>a+b);\n let sumleft = 0;\n for(let i =0; i<arr.length; i++){\n total = total- arr[i]\n console.log(\"total and sum left are these:\", total, sumleft)\n if(total == sumleft){\n return i;\n }\n sumleft += arr[i]\n }\n return -1\n\n}", "function balanceIndex(nums) {\n if (nums.length <= 2) {\n return -1;\n }\n\n let leftSum = 0;\n let rightSum = 0;\n\n for (let i = 1; i < nums.length; i++) {\n leftSum += nums[i - 1];\n for (let j = i + 1; j < nums.length; j++) {\n rightSum += nums[j];\n }\n if (leftSum == rightSum) {\n return i;\n }\n rightSum = 0;\n }\n return -1\n}", "function findEquilibriumSlower(arr) { \n //mildly offensive: two running sums, O(n^2)\n //get sum of elements before me and after me\n var sumUp, sumDown; \n for (var i=0, len = arr.length; i < len; i++) { \n sumUp =0;\n sumDown=0; \n for (j=0; j<i; j++) { \n sumUp += arr[j];\n }\n for (k=(arr.length-1); k>i; k--) { \n sumDown += arr[k]; \n }\n if (sumUp === sumDown) { \n return i; \n } \n }\n}", "function balanceIndex(inputArrary) {\n\tfor (let i = 1; i < inputArrary.length; i++) {\n\t\tvar balancePoint = i + 1,\n\t\t\tleftTotal = 0,\n\t\t\trightTotal = 0;\n\t\tinputArrary.slice(0, balancePoint).map(element => leftTotal += element);\n\t\tinputArrary.slice(balancePoint + 1).map(element => rightTotal += element);\n\t\tif (leftTotal === rightTotal) return balancePoint;\n\t}\n\treturn -1;\n}", "function findEvenIndex(arr) {\n let left = 0;\n let right = 0;\n let checker = false;\n \n for (let i = 0; i < arr.length; i++) {\n left = 0;\n right = 0;\n\n for (let x = i; x > 0; x--) {\n left += arr[x-1];\n }\n\n for (let y = (arr.length - (i+1)); y > 0; y--) {\n right += arr[(i+y)];\n }\n\n if (left === right) {\n console.log(i);\n checker = true;\n return i;\n }\n }\n\n if (checker === false) {\n return -1;\n }\n\n}", "function equilibrium_index(a) {\n let res = [];\n for(let i = 0; i < a.length; i++) {\n if (a.slice(0,i).sum2() === a.slice(i+1).sum2()) {\n res.push(i);\n }\n }\n return res;\n}", "function findEvenIndex(arr) {\n let sum_s = 0, sum_e = 0;\n for (let s = 0; s < arr.length; s++) {\n sum_s += arr[s];\n sum_e = 0;\n for (let e = s; e < arr.length; e++) {\n sum_e += arr[e];\n }\n if (sum_s === sum_e) {\n return s;\n }\n }\n return -1;\n}", "function pivotIndex(array, sum = 0, leftSum = 0, rightSum = 0) {\n array.forEach(element => (sum += element));\n\n for (var idx = 0; idx < array.length - 1; idx++) {\n rightSum = sum - leftSum - array[idx];\n if (leftSum === rightSum) {\n return idx;\n }\n leftSum += array[idx];\n }\n return -1;\n}", "function equilibrium_index2(a) {\n let res = [];\n let left = a[0];\n let right = a.slice(1).sum2();\n for(let i = 1; i < a.length; i++) {\n right -= a[i];\n if (left === right) {\n res.push(i);\n }\n left += a[i];\n }\n return res;\n}", "function balanceIndex(nums) {\n if (nums.length < 3) {\n return -1\n }\n \n let left = nums[0]\n let right = 0\n \n for (let i = 2; i < nums.length; i++) {\n right += nums[i]\n }\n \n for (let i = 1; i < nums.length - 1; i++) {\n if (left === right) {\n return i\n }\n \n right -= nums[i + 1]\n left += nums[i]\n }\n return -1\n\n}", "function solution(A) {\n // write your code in JavaScript (Node.js 8.9.4)\n if (A.length === 1) {\n return 1;\n }\n\n let left = 0;\n let right = 0;\n for (let i = 0; i < A.length; i++) {\n if (A[i] >= 0) {\n left = i;\n right = i;\n break;\n } else {\n A[i] *= -1;\n }\n }\n\n let lastVal = A[left];\n let nextVal = lastVal;\n let count = 1;\n while (left >= 0 && right < A.length) {\n if (A[left] !== A[right] && lastVal !== nextVal) {\n count++;\n }\n\n if (left > 0 && A[left] < A[right]) {\n lastVal = A[left];\n left--;\n nextVal = A[left];\n } else if (right < A.length - 1 && A[right] < A[left]) {\n lastVal = A[right];\n right++;\n nextVal = A[right];\n } else if (left > 0) {\n lastVal = A[left];\n left--;\n nextVal = A[left];\n } else if (right < A.length - 1) {\n lastVal = A[right];\n right++;\n nextVal = A[right];\n } else {\n break;\n }\n }\n\n return count;\n}", "function findIndexWhereSumIs9(arr) {\n\n arr.forEach(function(subArr){\n var whereIsit = [];\n var bouncer =subArr[0]+subArr[1]===9;\n if(bouncer){\n whereIsit = subArr;\n return subArr;\n }\n if(!bouncer){\n return -1;\n }\n\n });\n\n}", "function findEvenIndex(arr) {\n // assign two placeholders\n let sum1 = 0\n let sum2 = 0\n // get a full array total sum\n for (let i=0; i<arr.length; i++) {\n sum1 += arr[i]\n console.log(\"Sum1 i: \",sum1)\n }\n // decriment sum1 from index 0, while incrimenting sum2 from index 0\n for (let j=0; j<arr.length; j++) {\n // decriment of sum1\n sum1 -= arr[j]\n console.log(\"Sum1 j: \",sum1)\n // check to see if the two sums are equal\n if (sum2 == sum1) {\n return j\n }\n // incriment of sum2\n sum2 += arr[j]\n console.log(\"Sum2: \", sum2)\n }\n\n return -1\n}", "function findNumber(array) {\n array.sort(function(a,b){ return a - b;});\n\n if( array[0] !== 1 ) {\n return 1;\n }\n\n for( var i = 1; i < array.length; i++ ) {\n if( array[i] !== array[i-1] + 1 )\n return array[i-1] + 1;\n }\n}", "function posSum(array){\n\tif (array.length===0){\n\t\treturn 0\n\t}else {\n\t\tif(array[0] <0) {\n\t\treturn 0 +posSum(array.splice(1))\n\t}\n\treturn array[0]+posSum(array.splice(1))\n}\n}", "function findFirst(arr, leftIdx = 0, rightIdx = arr.length - 1) {\n let middleIdx = Math.floor((leftIdx + rightIdx) / 2);\n\n // all values in the array are 0s\n if (arr[leftIdx] === 0) return 0;\n\n // array has no 0s\n if (arr[leftIdx] && arr[rightIdx]) return -1; \n\n while (leftIdx <= rightIdx) {\n // values at leftIdx and middleIdx both 1\n if (arr[leftIdx] && arr[middleIdx]) {\n if (arr[middleIdx + 1] === 0) {\n return middleIdx + 1;\n } else {\n leftIdx = middleIdx + 1;\n }\n }\n // value at middleIdx is 0\n if (arr[middleIdx] === 0) {\n if (arr[middleIdx - 1] === 1) {\n return middleIdx;\n } else {\n rightIdx = middleIdx - 1;\n }\n }\n\n middleIdx = Math.floor((leftIdx + rightIdx) / 2);\n }\n}", "function findSumSubArray(arr, sum) {\n let startI = 0;\n let currentSum = 0;\n\n for (let j = 0; j < arr.length; j++) {\n currentSum += arr[j];\n\n while (currentSum > sum) {\n currentSum -= arr[startI];\n startI++;\n }\n\n if (currentSum === sum) {\n return (`${startI}, ${j}`);\n }\n }\n\n return false;\n}", "function findEquilibriumFaster(arr) { \n var totalSum, sumUp=0; \n //execute once for each element, execute the callback, passing the previous callback's value and the current element\n totalSum = arr.reduce(function (prev, cur) { return prev + cur })\n //execute once for each element\n for (var i=0; i<arr.length; i++) { \n totalSum -= arr[i];\n if (sumUp === totalSum) { \n return i;\n }\n sumUp += arr[i];\n }\n return undefined; \n}", "function countAdjacentSums(arr, n) {\n var counter = 0;\n arr.forEach(function(ele, i) {\n if (arr[i] + arr[i + 1] === n) {\n counter++;\n }\n })\n console.log(counter);\n return counter;\n}", "function advanced(arr) {\n const n = arr.length;\n let leftSum = 0;\n let rightSum = 0;\n\n for (let i = 1; i < n; i++) {\n rightSum += arr[i];\n }\n\n for (let i = 0, j = 1; i < n; i++, j++) {\n leftSum += arr[i];\n rightSum -= arr[j];\n\n if (leftSum === rightSum) {\n return arr[j];\n }\n }\n\n return arr[0];\n}", "function FindSum(arr = [], T) {\n let leftIndex = 0,\n rightIndex = arr.length - 1;\n while (leftIndex < rightIndex) {\n let cur = arr[leftIndex] + arr[rightIndex];\n if (cur == T)\n return true;\n else if (cur > T)\n rightIndex -= 1;\n else\n leftIndex += 1;\n }\n return false;\n}", "function findPairsWiithMatchingSum(array, sum) {\n let start = 0;\n let end = array.length - 1;\n while (start < end) {\n let currentSum = array[start] + array[end];\n // console.log(`currentSum = ${currentSum}, start = ${start}, end = ${end}`);\n if (currentSum === sum) {\n return true;\n } else if ( currentSum < sum ) {\n start++;\n } else {\n end--;\n }\n }\n return false;\n}", "function ArrayAdditionI(arr) { \n \n // sort array ascending\n arr = arr.sort( function(a,b){return a - b});\n \n var max = arr.pop();\n \n function lookForSolution(){\n function search(sum,i) {\n if ( sum == max ) {\n return true;\n }\n else if ( sum > max || i == arr.length ) {\n return null;\n }\n else {\n return search(sum + arr[i],i + 1) ||\n search(sum,i + 1);\n }\n }\n \n // start search with sum of zero in position zero:\n return search(0,0);\n }\n return lookForSolution() || false; \n \n}", "function getIndexToIns(arr, num) {\n\n // sort the array, need sort function\n let arrSorted = arr.sort((a,b)=>a-b);\n\n // store array length, use in multiple places\n let lengthArraySorted = arrSorted.length;\n \n // initialize result as 0\n let result = 0;\n\n // branch if array is empty\n if (arrSorted === undefined || arrSorted.length == 0) {\n return result;\n }\n\n // branch if num at beginning \n else if (num<=arrSorted[0]) {\n return result;\n }\n\n // branch if num after end\n else if (num>arrSorted[lengthArraySorted - 1]) {\n result = lengthArraySorted\n return result;\n }\n\n // loop through array figure out where it belongs\n else {\n console.log('BranchElse');\n for (let i=0; i<lengthArraySorted; i++) {\n if (num>=arrSorted[i] && num<=arrSorted[i+1]) {\n result = i+1;\n return result;\n }\n }\n }\n\n}", "function posSum(array){\n var sum= 0;\n var post=0;\n if(array.length===0){\n return 0;\n }\n if ( array[0]>0){\n post=array.splice(0,1)[0]\n }else{\n post=0;\n array.splice(0,1)\n }\n return sum+post+posSum(array)\n}", "function sumZeroPar(arr) {\n\tlet left = 0;\n\tlet right = arr.length - 1;\n\t// Iterate trough the sorted array from the left\n\t// If sum = arr[left] + arr[right] === 0 -> return pair\n\t// If sum > 0 , right--\n\twhile (left < right) {\n\t\tlet sum = arr[left] + arr[right];\n\n\t\tif (sum === 0) {\n\t\t\treturn [arr[left], arr[right]];\n\t\t}\n\n\t\t// the number is below if there is one\n\t\tif (sum > 0) {\n\t\t\tright--;\n\t\t}\n\t\t// the number on right is less so there isnt match for the left one\n\t\tif (sum < 0) {\n\t\t\tleft++;\n\t\t}\n\t}\n}", "function equilibrium(a) {\n const eqIndices = [];\n for (let i = 0; i < a.length; i++) {\n const first = a.slice(0, i);\n const second = a.slice(i + 1);\n const sumFirst = first.reduce((acc, curr) => {\n return acc + curr;\n }, 0);\n const sumSecond = second.reduce((acc, curr) => {\n return acc + curr;\n }, 0);\n if (sumFirst === sumSecond) {\n eqIndices.push(i);\n }\n }\n return eqIndices;\n}", "function balancedSums(arr) {\n let sum=0;\n let leftSum =0;\n for(let i=0;i<arr.length;i++){\n sum+=arr[i];\n }\n for (let i = 0; i < arr.length; ++i) { \n sum -= arr[i]; // sum is now right sum for index i \n \n if (leftSum == sum) \n return \"YES\"; \n \n leftSum += arr[i]; \n } \n \n return \"NO\";\n \n}", "function findNumber(arr, num) {\n arr = [21, -9, 15, 2116, -71, 33];\n num = 5;\n let sum = num - arr[0];\n let lastNum;\n for (let i = 0; i < arr.length; i++) {\n if (arr[i] === num) {\n return i;\n } else {\n if (Math.abs(num - arr[i]) - Math.abs(sum) < 0) {\n sum = Math.abs(num - arr[i]);\n lastNum = arr[i];\n }\n }\n }\n return arr.indexOf(lastNum);\n}", "function isThere (arr, num){\n for (let i=0; i <= arr.length; i++){\n if (arr[i] === num){\n return sum;\n } \n }\n return -1;\n}", "function countAdjacentSums(arr, num){\n var count = 0;\n for (var i = 0; i < arr.length; i++) {\n var current = arr[i];\n var next = arr[i+1];\n if (next+current === num){\n count +=1\n }\n }\n return count;\n}", "function getIndx(arr){\r\n\t\r\n\tlet res = arr.reduce(function(t, el, i, arr){\r\n\t\t\r\n\t\treturn t = el < arr[i - 1] ? i : t;\r\n\t\t\r\n\t}, 0);\r\n\t\r\n\treturn res ? res : -1;\r\n\t\r\n}", "function binarySearch(arr, num){\n //assume sorted array with postive integers and no repeating numbers\n // newArr = arr.slice(0,num+1)\n var newArr = arr.slice();\n let index = 0;\n\n\n if(newArr[0] === num) return 0;\n\n function helper(a){\n let arrHalf = Math.floor(a.length/2)\n\n if(a.length ===1 ){\n index = -1;\n return;\n }\n\n if(a[arrHalf] === num){\n index += arrHalf;\n return;\n }\n if(a[arrHalf+1] === num){\n index += arrHalf+1;\n return;\n }\n if(a[arrHalf] > num){\n a = a.slice(0, arrHalf);\n }\n\n if(a[arrHalf] < num){\n index += arrHalf;\n a = a.slice(arrHalf);\n }\n\n helper(a)\n }\n helper(newArr)\n return index\n}", "function twoSumSorted(numArray, target) {\n\n let leftIndex = 0;\n let rightIndex = numArray.length - 1;\n\n while (numArray[leftIndex] + numArray[rightIndex] !== target) {\n\n while (numArray[leftIndex] + numArray[rightIndex] < target) {\n leftIndex++;\n }\n\n while (numArray[leftIndex] + numArray[rightIndex] > target) {\n rightIndex--;\n }\n\n }\n\n return [leftIndex + 1, rightIndex + 1];\n\n // let leftIndex = 0;\n // let rightIndex = numArray.length - 1;\n // let left, right;\n //\n // do {\n //\n // left = numArray[leftIndex];\n // right = numArray[rightIndex];\n //\n // while (left + right < target) {\n // leftIndex++;\n // }\n //\n // while (left + right > target) {\n // rightIndex--;\n // }\n // } while (left + right !== target)\n //\n //\n // return [leftIndex + 1, rightIndex + 1];\n\n\n // while (numArray[numArray.length - 1] + numArray[0] > target) {\n // numArray.pop();\n // }\n //\n // let index = -1;\n //\n // do {\n // let number = numArray.shift();\n // let n = 0;\n // index++;\n //\n // while (n < numArray.length) {\n // if (numArray[n] + number === target) {\n // return [index + 1, index + 2 + n];\n // }\n // n++;\n // }\n // } while (true)\n\n\n // let n = 0;\n //\n // while (true) {\n //\n // let i = n + 1;\n //\n // while (i < numArray.length && numArray[i] < target) {\n // if (numArray[n] + numArray[i] === target) {\n // return [n, i];\n // }\n // i++;\n // }\n // n++;\n // }\n}", "function printResult(arr) {\n arr = arr.map(value => parseInt(value));\n var numbers = [];\n for (var k = 0; k < 10; k++) {\n numbers[k] = 0;\n }\n\n for (var value of arr) {\n numbers[value]++;\n }\n\n var minIndex = 0;\n for (var i = 1; i < numbers.length; i++) {\n if (numbers[i] === 1) {\n for (var j = 0; j < arr.length; j++) {\n if (i === arr[j]) {\n console.log(j + 1);\n return;\n }\n }\n }\n }\n console.log(minIndex);\n}", "function sumAll(arr) {\n arr.sort((a,b) => a -b);\n var sum = arr[0];\n if(arr[0] == arr[1]){\n return sum;\n }else{\n sum++;\n return arr[0] + sumAll([arr[0]+1, arr[1]]);\n }\n}", "function maxSubsetSumNoAdjacent(array) {\n\t// if array is empty return 0\n\tif(array.length === 0) {\n\t\treturn 0;\n\t}\n\t// if length is 1 return the value\n\tif (array.length === 1) {\n\t\treturn array[0];\n\t}\n\t// pointer for n-2\n let second = array[0];\n\t// pointer for n -1\n let first = Math.max(array[0], array[1]);\n\t\n\t// loop through array starting at 2\n\tfor (let i = 2; i < array.length; i++) {\n\t\t// current index - 1\n let current = Math.max(first, second + array[i]);\n second = first;\n first = current;\n\t}\n\t// return last index as it's the max Sum\n\treturn first;\n}", "function sumAll(arr) {\n let sum = 0;\n if (arr[0] <= arr[1]) {\n for (let i = arr[0]; i <= arr[1]; i++) {\n sum += i;\n }\n } else {\n for (let i = arr[1]; i <= arr[0]; i++) {\n sum += i;\n }\n }\n return sum;\n}", "function findSum(array){\n var l = array.length;\n var sum = 0\n //initialize to negative number for first condition of sum > bestSum to always hold true\n var bestSum = -1;\n var length = 0;\n var bestLength = 0;\n\n for (i=0; i<l; i++){\n //only store as bestsum if sum + new element >= 0\n if (sum + array[i] >= 0) {\n sum += array[i]\n length++;\n } else {\n length = 1;\n sum = array[i]\n }\n if (sum > bestSum){\n //initially bestSum = 0 & bestLength = 0\n bestSum = sum;\n bestLength = length;\n } else {\n length = 0;\n sum = 0;\n }\n }\n console.log(bestSum + \" of array length \" + bestLength);\n}", "function missingInt(array){\n array.sort()\n for (let i=0; i<=array.length; i++) {\n if(array[i] + 1 !== array[i+1]){\n return array[i] + 1\n }\n }\n}", "function subarrayWithGivenSum(arr, s) {\n // brute force\n for (let i = 0; i < arr.length; i++) {\n let currSum = 0;\n for (let j = i; j < arr.length; j++) {\n currSum += arr[j];\n if (currSum === s) return [i, j];\n }\n }\n return [-1, -1];\n // two pointer\n // let start = 0, end = 0;\n // let currSum = 0;\n // while (start < arr.length && end < arr.length) {\n // currSum += arr[end];\n // if (currSum === s) return [start, end];\n // if (currSum + arr[end] > s) start++;\n // else if (currSum + arr[end] < s) end++;\n // }\n // while (start < arr.length) {\n // currSum -= arr[start]\n // if (currSum === s) return [start, end];\n // start++;\n // }\n}", "function arraySumN(ary, n) {\n var indicesSumToN = [];\n\n for(i = 0; i < ary.length; i ++){\n var innerArr = ary[i];\n\n if (sumUp(innerArr) === n) {\n indicesSumToN.push(i);\n }\n }\n return indicesSumToN;\n}", "function sumOfZero(arr){\n let left = 0; \n let right = arr.length - 1;\n\n while(left < right){\n let sum = arr[left] + arr[right];\n if(sum === 0){\n return [arr[left], arr[right]];\n }else if(sum < 0){\n left++;\n }else{\n right--;\n }\n }\n}", "function sumPos(array) {\n for (var i = 0; i < array.length; i ++) {\n if (array[i] > 0) {\n array [i] *= 2;\n }\n }\n return array;\n}", "function sumAll(arr) {\n arr.sort((a, b) => { return a >= b ? 1 : -1 });\n const getSumAllNumbersInRange = (n1, n2) => {\n if (n1 === n2) return n1;\n return n1 + getSumAllNumbersInRange(n1 + 1, n2);\n }\n return getSumAllNumbersInRange(arr[0], arr[1]);\n}", "function hasPairSumElement(arr, element) {\n if (arr.length < 2) return [-1]\n let [left, right] = [0, arr.length-1]\n while (left < right) {\n if (arr[left] + arr[right] == element) {\n return [arr[left], arr[right]]\n }\n if (arr[left] + arr[right] > element) {\n right -= 1\n } else {\n left += 1\n }\n }\n return [-1]\n}", "function sumZero(arr){\n let left = 0\n let right = arr.length - 1\n\n // can't overlap because if we have 0 in the array it would be a false positive\n while (left < right) {\n let sum = arr[left] + arr[right]\n if (sum === 0) {\n return [arr[left], arr[right]]\n } else if (sum > 0) {\n right--\n } else {\n left++\n }\n }\n}", "function arrSum (array, start, end, hops){\n sum = 0\n for(var i = start; i < end; i++){\n if ((i - start)%hops == 0){\n sum = sum + array[i];\n }\n }\n\n return sum\n}", "function countZeroes(array) {\n let left = 0;\n let right = array.length - 1;\n\n while (left <= right) {\n const mid = Math.floor((left + right) / 2);\n\n if (array[mid] === 1) left = mid + 1;\n else right = mid - 1;\n }\n\n return array.length - left;\n}", "function isSumPossible1(a, n) {\n var iMdone = 0,\n len = a.length,\n val, i, j;\n\n if (len < 2) {\n return iMdone;\n }\n if (len === 2) {\n return a[0]+a[1] === n ? 1 : 0;\n }\n\n for (i=0; i<len; i+=1) {\n val = a[i];\n \n // since all the test cases pass I assume that the numbers in the array are always positive\n if (val > n) {\n continue;\n }\n if (iMdone) {\n break;\n }\n for (j=i; j < len; j+=1) {\n if ((val + a[j] === n)) {\n iMdone = 1;\n break; \n }\n }\n }\n return iMdone; \n}", "function findTriplets(arr) {\n let count = 0;\n arr.sort((a, b) => a - b);\n if (arr.length <= 3) {\n let sum = arr[0] + arr[1] + arr[2];\n return sum === 0 ? 1 : 0;\n }\n for (let i = 0; i < arr.length - 3; i++) {\n let left = i + 1;\n let right = arr.length - 1;\n while (left < right) {\n let sum = arr[i] + arr[left] + arr[right];\n if (sum === 0) {\n count++;\n left++;\n right--;\n } else if (sum < 0) left++;\n else right--;\n }\n }\n return count;\n}", "function sumFinder(arr, sum) {\n var len = arr.length;\n for(var i = 0; i < len-1; i++) {\n for(var j = i+1; j < len; j++) {\n if (arr[i] + arr[j] === sum) {\n return true;\n }\n }\n }\n return false;\n}", "function sumArray(arr){\n if (arr.length <= 1 || arr === null) return 0;\n\n const maxidx = arr.lastIndexOf(Math.max.apply(null, arr));\n arr.splice(maxidx,1);\n\n const minidx = arr.lastIndexOf(Math.min.apply(null, arr));\n arr.splice(minidx,1);\n\n var sum = 0;\n return sum = arr.reduce(function (accumulator, currentValue) {\n return accumulator + currentValue;\n }, 0);\n\n}", "function solution(A) {\n //key insight: answer will always be from 1 to A.length + 1, inclusive\n\n //keep track of the presence of values in stack. time O(n)\n let isInA = []\n for (let i = 0; i < A.length; i++) {\n if (A[i] > 0 && A[i] <= A.length) {\n isInA[A[i]] = true\n }\n }\n\n // iterate through arr and check if exists in A. If not, return it. time O(n)\n for (let i = 0; i <= isInA.length; i++) {\n if (!isInA[i + 1]) {\n return i + 1\n }\n }\n}", "function sumZero(arr) {\n\n let left = 0;\n let right = arr.length - 1;\n\n while (left < right) {\n let sum = arr[left] + arr[right];\n\n if (sum === 0) {\n return [arr[left], arr[right]];\n } else if (sum < 0) {\n left++;\n } else {\n right--;\n }\n }\n\n}", "function sumZero(arr) {\n let left = 0;\n let right = arr.length - 1;\n\n while (arr[left] < arr[right]) {\n let sum = arr[left] + arr[right];\n if (sum === 0) {\n return [arr[left], arr[right]];\n } else if (sum > 0) {\n right--;\n } else {\n left++;\n }\n }\n}", "function solution(A) {\n const arr = A;\n const len = arr.length;\n let sum = 0;\n\n for (let i = 0; i < len; i++) {\n sum += arr[i];\n }\n\n let curLeft = 0;\n let curRight = 0;\n let lowest;\n for (let i = 0; i < len; i++) {\n curLeft += arr[i];\n curRight = sum - curLeft;\n const diff = Math.abs(curLeft - curRight);\n if (diff < lowest || lowest === undefined) {\n lowest = diff;\n }\n }\n\n return lowest;\n}", "function lowestPositiveInt(arr){\n const sorted = arr.sort();\n\tfor(let i = 0; i < sorted.length; i++){\n \tif(sorted[i] > 0){\n if(sorted[i + 1] - sorted[i] !== 1){\n \treturn sorted[i + 1] - 1; \n } else {\n return sorted[sorted.length - 1] + 1;\n }\n } \n }\n}", "function getIndexToIns(arr, num) {\n if(arr.length==0) {\n return 0;\n }\n arr.sort(function(a,b){return a-b});\n if(num>arr[arr.length-1]) {\n return arr.length;\n }\n for (let i=0; i<arr.length; i++) {\n if(num==arr[i]) {\n return i;\n }\n if(num>arr[i] && num<arr[i+1]) {\n return i+1;\n }\n }\n}", "function sumZero(arr) {\n if(!arr || !arr.length) return 'please provide a sorted array '\n let left = 0;\n let right = arr.length - 1;\n while(left < right) {\n let sum = arr[left] + arr[right];\n if(sum === 0) {\n return [arr[left], arr[right]];\n } else if(sum > 0) {\n right --;\n } else {\n left ++;\n }\n }\n}", "function findPair(array,sum){\n let first = 0; //value at zero Index\n let last = array.length-1;\n\n while(first <= last){\n\n if(array[first] + array[last] == sum){\n return [array[first],array[last]]\n }\n\n if(array[first] + array[last] < sum){\n\n first++;\n\n }\n\n if(array[first] + array[last] > sum){\n last--;\n }\n\n }\n\n return -1;\n\n}", "function increaseArr(arr) {\n let index;\n for(let i = 0; i < arr.length; i++) {\n if(arr[i+1] - arr[i] < 0) {\n index = i;\n break;\n } else {\n index = -1;\n }\n }\n return index;\n }", "function sol26(arr = [2, 3, 1, 1, 2, 4, 2, 0, 1, 1]) {\n // number at idx is the max number of jumps can take\n const dp = arr.slice().fill(Infinity);\n dp[0] = 0;\n\n for (let i = 1; i < arr.length; i++) {\n for (let j = 0; j < i; j++) {\n if (arr[j] + j >= i) {\n if (dp[j] + 1 < dp[i]) {\n dp[i] = dp[j] + 1;\n }\n }\n }\n }\n\n return dp[dp.length - 1];\n}", "function rBinarySearch(arr, target){\n let leftIdx = 0;\n let rigthIdx = arr.length-1 \n\n\n while (leftIdx <= rightIdx) {\n let midpointIdx = leftIdx + Math.floor((rigthIdx - leftIdx) / 2 );\n let midpointVal = arr[midpointIdx];\n if (midpointVal === target) {\n return true;\n } else {\n\n }\n }\n \n while (num > 0) {\n totalSum += num;\n // console.log(totalSum)\n num--\n // console.log(num);\n rBinarySearch(num);\n }\n return totalSum;\n}", "function indexEqualsValueSearch(arr) {\n let min = undefined \n let hi = arr.length-1\n let lo = 0\n while (hi >= lo) {\n let mid = lo + Math.floor((hi - lo)/2)\n if (arr[mid] === mid) {\n min = mid\n if (mid > 0 && arr[mid-1] !== (mid-1)) return min\n hi = mid - 1\n }\n else if (mid < arr[mid]) hi = mid - 1\n else if (mid > arr[mid]) lo = mid + 1\n }\n return (min !== undefined) ? min : -1\n}", "function peak(arr){\n let total = arr.reduce((a,b)=> a+b)\n let sum = 0 \n for(let i=0; i < arr.length; i++){\n if(sum === (total - arr[i])/2){\n return i\n } \n sum = sum + arr[i]\n }\n return -1\n }", "function solution(arr) {\n let max = 0,\n map = arr.reduce((accum, num)=> {\n if(num > 0) accum[num] = true;\n if(num > max) max = num;\n return accum;\n }, {});\n\n for(let i=1; i<=max+1; i++) {\n if(!map[i]) return i;\n }\n}", "function sumZero(arr) {\n let left = 0\n let right = arr.length - 1\n while(left < right) {\n let sum = arr[left] + arr[right]\n if(sum === 0) {\n return [arr[left], arr[right]]\n } else if(sum > 0) {\n right--\n } else {\n left++\n }\n }\n}", "function zeroSum(arr) {\n // start with assigning two pointers. One at the beginning of the array and one at the end\n let left = 0;\n let right = arr.length - 1\n // then loop through the array\n while (left < right) {\n // condition is when the left side is smaller than the right side do something...\n let sum = arr[left] + arr[right]\n // if the sum of the left plus the right === 0 return [arr[left], arr[right]]\n if (sum === 0) {\n return [arr[left], arr[right]]\n // else if sum > 0 then right--\n } else if (sum > 0) {\n right--;\n // else left++\n } else {\n left++;\n }\n }\n // return undefined if no numbers add up to 0\n}", "function getIndexToIns(arr, num) {\n let newArr = arr.slice().sort((a,b) => a - b);\n for (let i = 0 ; i < newArr.length ; i++ ) {\n if (num <= newArr[i] ) {\n return i\n }\n }\n return newArr.length\n}", "function indicesArray(arr, target) {\n let indices = [-1,-1];\n for (let i = 0; i < arr.length; i++) {\n for (let j = i + 1; j < arr.length; j++) {\n if (arr[i] + arr[j] === target) {\n indices[0]=i;\n indices[1]=j;\n return indices;\n }\n }\n }\n return indices;\n}", "function sumZero(arr) {\n let left = 0;\n let right = arr.length - 1;\n while (left < right) {\n let sum = arr[left] + arr[right];\n if (sum === 0) {\n return [arr[left], arr[right]];\n } else if (sum > 0) {\n right--;\n } else {\n left++;\n }\n }\n}", "function sumZero(arr) {\n let left = 0;\n let right = arr.length - 1;\n\n while (left < right) {\n if (arr[left] + arr[right] === 0) {\n return [arr[left], arr[right]];\n } else if (arr[left] + arr[right] > 0) {\n right--;\n } else {\n left++;\n }\n }\n}", "function FindSum(arr = [], T) {\n for (elem in arr) {\n if (binarySearch(T - elem) > -1)\n return true\n }\n return false;\n}", "function sumZero(arr){\n\n //We define position of variables\n let left = 0;\n let right = arr.length -1;\n while(left<right){\n //We are declaring the sum of two arrays\n let sum = arr[left] + arr[right];\n //if the sum is equal to zero then we return a pair of values\n if(sum===0){\n return [arr[left], arr[right]];\n }\n //if sum is greater than zero, then the array of pointers from right side will reduce by 1\n else if (sum>0){\n right--;\n }\n else{\n //if the above condition fails, here it array of pointers from left side will increament\n left++;\n }\n }\n}", "function solution(A, S) {\n // write your code in JavaScript (Node.js 8.9.4\n let result = 0;\n if(A.length<1){\n return result; //base case\n }\n //dymamic\n let runningSum = 0;\n for(let i=0; i<A.length; i++){\n let el = A[i];\n \n runningSum+=el;\n \n // if(el>S){\n // continue;\n // }\n // else if(el===S){\n // result++;\n // }\n // else {\n // remaining=S-el;\n //get left and right of S\n result+= solution(A.slice(0,i), S);\n result+= solution(A.slice(i+1), S);\n //}\n }\n if(Math.floor(runningSum/A.length)===S){\n result++;\n }\n \n \n return result;\n //solutionHelper(A,S,0, A.length-1);\n}", "function sumZero(arr) {\n let left = 0,\n right = arr.length - 1;\n \n while(left < right){\n let sum = arr[left] + arr[right];\n if (sum === 0) {\n return [arr[left], arr[right]];\n } else if (sum > 0) {\n right--;\n } else {\n left++;\n }\n }\n}", "function sumAll(arr) {\n const numbers = [];\n let indx = arr.sort((a, b) => a - b)[0];\n let extreme = arr.sort((a, b) => a - b)[1];\n while (indx < extreme - 1) {\n indx += 1;\n numbers.push(indx);\n }\n let result = arr.concat(numbers).reduce((a, b) => a + b);\n return result;\n}", "function balancePoint(arr){\n for (var i = 1; i < arr.length; i++){\n var left = 0;\n var right = 0;\n for (var leftidx = 0; leftidx < i; leftidx++){\n left += arr[leftidx];\n }\n for (var rightidx = i; rightidx < arr.length; rightidx++){\n right += arr[rightidx];\n }\n if (left == right){\n return true;\n }\n }\n return false;\n}", "function sumZero2(arr) {\n let left = 0\n let right = arr.length - 1\n while (left < right) {\n let sum = arr[left] + arr[right]\n if (sum === 0) {\n return [arr[left], arr[right]]\n } else if (sum > 0) {\n right--\n } else {\n left++\n }\n }\n}", "function findEvenIndex(arr){\n\t// pertama, lakukan inisiasi variabel, jika jumlah sum array dari indek 1 hingga indeks terakhir nilainya 0, maka return 0\n\tvar irisan1 = arr.slice(1,arr.length);\n\tvar value1 = arraySum(irisan1);\n\tif(value1 == 0){\n\t\treturn 0;\n\t}\n\t\n\t//jika syarat diatas tidak memenuhi, maka eksekusi kode dibawah ini\n\t//kode dibawah ini bertujuan untuk mengecek bagian dalam array\n\tfor(var i = 0; i < arr.length-2; i++){\n\t\t//dengan slice() kita menentukan array sisi kanan dan sisi kiri yang akan dihitung serta dijumlahkan\n\t\t//indeks array yang ditengah tidak diikut sertakan dalam perhitungan, karena dia akan direnturn jika kanan dan kiri memiliki nilai sama\n\t\tvar irisan2 = arr.slice(0,1+i);\n\t\tvar irisan3 = arr.slice(0+2+i,arr.length);\n\n\t\t//setelah ditentukan yang mana sisi kiri dan kanan, maka tiap tiap sisi dijumlahkan masing - masing nya\n\t\tvar tempValue2 = arraySum(irisan2);\n\t\tvar tempValue3 = arraySum(irisan3);\n\t\t\n\t\t//didapatkan nilai kanan dan kiri, maka dibandingkan, jika nilainya sama, maka indeks ditengah-tengah kedua sisi tersebut akan direnturn\n\t\tif(tempValue2 == tempValue3){\n\t\t\treturn i+1;\n\t\t}\n\n\t\t//proses ini terus berulang sepanjang banyak array, dan juga tidak ketemu, makan akan dilanjutkan dengan kode dibawah\n\t}\n\n\t// inilah perkondisian terakhir\n\t// lakukan inisiasi variabel, jika jumlah sum array dari indek 0 hingga indeks terakhir-1 nilainya 0, maka return indeks terakhir dari array tersebut\n\tvar irisan4 = arr.slice(0,arr.length-1);\n\tvar value4 = arraySum(irisan4);\n\tif(value4 == 0){\n\t\treturn arr.length-1;\n\t}\n\t//dan jika semua kondisi diatas tidak memenuhi, maka direnturn -1\n\telse{\n\t\treturn -1;\n\t}\n}", "function getIndexToIns(arr, num) {\r\n\tvar sorted = arr.sort(function (a, b) {\r\n\t\t\treturn a - b;\r\n\t\t});\r\n\tfor (var i = 0; i < sorted.length; i++) {\r\n\t\tif (num <= sorted[i]) {\r\n\t\t\treturn i;\r\n\t\t}\r\n\t}\r\n\treturn sorted.length;\r\n}", "function positiveSum(arr){\nreturn arr\n .filter(positivenumbers => positivenumbers > 0)\n .reduce((a,b) => a + b, 0);\n}", "function getIndexToIns(arr, num) {\n let count = 0;\n for (let x=0; x<arr.length; x++){\n if (arr[x] < num) {\n count++;\n }\n }\n return count;\n}", "function solution(A) {\n // Sort the array, so that test element can be found with linear search\n A.sort(function(a, b) { return a - b; });\n\n // Increment the test element. Return it when not in the array.\n let next = 1; // minimum positive integer\n let i = 0;\n while (next === A[i]) {\n next++;\n i++;\n }\n\n return next;\n}", "function checkArray2(arr){\n var idealLength = arr.length + 1;\n var estSum = (idealLength * (idealLength + 1)) / 2;\n var sum = 0;\n var k;\n for (k = 0; k < arr.length; k++) {\n sum += arr[k];\n };\n return estSum - sum;\n}", "function findSum(arr) {\r\n let sum = 0;\r\n for (let i = 0; i < arr.length; i++) {\r\n sum = sum + arr[i];\r\n }\r\n return sum;\r\n}", "function subarraySum(arr, k) {\n let left = 0;\n let right = 0;\n let maxCount = 0;\n let sum = arr[0];\n while (left <= right) {\n console.log(left, right);\n if (sum < k) {\n if (right < arr.length - 1) {\n right++;\n sum += arr[right];\n } else {\n sum -= arr[left];\n left++;\n }\n } else if (sum === k) {\n maxCount++;\n if (right < arr.length - 1) {\n sum -= arr[left];\n left++;\n right++;\n sum += arr[right];\n } else {\n sum -= arr[left];\n left++;\n }\n } else {\n if (right < arr.length - 1) {\n if (right == left) {\n sum -= arr[left];\n left++;\n right++;\n sum += arr[right];\n } else {\n sum -= arr[left];\n left++;\n }\n } else {\n sum -= arr[left];\n left++;\n }\n }\n // }\n }\n return maxCount;\n}" ]
[ "0.7906271", "0.78039396", "0.775093", "0.7715918", "0.76990026", "0.7683487", "0.7554195", "0.74983937", "0.7477046", "0.74080884", "0.739395", "0.7382017", "0.7339562", "0.7195341", "0.71766406", "0.71043175", "0.709105", "0.7086797", "0.7032675", "0.7029075", "0.7018418", "0.6951922", "0.6913933", "0.6905522", "0.68352705", "0.68330985", "0.68217784", "0.67802304", "0.6765965", "0.6730962", "0.672165", "0.671918", "0.6718437", "0.67073613", "0.66985726", "0.66951364", "0.6686971", "0.6677242", "0.6676157", "0.6654371", "0.6622588", "0.66147083", "0.66122806", "0.66111034", "0.6605248", "0.6594053", "0.6549761", "0.6526883", "0.652541", "0.6523705", "0.6523585", "0.6499786", "0.64958805", "0.64886874", "0.6468011", "0.6464596", "0.6463129", "0.64557046", "0.6447056", "0.6446888", "0.64427406", "0.6441699", "0.64342755", "0.6431245", "0.6431152", "0.6425343", "0.6420589", "0.6418993", "0.6418114", "0.6414069", "0.64062434", "0.6405096", "0.63985205", "0.6390206", "0.63881373", "0.63838065", "0.63824624", "0.63749975", "0.6372772", "0.6354063", "0.6347124", "0.6343257", "0.63423777", "0.63422483", "0.63421994", "0.6338227", "0.6326715", "0.63251406", "0.63101596", "0.6305801", "0.63018274", "0.6301443", "0.6297499", "0.6296745", "0.62947094", "0.6290674", "0.6282296", "0.62766033", "0.62761045", "0.6268249" ]
0.75329965
7
End of SocketIO part of the code / FUNCTIONS
function changeTurn(onDisconnect) { gameState.turnIndex = (gameState.turnIndex + 1) % gameState.players.length; // Broadcast turnChange to ALL clients, with disconnected player ID (which exists only if current player disconnected): io.emit('turnChange', onDisconnect); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function socketIOinit(io)\n{\n console.log(\"running on port\");\n //python client connects\n io.on('connection',function(socket){\n // socketListeners\n // call this immediately on PC client\n socket.on('registerListener',function(data){\n console.log(\"uid: \" + data['UID']);\n var uuid = data['UID'];\n if (!socketListeners[uuid]) {\n socketListeners[uuid] = [];\n }\n socketListeners[uuid].push(socket);\n });\n\n socket.on('reqFiles',function(data){\n var client = data[\"client\"];\n var dir = data[\"dir\"];\n var file = data[\"file\"];\n console.log(\"req files\");\n requestFilesFromClient(file, dir, client, socket);\n });\n\n socket.on(\"reqEncrypt\",function(data){\n var client = data[\"client\"];\n console.log(\"req encrypt\");\n encrypt(client);\n });\n\n socket.on(\"reqDecrypt\",function(data){\n var client = data[\"client\"];\n console.log(\"req decrypt\");\n decrypt(client);\n });\n\n socket.on(\"reqKeylog\",function(data){\n var client = data[\"client\"];\n console.log(\"req keylog\");\n keylog(client,socket);\n });\n\n socket.on(\"reqWebcam\",function(data){\n var client = data[\"client\"];\n console.log(\"req webcam\");\n webcam(client,socket);\n });\n\n socket.on(\"reqScreenshot\",function(data){\n var client = data[\"client\"];\n console.log(\"req screenshot\");\n screenshot(client,socket);\n });\n\n socket.on(\"reqTTS\",function(data){\n var client = data[\"client\"];\n var text = data[\"text\"];\n console.log(\"req tts\");\n tts(client,text);\n });\n\n });\n}", "function on_socket_get(message){}", "function on_socket_get(message) {\"use strict\"; }", "function StartSocket (socket, io) {\n\n socket.on('getBlocksAndTxns', () => {\n PushBlockInfo.getCacheData(socket, 'getBlocksAndTxns')\n })\n\n\n socket.on('getPrice', (req) => {\n ChartsPrice.Price(socket, req, 'getPrice')\n })\n\n socket.on('transaction', (req) => {\n Txns.List(socket, req, 'transaction')\n })\n \n socket.on('blocks', (req) => {\n Blocks.List(socket, req, 'blocks')\n })\n\n socket.on('transferDtil', (req) => {\n Txns.Dtil(socket, req, 'transferDtil')\n })\n socket.on('transferPage', (req) => {\n Txns.Page(socket, req, 'transferPage')\n })\n \n socket.on('txnsDexList', (req) => {\n TxnsDex.List(socket, req, 'txnsDexList')\n })\n socket.on('txnsDexDtil', (req) => {\n TxnsDex.Dtil(socket, req, 'txnsDexDtil')\n })\n socket.on('txnsDexPage', (req) => {\n TxnsDex.Page(socket, req, 'txnsDexPage')\n })\n\n socket.on('txnsPending', (req) => {\n TxnsPending.pendingList(socket, req, 'txnsPending')\n })\n socket.on('txnsPendingDtil', (req) => {\n TxnsPending.pendingDtil(socket, req, 'txnsPendingDtil')\n })\n socket.on('txnsPendingPage', (req) => {\n TxnsPending.pendingPage(socket, req, 'txnsPendingPage')\n })\n\n\n socket.on('getAvgData', (req) => {\n getAvgData.Avg(socket, req, 'getAvgData')\n })\n \n socket.on('blockNum', (req) => {\n Blocks.Dtil(socket, req, 'blockNum')\n })\n\n\n socket.on('getOrders', (req) => {\n Orders.List(socket, req, 'getOrders')\n })\n socket.on('OrdersPage', (req) => {\n Orders.List(socket, req, 'OrdersPage')\n })\n\n socket.on('topAccounts', (req) => {\n AccountOther.TopA(socket, req, 'topAccounts')\n })\n socket.on('getAccounts', (req) => {\n AccountOther.TopA(socket, req, 'getAccounts')\n })\n socket.on('accountTxn', (req) => {\n AccountOther.ATxn(socket, req, 'accountTxn')\n })\n socket.on('accountLiloTxn', (req) => {\n AccountOther.ATxn(socket, req, 'accountLiloTxn')\n })\n\n socket.on('transactionChart', (req) => {\n ChartsTxns(socket, req, 'transactionChart')\n })\n socket.on('addressChart', (req) => {\n ChartsAccount(socket, req, 'addressChart')\n })\n\n // socket.on('sendTxns', (req) => {\n // sendTxns.sendTxns(socket, req, 'sendTxns')\n // })\n}", "function Socket() {}", "function onConnect(socket) {\n // When the client emits 'info', this listens and executes\n socket.on('info', function (data) {\n console.info('[%s] %s', socket.address, JSON.stringify(data, null, 2));\n });\n\n //When the document is delete(active status is changed) 'Document:Delete' is emitted\n socket.on('Document:Delete', function (data) {\n socket.broadcast.emit('Document:Delete', data);\n});\n\n socket.on('onDisconnect', function (data) {\n socket.disconnect();\n });\n require('../api/photo/photo.socket').register(socket);\n require('../api/stamp/stamp.socket').register(socket);\n require('../api/signature/signature.socket').register(socket);\n require('../api/mobilelink/mobilelink.socket').register(socket);\n require('../api/links/links.socket').register(socket);\n require('../api/department/department.socket').register(socket);\n require('../api/otp/otp.socket').register(socket);\n require('../api/folder/folder.socket').register(socket);\n require('../api/document/document.socket').register(socket);\n require('../api/sharingpeople/sharingpeople.socket').register(socket);\n require('../api/notification/notification.socket').register(socket);\n require('../api/chat/chat.socket').register(socket);\n require('../api/onlineuser/onlineuser.socket').register(socket);\n require('../api/comment/comment.socket').register(socket);\n require('../api/fieldvalue/fieldvalue.socket').register(socket);\n require('../api/fieldoption/fieldoption.socket').register(socket);\n require('../api/documentlogs/documentlogs.socket').register(socket);\n require('../api/user/user.socket').register(socket);\n require('../api/favorite/favorite.socket').register(socket);\n}", "initSocketIo(){\n // eslint-disable-next-line no-undef\n // eslint-disable-next-line no-undef\n this._socket = io.connect(WEBSOCKET_SERVER_URL);\n const messageInput = this.template.querySelector('.message-input');\n\n if (this._socket !== undefined) {\n\n /**\n * Not necessary for functionality. We are just demonstrates the socket \n * connection with the server by display a counting timestring on the frontend.\n */\n this._socket.on('time', (timeString) => {\n this.timeString = timeString;\n });\n\n /**\n * Listening for activity on the message input field. \n * Handling the socket event emit for when the user is typing \n * and if a chat message was submitted (enter key is pressed).\n */\n messageInput.addEventListener('keydown', (event) => {\n this._socket.emit('usertyping', { userId: this.userId });\n // Tab key for when input field is put into focus.\n if (event.keyCode !== 9) {\n this._socket.emit('usertyping', { userId: this.userId });\n }\n if (event.which === 13 && event.shiftKey === false) {\n event.preventDefault();\n\n const fields = {};\n fields[CONTENT_FIELD.fieldApiName] = messageInput.value;\n fields[USER_FIELD.fieldApiName] = this.userId;\n const message = { apiName: MESSAGE_OBJECT.objectApiName, fields };\n\n createRecord(message)\n .then(() => {\n // Reset the form input field.\n messageInput.value = '';\n // Refresh the message data for other active users.\n this._socket.emit('transmit');\n // Refresh the message data for the current user.\n return refreshApex(this.wiredMessages);\n })\n .catch(error => {\n // eslint-disable-next-line no-console\n console.error('error', error);\n this.error = 'Error creating message';\n });\n }\n });\n\n /**\n * When the user has released typing, debounce the release.\n * After 1 second, emit that the user as not typing at longer. \n * Useful for displaying the typing indicator to the other connected users.\n */\n messageInput.addEventListener('keyup', this.debounce( () => {\n this._socket.emit('usernottyping', { userId: this.userId });\n }, 1000));\n\n /**\n * If we received an event indicating that a user is typing, display \n * the typing indicator if it's not the current user.\n * TODO: Handle specific users typing.\n */\n this._socket.on('istyping', (data) => {\n if (data.userId !== this.userId) {\n this.isTyping = true;\n }\n });\n\n /**\n * If we received an event indicating that a user has stopped typing,\n * stop displaying the typing indicator if it's not the current user.\n * TODO: Handle specific users typing.\n */\n this._socket.on('nottyping', (data) => {\n if (data.userId !== this.userId) {\n this.isTyping = false;\n }\n });\n\n /**\n * Utility socket event to display the chat data for demo\n * purposes only.\n */\n this._socket.on('output', (data) => {\n // eslint-disable-next-line no-console\n console.log('on output', data);\n });\n\n /**\n * Setting various messages received back from the socket connection.\n */\n this._socket.on('status', (data) => {\n if (data.success) {\n messageInput.value = '';\n this.message = data.message;\n this.messageResetDelay('message');\n this.error = '';\n } else if (!data.success) {\n this.error = data.message;\n this.messageResetDelay('error');\n this.message = '';\n }\n })\n\n /**\n * If we're told that a message was sent to the chatroom,\n * refresh the stale messages data.\n */\n this._socket.on('chatupdated', () => {\n return refreshApex(this.wiredMessages);\n });\n\n this._socket.on('refreshChatUsers', () => {\n return refreshApex(this.wiredChatUsers);\n });\n }\n }", "_constructSocketListeners () {\n /* Handles our open event */\n this._ws.addEventListener('open', evt => {\n setInterval(() => {\n this._sendArray([{ m: '+ls' }])\n }, this._roomScanMS)\n this._isConnected = true\n this._sendArray([{ m: 'hi' }])\n this._heartbeatInterval = setInterval(() => {\n this._sendArray([{ m: 't', e: Date.now() }])\n }, this._heartbeatMS)\n this.emit('connected')\n this.setChannel('lobby')\n this._noteFlushInterval = setInterval(() => {\n if (this._noteBufferTime && this._noteBuffer.length > 0) {\n this._sendArray([{ m: 'n', t: this._noteBufferTime + this._serverTimeOffset, n: this._noteBuffer }])\n this._noteBufferTime = 0\n this._noteBuffer = []\n }\n }, this._noteFlushIntervalMS)\n })\n\n /* Handles our close event */\n this._ws.addEventListener('close', evt => {\n clearInterval(this._heartbeatInterval)\n clearInterval(this._noteFlushInterval)\n if (!this.hasErrored) this.emit('disconnected')\n })\n\n /* Handles our errors */\n this._ws.addEventListener('error', error => {\n if (error.message === 'WebSocket was closed before the connection was established') return\n this.emit('error', new Error(error))\n this._ws.close()\n })\n\n /* Handles generic messages */\n this._ws.addEventListener('message', evt => {\n if (typeof evt.data !== 'string') return\n try {\n const transmission = JSON.parse(evt.data)\n for (var i = 0; i < transmission.length; i++) {\n var msg = transmission[i]\n if (msg.m === 'hi') {\n this._recieveServerTime(msg.t, msg.e || undefined)\n }\n if (msg.m === 't') {\n this._recieveServerTime(msg.t, msg.e || undefined)\n }\n if (msg.m === 'a') {\n this.emit('message', {\n content: msg.a,\n user: {\n id: msg.p.id,\n name: msg.p.name,\n color: msg.p.color\n },\n time: msg.t\n })\n }\n if (msg.m === 'ch') {\n this.room.name = msg.ch._id\n this._channelHasJoined = true\n if (this.room.users.length !== 0) return\n msg.ppl.forEach(person => {\n this.room.users.push({\n id: person.id,\n name: person.name,\n color: person.color\n })\n })\n }\n if (msg.m === 'p') {\n const formattedUser = {\n id: msg.id,\n name: msg.name,\n color: msg.color\n }\n this.emit('userJoined', formattedUser)\n this.room.users.push(formattedUser)\n }\n if (msg.m === 'bye') {\n const user = this.room.users.filter(e => e.id === msg.p)[0]\n this.room.users = this.room.users.filter(e => e.id !== msg.p)\n this.emit('userLeave', user)\n }\n if (msg.m === 'ls') {\n this.rooms = []\n msg.u.forEach(room => {\n this.rooms.push({\n name: room._id,\n count: room.count\n })\n })\n this._sendArray([{ m: '-ls' }])\n }\n if (msg.m === 'n') {\n this.emit('notePress', {\n note: msg.n,\n user: msg.p\n })\n }\n }\n } catch (error) {\n this.emit('error', error)\n }\n })\n }", "setupSocket() {\n this.socket = io('/gameroom');\n this.socket.on('connect', () => {\n this.socket.emit('setup_client')\n });\n this.socket.on('packet', this.handleSocketMessages)\n }", "function initSockets(){\n //connect to the io opened tunnel in the server\n var socket = io();\n socket.on(\"Order Status\", function(obj){\n createReadyOrders(obj.nowServing);\n createToBeCooked(obj.kitchen);\n });\n\n}", "function startUp() {\n io.on('connection', function (socket) {\n io.sockets.setMaxListeners(Infinity);\n if (nextOrder > orderLength - 1) {\n stepCount = 0;\n nextOrder = 0;\n }\n var clients = io.sockets.clients(); \n socketArr = Object.values(Object.keys(io.sockets.sockets)); \n\n socket.on('disconnect', function () { \n });\n socket.on('error', function () {\n \n });\n });\n}", "function initSocketIO() {\n io.on('connection', function (socket) {\n\n console.log(\"Client connected\");\n\n currentConnections[socket.id] = {socket: socket};\n\n socket.on('join', function(data) {\n console.log(data);\n console.log(socket.id);\n join(socket, data);\n });\n socket.on('send_emoji', function (data) {\n console.log(data);\n sendEmoji(socket, data);\n });\n socket.on('play_card', function (data) {\n console.log(data);\n playCard(socket, data);\n });\n socket.on('minion_attack', function (data) {\n minionAttackCommand(socket, data);\n });\n socket.on('disconnect', function() {\n var room_id = currentConnections[socket.id]['room_id'];\n if(room_id != undefined && room_id != null && connectionRooms[room_id]) {\n connectionRooms[room_id].forEach(function (player) {\n if(player.socket.id != socket.id) {\n players.push({socket:player.socket, id:player.id});\n }\n player.socket.leave(room_id);\n });\n delete connectionRooms[room_id];\n }\n delete currentConnections[socket.id];\n });\n });\n}", "initSockets() {\n ;\n }", "onConnect(socket) {\n // When the client emits 'info', this listens and executes\n socket.on('info', data => {\n socket.log(JSON.stringify(data, null, 2));\n });\n\n // Insert sockets below\n require('../api/thing/thing.socket').register(socket);\n }", "messageHandler(socket)\n {\n socket.on('message', message =>\n {\n // lo strasforma in un tipo javascript\n const data = JSON.parse(message);\n\n switch(data.type)\n {\n case MESSAGE_TYPES.chain:\n this.blockchain.replaceChain(data.chain);\n break;\n case MESSAGE_TYPES.transaction:\n this.transactionPool.updateOrAddTransaction(data.transaction);\n break;\n case MESSAGE_TYPES.clear_transactions:\n this.transactionPool.clear();\n break;\n }\n });\n }", "function createSocketIOObject(sendFunc, warnFunc=null) {\n\n // Funcs is the list of \"On\" callback functions with their\n // corresponding scope.\n var funcs = {};\n var obj = {};\n\n if(warnFunc)\n var warn = warnFunc;\n else\n var warn = console.log;\n\n\n // Like: socketIO.on('name', function(arg0, arg1, arg2, ...) {})\n //\n obj.On = function(name, func) {\n\n // Make it be able to be set more than one callback for a given\n // name. So if we have an array of functions for a given name\n // than there is more than one callback to call.\n //\n // javaScript is f-ing magic and will save the scope (context) of\n // the function, func, too.\n\n if(funcs[name] === undefined)\n funcs[name] = [];\n funcs[name].push(func);\n };\n\n // Return true if the message is consumed; that is it should have been\n // used up by this interface, even if it failed.\n obj.CheckForSocketIOMessage = function(msg) {\n\n // msg should be like:\n //\n // msg = I{name: funcName, args: [ arg0, arg1, arg2 ] }\n\n if(msg.substr(0,1) !== 'I')\n return false; // The user may handle this message.\n\n try {\n var json = JSON.parse(msg.substr(1));\n } catch {\n warn('bad json parse in msg=' + msg);\n return true; // fail but handled\n }\n\n if(json.name === undefined) {\n warn('No IO name in msg=' + msg);\n return true; // fail but handled\n }\n\n\n if(json.args === undefined || typeof(json.args) !== 'object' ||\n json.args.length === undefined) {\n warn('Bad IO json args in: ' + msg);\n return true; // fail but handled\n }\n\n if(funcs[json.name] === undefined) {\n warn('NO socketIO On \"' + json.name + '\" for message=' + msg);\n return true;\n }\n\n //warn('handling (' + funcs[json.name].length +\n // ') socketIO On \"' + json.name + '\" message');\n\n funcs[json.name].forEach(function(func) {\n\n // Call the callback function with the args:\n func(...json.args);\n });\n\n return true; // success and handled\n }\n\n // Like socketIO.emit()\n //\n // Usage: obj.Emit(name, arg0, arg1, arg2, ...)\n //\n obj.Emit = function(x) {\n\n var args = [].slice.call(arguments);\n var name = args.shift();\n\n // Call the users send function which may add EOT char at the end\n // of the message in the case that the send protocol does not have\n // framing built it. Like for example TCP/IP does not frame\n // messages, but webSockets does frame massages.\n //\n try {\n sendFunc('I' + JSON.stringify({ name: name, args: args }));\n } catch(e) {\n console.log('FAILED to send(name=\"' + name + '\"): ' + e);\n }\n };\n\n if(typeof(window) !== 'undefined')\n // This is not node JS. We do not need addition\n // code for the client browser.\n return obj;\n\n\n // This is node JS:\n \n obj.SetUserName = function(userName) {\n obj.userName = userName;\n }\n\n var count = ++createCount;\n // Add to list of objects. Needed for Broadcast() and\n // BroadcastUser().\n sends[count] = sendFunc;\n objs[count] = obj;\n\n // These methods will Broadcast to all but this obj.\n obj.BroadcastUser = BroadcastUser;\n obj.Broadcast = Broadcast;\n\n\n\n obj.Cleanup = function() {\n\n // Replace this functions with dummies so\n // that events that trigger them will not\n // really call them any more, and they don't\n // try to send() with a closed webSocket.\n\n delete obj.Cleanup;\n obj.CheckForSocketIOMessage = function() {};\n obj.Emit = function() {};\n obj.On = function() {};\n delete sends[count];\n };\n\n return obj;\n}", "messageHandler(socket) \n\t{\n \t\tsocket.on('message', message => {\n \t\tconst data = JSON.parse(message);\n \t\t\tswitch(data.type) \n\t\t\t{\n\t\t\t\t//when another user has a more updated chain.\t\n \t\t\tcase MESSAGE_TYPES.chain:\n \t\t\t\tthis.blockchain.replaceChain(data.chain);\n \t\t\t\tbreak;\n\t\t\t\t//when another user adds to the transaction pool.\n \t\t\tcase MESSAGE_TYPES.transaction:\n \t\t\t\tthis.transactionPool.updateOrAddTransaction(data.transaction);\n \t\t\t\tbreak;\n\t\t\t\t//when another user clears the transaction pool(only happends when mine completes).\n\t\t\t\tcase MESSAGE_TYPES.clear_transactions:\n\t\t\t\t\tthis.transactionPool.clear();\n\t\t\t\t\tbreak;\n \t\t\t}\t\n\t\t});\n\t}", "function InitSocketIOConnections() {\n io.on('connection', (socket) => {\n\n // Notify of user connect\n console.info('User connected');\n\n // Widget socket functions\n\n socket.on('fetch_info_bar_messages', (callback) => {\n //console.info('== Server received request to fetch saved messages for info bar widget, fetching messages...');\n fs.readFile('data/info_bar_messages.txt', 'utf8', (err, data) => {\n if (err) {\n console.error(err);\n return;\n }\n //socket.broadcast.emit('info_bar_update_messages', data);\n callback(data);\n //console.info('== Messages fetched, sending the following:\\n' + data);\n });\n });\n\n socket.on('info_bar_new_messages', (msg) => {\n socket.broadcast.emit('info_bar_new_messages', msg);\n //console.info('== Server received request to change info bar messages, sending now the following:\\n' + msg);\n });\n\n socket.on('info_bar_open', () => {\n socket.broadcast.emit('info_bar_open');\n //console.info('== Server received request to open the information bar, opening now...');\n });\n\n socket.on('send_to_chat', (msg) => {\n SendToChat(msg);\n //console.info('== Server received request to send text to the chat, sending now the following:\\n' + msg);\n });\n\n socket.on('start_stream_signal', () => {\n if (!streaming_mode) {\n StartStreamMode();\n //console.info('== Server is now transitioning to streaming mode...')\n }\n });\n\n // Notify of user disconnect\n socket.on('disconnect', () => {\n console.info('User disconnected');\n });\n });\n}", "setupChatNs() {\r\n\t\tthis.ns.chat.on(\"connection\", baseSocket => {\r\n\t\t\tconst socket = new Proxy(baseSocket, new ExtendedSocket()); //extend socket\r\n\r\n\t\t\tsocket.log(chalk.cyan(\"connected\"));\r\n\t\t\tthis.sockets.add(socket);\r\n\r\n\t\t\t//socket wants to join a room\r\n\t\t\tsocket.on(ACTION_TYPE.JOIN_ROOM, ({\r\n\t\t\t\troom,\r\n\t\t\t\tnick\r\n\t\t\t}) => {\r\n\t\t\t\tsocket.changeRoomTo(room);\r\n\r\n\t\t\t\tif (nick) {\r\n\t\t\t\t\tsocket.nick = nick;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//give the socket a random name if it doesnt have any yet\r\n\t\t\t\tif (!socket.nick) {\r\n\t\t\t\t\tsocket.nick = randomNick();\r\n\t\t\t\t\tsocket.emit(ACTION_TYPE.OWN_NICK_CHANGE, {\r\n\t\t\t\t\t\tuser: {\r\n\t\t\t\t\t\t\tnew: socket.nick\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//send the initial state of the room\r\n\t\t\t\tthis.getRoomState(room).then(state => {\r\n\t\t\t\t\tsocket.emit(ACTION_TYPE.ROOM_STATE, {\r\n\t\t\t\t\t\tstate\r\n\t\t\t\t\t});\r\n\t\t\t\t}).catch(err => console.error(err));\r\n\r\n\t\t\t\t//tell others\r\n\t\t\t\tsocket.broadcastToRoom(ACTION_TYPE.ENTERED_ROOM, {\r\n\t\t\t\t\tuser: socket.user\r\n\t\t\t\t});\r\n\r\n\t\t\t\tsocket.log(chalk.green(\"joined\"), room);\r\n\t\t\t});\r\n\r\n\t\t\t//socket wants to leave a room\r\n\t\t\tsocket.on(ACTION_TYPE.LEAVE_ROOM, ({room}) => {\r\n\t\t\t\tsocket.broadcastToRoom(ACTION_TYPE.LEFT_ROOM, {\r\n\t\t\t\t\tuser: socket.user\r\n\t\t\t\t});\r\n\t\t\t\tsocket.leaveAllRooms();\r\n\t\t\t});\r\n\r\n\t\t\t//socket sent a chat message\r\n\t\t\tsocket.on(ACTION_TYPE.ADD_CHAT_MESSAGE, message => {\r\n\t\t\t\tdb.addChatMessage(socket.currentRoom, message).catch(console.error.bind());\r\n\t\t\t\tsocket.broadcastToRoom(ACTION_TYPE.ADD_CHAT_MESSAGE, {\r\n\t\t\t\t\tmessage\r\n\t\t\t\t});\r\n\t\t\t});\r\n\r\n\t\t\tsocket.on(ACTION_TYPE.OWN_NICK_CHANGE, nick => {\r\n\t\t\t\tsocket.broadcastToRoom(ACTION_TYPE.NICK_CHANGE, {\r\n\t\t\t\t\tuser: {\r\n\t\t\t\t\t\told: socket.nick,\r\n\t\t\t\t\t\tnew: nick\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\tsocket.nick = nick;\r\n\t\t\t});\r\n\r\n\t\t\tsocket.on(\"disconnect\", () => {\r\n\t\t\t\tsocket.broadcastToRoom(ACTION_TYPE.LEFT_ROOM, {\r\n\t\t\t\t\tuser: socket.user\r\n\t\t\t\t});\r\n\t\t\t\tthis.sockets.delete(socket);\r\n\t\t\t\tsocket.log(STRINGS.DISCONNECTED);\r\n\t\t\t});\r\n\r\n\t\t\tsocket.on(\"error\", err => {\r\n\t\t\t\tsocket.log(STRINGS.ERROR, err);\r\n\t\t\t});\r\n\t\t});\r\n\t}", "function socketIo() {\n\n io.on('connection', function (socket) {\n io.removeAllListeners();\n\n Appointment.findOne({\n _id: appointment_id,\n }, function (err, appointment) {\n if (err) {\n res.json({\n err: err\n });\n }\n //If patient has entered the appointment\n if (req.user.type === 'patient') {\n // let doctor_socket_id\n appointment.patient.socket_id = socket.id;\n appointment.patient.status = 'online';\n appointment.save()\n }\n //If doctor has entered the appointment\n else if (req.user.type === 'doctor') {\n // let patient_socket_id\n appointment.doctor.socket_id = socket.id;\n appointment.doctor.status = 'online';\n appointment.save()\n }\n\n if (appointment.doctor.status === 'online' && appointment.patient.status === 'online') {\n\n let users = [appointment.patient.socket_id, appointment.doctor.socket_id]\n\n users.forEach(userID => {\n accessChat(userID)\n })\n\n }\n });\n\n socket.on('typing', (data) => {\n //We're getting the appointment's data because we need the socket ids of our patient and our doctor\n Appointment.findOne({\n _id: appointment_id,\n }, function (err, appointment) {\n\n // If patient sent data that he's typing\n if (data.type === 'patient') {\n //Then we need to send it to the doctor\n if (data.typing === true) {\n socket.broadcast.to(appointment.doctor.socket_id).emit('typing', `${appointment.patient.name} ${appointment.patient.surname} is typing...`)\n }\n //If he's no longer typing \n else {\n socket.broadcast.to(appointment.doctor.socket_id).emit('typing', ``)\n }\n }\n // Else if doctor sent data that he's typing \n else if (data.type === 'doctor') {\n if (data.typing === true) {\n socket.broadcast.to(appointment.patient.socket_id).emit('typing', `Dr. ${appointment.doctor.name} ${appointment.doctor.surname} is typing...`)\n }\n //If he's no longer typing \n else {\n socket.broadcast.to(appointment.patient.socket_id).emit('typing', ``)\n }\n }\n })\n })\n\n socket.on('sendMessage', (data) => {\n //We're getting the appointment's data because we need the socket ids of our patient and our doctor\n Appointment.findOne({\n _id: appointment_id,\n }, function (err, appointment) {\n\n //Push message data to the database's array where chat data is stored\n appointment.chat.push(data);\n appointment.save();\n\n // If the message is from the patient\n if (data.from === 'patient') {\n //Send to doctor\n socket.broadcast.to(appointment.doctor.socket_id).emit('receiveMessage', data)\n }\n // Else if the message is from the doctor \n else if (data.from === 'doctor') {\n //Send to patient\n socket.broadcast.to(appointment.patient.socket_id).emit('receiveMessage', data)\n }\n })\n })\n\n function accessChat(socketID) {\n socket.broadcast.to(socketID).emit('accessChat', 'true')\n }\n\n socket.on('fileUploaded', (data) => {\n Appointment.findOne({\n _id: appointment_id,\n }, function (err, appointment) {\n if (data.from === 'patient') {\n socket.broadcast.to(appointment.doctor.socket_id).emit('fileUploaded')\n } else if (data.from === 'doctor') {\n socket.broadcast.to(appointment.patient.socket_id).emit('fileUploaded')\n }\n })\n })\n\n socket.on('callEvent', (data) => {\n Appointment.findOne({\n _id: appointment_id,\n }, function (err, appointment) {\n if (data.caller === 'patient') {\n socket.broadcast.to(appointment.doctor.socket_id).emit('callEvent', {\n caller: `${appointment.patient.name} ${appointment.patient.surname}`\n })\n } else if (data.caller === 'doctor') {\n socket.broadcast.to(appointment.patient.socket_id).emit('callEvent', {\n caller: `${appointment.doctor.name} ${appointment.doctor.surname}`\n })\n }\n })\n })\n\n socket.on('cancelCall', (data) => {\n Appointment.findOne({\n _id: appointment_id,\n }, function (err, appointment) {\n if (data.from === 'patient') {\n socket.broadcast.to(appointment.doctor.socket_id).emit('cancelCall', {\n caller: `${appointment.patient.name} ${appointment.patient.surname}`\n })\n } else if (data.from === 'doctor') {\n socket.broadcast.to(appointment.patient.socket_id).emit('cancelCall', {\n caller: `${appointment.doctor.name} ${appointment.doctor.surname}`\n })\n }\n })\n })\n\n socket.on('acceptCall', (data) => {\n Appointment.findOne({\n _id: appointment_id,\n }, function (err, appointment) {\n if (data.from === 'patient') {\n socket.broadcast.to(appointment.doctor.socket_id).emit('acceptCall', {\n caller: `${appointment.patient.name} ${appointment.patient.surname}`\n })\n } else if (data.from === 'doctor') {\n socket.broadcast.to(appointment.patient.socket_id).emit('acceptCall', {\n caller: `${appointment.doctor.name} ${appointment.doctor.surname}`\n })\n }\n })\n })\n\n socket.on('endCall', (data) => {\n Appointment.findOne({\n _id: appointment_id,\n }, function (err, appointment) {\n if (data.from === 'patient') {\n socket.broadcast.to(appointment.doctor.socket_id).emit('endCall', {\n end: true\n })\n } else if (data.from === 'doctor') {\n socket.broadcast.to(appointment.patient.socket_id).emit('endCall', {\n end: true\n })\n }\n })\n })\n\n //Video offer\n\n socket.on('videoOffer', (data) => {\n online.forEach(user => {\n if (user.id === data.receiver.id) {\n socket.broadcast.to(user.socketID).emit('videoOffer', data)\n }\n })\n })\n\n socket.on('callAnswer', (data) => {\n let uid = data.uid\n online.forEach(user => {\n if (user.id === data.answerTo.id) {\n socket.broadcast.to(user.socketID).emit('videoOfferAnswer', data)\n //data to send with videoOfferAnswer are the same with the received from callAnswer:\n // {\n // answer: 'accept/decline',\n // answerFrom: {\n // id: data.receiver.id,\n // name: data.receiver.name\n // },\n // answerTo: {\n // id: data.sender.senderId,\n // name: data.sender.senderName\n // }\n // }\n }\n })\n })\n\n socket.on(\"NewClient\", function () {\n if (clients < 2) {\n if (clients == 1) {\n socket.emit('CreatePeer')\n }\n }\n else {\n socket.emit('SessionActive')\n socket.emit('CreatePeer')\n }\n clients++;\n })\n\n socket.on('Offer', function (offer) {\n socket.broadcast.emit(\"BackOffer\", offer)\n })\n\n socket.on('Answer', function (data) {\n this.broadcast.emit(\"BackAnswer\", data)\n })\n\n //Whenever someone disconnects this piece of code executed\n\n socket.on('disc', (data) => {\n Appointment.findOne({\n _id: appointment_id,\n }, function (err, appointment) {\n if (data.from === 'patient') {\n socket.broadcast.to(appointment.patient.socket_id).emit(\"Disconnect\")\n clients--\n } else if (data.from === 'doctor') {\n socket.broadcast.to(appointment.doctor.socket_id).emit(\"Disconnect\")\n clients--\n }\n\n })\n })\n\n socket.on('disconnect', function () {\n if (clients > 0) {\n if (clients <= 2)\n this.broadcast.emit(\"Disconnect\")\n clients--\n }\n\n if (req.user.type === 'patient') {\n Appointment.findOne({\n _id: appointment_id,\n }, function (err, appointment) {\n if (err) {\n console.log(err)\n }\n if (appointment.patient.timesConnected > 0) {\n appointment.type = 'completed'\n }\n appointment.patient.socket_id = ''\n appointment.patient.status = 'offline'\n appointment.save()\n\n //Send event that patient disconnected\n socket.broadcast.to(appointment.doctor.socket_id).emit('peerDisconnected', `Patient left`)\n\n })\n\n } else if (req.user.type === 'doctor') {\n Appointment.findOne({\n _id: appointment_id,\n }, function (err, appointment) {\n if (err) {\n console.log(err)\n }\n if (appointment.doctor.timesConnected > 0) {\n appointment.type = 'completed'\n }\n appointment.doctor.socket_id = ''\n appointment.doctor.status = 'offline'\n appointment.save()\n\n //Send event that doctor disconnected\n socket.broadcast.to(appointment.patient.socket_id).emit('peerDisconnected', `Doctor left`)\n\n })\n\n }\n\n\n });\n });\n }", "function initConn(){\nnode.warn(\"LINE 15: node.path= \" + node.path);\n var socket = require('socket.io-client')(node.host, { path: node.path, multiplex:false });\n node.server = socket; // keep for closing\n handleConnection(socket);\n }", "function socketReady() {\n SOCKET.send(\"R\");\n}", "registerListeners(){\n this.io.on('connection', socket => {\n this.App.debug(\"Client connected\", this.prefix);\n\n this.registerSocketListener(socket, 'send-message', data => {\n this.App.MessageOrm.getByChatName({chatName: data.room}, (err, rows) => {\n if (err) return this.App.throwErr(err, this.prefix);\n if (rows) rows.forEach(row => row.userId = this.App.serializeSalt(row.userId));//Serialize userId\n this.send(this.io.sockets, 'get-message', rows)\n })\n });\n\n this.registerSocketListener(socket, 'refresh', data => {\n this.App.MessageOrm.getByChatName({chatName: data.room}, (err, rows) => {\n if (err) return this.App.throwErr(err, this.prefix);\n if (rows) rows.forEach(row => row.userId = this.App.serializeSalt(row.userId));//Serialize userId\n this.send(this.io.sockets, 'refresh', rows)\n })\n })\n })\n }", "run() {\n this.reset();\n this.socket = net.createConnection({\n 'host': this.host.address, \n 'port': this.port,\n }).setKeepAlive(true); // .setNoDelay(true)\n this.socket.on('connect', this.onConnect);\n this.socket.on('error', this.onError);\n this.socket.on('data', this.onData);\n this.socket.on('close', this.onClose);\n }", "function socket_connect() {\n socket = io('localhost:3000/');\n socket_emitUsername();\n socket_initSocketEventHandlers();\n}", "messageHandler(socket) {\n socket.on('message', (message) => {\n const data = JSON.parse(message);\n\n //when data is more than 1 item, they can be accessed using data.thing\n\n //the data type determines how messageHandler proceeds\n switch (data.type) {\n case MESSAGE_TYPES.chain:\n this.blockchain.replaceChain(data.chain);\n break;\n case MESSAGE_TYPES.transaction:\n this.transactionPool.updateOrAddTransaction(data.transaction);\n break;\n case MESSAGE_TYPES.clear_transactions:\n this.transactionPool.clear();\n\n //when a websocket receives a message of type clear_transactions\n // it calls the transactionPool.clear() method to clear\n // their local transaction pools\n break;\n }\n });\n }", "customSocketRender(socket){\n return null;\n }", "_propagateServerEvents () {\n function socketProperties (socket) {\n const byteSize = require('byte-size')\n const output = {\n bytesRead: byteSize(socket.bytesRead).toString(),\n bytesWritten: byteSize(socket.bytesWritten).toString(),\n remoteAddress: socket.remoteAddress\n }\n if (socket.bufferSize) {\n output.bufferSize = byteSize(socket.bufferSize).toString()\n }\n return output\n }\n\n /* stream connection events */\n const server = this.server\n server.on('connection', socket => {\n this.emit('verbose', 'server.socket.new', socketProperties(socket))\n socket.on('connect', () => {\n this.emit('verbose', 'server.socket.connect', socketProperties(socket))\n })\n socket.on('data', () => {\n this.emit('verbose', 'server.socket.data', socketProperties(socket))\n })\n socket.on('drain', () => {\n this.emit('verbose', 'server.socket.drain', socketProperties(socket))\n })\n socket.on('timeout', () => {\n this.emit('verbose', 'server.socket.timeout', socketProperties(socket))\n })\n socket.on('close', () => {\n this.emit('verbose', 'server.socket.close', socketProperties(socket))\n })\n socket.on('end', () => {\n this.emit('verbose', 'server.socket.end', socketProperties(socket))\n })\n socket.on('error', function (err) {\n this.emit('verbose', 'server.socket.error', err)\n })\n })\n\n server.on('close', () => {\n this.emit('verbose', 'server.close')\n })\n\n /* on server-up message */\n server.on('listening', () => {\n const isSecure = t.isDefined(server.addContext)\n let ipList\n if (this.config.hostname) {\n ipList = [ `${isSecure ? 'https' : 'http'}://${this.config.hostname}:${this.config.port}` ]\n } else {\n ipList = util.getIPList()\n .map(iface => `${isSecure ? 'https' : 'http'}://${iface.address}:${this.config.port}`)\n }\n this.emit('verbose', 'server.listening', ipList)\n })\n\n server.on('error', err => {\n this.emit('verbose', 'server.error', err)\n })\n\n /* emit memory usage stats every 30s */\n const interval = setInterval(() => {\n const byteSize = require('byte-size')\n const memUsage = process.memoryUsage()\n memUsage.rss = byteSize(memUsage.rss).toString()\n memUsage.heapTotal = byteSize(memUsage.heapTotal).toString()\n memUsage.heapUsed = byteSize(memUsage.heapUsed).toString()\n memUsage.external = byteSize(memUsage.external).toString()\n this.emit('verbose', 'process.memoryUsage', memUsage)\n }, 60000)\n interval.unref()\n }", "messageHandler(socket) {\n socket.on('message', message => {\n // change the json object to a JS object store in 'data':\n const data = JSON.parse(message);\n\n switch(data.type) {\n // adjust MESSAGE_TYPE\n case MESSAGE_TYPES.chain:\n this.blockchain.replaceChain(data.chain);\n break;\n case MESSAGE_TYPES.transaction:\n this.transactionPool.updateOrAddTransaction(data.transaction);\n break;\n case MESSAGE_TYPES.transaction:\n this.transactionPool.updateOrAddTransaction(data.transaction);\n break;\n case MESSAGE_TYPES.clear_transactions:\n this.transactionPool.clear();\n break;\n //create function to the node bc stuff (substitute with new bc when new blocks mined)\n }\n });\n }", "setupWebSocket() {\n\n let self = this;\n let filterImsi = self._nconf.get(\"udpRelayService:filterImsi\");\n self.socket.on('connect', function () {\n console.log(\"Connected to NB-IoT relay service\");\n });\n self.socket.on('message', function (data) {\n data.msgStr = new Buffer(data.data, 'base64').toString(\"ascii\");\n data.msgJSON = safelyParseJSON(data.msgStr) || {};\n\n // if set in the config.jsom the messages are filtered bei an imsi\n if (filterImsi === '' || filterImsi === data.imsi) {\n log.L2(dl, '########################');\n log.L2(dl, 'Received from: ' + data.imsi);\n log.L2(dl, \"Reveiced at: \" + data.timestamp);\n log.L2(dl, \"Direction: \" + data.direction);\n log.L2(dl, \"Message_raw: \" + data.msgStr);\n log.L2(dl, \"Message_json: \" + JSON.stringify(data.msgJSON, null, 4));\n log.L2(dl, '########################\\n\\n\\n');\n\n self.emit('jsonData', data);\n }\n });\n\n self.socket.on('disconnect', function () {\n log.L1(dl,\"Disconnected from NB-IoT relay service\");\n });\n\n self.socket.on('error', (error) => {\n log.Err(dl, error);\n });\n\n }", "function init(){\r\n\tsocket = io();\r\n\tsocket.emit(\"startmeup\");\r\n\tsocket.on(\"displayName\",function(name){\r\n\t\tdisplayName(name);\r\n\t});\r\n\t\r\n\t//Get questions from the server\r\n\tsocket.on(\"initialize\",function(questions){\r\n\t\tloadQuestions(questions);\r\n\t});\r\n\t\r\n\t//Load the chat\r\n\tsocket.on(\"loadChat\",function(messages){\r\n\t\tchat(messages);\r\n\t});\r\n\t\r\n\t//Diplay the player's name\r\n\tsocket.on(\"yourname\",function(name){\r\n\t\tdocument.getElementById(\"playername\").innerHTML = \"Username: \" + name;\r\n\t})\r\n\t\r\n\t//Load new message from player\r\n\tsocket.on(\"loadMessage\",function(messages){\r\n\t\tloadMessage(messages);\r\n\t});\r\n\t\r\n\t//Update the scoreboard\r\n\tsocket.on(\"updateScoreboard\",function(scores){\r\n\t\tupdateScoreboard(scores);\r\n\t})\r\n\t\r\n\t//Load next question\r\n\tsocket.on(\"nextQuestion\",function(question){\r\n\t\tloadQuestions(question);\r\n\t})\r\n\t\r\n\t//Display winner onscreen\r\n\tsocket.on(\"winner\",function(name){\r\n\t\tdisplayWinner(name);\r\n\t})\r\n\t\r\n\t//Change player's name colour if they have answered\r\n\tsocket.on(\"hasAnswered\",function(name){\r\n\t\tdocument.getElementById(name).style.color = \"green\";\r\n\t})\r\n\t\r\n\t//Load private message\r\n\tsocket.on(\"privateMessage\",function(incoming){\r\n\t\tloadPrivateMessage(incoming);\r\n\t})\r\n\t\r\n\t//Kick player out and alert them that they've been kicked\r\n\tsocket.on(\"kickedOut\",function(){\r\n\t\talert(\"You've been kicked from the game!\");\r\n\t\tsocket.emit(\"kickMe\");\r\n\t})\r\n\t\r\n\t//Display current question number\r\n\tsocket.on(\"whichRound\", function(round){\r\n\t\tlet curRound = document.getElementById(\"roundnumber\");\r\n\t\tcurRound.innerHTML = \"Question: \" + round;\r\n\t})\r\n}", "function connect(){\n const socket = io(server);\n socket.on('connect', ()=>{\n console.log('connected')\n })\n\n emissionObject ={\n currentName:user.userName,\n currentImg:user.imgUrl,\n date:new Date().getTime,\n message:\"hello world\"\n }\n socket.on(room, (message)=>{\n console.log(`${user.username}: ${user.imgUrl}: ${message}`)\n let textLine = document.createElement(\"li\")\n let image = createImage(user.imgUrl);\n textLine.innerText = `${user.userName}: ${message}`\n textLine.appendChild(image);\n chatbox.appendChild(textLine);\n\n \n }) ;\n\n return socket;\n}", "function netsetup(url)\n{\n\n username = window.prompt(\"Ingresa tu nombre\");\n\n socket = io();\n\n console.log(local);\n\n var sdata = {\n x: local.pos.x,\n y: local.pos.y,\n r: local.radius,\n cr: red(local.color),\n cg: green(local.color),\n cb: blue(local.color),\n name: username\n };\n\n\n socket.on(\"getdata\", function() {\n socket.emit(\"start\", sdata);\n });\n\n socket.on(\"heartbeat\", function(data) {\n players = data;\n });\n\n socket.on(\"createfood\", function(data) {\n food.push(new Food(data.x, data.y));\n });\n\n socket.on(\"removefood\", function(data) {\n console.log(\"Remove food \" + data.index + \" at \" + food[data.index].pos.x + \",\" + food[data.index].pos.y);\n food.splice(data.index, 1);\n });\n\n socket.on(\"clearfood\", function() {\n food = [];\n });\n\n socket.on(\"kill\", function() {\n alert(\"You died\");\n location.reload();\n socket.disconnect();\n });\n\n socket.on(\"setup\", function(data) {\n mapsize = data.mapsize;\n bounds.x = -mapsize;\n bounds.y = -mapsize;\n bounds.w = mapsize*2;\n bounds.h = mapsize*2;\n done = true;\n });\n\n socket.on(\"reload\", function() {\n location.reload();\n });\n}", "onSocketFullyConnected() {\n this.debugOut('socketFullyConnected()');\n this.last_socket_error = null;\n this.emit('open');\n }", "function init_socket(socket) {\n socket.onopen = on_open;\n socket.onclose = on_close;\n socket.onmessage = (raw) => on_message(raw.data);\n}", "function sockets() {\t \n\tio.sockets.on('connection', function(socket) {\n\t socket.send('connected...');\n\t \n\t socket.on('message', function(data) {\n\t\t//~ if (data == 'turn on') {\n\t\t //~ console.log('+');\n\t\t //~ board.digitalWrite(ledPinL, board.HIGH);\n\t\t //~ socket.broadcast.send(\"let there be light!\");\n\t\t//~ }\n\t\t//~ if (data == 'turn off') {\n\t\t //~ console.log('-');\n\t\t //~ board.digitalWrite(ledPinL, board.LOW);\n\t\t //~ socket.broadcast.send(\"who turned out the light?\");\n\t\t//~ }\n\t\t if (data == 'Get moisture') {\n\t\t\tsocket.send(lastMoisture);\n\t\t }\t\t \n\t\treturn;\n\t });\n\t \n\t socket.on('disconnect', function() {\n\t\tsocket.send('disconnected...');\n\t });\n\t});\n}", "function newConnection(socket){\n currentSocket = socket\n\n console.log( Date(Date.now()) + 'new connection: ' + socket.id);\n\n // MAJOR FUNCTIONS TO START OR STOP CONTROL\n socket.on('restartControl', callRestartControl);\n socket.on('launchControl', callLaunchControl);\n socket.on('killControl', callKillControl);\n\n\n // GENERIC FUNCTIONS for DATGui! -mg\n socket.on('sendDatOSC', sendDatOSC); // non-socket specific\n socket.on('sendDatCommand', sendDatCommand); \n socket.on('requestSettings', loadDatPreset);\n socket.on('requestPresets', loadPresetList);\n socket.on('saveSettings', saveDatSettings);\n\n // GENERIC FUNCTIONS FOR Patcher \n socket.on('sendPatchableUpdate', sendPatchableUpdate);\n\n // PAINTBRUSH\n socket.on('paintbrush', sendPaintBrushCoords);\n\n\n // Define Socket Messages and their Corresponding function\n socket.on('muteToggle',muteToggle);\n socket.on('toggleSoundFile',toggleSoundFile);\n // socket.on('turnOffSoundFiles',turnOffSoundFiles);\n socket.on('gestureToggle',gestureToggle);\n socket.on('setVolume',setVolume);\n socket.on('triggerGesture',triggerGesture);\n socket.on('triggerLightGesture', triggerLightGesture)\n socket.on('toggleInterpDisplay',toggleInterpDisplay);\n socket.on('rhToggle',rhToggle);\n socket.on('setRHSpeed',setRHSpeed);\n socket.on('awToggle',awToggle);\n socket.on('setAwVelocity',setAwVelocity);\n socket.on('setAwAmplitude',setAwAmplitude);\n socket.on('setAwPeriod',setAwPeriod);\n socket.on('setAwAngle',setAwAngle);\n socket.on('tlToggle',tlToggle);\n socket.on('setTlState',setTlState);\n socket.on('setTlScaleFactor',setTlScaleFactor);\n socket.on('checkCredentials',checkCredentials);\n socket.on('verifyLogin', verifyLogin);\n socket.on('sleepButton', callSleep);\n socket.on('wakeButton', callWake);\n socket.on('radioLight', radioLight);\n socket.on('behaviourScene', behaviourScene);\n socket.on('load', emitUpdate);\n socket.on('setTimer', setTimerData);\n socket.on('useTimer',settimerActive);\n\n socket.on('setVolumeGeneric',setVolumeGeneric);\n socket.on('setBehaviourIntensity',setBehaviourIntensity);\n \n\n\n /////////////////////////////////////////\n //// Login Functions ////\n /////////////////////////////////////////\n\n function checkCredentials(uPid){\n // log recieved Username, Password, and Connection ID\n console.log( Date(Date.now()) + uPid)\n var uname = uPid[0];\n var psw = uPid[1];\n var id = uPid[2];\n \n // check password\n for (i=0; i<credentials.length; i++){\n credCheck = credentials[i];\n if (credCheck[0] == uname){\n if (credCheck[1] == psw){\n loginId = id;\n boolID = [true,id,credCheck[2]];\n socket.emit('checkedCredentials',boolID);\n console.log( Date(Date.now()) + 'all good')\n return\n }\n else{console.log( Date(Date.now()) + 'incorrect password'); return}\n }\n }\n console.log( Date(Date.now()) + 'username not recognized')\n }\n\n function verifyLogin(inputId){\n console.log(Date(Date.now())+\"input Id: \" +inputId)\n console.log(Date(Date.now())+\"login Id: \" +loginId)\n if (inputId == ('?'+loginId)){\n socket.emit(\"loginVerified\",true)\n }\n else{socket.emit(\"loginVerified\",false)}\n\n }\n\n\n /// load DAT.gui settings from disk for this connection - replaced with a \n // non-connection-specific version above, so I can change programmatically via OSC.\n/*\n function loadDatSettings(data) { // { behaviour: ___, preset: ____ , target: (optional) <- am i using}\n\n console.log( Date(Date.now()) + \" Requesting: \" + data.behaviour + \"_settings_\" + data.preset);\n let raw = fs.readFileSync(behaviourdir + data.behaviour + \"_settings_\" + data.preset + \".json\");\n let s = JSON.parse(raw);\n\n // if(data.target != undefined) { // we are looking for a nested target..\n \n // var t = data.target; // string name of source\n // // for now, hardcode to look in the \"particleSources\" array\n\n // if(s.particleSources[data.target] != undefined) {\n\n // console.log( Date(Date.now()) + \" Sending subset of data called )\n // }\n\n\n \n // }\n\n console.log( Date(Date.now()) + \" Sending data... \");\n socket.emit('updateSettings', { behaviour: data.behaviour, settings: s, presetname: data.preset});\n\n // now sync the rest of my clients to this new preset\n socket.broadcast.emit('syncClients', { beh: data.behaviour, param: 'changeToNewPreset', val: data.preset });\n\n }\n*/\n\n function loadPresetList(beh) {\n console.log( Date(Date.now()) + \" Looking for all \" + beh + \" presets...\");\n // do a directory search for presets that aren't called 'current'.\n\n var presets = [];\n\n var files = glob.sync(behaviourdir+ beh + \"_settings_*.json\");\n for(var filename of files) {\n var p = filename.substring((behaviourdir.length + beh.length+10), filename.lastIndexOf('.json')); // truncate after '_settings_'\n if(p != 'current') {\n presets.push(p); // current is special, don't use it.\n }\n }\n console.log(Date(Date.now()) + \" ... sending: \" + JSON.stringify(presets));\n socket.emit('populatePresets', { behaviour: beh, presetlist: presets });\n\n }\n\n /// save DAT.gui settings to disk (actually, this simply copies the file \"XXXXX_current.json\" to the new filename (hack, but it works!)\n\n function saveDatSettings(data) { // { behaviour: ___, preset: ____ }\n \n console.log( Date(Date.now()) + \" Saving: \" + data.behaviour + \"_settings_\" + data.preset + \".json\");\n fs.copyFile(behaviourdir + data.behaviour + \"_settings_current.json\", behaviourdir + data.behaviour + \"_settings_\" + data.preset + \".json\", (err) => {\n if (err) throw err;\n console.log(\" Success.\");\n });\n\n // sync all my clients' preset lists...\n socket.broadcast.emit('syncClients', { beh: data.behaviour, param: 'reloadPresetList', val: data.preset });\n\n }\n\n //////////\n function callKillControl() {\n killControl();\n }\n\n function callRestartControl() {\n restartControl();\n }\n\n function callLaunchControl() {\n launchControl();\n }\n\n //////////\n\n function sendPaintBrushCoords(coords) {\n paintBrush(coords);\n }\n\n\n //////////\n\n function settimerActive(bool){\n amatriadata.timerActive = JSON.parse(bool)\n rewriteData(amatriadata);\n }\n\n function callSleep(){\n processingSleep()\n }\n\n function callWake(){\n processingWake()\n }\n\n function setTimerData(values){\n \n amatriadata.sleepHour = values[0]\n amatriadata.sleepMin = values[1]\n amatriadata.wakeHour = values[2]\n amatriadata.wakeMin = values[3]\n\n console.log ('Sleep Time: ' + amatriadata.sleepHour + \":\" + amatriadata.sleepMin)\n console.log ('Wake Time: ' + amatriadata.wakeHour + \":\" + amatriadata.wakeMin)\n\n rewriteData(amatriadata);\n createTimerCallback(values);\n }\n\n\n function triggerLightGesture(gesture){\n // OSC message reference: https://support.etcconnect.com/ETC/Consoles/ColorSource/ColorSource_20_and_40_AV/OSC_Commands_for_ColorSource_AV_Console\n killPlaybacks(0,81); // Kills all playbacks\n if (gesture.type == 'playback'){\n console.log( Date(Date.now()) + 'triggering playback: ' + gesture.id + ' at level: ' + gesture.level);\n lightOscClient.send(('/cs/playback/' + gesture.id + '/level'), gesture.level);\n }\n else if (gesture.type == 'cue'){\n console.log( Date(Date.now()) + 'triggering lighting cue: ' + gesture.id);\n lightOscClient.send('/cs/playback/gotocue/' + gesture.id);\n // lightOscClient.send('/cs/playback/go');\n }\n else{\n console.log( Date(Date.now()) + 'unknown light gesture type called');\n }\n }\n\n function killPlaybacks(min,max){\n for(var i = min; i < max; i++){\n lightOscClient.send(('/cs/playback/' + i + '/level'), 0);\n }\n }\n \n // function behaviourScene(scene){\n // console.log( Date(Date.now()) + \" *** SWITCHING TO SCENE: \" + scene + \" [ \" + socket.id + \" ]\");\n // amatriadata.behaviourScene = scene\n // behaviourOscClient.send('/serverMessage/scene', scene);\n // rewriteData(amatriadata);\n // try {\n // loadCues(scene);\n // } catch (err) {\n // console.log(Date(Date.now()) + err);\n // // console.log(Date(Date.now()) + \"No cue_settings file for this scene\");\n // }\n \n // }\n\n function loadCues(scene){\n console.log(Date(Date.now()) + \"clearing existing cues for scene change\");\n for (let i in active_cues){\n clear_timeouts(i);\n }\n console.log(Date(Date.now()) + \"loading cues for scene: \" + scene);\n var cue_settings = fs.readFileSync(behaviourdir + 'cue_settings_' + scene + '.json');\n var cue_settings_json = JSON.parse(cue_settings);\n for (let q in cue_settings_json){\n send_timeout_coummands(q, cue_settings_json[q]);\n }\n }\n\n function send_timeout_coummands(name, cue){\n var timeoutID = setTimeout(console.log, cue.start_time, (Date(Date.now()) + \"starting cue for \" + cue.behaviour + \" , parameter: \" + cue.param)); // console log message for each cue\n if (active_cues[name] == null){\n active_cues[name] = [];\n }\n active_cues[name].push(timeoutID);\n // interpolate the parameter values over the duration of the cue\n var linear_interpolation_delta = cue.end_value - cue.start_value;\n \n for(var step = 0; step <= cue.duration; step += cue_step_interval){\n var interpolation_proportion = step/cue.duration; // should be range 0-1, like a percentage\n var datMessage = {};\n datMessage.behaviour = cue.behaviour;\n datMessage.name = cue.param;\n datMessage.value = cue.start_value + (linear_interpolation_delta * interpolation_proportion);\n if(cue.target != null) { // Target is for specifying a nested behaviour, like gridrunner source\n datMessage.target = cue.target;\n }\n if(cue.behaviour == \"globalSetting\"){\n // can't use sendDatOSC for a global setting\n if(cue.param == \"behaviourIntensity\"){\n timeoutID = setTimeout(setBehaviourIntensity, cue.start_time + step, datMessage.value);\n }\n } else {\n timeoutID = setTimeout(sendDatOSC,cue.start_time + step, datMessage);\n }\n active_cues[name].push(timeoutID);\n }\n }\n\n function clear_timeouts(cue_name){\n for (let i in active_cues[cue_name]) {\n clearTimeout(active_cues[cue_name][i]);\n /// remove [cue name] object from active_cues here.\n }\n }\n\n\n\n function radioLight(value){\n var playback = value[1];\n var destination = value[0];\n var playbackseq = [\"11\",\"12\",\"11\",\"13\",\"14\",\"13\",\"15\",\"16\",\"15\"];\n\n if (destination == 'grotto'){ amatriadata.grottoPlayback = playback;}\n else if (destination == 'river'){amatriadata.riverPlayback = playback;}\n else if (destination == 'cloud'){amatriadata.cloudPlayback = playback;}\n rewriteData(amatriadata);\n killPlaybacks(30,36);\n var idx = playbackseq.indexOf(playback);\n if (idx != -1){\n console.log ('turning on playback: ' + playback + ' turning off playback: ' + playbackseq[idx+1]);\n\n // until we know how to do a fade without colors, we need to just turn them on:\n // fadeplayback(playback,true,2000);\n \n \n // just set the other playback directly to zero\n // if we had a way to get a playbacks current value from the CS40\n // we could lerp this nicely from current value to zero\n // but untill we figure that out this works - KC\n lightOscClient.send(('/cs/playback/' + playback + '/level'), 1); \n lightOscClient.send(('/cs/playback/' + playbackseq[idx+1] + '/level'), 0); \n }\n else{\n console.log ('turning off: ' + destination);\n var p1 = 0;\n var p2 = 0;\n if (destination == 'grotto'){p1=11;p2=12;}\n else if (destination == 'river'){p1=13;p2=14;}\n else if (destination == 'cloud'){p1=15;p2=16;}\n\n // see above re: lerping values to zero\n lightOscClient.send(('/cs/playback/' + p1 + '/level'), 0);\n lightOscClient.send(('/cs/playback/' + p2 + '/level'), 0);\n\n }\n }\n\n\n function muteToggle(data){\n if (!amatriadata.muteState) {\n audioOscClient.send('/masterMute', 0);\n console.log( Date(Date.now()) + 'muting audio');\n amatriadata.muteState = true;\n amatriadata.manualMute = true; \n }\n else{\n audioOscClient.send('/masterMute', 1);\n console.log( Date(Date.now()) + 'unmuting audio');\n amatriadata.muteState = false;\n amatriadata.manualMute = true; // back to manual \n }\n rewriteData(amatriadata);\n socket.broadcast.emit('muteToggle', muteState);\n\n }\n\n function toggleSoundFile(file){\n audioOscClient.send('/toggle' + file);\n console.log(Date(Date.now()) + 'playing sound file: ' + file);\n\n }\n\n // function toggleSoundFile(file){\n // switch (file) {\n // case 'MeanderComp01':\n // if(!amatriadata.playingMeanderComp01) {\n // audioOscClient.send('/toggle' + file);\n // console.log(Date(Date.now()) + 'playing sound file: ' + file);\n // amatriadata.playingMeanderComp01 = true;\n // }\n // else {\n // audioOscClient.send('/toggle' + file);\n // console.log(Date(Date.now()) + 'stopping sound file: ' + file);\n // amatriadata.playingMeanderComp01 = false;\n // }\n // rewriteData(amatriadata);\n // break;\n \n // case 'Track8Min':\n // if(!amatriadata.playingTrack8Min) {\n // if(amatriadata.playingMeanderComp01)\n // audioOscClient.send('/toggleMeanderComp01'); // turn off MeanderComp01\n // audioOscClient.send('/toggle' + file);\n // console.log(Date(Date.now()) + 'playing sound file: ' + file);\n // amatriadata.playingMeanderComp01 = false;\n // amatriadata.playingTrack8Min = true;\n // }\n // else {\n // audioOscClient.send('/toggle' + file);\n // console.log(Date(Date.now()) + 'stopping sound file: ' + file);\n // amatriadata.playingTrack8Min = false;\n // }\n // rewriteData(amatriadata);\n // break;\n // default:\n // console.log(Date(Date.now()) + 'unrecognized sound file requested: ' + file);\n // break;\n // }\n // }\n\n // function turnOffSoundFiles() {\n // console.log(Date(Date.now()) + 'stopping any playing sound files');\n // if(amatriadata.playingTrack8Min) {\n // audioOscClient.send('/toggleTrack8Min');\n // console.log(Date(Date.now()) + 'toggling ------------------------------');\n // amatriadata.playingTrack8Min = false;\n // }\n // rewriteData(amatriadata);\n // }\n\n function gestureToggle(data){\n // Set State Directly\n if (typeof data == 'boolean'){\n if (data){\n behaviourOscClient.send('/sensorGestures/toggle', 1);\n console.log( Date(Date.now()) + 'Directly setting sensor sound gestures on');\n amatriadata.gestureState = data;\n }\n else {\n behaviourOscClient.send('/sensorGestures/toggle', 0);\n console.log( Date(Date.now()) + 'Directly setting sensor sound gestures off');\n amatriadata.gestureState = data;\n }\n }\n \n else{\n // Toggle\n if (!amatriadata.gestureState) {\n behaviourOscClient.send('/sensorGestures/toggle', 1);\n console.log( Date(Date.now()) + 'setting sensor sound gestures on');\n amatriadata.gestureState = true;\n }\n else{\n behaviourOscClient.send('/sensorGestures/toggle', 0);\n console.log( Date(Date.now()) + 'setting sensor sound gestures off');\n amatriadata.gestureState = false;\n }\n }\n rewriteData(amatriadata);\n }\n\n function setVolume(volume){\n audioOscClient.send('/masterVolume', parseFloat(volume));\n console.log( Date(Date.now()) + 'Volume: ' + volume);\n amatriadata.masterVolume = volume;\n rewriteData(amatriadata);\n }\n\n function toggleInterpDisplay(value){\n //toggle message based on current state\n var interpOscClient = null\n var piMonitorState = false\n if (value == 1){\n interpOscClient = interpOscClient1\n piMonitorState = piMonitorState1\n piMonitorState1 = !piMonitorState1\n }\n else if (value == 2){\n interpOscClient = interpOscClient2\n piMonitorState = piMonitorState2\n piMonitorState2 = !piMonitorState2\n }\n else if (value == 3){\n interpOscClient = interpOscClient3\n piMonitorState = piMonitorState3\n piMonitorState3 = !piMonitorState3\n }\n\n var message = 'on';\n if (piMonitorState){\n message = 'off';\n }\n\n // use incoming value to specify pi unit number\n interpOscClient1.send('/pipresents/unit01/core/monitor', message);\n console.log( Date(Date.now()) + 'Toggling Pi ' + value + \"with state: \" + message);\n }\n\n // Triggers Max Gesture based on button ID\n function triggerGesture(gestureNum){\n var soundOrNoise = ((Math.random() < 0.90) ? 1 : 2); // 10 percent chance it is noise.\n audioOscClient.send('/gesture/trigger',gestureNum, soundOrNoise);\n console.log( Date(Date.now()) + 'Gesture ' + gestureNum + ' Triggered ' + ((soundOrNoise == 1) ? \"(Sound)\" : \"(Noise)\"));\n }\n\n // Set Riverhead speed from rhSlider\n function setRHSpeed(rhSpeed){\n behaviourOscClient.send('/riverHead/rhRingSpeed', parseFloat(rhSpeed));\n socket.broadcast.emit('setRHSpeed',rhSpeed)\n console.log( Date(Date.now()) + 'RH Speed: ' + rhSpeed);\n }\n \n // Toggles Riverhead\n function rhToggle(data){\n if (rhState) {\n behaviourOscClient.send('/riverHead/rhDisplayRings', 0);\n console.log( Date(Date.now()) + 'turning Riverhead off');\n rhState = false;\n }\n else{\n behaviourOscClient.send('/riverHead/rhDisplayRings', 1);\n console.log( Date(Date.now()) + 'turning Riverhead on');\n rhState = true;\n }\n }\n\n\n ///// experimental ambient wave adjustmnts ====== mg March 10\n // Toggles AW Arrow\n function awToggle(data){\n if (awState) {\n behaviourOscClient.send('/ambientWaves/display', 0);\n console.log( Date(Date.now()) + 'turning aw arrow off');\n awState = false;\n }\n else{\n behaviourOscClient.send('/ambientWaves/display', 1);\n console.log( Date(Date.now()) + 'turning aw arrow on');\n awState = true;\n }\n\n socket.broadcast.emit('awToggle', awState);\n }\n\n // Set AW Velocity\n function setAwVelocity(awVelocity){\n behaviourOscClient.send('/ambientWaves/velocity', parseFloat(awVelocity));\n socket.broadcast.emit('setAwVelocity', awVelocity)\n console.log( Date(Date.now()) + 'AW Velocity: ' + awVelocity);\n }\n\n // Set AW Period\n function setAwPeriod(awPeriod){\n behaviourOscClient.send('/ambientWaves/period', parseFloat(awPeriod));\n socket.broadcast.emit('setAwPeriod', awPeriod)\n console.log( Date(Date.now()) + 'AW Period: ' + awPeriod);\n }\n\n // Set AW Amplitude\n function setAwAmplitude(awAmplitude){\n behaviourOscClient.send('/ambientWaves/amplitude', parseFloat(awAmplitude));\n socket.broadcast.emit('setAwAmplitude', awAmplitude)\n console.log( Date(Date.now()) + 'AW Amplitude: ' + awAmplitude);\n }\n\n // Set AW Angle\n function setAwAngle(awAngle){\n behaviourOscClient.send('/ambientWaves/angle', parseFloat(awAngle));\n socket.broadcast.emit('setAwAngle', awAngle)\n console.log( Date(Date.now()) + 'AW Angle: ' + awAngle);\n }\n\n ///// Timelapse Scale Factor adjustmnt ====== rg March 26\n // Toggles TL Scale Factor\n function tlToggle(data){ \n if (tlState) {\n behaviourOscClient.send('/timelapse/tlon', 0); \n console.log( Date(Date.now()) + 'turning timelapse scale factor off');\n socket.emit(\"behaviourScene\",'default'); // switch to timelapse scene\n //socket.broadcast.emit('setSceneButtons','default');\n console.log( Date(Date.now()) + 'switching to Default scene');\n tlState = false;\n }\n else{\n behaviourOscClient.send('/timelapse/tlon', 1);\n console.log( Date(Date.now()) + 'turning timelapse scale factor on');\n socket.emit(\"behaviourScene\",'timelapse'); // switch to timelapse scene\n //socket.broadcast.emit('setSceneButtons','timelapse');\n console.log( Date(Date.now()) + 'switching to Timelapse scene');\n tlState = true;\n }\n\n socket.broadcast.emit('tlToggle', tlState);\n }\n\n function setTlState(tlTargetState){ \n if (tlTargetState) {\n behaviourOscClient.send('/timelapse/tlon', 1);\n console.log( Date(Date.now()) + 'turning timelapse scale factor on');\n socket.emit(\"behaviourScene\",'timelapse'); // switch to timelapse scene\n socket.emit('setSceneButtons','timelapse');\n console.log( Date(Date.now()) + 'switching to Timelapse scene');\n tlState = true;\n }\n else{\n behaviourOscClient.send('/timelapse/tlon', 0);\n console.log( Date(Date.now()) + 'turning timelapse scale factor off');\n socket.emit(\"behaviourScene\",'default'); // switch to timelapse scene\n socket.emit('setSceneButtons','default');\n console.log( Date(Date.now()) + 'switching to Default scene');\n tlState = false;\n }\n\n socket.broadcast.emit('tlToggle', tlState);\n }\n\n // Set Timelapse Scale Factor\n function setTlScaleFactor(tlScaleFactor){\n behaviourOscClient.send('/timelapse/scalefactor', parseFloat(tlScaleFactor));\n socket.broadcast.emit('setTlScaleFactor', tlScaleFactor)\n console.log( Date(Date.now()) + 'Timelapse Scale Factor: ' + tlScaleFactor);\n }\n\n}", "function initializeSocketIO(http) {\n\n io = require('socket.io')(http);\n\n function runCountdown() {\n var target_date = new Date().getTime() + (10*1000);\n var seconds, pastSeconds = 0;\n // update the tag with id \"countdown\" every 1 second\n var refresh = setInterval(function () {\n\n // find the amount of \"seconds\" between now and target\n var current_date = new Date().getTime();\n var seconds_left = (target_date - current_date + 1) / 1000;\n seconds = parseInt(seconds_left % 60);\n\n if (pastSeconds !== seconds) {\n io.emit('start game', seconds.toString());\n pastSeconds = seconds;\n }\n if (seconds === 0){\n io.emit('start game', 'countdown finished');\n clearInterval(refresh);\n reconnection = true;\n gameTime = 10 * 60;\n placePickups();\n livingPlayers = connections;\n gameInProgress = true;\n }\n }, 1000);\n }\n\n function notifyConnect(socket, newUser) {\n for (let clientId in activeUsers) {\n let client = activeUsers[clientId];\n if (newUser.userId !== clientId) {\n // Tell existing about the newly connected player\n client.socket.emit(NetworkIds.CONNECT_OTHER, {\n userId: newUser.userId,\n orientation: newUser.orientation,\n });\n\n // Tell the new player about the already connected player\n socket.emit(NetworkIds.CONNECT_OTHER, {\n userId: client.user.userId,\n orientation: client.user.orientation,\n });\n }\n }\n }\n\n function notifyReconnect(socket, newUser) {\n activeUsers[newUser.userId].socket.emit(NetworkIds.RECONNECT_SELF, {\n clientId: newUser.clientId,\n lastMessageId: activeUsers[newUser.userId].lastMessageId,\n orientation: activeUsers[newUser.userId].user.orientation,\n worldView: activeUsers[newUser.userId].user.worldView,\n userId: newUser.userId\n });\n\n for (let clientId in activeUsers) {\n let client = activeUsers[clientId];\n if (newUser.userId !== clientId) {\n // Tell existing about the newly connected player\n client.socket.emit(NetworkIds.RECONNECT_OTHER, {\n clientId: newUser.clientId,\n lastMessageId: newUser.lastMessageId,\n orientation: newUser.orientation,\n worldView: newUser.worldView,\n userId: newUser.userId\n });\n\n // Tell the new player about the already connected player\n socket.emit(NetworkIds.RECONNECT_OTHER, {\n clientId: clientId,\n lastMessageId: client.lastMessageId,\n orientation: client.user.orientation,\n worldView: client.user.worldView,\n userId: client.user.userId\n });\n }\n }\n }\n\n io.on('connection', function(socket){\n socket.on('join', function(data){\n //console.log(data.name + ' with id ' + socket.id + ' connected');\n if(reconnection) {\n if(typeof activeUsers[data.name] !== 'undefined') {\n activeUsers[data.name].dead = false;\n activeUsers[data.name].socket = socket;\n activeUsers[data.name].id = socket.id;\n activeUsers[data.name].user.clientId = socket.id;\n notifyReconnect(socket, activeUsers[data.name].user);\n io.sockets.sockets[socket.id].emit('start game', \"player reconnect\");\n io.emit('chat message',data.name + ' has rejoined the game.');\n } else {\n io.emit('chat message', \"Game already in progress.\")\n }\n } else {\n io.emit('chat message',data.name + ' has joined the game.');\n let newUser = User.makeplayer();\n newUser.clientId = socket.id;\n newUser.userId = data.name;\n activeUsers[data.name] = {\n id: socket.id,\n socket: socket,\n user: newUser\n };\n\n socket.emit(NetworkIds.CONNECT_ACK, {\n position: newUser.myPosition,\n view: newUser.view,\n userId: newUser.userId\n });\n\n notifyConnect(socket, newUser);\n\n connections++;\n if (connections >= TARGET_USERS_NUM) {\n if (!game_started) runCountdown();\n game_started = true;\n }\n }\n\n socket.on('chat message', function(msg){\n io.emit('chat message', data.name + \": \" + msg);\n });\n\n socket.on(NetworkIds.INPUT, keyInput => {\n inputQueue.enqueue({\n clientId: socket.id,\n message: keyInput\n });\n });\n\n socket.on('disconnect', function(){\n // notifyDisconnect(socket.id);\n //delete activeClients[socket.id];\n connections--;\n //console.log(data.name + ' with id ' + socket.id + ' disconnected');\n io.emit('chat message', data.name + ' has left the game');\n });\n\n });\n });\n}", "loadComms() {\n this.app.get('/', (req, res) => {\n res.send('Org backend server started');\n });\n\n this.http.listen(this.port, () => console.log(`Org server listening on port ${this.port}!`));\n\n this.io.on('connection', (socket) => {\n console.log('connected to client');\n\n this.socket = socket;\n this.fbServices._monitorFbConnection(this.socket);\n\n this.initListeners();\n });\n this.io.on('disconnect', () => {\n // this.fbServices.login(userId, false);\n console.log('disconnected');\n });\n }", "function callInicioSocket() {\r\n\tconsole.log(\"Peticion Inicio # \" + MAIN_SERVER_UDP_PORT + \" # \" + APP_ID);\r\n\t\r\n\tvar ab = str2ab(INICIO + \";\" + APP_ID);\r\n\tsocketUdp.write(socks.socketId, ab, writeComplete);\r\n}", "function sendToServer_wantnext() {\r\n socket.emit('clientend', {\r\n 'room': ROOM_ID\r\n });\r\n}", "function startClientListener() {\n socketIO.on(\"connection\",(socket)=>{\n console.log(\"New connection. Waiting for device authentication...\");\n\n socket.on(\"device\",(data)=>{\n let type = data.type;\n console.log(\"Device authenticated as \"+type);\n\n switch(type) {\n case \"python\": pythonModule = socket; initializePythonModule(); break;\n case \"esp\": espModules.push(socket); break;\n default: console.log(\"Unknown device type...\");\n }\n });\n });\n}", "socket_customEventFromServer(_, payload) {\n console.log(\"customEventFromServer\", payload);\n }", "function newConnection(socket) {\n var thisID;\n console.log('new connection: ' + socket.id);\n //store all user IDs here paired with their socket ID\n allSocketID[IDindex] = socket.id;\n\n socket.on(\"newDrawing\", sendNewDrawings);\n socket.on(\"newMouseClick\", sendNewMouseClick);\n socket.on(\"newUser\", sendNewUserID);\n socket.on(\"requestCanvases\", sendCanvases);\n socket.on(\"requestImageOfCanvas\", sendCanvasImage);\n socket.on(\"newPath\", sendNewPath);\n socket.on(\"newCircle\", sendNewCircle);\n socket.on(\"reset\", Reset);\n\n function sendNewDrawings(data) {\n //console.log(\"Got Here\");\n //console.log(data.drawing);\n canvasImages[data.id] = data.image;\n socket.broadcast.emit(\"newDrawingData\", data);\n }\n\n function sendNewMouseClick(data) {\n socket.broadcast.emit(\"newMouseClickData\", data);\n }\n\n function sendNewUserID() {\n //console.log(allSocketID[IDindex]);\n socket.emit(\"newUserID\", IDindex);\n IDindex += 1;\n }\n\n function sendCanvases() {\n data = {\n canvases: canvases\n }\n socket.emit(\"receivedCanvases\", data);\n }\n\n //send image of specific canvas\n function sendCanvasImage(id) {\n requestedCanvas = {\n image: canvasImages[id],\n id: id\n }\n socket.emit(\"receiveCanvasImage\", requestedCanvas);\n }\n\n function sendNewPath(data) {\n socket.broadcast.emit(\"receiveNewPath\", data);\n }\n\n function sendNewCircle(data) {\n socket.broadcast.emit(\"receiveNewCircle\", data);\n }\n\n function Reset() {\n canvasImages = {};\n socket.broadcast.emit(\"receiveReset\");\n }\n}", "function setupSocket(){\n socket = io();\n socket.on('disconnect', function(){\n changeState(gameConfig.GAME_STATE_END);\n });\n socket.on('setSyncUser', function(user){\n gameConfig.userID = user.objectID;\n });\n //change state game on\n socket.on('resStartGame', function(userDatas, foodsDatas, virusesDatas){\n Manager.setUsers(userDatas);\n Manager.setFoods(foodsDatas);\n Manager.setViruses(virusesDatas);\n console.log(Manager.users);\n\n canvasAddEvent();\n documentAddEvent();\n\n changeState(gameConfig.GAME_STATE_GAME_ON);\n });\n socket.on('userJoined', function(data){\n Manager.setUser(data);\n });\n socket.on('createViruses', function(virusesData){\n Manager.createViruses(virusesData);\n });\n socket.on('deleteVirus', function(virusID){\n Manager.deleteVirus(virusID);\n });\n socket.on('createFoods', function(foodsDatas){\n Manager.createFoods(foodsDatas);\n });\n socket.on('deleteFood', function(foodID){\n Manager.deleteFood(foodID);\n });\n socket.on('updateUser', function(userDatas){\n Manager.updateUsers(userDatas);\n });\n socket.on('userDestroy', function(userID){\n if(userID === gameConfig.userID){\n changeState(gameConfig.GAME_STATE_END);\n }\n Manager.deleteUser(userID);\n })\n socket.on('userLeave', function(objID){\n Manager.kickUser(objID);\n });\n socket.on('rename', function(){\n changeState(gameConfig.GAME_STATE_START_SCENE);\n });\n}", "function addEventListener(socket) {\n socket.on('message', function (data, rinfo){\n var jsonData = BSON.parse(data);\n if (utils.hasFileIndex(jsonData)) {\n var blockID = jsonData[\"index\"];\n var readStream = fs.createReadStream(\n source_file, {\n start: blockID * BLOCK_SIZE,\n end: blockID * BLOCK_SIZE + BLOCK_SIZE - 1,\n autoClose: true\n }\n );\n readStream.on('data', function(data) {\n console.log('transfer data....', blockID);\n var toSend = BSON.serialize({\n header: \"media\",\n index: blockID,\n content: data,\n checksum: utils.get_checksum(data)\n });\n socket.send(toSend, 0, toSend.length, rinfo.port, rinfo.address);\n });\n\n readStream.on('end', function () {\n// console.log('transfer data end....');\n });\n }\n else{\n console.log(\"Waning: BSON is not a file content...\");\n }\n });\n socket.on('close', function(){\n console.log('close....');\n });\n socket.on('error', function(){\n console.log('\\033[96m error occur. \\033[39m');\n });\n}", "_setDefaultListeners () {\n this.io.on('connection', (objSocket) => {\n console.log('Socket client connected', this.io.engine.clientsCount);\n objSocket.on('join_room', (strRoom) => {\n console.log('Joining room', strRoom);\n objSocket.join(strRoom);\n });\n })\n }", "function onConnect(socket, socketio) {\n\n\n // SENDS THE AVAILABLE COURIERS TO CLIENT DEPENDING ON THEIR LOCATION\n socket.on('getAvailableCouriers', function(userData) {\n\n\n //GET DISTANCE AND TIMES\n unirest.get('http://maps.googleapis.com/maps/api/distancematrix/json?origins='+userData.latitude+','+userData.longitude+'&destinations=' + finalLink + '&mode=driving&language=tr-TR&sensor=false')\n\n .header('Accept', 'application/json')\n .end(function(response) {\n //console.log(response.raw_body);\n if (availableCouriersUnsortedArray != null) {\n for (var i = 0; i < JSON.parse(response.raw_body).rows[0].elements.length; i++) {\n\n // ASSIGN EACH DISTANCE VALUE TO ITS CORRESPONDING OBJECT\n availableCouriersUnsortedArray[i].distance = JSON.parse(response.raw_body).rows[0].elements[i];\n }\n console.log(availableCouriersUnsortedArray)\n //SEND THE UNSORTED COURIER ARRAY TO THE CLIENT\n socket.emit('sortedCouriersList', availableCouriersUnsortedArray);\n }\n\n });\n\n\n\n console.info('[%s] %s', socket.address, JSON.stringify(userData, null, 2));\n\n });\n\n\n\n //HANDLE ORDERS AND BROADCASTS TO ALL THE COURIERS, TO DETECT FOR WHICH ONE IS IT MEANT TO\n socket.on('newOrder', function(order) {\n\n console.log(\"New Order Received, Waiting For Courier To Respond\")\n console.log(order)\n // socket.to().emit(\"offerFromUser\", order);\n socketio.emit('offerFromUser', order);\n\n });\n\n\n //COURIER ACCEPTED THE JOB, HE IS NO MORE AVAILABLE\n socket.on('acceptedByCourier', function(data) {\n console.log(\"ORDER ACCEPTED BY COURIER\")\n dataModule.postOrder(data) // Write it into Database in ORDER Model\n\n //REMOVE THAT COURIER TEMPORARILY WHO HAS JUST GOT THE JOB\n\n\n console.log(availableCouriersUnsortedArray)\n\n availableCouriersUnsortedArray = _.remove(availableCouriersUnsortedArray, function(currentObject) {\n return currentObject._id === data.courierId;\n });\n console.log(availableCouriersUnsortedArray)\n\n })\n\n //THIS MESSAGE COMES FROM USER TO RELEASE THE COURIER, TO MAKE HIM AVAILABLE\n socket.on('JobAccomplished', function(courierid) {\n //GERI AL REMOVELADIGIN KURYEYI\n console.log(\"JOB ACCOMPLISHED\")\n dataModule.getCourier(courierid).then(function(courier) {\n availableCouriersUnsortedArray.push(courier)\n })\n console.log(availableCouriersUnsortedArray)\n })\n\n\n\n //A COURIER IS LOGGING IN\n socket.on('courierLogin', function(data) {\n console.log(\"COURIER LOGGED IN\");\n dataModule.getCourier(data.courierId).then(function(courier) {\n socket.id = data.courierId; //give socket the same name with data's courierId\n\n availableCouriersUnsortedArray.push(courier);\n console.log(\"-----AVAILABLE COURIERS-----\");\n console.log(availableCouriersUnsortedArray)\n\n\n })\n });\n\n //REALTIME UPDATE THE CURRENT LOCATION OF COURIER\n socket.on('courierLocation', function(data) {\n console.log(\"courierLocation:::\")\n var idx = -1;\n _.find(availableCouriersUnsortedArray, function(courier, courierIndex) {\n if (courier._id == data.courierId) {\n idx = courierIndex;\n return true;\n };\n });\n if (idx > -1) {\n availableCouriersUnsortedArray[idx].latitude = data.latitude\n availableCouriersUnsortedArray[idx].longitude = data.longitude\n }\n\n\n console.log(availableCouriersUnsortedArray)\n\n });\n\n\n //A COURIER IS REGISTERING TO THE SYSTEM\n socket.on('registerCourier', function(data) {\n\n availableCouriersUnsortedArray.push(data);\n socket.broadcast.emit('new courierAvailable', data);\n });\n socket.on('UnRegisterCourier', function(data) {\n console.log(data)\n socket.broadcast.emit('courierRemoved', data);\n availableCouriersUnsortedArray.splice(availableCouriersUnsortedArray.indexOf(data), 1);\n });\n\n\n // Insert sockets below\n require('../api/address/address.socket').register(socket);\n require('../api/category/category.socket').register(socket);\n require('../api/order/order.socket').register(socket);\n require('../api/user/user.socket').register(socket);\n require('../api/courier/courier.socket').register(socket);\n require('../api/thing/thing.socket').register(socket);\n}", "function socketInit() {\r\n\tsocket = io();\r\n\r\n\tsocket.on('message', parsedMessage => {\r\n\t\tconsole.info('Received message: ' + parsedMessage.id);\r\n\r\n\t\tswitch (parsedMessage.id) {\r\n\t\t\t//event for self user, when he leaves the room\r\n\t\t\tcase 'disconn':\r\n\t\t\t\tparticipants[userId].disposeSelf();\r\n\t\t\t\tsocket.close();\r\n\t\t\t\tbreak;\r\n\t\t\t// event for new user to connect to KMS and register other users in room\r\n\t\t\tcase 'existingParticipants':\r\n\t\t\t\tonExistingParticipants(parsedMessage);\r\n\t\t\t\tbreak;\r\n\t\t\t// event for other users to register new participant\r\n\t\t\tcase 'newParticipantArrived':\r\n\t\t\t\tonNewParticipant(parsedMessage);\r\n\t\t\t\tbreak;\r\n\t\t\t// event for other users to register the leaving of user\r\n\t\t\tcase 'participantLeft':\r\n\t\t\t\tonParticipantLeft(parsedMessage);\r\n\t\t\t\tbreak;\r\n\t\t\t// event to register answers : user-KMS and user-user\r\n\t\t\tcase 'receiveVideoAnswer':\r\n\t\t\t\treceiveVideoResponse(parsedMessage);\r\n\t\t\t\tbreak;\r\n\t\t\t// event for exchanging ICE candidates between WebRTC peers\r\n\t\t\tcase 'iceCandidate':\r\n\t\t\t\tparticipants[parsedMessage.userId].rtcPeer.addIceCandidate(parsedMessage.candidate, function (error) {\r\n\t\t\t\t\tif (error) {\r\n\t\t\t\t\t\tconsole.error(\"Error adding candidate: \" + error);\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\tbreak;\r\n\t\t\tcase'chat message':\r\n\t\t\t\treceiveChatMessage(parsedMessage);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t// event for new user to receive a response of moderator\r\n\t\t\tcase 'moderatorResponse':\r\n\t\t\t\tmoderatorResponse(parsedMessage.accepted, socket);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'videoDisabled':\r\n\t\t\t\tputNameOverVideo(document.getElementById(parsedMessage.userId));\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'videoEnabled':\r\n\t\t\t\tputVideoOverName(document.getElementById(parsedMessage.userId));\r\n\t\t\t\tbreak;\r\n\r\n\t\t}\r\n\t});\r\n\t// event fired when moderator enters the room or if the moderator is not available\r\n\tsocket.on('onEnterNotification', error => {\r\n\t\tif (error === null) {\r\n\t\t\tenter('moderator');\r\n\t\t} else {\r\n\t\t\talert(error);\r\n\t\t}\r\n\t});\r\n\t// event for requesting permission from the moderator to log in a new user\r\n\tsocket.on('requestForModerator', (socketId, fullName) => {\r\n\t\tlet data = {\r\n\t\t\tid: 'moderatorResponse',\r\n\t\t\tuserId: socketId,\r\n\t\t\taccepted: false\r\n\t\t}\r\n\r\n\t\taddModal(fullName, (modalId) => {\r\n\t\t\tdata.accepted = true;\r\n\t\t\tdocument.getElementById(modalId).remove();\r\n\t\t\tsendMessage(data);\r\n\t\t}, (modalId) => {\r\n\t\t\tdocument.getElementById(modalId).remove();\r\n\t\t\tsendMessage(data);\r\n\t\t});\r\n\r\n\t});\r\n\tsocket.on('waitModeratorResponse', () => {\r\n\t\talert('Please wait until moderator accepts your entry');\r\n\t});\r\n}", "connected(socket) {\n for (let eventName in events) {\n socket.on(eventName, (function (eventName) {\n return function (userdata) {\n events[eventName](socket, userdata);\n };\n })(eventName));\n }\n }", "bindCallbacks() {\n this.socket.onopen = (event) => this.onopen(event);\n this.socket.onmessage = (event) => this.onmmessage(event);\n this.socket.onclose = (event) => this.onclose(event);\n this.socket.onerror = (event) => this.onerror(event);\n }", "function updateSocket(socket) {\n\t\tconsole.log(socket.id + \" --- SOCKET UPDATED\");\n\t\tsendToSocket(socket, 'sendChannels', channels);\n\t\tsendToSocket(socket, 'sendCountReceivers', countReceivers);\n\t\tsendToSocket(socket, 'sendDefaultCarst', defaultCarst);\n\t\tsendToSocket(socket, 'sendCarsts', carsts);\n\t\tsendToSocket(socket, 'sendCommands', commands);\n\t\tsendToSocket(socket, 'sendPlaylists', playlists);\n\t\tsendToSocket(socket, 'sendEvents', events);\n\t}", "setUpSocketEventListeners() {}", "componentDidMount() {\n this.socket = io(\"localhost:8080\");\n\n // Listen event id\n this.socket.on(\"id\", res => this.setState({ user: res }));\n\n // Listen event newMessage\n this.socket.on(\"newMessage\", response => {\n this.newMessage(response);\n });\n }", "handleEvents(){\n this.io.on('connection', (socket) => {\n this.handleJoinEvent(socket);\n this.handleLeaveEvent(socket);\n this.handleSendMsgEvent(socket);\n this.handleAddNotificationEvent(socket);\n });\n }", "function init_socketio() {\n\n // on connection, server will emit channel_update and users_update events, making the app load users and channels\n socket = io();\n\n // process the new chat message once its received from the server\n socket.on('chat_message', (message) => {\n receiveMessage(message)\n });\n\n // update the locally stored channels once an update is received from the server\n socket.on('channel_update', (response) => {\n updateChannels(response.channels);\n });\n\n // update the locally stored users once an update is received from the server\n socket.on('users_update', (response) => {\n updateUsers(response.users);\n });\n}", "_process(data, socket) {\n var line = data.toString().trim();\n line = JSON.parse(line);\n var command = line.command;\n var lineData = line.data;\n\n if(command === 'exit'){\n // console.log('disconnected');\n socket.end();\n }else if (command === 'add') {\n var peer = lineData;\n if(!(peer.connectionString in this._connections)) {\n if(this._addToSwarm(peer)) {\n peer.socket = socket;\n this._addToHistory(peer);\n if(this._addConnection(peer)) {\n // console.log(\"peer \" + peer.username + \" added successfully\");\n // console.log(\"swarm length: \" + Object.keys(this._swarm).length);\n }\n }\n } else {\n // we already have a connection no duplicates please\n // console.log(\"duplicate connection\");\n socket.end();\n }\n } else if (command === 'remove') {\n socket.end();\n } else if (command === 'giveSwarm'){\n this._mergeSwarms(lineData);\n this._connectToSwarm(false);\n // socket.write(JSON.stringify(message));\n } else if (command === 'getSwarm'){\n // console.log('giving peer the swarm');\n var message = {\n command: \"giveSwarm\",\n data: this.swarm\n };\n // console.log(message);\n message = JSON.stringify(message, function(key, value){\n if(key == 'socket') {\n return undefined;\n } else {\n return value;\n }\n });\n socket.write(message);\n } else if (command === 'game') {\n // INTERACT with game here\n // this is an incoming game broadcast\n // to send a message to the other gamers use the broadcast function below\n // console.log(\"got message: \" + lineData);\n this.emit('message', lineData, socket);\n\n } else {\n // not a recognized option\n console.log(\"command \" + command + \" not recognized.\");\n // socket.write(\"Did you say '\"+line+\"'?\");\n }\n }", "function socketIOinput(socket) {\n socket.on('server-message', function(message) {\n var notes = message;\n recordIOStroke(notes[0], \"redButton\");\n recordIOStroke(notes[1], \"yellowButton\");\n recordIOStroke(notes[2], \"greenButton\");\n recordIOStroke(notes[3], \"blueButton\");\n });\n}", "connect() {\n const protocol = this.config.ssl ? 'wss' : 'ws';\n const url = `${protocol}://${this.config.ip}:${this.config.port}`;\n\n log.debug('Socket - connect()', url);\n\n this.connection = null;\n\n this.connection = io(url, {\n forceNew: true,\n reconnection: false,\n upgrade: false,\n transports: ['websocket'],\n });\n\n // listens for server side errors\n this.connection.on('error', (error) => {\n log.debug('Socket - connect() - error', error);\n });\n\n // listens for websocket connection errors (ie db errors, server down, timeouts)\n this.connection.on('connect_error', (error) => {\n log.debug('Socket - connect() - server connection error', this.config.ip);\n log.error(error);\n\n this.listening = false;\n\n this.game.app.toggleLogin(false);\n this.game.app.sendError(null, 'Could not connect to the game server.');\n });\n\n // listens for socket connection attempts\n this.connection.on('connect', () => {\n log.debug('Socket - connect() - connecting to server', this.config.ip);\n this.listening = true;\n\n this.game.app.updateLoader('Preparing handshake...');\n this.connection.emit('client', {\n gVer: this.config.version,\n cType: 'HTML5',\n });\n });\n\n // listens for server side messages\n this.connection.on('message', (message) => {\n log.debug('Socket - connect() - message', message);\n this.receive(message);\n });\n\n // listens for a disconnect\n this.connection.on('disconnect', () => {\n log.debug('Socket - connect() - disconnecting');\n this.game.handleDisconnection();\n });\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 }", "init() {\n this.socket.emit('init', 'ooga');\n }", "startSocketHandling() {\n this.userNamespace.on('connection', (socket) => {\n logger.debug(`New socket connected to namespace ${this.userNamespace.name} + ${socket.id}`);\n\n // Register socket functions\n socket.on('getQuestions', this.getQuestions(socket));\n socket.on('answerQuestion', this.answerQuestion(socket));\n socket.on('answerOpenQuestion', this.answerOpenQuestion(socket));\n });\n }", "function onConnected()\n{\n document.getElementById('connectionStatus').textContent = \"connected!\";\n readForever();\n console.log(socketId);\n read();\n write('PASS none');\n write('NICK ' + userName);\n write('USER USER 0 * :Real Name', function()\n {\n //wait for a sign that we're registered before joining.\n //Welcome to the Internet Relay Network -RPL_WELCOME via IRC RFCs\n //socket.listen is not an option for client side connections. let's try reading until we get what we want\n var welcomeMsg=\"\";\n var dateRead = new Date();\n console.log(dateRead+\": Wrote after USER\\r\\n\");\n\n //write('JOIN #realtestchannel\\r\\n');\n })//end write\n} // end onConnected", "createSocket() {\n // Create the socket\n this.socket = new WebSocket('ws://localhost:7777');\n\n extendWebSocket(this.socket);\n\n // Listen for connect events and\n // print them to the terminal\n this.socket.onopen = function() {\n this.top.onConnectionWithServer();\n }.bind(this);\n\n // Listen for a variety of messages\n // and define the callbacks for each\n this.socket.register(\n 'presets', (message) => this.handlePresetsMessage(message));\n this.socket.register(\n 'serialPorts', (message) => this.handleSerialPortsMessage(message));\n this.socket.register(\n 'channelDataString',\n (message) => this.handleChannelDataStringMessage(message));\n this.socket.register(\n 'impedanceDataString',\n (message) => this.handleImpedanceDataStringMessage(message));\n this.socket.register(\n 'recordingStarted',\n (message) => this.handleRecordingStartedMessage(message));\n this.socket.register(\n 'recordingStopped',\n (message) => this.handleRecordingStoppedMessage(message));\n this.socket.register(\n 'presetSaved', (message) => this.handlePresetSavedMessage(message));\n this.socket.register(\n 'unableToConnectToChannelDataSocket',\n (message) =>\n this.handleUnableToConnectToChannelDataSocketMessage(message));\n this.socket.register(\n 'channelDataSocketConnected',\n (message) => this.handleChannelDataSocketConnectedMessage(message));\n this.socket.register(\n 'channelDataSocketClosed',\n (message) => this.handleChannelDataSocketClosedMessage(message));\n this.socket.register(\n 'channelDataSocketError',\n (message) => this.handleChannelDataSocketErrorMessage(message));\n this.socket.register(\n 'version', (message) => this.handleVersionMessage(message));\n this.socket.register(\n 'recordingAlreadyExists',\n (message) => this.handleRecordingAlreadyExistsMessage(message));\n this.socket.register(\n 'recordingError',\n (message) => this.handleRecordingErrorMessage(message));\n this.socket.register(\n 'bioampVersion',\n (message) => this.handleBioampVersionMessage(message));\n this.socket.register(\n 'alwaysOnArtifactUpdate',\n (message) => this.handleAlwaysOnArtifactUpdateMessage(message));\n }", "static onSocketReady(socket) {\n Object.keys(socket.rooms).forEach(room => {\n if (rooms.isRoomExists(room)) {\n if (rooms.getRoomPlayersCount(room) > 1) {\n rooms.getRoom(room).setPlayerReady(socket.id);\n\n let readyPlayers = 0;\n\n rooms.getRoom(room).getPlayers().forEach(player => {\n if (player.ready) {\n readyPlayers++;\n }\n })\n\n if (readyPlayers === 2) {\n rooms.getRoom(room).resetPlayersActions();\n rooms.getRoom(room).resetPlayersReady();\n\n io.to(room).emit('startGame', {\n id: rooms.getRoom(room).getID(),\n winner: rooms.getRoom(room).getWinner(),\n players: rooms.getRoom(room).getPlayers()\n });\n }\n }\n }\n })\n }", "SOCKET_ONMESSAGE(state, message) {\n state.socket.message = message;\n console.log(\"SOCKET_ONMESSAGE\");\n }", "bindSocketListeners() {\n //Remove listeners that were used for connecting\n this.netClient.removeAllListeners('connect');\n this.netClient.removeAllListeners('timeout');\n // The socket is expected to be open at this point\n this.isSocketOpen = true;\n this.netClient.on('close', () => {\n this.log('info', `Connection to ${this.endpointFriendlyName} closed`);\n this.isSocketOpen = false;\n const wasConnected = this.connected;\n this.close();\n if (wasConnected) {\n // Emit only when it was closed unexpectedly\n this.emit('socketClose');\n }\n });\n\n this.protocol = new streams.Protocol({ objectMode: true });\n this.parser = new streams.Parser({ objectMode: true }, this.encoder);\n const resultEmitter = new streams.ResultEmitter({objectMode: true});\n resultEmitter.on('result', this.handleResult.bind(this));\n resultEmitter.on('row', this.handleRow.bind(this));\n resultEmitter.on('frameEnded', this.freeStreamId.bind(this));\n resultEmitter.on('nodeEvent', this.handleNodeEvent.bind(this));\n\n this.netClient\n .pipe(this.protocol)\n .pipe(this.parser)\n .pipe(resultEmitter);\n\n this.writeQueue = new WriteQueue(this.netClient, this.encoder, this.options);\n }", "function socket_init(map_){\n socket = new io.Socket(null, {port: 3000, rememberTransport: false});\n socket.connect();\n map = map_;\n\n var socket_events = {\n 'connect' : connectHandler\n ,'disconnect' : disconnectHandler\n ,'reconnect' : reconnectHandler\n ,'reconnecting' : reconnectingHandler\n ,'reconnect_failed' : reconnect_failedHandler\n ,'message' : messageHandler\n }\n\n _.forEach(socket_events, function(func, event) {\n if(!func) console.log(\"Cannot find \" + event + 'function. Please create it!' );\n else socket.on(event,func);\n });\n}", "function _buildSocketDest(){var model=UIModel.getInstance();var socketDest=model.applicationSettings.socketDest;socketDest=model.socketProtocol+model.authenticateRequest.socketUrl;socketDest+=\":\"+model.authenticateRequest.socketPort;socketDest+=\"?access_token=\"+model.authenticateRequest.accessToken;socketDest+=\"&agent_id=\"+model.agentSettings.agentId;model.applicationSettings.socketDest=socketDest;// seems redundant, but needed to update value on model\nreturn socketDest;}// connect socket, setup socket event listeners", "function connect(socket) {\n\n var f = functions;\n\n var clientIP = f.showConnection(this);\n\n socket.on('new_text',function(m) {\n\n var gameID = f.lookupGameID(socket.id);//gets the gameid\n var opponent = f.lookupOpponent(socket.id);\n var s = f.GoThroughSuperlist(m.first.id, m.first.text, UltraList[gameID],socket.id);//updates the super list\n s = f.GoThroughSuperlist(m.second.id, m.second.text, UltraList[gameID],socket.id);//updates it for the other guy\n socket.emit('score', s);\n opponent.emit('score', s);\n\n opponent.emit('new_text',{id:m.first.id,text:m.first.text});\n\n });\n\n socket.on('disconnect', function () {\n //console.log(clientIP, \" disconnected\");\n //remove from socketArr\n if(socket.id in gameIDArr){\n var gameID = f.lookupGameID(socket.id);\n var opponent = f.lookupOpponent(socket.id);\n delete gameIDArr[socket.id];\n var gameTuple = f.lookupGame(gameID);\n clearTimeout(gameTuple.timeout);\n var S1 = f.lookupSocket(gameTuple.player1.socketID);\n var S2 = f.lookupSocket(gameTuple.player2.socketID);\n if(S1 != null && S2 != null) {\n var player1 = f.lookupPlayer(S1.id);\n var player2 = f.lookupPlayer(S2.id);\n if (opponent) {\n opponent.emit('game_over', {\n player1: player1,\n player2: player2,\n msg: 'forfeit',\n playerForfeit: f.lookupPlayer(socket.id)\n });\n }\n }\n\n //TODO: if game in GameArr, then forefit\n }\n else {\n //remove from waitQueue if in there\n var index = waitQueue.indexOf(socket.id);\n //console.log(\"Before waitQueue =\",waitQueue);\n if (index > -1) {\n waitQueue.splice(index, 1);\n }\n //console.log(\"After waitQueue =\",waitQueue);\n }\n delete socketArr[socket.id];\n delete playerArr[socket.id];\n });\n\n socket.on('catch',function(m) {\n var opponent = f.lookupOpponent(socket.id);\n if(opponent !== null)\n opponent.emit('catch',m);\n });\n\n socket.on('caught',function(m){\n var opponent = f.lookupOpponent(socket.id);\n if(opponent !== null)\n opponent.emit('caught',m);\n });\n\n socket.on('identity',function(playerName){\n socketArr[socket.id]= socket;\n playerArr[socket.id]= playerName;\n var player = {socketID:socket.id,playerName: playerName};\n if(waitQueue.length % 2 == 0){\n waitQueue.push(player.socketID);\n }\n else{\n var player1ID = waitQueue.shift();\n var player1 = {socketID:player1ID,playerName: f.lookupPlayer(player1ID)};\n var player2 = player;\n f.createGame(player1,player2);\n }\n });\n socket.on('saveToDB', function(data){\n db.run(\"INSERT INTO Scores (player1, player2, winner, winnerScore) VALUES (?,?,?,?)\",\n data.player1, data.player2, data.winner, data.winnerScore, function(err){\n if(err){\n throw err;\n }\n });\n });\n\n socket.emit('identify');\n}", "async function handleConnection(socket){\n let id = socket.remoteAddress + ':' + socket.remotePort;\n console.log(\"[New Client connection]\".green,id); \n socketsClient.push({socket: socket, id: id}); \n socket.on('data', function (data) {\n let msg={};\n if(typeof data ==='object' ){\n try{\n msg = JSON.parse(data);\n }catch( e){\n if (e instanceof SyntaxError){\n msg[\"message\"]=data.toString();\n msg[\"succes\"]=true;\n }else console.error(e);\n\n }\n console.log(\"[CLIENTE MSG]\".blue,msg)\n //Find client stiored on Array\n let picked = socketsClient.find(o => o.id === socket.remoteAddress + ':' + socket.remotePort);\n //Add id client socket host:port\n msg[\"idsocket\"]=picked.id;\n //If we want to add timeout for each client it's necessary to add 'setTimeout' as a variable on Array\n //msg[\"timer\"]=setTimeout()\n\n /**if(msg.hasOwnProperty('uuid'))\n console.log(\"[CLIENT UUID]\",msg.uuid,msg)**/\n }else msg=data;\n \n eventEmitter.emit('msg', msg);\n })\n socket.on('end', function() {\n console.log('[Client disconnected]'.red,id);\n //Deñete client disconnected from array\n socketsClient.filter(function(el) { return el.id != id; }); \n });\n\n }", "constructor(socket, cleanup) {\n this.socket = null;\n this.cleanup = null;\n this.authenticationTimeout = null;\n this.handshake = null;\n\n this.handshake = crypto.randomBytes(16).toString('base64')\n\n this.socket = socket;\n this.cleanup = cleanup;\n\n // client gets 500 ms to authenticate\n this.authenticationTimeout = setTimeout(() => { this.destroy(); }, 500);\n\n // here we ensure only our SSE servers will connect to this socket before sending data.\n this.socket.emit(protocolTopics.authenticationRequest, this.handshake, (reply) => {\n if (this.authenticate(reply) === false) { this.destroy(); return; }\n clearTimeout(this.authenticationTimeout);\n\n // add to the list of sockets that can process SSE's\n this.socket.join(EVENT_ROOM_NAME, (err) => {\n if (err) { return this.destroy(); }\n });\n\n // check if an accesstoken is valid.\n this.socket.on(protocolTopics.requestForAccessTokenCheck, (token, callback) => {\n this.handleAccessTokenRequest(token, callback);\n })\n // check if an accesstoken is valid.\n this.socket.on(protocolTopics.requestForOauthTokenCheck, (token, callback) => {\n this.handleOauthTokenRequest(token, callback);\n })\n });\n\n this.socket.on(\"disconnect\", () => { this.destroy(); });\n }", "init() {\n this.io.on('connection', function (socket) {\n /**\n * Triggered when a socket disconnects\n */\n socket.on('disconnect', function () {\n console.log(`[SOCKET] Client disconnected! ID: ${socket.id}`);\n });\n\n console.log(`[SOCKET] New client connected! ID: ${socket.id}`);\n });\n\n /**\n * Start listening on the right port/host for the Socket.IO server\n */\n console.log('[SYSTEM] Socket.IO started !');\n }", "function newConnection(socket) {\n console.log('Connnected: ' + socket.id);\n player_id.push(socket.id);\n players++;\n //function if this socket ever disconnects\n socket.on(\"disconnect\", (reason) => {\n\n console.log(reason);\n Disconnect(socket);\n\n });\n socket.emit('number_of_players', player_id);\n socket.broadcast.emit('updated_player_length', player_id);\n socket.on('player_data', playerdata);\n socket.on('shoot', Shoot);\n socket.on('Player_got_hit',PlayerHit);\n socket.on('i_hit_someone', hit)\n socket.on('increase_kill_count', increaseKillCount);\n\n function Shoot(shoot_data) {\n socket.broadcast.emit('shoot', shoot_data);\n //console.log(shoot_data);\n }\n\n function playerdata(all_data) {\n socket.broadcast.emit('player_data', all_data);\n //console.log(all_data);\n }\n\n function PlayerHit(hit_data){\n socket.broadcast.emit('someone_got_hit',hit_data);\n }\n\n function increaseKillCount(pid) {\n socket.to(pid).emit('kills_badhao_mera');\n }\n\n function hit(hit_data) {\n //console.log(hit_data[0])\n socket.broadcast.emit('someone_hit_me',hit_data);\n }\n}", "function onConnect(socket) {\n // When the client emits 'info', this listens and executes\n socket.on('info', data => {\n socket.log(JSON.stringify(data, null, 2));\n });\n socket.on('sendSocket', function(data){\n console.log('sendSocket')\n data.socket=socket.id\n User.findOne({name:data.name},function(err,user){\n user.socket=data.socket;\n user.save();\n })\n })\n\n socket.on('sendSocketQQ', function(data){\n data.socket=socket.id\n User.findOne({name:data.name},function(err,user){\n user.socket=data.socket;\n user.save();\n //QQArtist.createAsync(data)\n QqSystem.QQNewArtist(data)\n })\n });\n\n // Insert sockets below\n require('../api/regularrequest/regularrequest.socket').register(socket);\n //require('../api/privaterequest/privaterequest.socket').register(socket);\n //require('../api/publicrequest/publicrequest.socket').register(socket);\n require('../api/currentrequest/currentrequest.socket').register(socket);\n //require('../api/qqartist/qqartist.socket').register(socket);\n //require('../api/qqrequest/qqrequest.socket').register(socket);\n require('../api/thing/thing.socket').register(socket);\n\n}", "initTCP() {\n\t\tthis.receiveBuffer = ''\n\n\t\tif (this.socket !== undefined) {\n\t\t\tthis.socket.destroy()\n\t\t\tdelete this.socket\n\t\t}\n\n\t\tif (this.pollTimer !== undefined) {\n\t\t\tclearInterval(this.pollTimer)\n\t\t}\n\n\t\tif (this.config.port === undefined) {\n\t\t\tthis.config.port = 23\n\t\t}\n\n\t\tif (this.config.host) {\n\t\t\tthis.socket = new TCPHelper(this.config.host, this.config.port)\n\n\t\t\tthis.socket.on('status_change', (status, message) => {\n\t\t\t\tthis.updateStatus(status, message)\n\t\t\t})\n\n\t\t\tthis.socket.on('error', (err) => {\n\t\t\t\tthis.log('error', 'Network error: ' + err.message)\n\t\t\t})\n\n\t\t\tthis.socket.on('connect', () => {\n\t\t\t\tthis.log('debug', 'Connected')\n\t\t\t})\n\n\t\t\tthis.socket.on('disconnect', () => {\n\t\t\t\tthis.log('debug', 'Disconnected')\n\t\t\t\tthis.loggedIn = false\n\t\t\t\tthis.okToSend = false\n\n\t\t\t\tif (this.pollTimer !== undefined) {\n\t\t\t\t\tclearInterval(this.pollTimer)\n\t\t\t\t}\n\t\t\t})\n\n\t\t\t// separate buffered stream into lines with responses\n\t\t\tthis.socket.on('data', (chunk) => {\n\t\t\t\tlet i = 0,\n\t\t\t\t\tline = '',\n\t\t\t\t\toffset = 0\n\t\t\t\tthis.receiveBuffer += chunk\n\n\t\t\t\t// Process lines\n\t\t\t\twhile ((i = this.receiveBuffer.indexOf('\\n', offset)) !== -1) {\n\t\t\t\t\tline = this.receiveBuffer.substr(offset, i - offset)\n\t\t\t\t\toffset = i + 1\n\t\t\t\t\tthis.socket.emit('receiveline', line.toString())\n\t\t\t\t}\n\n\t\t\t\tthis.receiveBuffer = this.receiveBuffer.substr(offset)\n\n\t\t\t\t// Read current line\n\t\t\t\tif (this.receiveBuffer.match(/[L|l]ogin:/)) {\n\t\t\t\t\tthis.receiveBuffer = ''\n\t\t\t\t\tthis.socket.send(this.config.username + '\\r\\n')\n\t\t\t\t} else if (this.receiveBuffer.match(/[P|p]assword:/)) {\n\t\t\t\t\tthis.receiveBuffer = ''\n\t\t\t\t\tthis.socket.send(this.config.password + '\\r\\n')\n\t\t\t\t} else if (this.receiveBuffer.match(/>/)) {\n\t\t\t\t\tthis.loggedIn = true\n\n\t\t\t\t\tif (this.deviceName == '') {\n\t\t\t\t\t\tthis.receiveBuffer = ''\n\t\t\t\t\t\tthis.socket.send('version\\r\\n')\n\t\t\t\t\t\tthis.catchUp = true\n\t\t\t\t\t\tthis.lastPoll = -1\n\t\t\t\t\t} else if (this.catchUp == true) {\n\t\t\t\t\t\tlet thisPoll = this.lastPoll + 1\n\n\t\t\t\t\t\tif (thisPoll < PollCommands.length) {\n\t\t\t\t\t\t\tthis.socket.send(PollCommands[thisPoll] + '\\r\\n')\n\t\t\t\t\t\t\tthis.lastPoll = thisPoll\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthis.catchUp = false\n\n\t\t\t\t\t\t\tif (this.config.pollingOn === true) {\n\t\t\t\t\t\t\t\tthis.pollTimer = setInterval(this.sendPollCommand.bind(this), this.config.pollingInterval * 1000)\n\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\tthis.okToSend = true\n\t\t\t\t\t\tthis.sendCommand()\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\n\t\t\tthis.socket.on('receiveline', (line) => {\n\t\t\t\tif (this.loggedIn == false) {\n\t\t\t\t\tthis.processLogin(line)\n\t\t\t\t} else {\n\t\t\t\t\tthis.processCameraInformation(line)\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t}", "onpacket(packet) {\n const sameNamespace = packet.nsp === this.nsp;\n if (!sameNamespace) return;\n\n switch (packet.type) {\n case socket_io_parser_1.PacketType.CONNECT:\n if (packet.data && packet.data.sid) {\n const id = packet.data.sid;\n this.onconnect(id);\n } else {\n this.emitReserved(\"connect_error\", new Error(\"It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)\"));\n }\n\n break;\n\n case socket_io_parser_1.PacketType.EVENT:\n this.onevent(packet);\n break;\n\n case socket_io_parser_1.PacketType.BINARY_EVENT:\n this.onevent(packet);\n break;\n\n case socket_io_parser_1.PacketType.ACK:\n this.onack(packet);\n break;\n\n case socket_io_parser_1.PacketType.BINARY_ACK:\n this.onack(packet);\n break;\n\n case socket_io_parser_1.PacketType.DISCONNECT:\n this.ondisconnect();\n break;\n\n case socket_io_parser_1.PacketType.CONNECT_ERROR:\n const err = new Error(packet.data.message); // @ts-ignore\n\n err.data = packet.data.data;\n this.emitReserved(\"connect_error\", err);\n break;\n }\n }", "function wsConnect(){\n\n socket = io(\"http://\" + window.location.hostname + \":2345\"); \n\n socket.on('reconnecting',function(){\n // notify the user that he is currently deconnected\n $(\"#status\").html(langs[lang].reconnecting + \"<span id='ellipsisSpan'></span>\");\n startEllipsis();\n });\n socket.on('reconnect',function(){\n stopEllipsis();\n })\n socket.on('connect', function() {\n $(\"#server\").hide();\n $('#waitForConnection').show();\n $(\"#status\").html(langs[lang].connected);\n socket.emit(\"fetch img\");\n });\n\n socket.on('close', function() {\n console.log('disconnected');\n $(\"#server\").show();\n $('#waitForConnection').hide();\n });\n\n socket.on('update img',function(data) {\n grid = data;\n loadFromGrid();\n });\n\n socket.on('update pixel',function(pixel) {\n grid[pixel[0][0]][pixel[0][1]] = pixel[1];\n drawPixel(pixel[0][0],pixel[0][1],pixel[1]);\n });\n\n socket.on('set rot speed',function(rotSpeed){\n $(\"#rotationSpeed\").val(rotSpeed);\n });\n\n // receive a binary Array and transform it to array to finally save it with the library FileSaver\n socket.on('get raw file',function(rawFile){\n // You can't directly use a binary Array, to use it, you have to create a DataView\n var data = new DataView(rawFile);\n var offset = 0;\n var array = new Array(rawFile.byteLength);\n while(offset < rawFile.byteLength)\n {\n //An array isn't a binary array, so, we have to transform uint8 to char \n array[offset] = String.fromCharCode(data.getUint8(offset));\n offset++;\n } \n\n saveAs(new Blob(array),\"sphere.colors\");\n });\n}", "function socketCallback(socket) {\n\n /////////////////////////////////////////////////////////////////////////////\n // place client in a room, removing them from all other rooms\n // note: client can only join a room they are authorized to be in\n // requires:\n // payload.roomId : the room to join\n // emits to socket:\n // \"joinResponse\" of either `joined room ${payload.roomId}` or \"failed\"\n /////////////////////////////////////////////////////////////////////////////\n socket.on(\"join\", function(payload) {\n let rooms = Object.keys(socket.rooms);\n rooms.forEach( room => {\n if(room.match(/room \\d+/)) {\n socket.leave(room);\n }\n });\n verifyAuthCookie(socket, userId => {\n UserRoom.UserRoom.findAll({where: {userId: userId, roomId: payload.roomId}})\n .then( userRooms => {\n if(userRooms.length > 0) {\n socket.join(`room ${payload.roomId}`);\n socket.emit(\"joinResponse\",`joined room ${payload.roomId}`);\n } else {\n socket.emit(\"joinResponse\",\"failed\");\n }\n }).catch( () => socket.emit(\"joinResponse\",\"failed\") );\n });\n });\n\n /////////////////////////////////////////////////////////////////////////////\n // remove client from a room\n // requires:\n // payload.roomId : the room to leave\n // emits: nothing\n /////////////////////////////////////////////////////////////////////////////\n socket.on(\"leave\", function(payload) {\n socket.leave(`room ${payload.roomId}`);\n });\n\n\n /////////////////////////////////////////////////////////////////////////////\n // check whether client is logged in - this should only be fired\n // AFTER a successful reconnection\n // emits:\n // \"loggedInResponse\" either \"logged in\" or \"not logged in\"\n /////////////////////////////////////////////////////////////////////////////\n socket.on(\"loggedInReconnectEvent\",function(payload) {\n verifyAuthCookie(socket,\n () => socket.emit(\"loggedInReconnectEventResponse\",\"logged in\"),\n () => socket.emit(\"loggedInReconnectEventResponse\",\"not logged in\")\n );\n });\n\n /////////////////////////////////////////////////////////////////////////////\n // user requests a lock on furniture item (no authorization here, for speed,\n // but note that furniture ID is a uuid hence effectively impossible to guess,\n // and even if guessed, all you obtain is a lock, not creation, deletion or update).\n // payload:\n // payload.furnishingId: the ID (uuid) of furnishing to lock\n // emits to socket:\n // \"lockResponse\" of either \"approved\" or \"denied\"\n /////////////////////////////////////////////////////////////////////////////\n socket.on(\"lockRequest\", function(payload) {\n verifyAuthCookie(socket, (userId,username) => {\n if(username === \"dummy\") {\n socket.emit(\"lockResponse\",\"approved\");\n } else {\n redis.get(payload.furnishingId)\n .then( result => {\n if(!result) {\n redis.set(payload.furnishingId, userId, 'PX', 2500);\n socket.emit(\"lockResponse\",\"approved\");\n } else {\n socket.emit(\"lockResponse\",\"denied\");\n }\n }).catch( () => socket.emit(\"lockResponse\",\"denied\") );\n }\n }, () => {\n socket.emit(\"lockResponse\",\"denied\");\n });\n });\n\n /////////////////////////////////////////////////////////////////////////////\n // notify every client to push the room to the undo stack\n // emits to room:\n // \"pushRoomToUndoStack\" passing on the payload\n /////////////////////////////////////////////////////////////////////////////\n socket.on(\"pushRoomToUndoStack\",function(payload) {\n verifyAuthCookie(socket, userId => {\n let rooms = Object.keys(socket.rooms);\n let roomStr = rooms.find( room => room.match(/room \\d+/))\n if(roomStr) {\n let roomId = parseInt(roomStr.split(\" \")[1])\n socket.to(`room ${roomId}`).emit(\"pushRoomToUndoStack\",payload);\n }\n });\n });\n\n /////////////////////////////////////////////////////////////////////////////\n // notify every client to push the room to the redo stack\n // emits to room:\n // \"pushRoomToRedoStack\" passing on the payload\n /////////////////////////////////////////////////////////////////////////////\n socket.on(\"pushRoomToRedoStack\",function(payload) {\n verifyAuthCookie(socket, userId => {\n let rooms = Object.keys(socket.rooms);\n let roomStr = rooms.find( room => room.match(/room \\d+/))\n if(roomStr) {\n let roomId = parseInt(roomStr.split(\" \")[1])\n socket.to(`room ${roomId}`).emit(\"pushRoomToRedoStack\",payload);\n }\n });\n });\n\n /////////////////////////////////////////////////////////////////////////////\n // notify every client to undo and persist payload to the room in DB\n // payload:\n // payload.room: the new room in object representation to persist to DB\n // emits to room:\n // \"undo\" passing on the payload\n /////////////////////////////////////////////////////////////////////////////\n socket.on(\"undo\",function(payload) {\n verifyAuthCookie(socket, userId => {\n let rooms = Object.keys(socket.rooms);\n let roomStr = rooms.find( room => room.match(/room \\d+/))\n if(roomStr) {\n let roomId = parseInt(roomStr.split(\" \")[1]);\n Furnishing.Furnishing.findAll({\n where: { roomId: roomId }\n }).then( furnishings => {\n let furnishingIds = furnishings.map(furnishing => furnishing.id);\n redis.mget(furnishingIds)\n .then( result => {\n if(!result.find( val => !!val ) ) {\n persistRoom(roomId,payload.room);\n socket.to(`room ${roomId}`).emit(\"undo\",payload);\n socket.emit(\"undo\",payload);\n }\n }).catch( () => { } );\n }).catch( () => {} );\n }\n });\n });\n\n /////////////////////////////////////////////////////////////////////////////\n // notify every client to redo and persist payload to the room in DB\n // payload:\n // payload.room: the new room in object representation to persist to DB\n // emits to room:\n // \"redo\" passing on the payload\n /////////////////////////////////////////////////////////////////////////////\n socket.on(\"redo\",function(payload) {\n verifyAuthCookie(socket, userId => {\n let rooms = Object.keys(socket.rooms);\n let roomStr = rooms.find( room => room.match(/room \\d+/))\n if(roomStr) {\n let roomId = parseInt(roomStr.split(\" \")[1]);\n Furnishing.Furnishing.findAll({\n where: { roomId: roomId }\n }).then( furnishings => {\n let furnishingIds = furnishings.map(furnishing => furnishing.id);\n redis.mget(furnishingIds)\n .then( result => {\n if(!result.find( val => !!val ) ) {\n persistRoom(roomId,payload.room);\n socket.to(`room ${roomId}`).emit(\"redo\",payload);\n socket.emit(\"redo\",payload);\n }\n }).catch( () => { } );\n }).catch( () => {} );\n }\n });\n });\n\n\n /////////////////////////////////////////////////////////////////////////////\n // notify every client to clear the undo stack\n // emits to room:\n // \"clearUndoStack\" passing on the payload\n /////////////////////////////////////////////////////////////////////////////\n socket.on(\"clearUndoStack\",function(payload) {\n verifyAuthCookie(socket, userId => {\n let rooms = Object.keys(socket.rooms);\n let roomStr = rooms.find( room => room.match(/room \\d+/))\n if(roomStr) {\n let roomId = parseInt(roomStr.split(\" \")[1])\n socket.to(`room ${roomId}`).emit(\"clearUndoStack\",payload);\n }\n });\n });\n\n /////////////////////////////////////////////////////////////////////////////\n // notify every client to clear the redo stack\n // emits to room:\n // \"clearRedoStack\" passing on the payload\n /////////////////////////////////////////////////////////////////////////////\n socket.on(\"clearRedoStack\",function(payload) {\n verifyAuthCookie(socket, userId => {\n let rooms = Object.keys(socket.rooms);\n let roomStr = rooms.find( room => room.match(/room \\d+/))\n if(roomStr) {\n let roomId = parseInt(roomStr.split(\" \")[1])\n socket.to(`room ${roomId}`).emit(\"clearRedoStack\",payload);\n }\n });\n });\n\n\n /////////////////////////////////////////////////////////////////////////////\n // user moves mouse while locked onto furniture item (does not persist!)\n // emits to room:\n // \"mouseMoved\" event passing the payload along.\n /////////////////////////////////////////////////////////////////////////////\n socket.on(\"mouseMoved\", function(payload) {\n verifyAuthCookie(socket, userId => {\n let rooms = Object.keys(socket.rooms);\n let roomStr = rooms.find( room => room.match(/room \\d+/))\n if(roomStr) {\n let roomId = parseInt(roomStr.split(\" \")[1])\n socket.to(`room ${roomId}`).emit(\"mouseMoved\",payload);\n }\n });\n });\n\n /////////////////////////////////////////////////////////////////////////////\n // user refreshes timestamp on lock\n // emits to socket:\n // \"lockRefreshResponse\" of either \"approved\" or \"denied\"\n /////////////////////////////////////////////////////////////////////////////\n socket.on(\"lockRefresh\", function(payload) {\n verifyAuthCookie(socket, (userId,username) => {\n if(username === \"dummy\") {\n socket.emit(\"lockRefreshResponse\",\"approved\");\n } else {\n redis.get(payload.furnishingId)\n .then( result => {\n if(parseInt(result) === parseInt(userId)) {\n redis.set(payload.furnishingId, userId, 'PX', 2500);\n socket.emit(\"lockRefreshResponse\",\"approved\");\n } else {\n socket.emit(\"lockRefreshResponse\",\"denied\");\n }\n }).catch( () => socket.emit(\"lockRefreshResponse\",\"denied\") );\n }\n });\n });\n\n /////////////////////////////////////////////////////////////////////////////\n // user releases lock on furniture item\n // payload:\n // payload.furnishing : new furnishing properties\n // emits to room:\n // \"update\" passing the payload along\n /////////////////////////////////////////////////////////////////////////////\n socket.on(\"lockRelease\", function(payload) {\n verifyAuthCookie(socket, userId => {\n if(payload && payload.furnishing) {\n redis.del(payload.furnishing.id);\n let rooms = Object.keys(socket.rooms);\n let roomStr = rooms.find( room => room.match(/room \\d+/))\n if(roomStr) {\n let roomId = parseInt(roomStr.split(\" \")[1])\n Furnishing.Furnishing.update({...payload.furnishing, roomId: roomId},\n {where: {id:payload.furnishing.id,roomId:roomId} });\n socket.to(`room ${roomId}`).emit(\"update\",payload);\n }\n }\n });\n });\n\n /////////////////////////////////////////////////////////////////////////////\n // user update color of furniture item -- update the DB and notify other users\n // payload:\n // payload.furnishingId : the ID (uuid) of the furnishing to update\n // payload.colorName : the new color name from the Color table\n // emits to room:\n // \"colorUpdate\" passing the payload along\n /////////////////////////////////////////////////////////////////////////////\n socket.on(\"updateColor\", function(payload) {\n verifyAuthCookie(socket, userId => {\n if(payload && payload.furnishingId && payload.colorName) {\n let rooms = Object.keys(socket.rooms);\n let roomStr = rooms.find( room => room.match(/room \\d+/))\n if(roomStr) {\n let roomId = parseInt(roomStr.split(\" \")[1])\n redis.get(payload.furnishingId)\n .then( result => {\n if(!result) {\n Furnishing.Furnishing.update({colorName:payload.colorName},\n {where:{id:payload.furnishingId, roomId:roomId}} );\n socket.to(`room ${roomId}`).emit(\"colorUpdate\",payload);\n socket.emit(\"colorUpdate\",payload);\n }\n }).catch(() => { } );\n }\n }\n });\n });\n\n /////////////////////////////////////////////////////////////////////////////\n // room is deleted by the owner, signal other clients (does nothing to DB)\n // emits to room:\n // \"roomDeleted\"\n /////////////////////////////////////////////////////////////////////////////\n socket.on(\"roomDeleted\",function() {\n verifyAuthCookie(socket, userId => {\n let rooms = Object.keys(socket.rooms);\n let roomStr = rooms.find( room => room.match(/room \\d+/))\n if(roomStr) {\n let roomId = parseInt(roomStr.split(\" \")[1])\n socket.to(`room ${roomId}`).emit(\"roomDeleted\");\n }\n });\n });\n\n /////////////////////////////////////////////////////////////////////////////\n // return client's available rooms to view\n // emits to socket:\n // \"availableRooms\" an object {availableRooms: rooms}\n /////////////////////////////////////////////////////////////////////////////\n socket.on(\"getAvailableRooms\",function(payload) {\n verifyAuthCookie(socket, userId => {\n User.User.findAll({where:{id:userId}})\n .then( users => {\n if(users.length > 0) {\n var user = users[0];\n user.getRooms().then( rooms => {\n socket.emit(\"availableRooms\",{availableRooms:rooms})\n })\n .catch( () => { } );\n }\n })\n .catch( () => { } );\n });\n });\n\n /////////////////////////////////////////////////////////////////////////////\n // user creates a furniture item -- persist the item to DB and notify other users\n // payload:\n // payload.furnishing an object representation of the new furnishing\n // emits to room:\n // \"create\" passing payload along\n /////////////////////////////////////////////////////////////////////////////\n socket.on(\"createFurnishing\", function(payload) {\n verifyAuthCookie(socket, userId => {\n if(payload && payload.furnishing) {\n let rooms = Object.keys(socket.rooms);\n let roomStr = rooms.find( room => room.match(/room \\d+/))\n if(roomStr) {\n let roomId = parseInt(roomStr.split(\" \")[1])\n Furnishing.Furnishing.create( {...payload.furnishing,roomId:roomId} )\n socket.to(`room ${roomId}`).emit(\"create\",payload);\n }\n }\n });\n });\n\n /////////////////////////////////////////////////////////////////////////////\n // remove client from all rooms\n /////////////////////////////////////////////////////////////////////////////\n socket.on(\"removeFromAllRooms\", function(payload) {\n let rooms = Object.keys(socket.rooms);\n rooms.forEach( room => {\n if(room.match(/room \\d+/)) {\n socket.leave(room);\n }\n });\n });\n\n\n /////////////////////////////////////////////////////////////////////////////\n // user deletes a furniture item -- delete from the database and notify other users\n // payload:\n // payload.furnishingId\n // emits to room:\n // \"delete\" passing along the payload\n /////////////////////////////////////////////////////////////////////////////\n socket.on(\"deleteFurnishing\", function(payload) {\n verifyAuthCookie(socket, userId => {\n if(payload && payload.furnishingId) {\n let rooms = Object.keys(socket.rooms);\n let roomStr = rooms.find( room => room.match(/room \\d+/))\n if(roomStr) {\n let roomId = parseInt(roomStr.split(\" \")[1])\n\n redis.get(payload.furnishingId)\n .then( result => {\n if(!result) {\n Furnishing.Furnishing.findAll( { where: { id: payload.furnishingId, roomId: roomId } } )\n .then( furnishings => {\n if(furnishings.length > 0) {\n let furnishing = furnishings[0];\n furnishing.destroy({force:true})\n }\n }).catch( () => { } )\n socket.to(`room ${roomId}`).emit(\"delete\",payload);\n socket.emit(\"delete\",payload);\n }\n }).catch( () => { } );\n }\n }\n });\n });\n}", "loadSockets () {\n const funcs = this.loadModules();\n this.io.on('connection', (socket) => {\n console.log('Socket Connected');\n const keys = Object.keys(funcs);\n for (let k = 0; k < keys.length; k++) {\n const key = keys[k];\n socket.on(key, (data) => funcs[key](socket, data));\n }\n });\n }", "function callbackFunctionToCallWhenNewClientHasArrived(socket) { \n socket.write(JSON.stringify(auditor.getArrayMusicians()));\n socket.end();\n\n}", "function socketAlive() {\n setTimeout(function() {\n socket.emit('socket_alive');\n socketAlive();\n }, 3200);\n }", "SOCKET_ONMESSAGE (state, message) {\n // console.log(message)\n state.socket.message = message\n }", "connect() {}", "socketMessage(message) {\n\n let msg = JSON.parse(message.data);\n if (!msg.event) throw \"Invalid message format: \" + msg;\n\n switch (msg.event) {\n case 'startApp':\n console.log('Application launched')\n this.viewHandler.onStartApplication();\n break;\n\n case 'appDisconnected':\n console.log('app disconnected');\n\n GlobalVars.reset();\n this.reset();\n break;\n\n case 'bodyJoints':\n this.eventsHandler.onReceiveBodyJoints(msg);\n break;\n }\n }", "onDisconnect(socket) {\n\n }", "initSocket(callback, idhandler, userhandler) {\n this.io.on('assignment', idhandler);\n this.io.on('questionAsked', callback);\n this.io.on('newUser', userhandler);\n }", "function initializeSocketIO(httpServer) {\n let io = require('socket.io')(httpServer);\n\n //------------------------------------------------------------------\n //\n // Notifies the already connected clients about the arrival of this\n // new client. Plus, tell the newly connected client about the\n // other players already connected.\n //\n //------------------------------------------------------------------\n function notifyConnect(socket, newPlayer) {\n for (let clientId in activeClients) {\n let client = activeClients[clientId];\n if (newPlayer.clientId !== clientId) {\n //\n // Tell existing about the newly connected player\n client.socket.emit('message', {\n type: 'connect-other',\n clientId: newPlayer.clientId,\n momentum: newPlayer.momentum,\n direction: newPlayer.direction,\n position: newPlayer.position,\n rotateRate: newPlayer.rotateRate,\n thrustRate: newPlayer.thrustRate,\n size: newPlayer.size\n });\n\n //\n // Tell the new player about the already connected player\n socket.emit('message', {\n type: 'connect-other',\n clientId: client.player.clientId,\n momentum: client.player.momentum,\n direction: client.player.direction,\n position: client.player.position,\n rotateRate: client.player.rotateRate,\n thrustRate: client.player.thrustRate,\n size: client.player.size\n });\n }\n }\n }\n\n //------------------------------------------------------------------\n //\n // Notifies the already connected clients about the disconnect of\n // another client.\n //\n //------------------------------------------------------------------\n function notifyDisconnect(playerId) {\n for (let clientId in activeClients) {\n let client = activeClients[clientId];\n if (playerId !== clientId) {\n client.socket.emit('message', {\n type: 'disconnect-other',\n clientId: playerId\n });\n }\n }\n }\n \n io.on('connection', function(socket) {\n console.log('Connection established: ', socket.id);\n // Create an entry in our list of connected clients\n let newPlayer = Player.create(missilesHandler,asteroidsHandler,ufosHandler,socket.id)\n newPlayer.clientId = socket.id;\n activeClients[socket.id] = {\n socket: socket,\n player: newPlayer\n };\n socket.emit('message', {\n type: 'connect-ack',\n momentum: newPlayer.momentum,\n direction: newPlayer.direction,\n position: newPlayer.position,\n size: newPlayer.size,\n rotateRate: newPlayer.rotateRate,\n thrustRate: newPlayer.thrustRate\n });\n\n socket.on('input', data => {\n inputQueue.push({\n clientId: socket.id,\n message: data,\n receiveTime: present()\n });\n });\n\n socket.on('disconnect', function() {\n delete activeClients[socket.id];\n notifyDisconnect(socket.id);\n });\n\n notifyConnect(socket, newPlayer);\n informNewClientAboutExistingAsteroids(socket);\n informNewClientAboutExistingUFOs(socket);\n informNewClientAboutExistingMissiles(socket);\n informNewClientAboutExistingPowerups(socket);\n });\n}", "_initialize () {\n this.socket.on('data', data => this._sessionProtocol.chuck(data))\n this.socket.once('close', () => this.disconnect())\n }", "function createConnection() {\n // Start a connection to the server\n let socket = jot.connect(SERVER_CONNECTION_PORT, function() {\n // Send the initial message once connected\n socket.write({\n question: \"Send me your directory\"\n })\n })\n\n // Whenever the server sends us an object...\n socket.on('data', function(data) {\n console.log(data)\n // Output the answer property of the server's message to the console\n if (data.type === 'dir') {\n if (data.action === \"create\") {\n fs.mkdir(ROOT_DIR + data.path)\n console.log(\"Created directory \" + data.path)\n }\n else if (data.action === \"delete\") {\n console.log(\"client side Deleted directory \" + ROOT_DIR + data.path)\n rimraf(ROOT_DIR + data.path,function(){\n console.log(\"Deleted\")\n })\n }\n\t} else {\n if (data.action === \"create\") {\n console.log(\"Created file \" + ROOT_DIR + data.path)\n let buffer = new Buffer(data.contents, 'base64')\n mkdirp(path.dirname(path.join(ROOT_DIR, data.path)))\n fs.writeFile(ROOT_DIR + data.path, buffer)\n }\n else if (data.action === \"delete\") {\n console.log(\"Deleted file \" + ROOT_DIR + data.path)\n fs.unlink(ROOT_DIR + data.path)\n }\n else if (data.action === \"update\") {\n console.log(\"Updated file \" + ROOT_DIR + data.path)\n let buffer = new Buffer(data.contents, 'base64')\n fs.truncate(ROOT_DIR + data.path, 0)\n fs.writeFile(ROOT_DIR + data.path, buffer)\n }\n\t}\n\n })\n}", "function newConnection(socket) { // create a new socket everytime there is a connection\n\n console.log ('new connetion: ' + socket.id); // print the id of socket cloent\n // when receive mesege called 'mouse', trigger function called MouseMsg\n // just printing data\n socket.on('mouse', mouseMsg);\n\n\n \n}", "_onClientConnection(socket) {\n\t\tlogger.debug(\"Socketio connection\");\n\n\t\tsocket.emit('your_id');\n\n\t\t//socket.on('pincodeGenerated', _.bind(this.onCodeGenerated, this, socket))\n\t\tsocket.on(\"pincodeHeard\", this._onClientCodeHeard.bind(this, socket));\n\n\t\tsocket.on(\"idmobile\", this._onClientIdMobile.bind(this, socket));\n\n\t\tsocket.on(\"okToClose\", function () {\n\t\t\tsocket.disconnect();\n\t\t});\n\n\t\t//socket.on('disconnect', this.onDisconnect.bind(this, socket));\n\n\t}", "function connectToRoom(ws,req){ // socket connection for rooms\n\n var clientId = random()\n\n function leftRoom(room,key){\n broadcast(room,socketClients[clientId].user,'onleave',key)\n }\n\n ws.on('close', function(req){\n \n //to do if user doesnot exist fallback, broadcast a leave message, on error\n //to remember: remove key can handle both array and object\n\n\n\n\n for (let key in roomsRegistry){\n\n for (let room in roomsRegistry[key].full){\n\n //remove client from full instance, remove instance from full and and add it not full\n\n if ( roomsRegistry[key].full[room].clients.includes(clientId ) ){\n\n removeFromBuilding('full',key,room)\n //because currently room is full if anyone leaves the room it will become empty\n\n\n }else{\n // console.log( roomsRegistry[key].full[room].clients[clientId] )\n }\n\n }\n\n \n for (let room in roomsRegistry[key].notFull){\n\n if ( roomsRegistry[key].notFull[room].clients.includes( clientId) ) {\n removeFromBuilding('notFull',key,room)\n }\n }\n\n }\n\n socketClients = removeKey(socketClients,clientId)\n\n })\n\n //remove user from all the room\n function removeRoomFromFullAddToNotFull(label,uniqueKeyOfRoom){\n roomsRegistry[label].notFull[uniqueKeyOfRoom] = roomsRegistry[label].full[uniqueKeyOfRoom]\n roomsRegistry[label].full = removeKey(roomsRegistry[label].full,uniqueKeyOfRoom)\n leftRoom(uniqueKeyOfRoom,label)\n }\n\n //there are two kinds of room in the building full and notFull\n function removeFromBuilding(kind,label,uniqueKeyOfRoom){\n roomsRegistry[label][kind][uniqueKeyOfRoom].clients = removeKey(roomsRegistry[label][kind][uniqueKeyOfRoom].clients,clientId)\n\n kind === 'full'? removeRoomFromFullAddToNotFull(label,uniqueKeyOfRoom) : leftRoom(uniqueKeyOfRoom,label)\n }\n\n function leaveRoom(label,uniqueKeyOfRoom,newRoom){\n\n if (!roomsRegistry[label]) {\n return sendError(label+' label is invalid',newRoom)\n }\n\n if (roomsRegistry[label].full[uniqueKeyOfRoom]){\n removeFromBuilding('full',label,uniqueKeyOfRoom)\n }else if(roomsRegistry[label].notFull[uniqueKeyOfRoom]){\n removeFromBuilding('notFull',label,uniqueKeyOfRoom)\n }\n\n }\n\n function sendError(errorMessage,label){\n ws.send( stringIt({type:'onerror', data:errorMessage, token:label}) )\n }\n //type getRoomToken\n // to do solve conflict of name query socket connection\n //limit defined by user\n ws.on('message', function(msg){\n\n\n msg = JSON.parse(msg)\n let roomLimit = 2\n // let roomId = msg.token\n let roomLabel = msg.app+'_'+msg.token //msg token is hotel name\n let roomToken = null\n if (msg.broadcastToken) roomToken = msg.broadcastToken \n if (msg.limit) if(msg.limit >= 2) roomLimit = msg.limit\n\n //what if where is not defined in update\n\n //the update function does not gives the update doc?\n\n //user can connect to multiple rooms the front end functions are mapped to \n if (msg.purpose == 'join'){\n createOrAddToRoom()\n }else if(msg.purpose == 'broadcast'){\n // console.log('broadcasting')\n broadcast(roomToken,msg.content,'ondata',roomLabel)\n }else if(msg.purpose == 'change_room'){\n\n\n\n\n //to do save from crash not defineed\n if (!msg.currentRoomLabel || !msg.unique || !msg.newToken) return sendError('required values missing')\n leaveRoom(msg.app+'_'+msg.currentRoomLabel, msg.unique, msg.newToken)\n\n // console.log('leaving room',msg.currentRoomLabel,'unique',msg.unique)\n roomLabel = msg.app+'_'+msg.newToken\n createOrAddToRoom()\n\n }else if(msg.purpose == 'leave'){\n\n if (!msg.currentToken || !msg.unique ) return sendError('required values missing')\n\n leaveRoom(msg.app+'_'+msg.currentToken,msg.unique )\n }\n\n\n \n\n //why one to one does not exist? because it can be created with room with limit 2\n\n function createOrAddToRoom(){\n\n if(!socketClients[clientId]){\n\n //if user does not exist\n return getUserData( msg.cookie ).then(function(userObject,error){//what if cookie is invalid\n if (error) return sendError('invalid cookie')\n socketClients[clientId] = {user:{id:userObject.id, username:userObject.username}, socket:ws}\n\n createOrAddToRoom()\n })\n\n \n }\n\n //also broadcast on join and leave and also joined member\n // console.log(clientId,'creating room or adding:'+roomLabel)\n function createRoom(){\n roomToken = random()\n roomsRegistry[roomLabel].notFull[roomToken] = {clients:[],limit:roomLimit}\n roomsRegistry[roomLabel].notFull[roomToken].clients.push(clientId)\n }\n\n if (!roomsRegistry[roomLabel]){ //room not constructed \n roomsRegistry[roomLabel] = { full:{},notFull:{} }\n createRoom()\n }else{\n\n if ( Object.keys(roomsRegistry[roomLabel].notFull).length === 0 ) {\n createRoom()\n }else{\n\n roomToken = Object.keys(roomsRegistry[roomLabel].notFull)[0]\n roomsRegistry[roomLabel].notFull[roomToken].clients.push(clientId)\n broadcast(roomToken,socketClients[clientId].user,'onjoin',roomLabel)\n\n let notFullRoomLimit = roomsRegistry[roomLabel].notFull[roomToken].limit\n let membersCountOfNotFull = roomsRegistry[roomLabel].notFull[roomToken].clients.length\n\n \n\n // if(membersCountOfNotFull > notFullRoomLimit) console.log('limit exceeded', membersCountOfNotFull, notFullRoomLimit)\n\n if(membersCountOfNotFull === notFullRoomLimit){\n roomsRegistry[roomLabel].full[roomToken] = roomsRegistry[roomLabel].notFull[roomToken]\n roomsRegistry[roomLabel].notFull = removeKey(roomsRegistry[roomLabel].notFull,roomToken)\n }\n\n }\n\n }\n\n broadcast(roomToken,null,'onopen',roomLabel)\n\n }\n\n })\n //add coments and decrease code\n // roomArgToken room name, roomLabel key\n function broadcast(roomArgToken,content,type,roomLabel){// room label is the type of room and roomArgToken is unique id of room which can be full or not full\n\n let token = roomLabel.split('_')[1]\n\n let broadcastTo = null\n try{\n broadcastTo = roomsRegistry[roomLabel].notFull[roomArgToken] === undefined ? roomsRegistry[roomLabel].full[roomArgToken] : roomsRegistry[roomLabel].notFull[roomArgToken] \n }catch(e){\n return ws.send( stringIt({error:roomArgToken+' room not found in '+roomLabel+'to broadcast'+e}) )\n }\n\n let members = []\n\n if (!broadcastTo) return ws.send( stringIt({ unique:roomArgToken, token:token, type:'onerror', data:'invalid unique' }))\n\n for (let index of broadcastTo.clients){\n\n members.push( socketClients[index].user )\n }\n\n if (type == 'onopen') return ws.send( stringIt({ unique:roomArgToken, token:token, members:members, type:type }))\n\n\n for (let index of broadcastTo.clients){\n if (index !== clientId) socketClients[index].socket.send( stringIt({unique:roomArgToken, members:members, token:token, sender:socketClients[clientId].user, data:content, type:type }) )\n }\n\n }\n}", "initSocket(socket){\n\t\tsocket.on('connect', (value)=>{\n\t\t\tconsole.log(\"Connected\");\n\t\t})\n\t\tsocket.on('disconnect', this.reconnectUserInfo)\n\t}", "function setupSockets() {\r\n\t\tgame = gameEngine.returnSystem( 'game' );\r\n\t\t\r\n\t\tplayerShip = game.returnShip( shipId );\r\n\t\t\r\n\t\ttoken = {};\r\n\t\ttoken.name = playerShip['displayName'];\r\n\t\ttoken.game = 0;\r\n\t\ttoken.ship = playerShip['id'];\r\n\t\t\r\n\t\tsocket = connectToServer();\r\n\t\t\r\n\t\tif(socket !== undefined) {\r\n\t\t\tsetTimeout(function() {\r\n\t\t\t\tsetupSocketTransfers();\t\t\t\r\n\t\t\t}, 1500);\r\n\t\t} else {\r\n\t\t\tsetTimeout(function() {\r\n\t\t\t\tsocket = finishConnection();\r\n\t\t\t\tsetupSocketTransfers();\r\n\t\t\t}, 1500);\r\n\t\t}\r\n\t}", "SOCKET_ONMESSAGE (state, message) {\n state.socket.message = message\n }", "function onsocketConnected () {\n\tconsole.log(\"connected to server\"); \n}", "_final(cb) {\n logger.debug('ZitiSocket._final entered');\n cb();\n }", "function emitter() {\n\tvar i;\n\t// store stringified data\n\t// append new line character so can determine end of JSON object\n\tstringified = JSON.stringify(bobj) + '\\n';\n\t// emit data on every socket connection in eList\n\tfor (i in eList)\n\t\teList[i].write(stringified);\n\t// cleanup\n\tstringified = '';\n\tbobj = {};\n}", "static listenSocketEvents() {\n Socket.shared.on(\"wallet:updated\", (data) => {\n let logger = Logger.create(\"wallet:updated\");\n logger.info(\"enter\", data);\n\n Redux.dispatch(Wallet.actions.walletUpdatedEvent(data));\n });\n }", "async function InitServer() {\n \n freePort = await fp(3000,3100);\n let serverAddress = await createServer(freePort[0],\"localhost\")\n console.log('Server listening on %j', serverAddress)\n\n try{\n\n let result = await waitEventClientData(eventEmitter,4000)\n console.log(\"[RESULT]\".blue,result);\n //idsocket is a id of client socket\n if(result.hasOwnProperty('idsocket')){\n result_w = await writeClient(socketsClient.find(o => o.id === result.idsocket).socket);\n result = await waitEventClientData(eventEmitter,12000)\n console.log(\"[RESULT]\".blue,result);\n }else console.log(\"[FINISH]\");\n\n }catch(error) {\n console.warn(\"error\",error.message)\n }\n\n \n }" ]
[ "0.6936016", "0.6867888", "0.682123", "0.68086815", "0.66597736", "0.65771884", "0.6573033", "0.6565166", "0.65449053", "0.6510505", "0.6459128", "0.64338434", "0.6417054", "0.64154327", "0.6396147", "0.6349292", "0.63471603", "0.63421875", "0.63358086", "0.63179195", "0.6311679", "0.6311381", "0.63010514", "0.6298751", "0.62843883", "0.6273639", "0.6264901", "0.6264008", "0.6262942", "0.6253521", "0.6250871", "0.6248505", "0.62446934", "0.62372434", "0.6222882", "0.6209949", "0.62098217", "0.620666", "0.6193936", "0.6186345", "0.6182754", "0.61670685", "0.61661386", "0.61619574", "0.6154536", "0.6151261", "0.614099", "0.61383855", "0.6134603", "0.6134227", "0.6134195", "0.61202157", "0.6114344", "0.6110831", "0.61102355", "0.6106073", "0.6104604", "0.60943466", "0.60918564", "0.608567", "0.608503", "0.6077678", "0.60773945", "0.6074123", "0.6068419", "0.6068357", "0.6067787", "0.6065914", "0.60540277", "0.6049038", "0.6046788", "0.604206", "0.6039344", "0.6038632", "0.6036062", "0.6035136", "0.6033879", "0.60127574", "0.60101026", "0.59985167", "0.5994811", "0.5994584", "0.59930384", "0.5991955", "0.59907657", "0.5990749", "0.5986441", "0.59861386", "0.5977707", "0.5968417", "0.5964488", "0.59638923", "0.5955407", "0.59529936", "0.59493643", "0.59405625", "0.59401095", "0.593488", "0.5932124", "0.59272766", "0.59258884" ]
0.0
-1
Initializes the turn and turn timer, returns timerId
function startTurnTimer(timerId, turnDuration) { console.log('\nInitializing turn timer!'); // Initialize or reset time remaining gameState.nextTurnTimestamp = Date.now() + turnDuration; console.log( 'Next turn at: ' + new Date(gameState.nextTurnTimestamp).toString().substring(16,25) ); // Every time the timer goes off, update timestamp and change turn! timerId = setInterval(() => { console.log('\n >>>>>>>>>>> ' + new Date().toString().substring(16,25) + ' - Time to change turns! <<<<<<<<<<\n'); // Update time of next turn change gameState.nextTurnTimestamp = Date.now() + turnDuration; changeTurn(); }, turnDuration); // TO DO: enable user-specified turn length return timerId; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startTurnTimer(timerId, turnDuration, socketId) {\n\t// If turn timer isn't already running\n\tif (!timerId) {\n\t\tconsole.log('Initializing turn timer!');\n\n\t\t// Initialize time of next turn change (will use this to sync the clients)\n\t\tnextTurnChangeTimestamp = Date.now() + turnDuration;\n\n\t\tconsole.log( new Date(nextTurnChangeTimestamp).toString() )\n\n\t\t// Initialize the turn data using given user ID\n\t\tchangeTurn(socketId);\t\t\n\n\t\t// Every time the timer goes off, change turn again and broadcast the data\n\t\ttimerId = setInterval(() => {\t \t\t\t \t\t\n\t \t\tconsole.log('Time to change turns!');\n\n\t \t\t// Update time of next turn change\n\t \t\tnextTurnChangeTimestamp = Date.now() + turnDuration;\n\n\t\t\tchangeTurn(socketId);\n\n\t\t\t// Broadcast turnChange with data to ALL clients\n\t\t\tio.emit( 'turnChange', getTurnData() );\n\n\t\t\tconsole.log( getTurnData() );\n\t\t}, turnDuration); // TO DO: enable user-specified turn length\n\t}\n\treturn timerId;\n}", "function initializeTimer(timerId){\n setupTimerButtonObservers(timerId);\n updateElapsedTime(timerId);\n // Start the timer so that it updates every second when active\n window.setInterval(() => updateElapsedTime(timerId), 1000);\n setupDescriptionObserver(timerId);\n setupTimeElapsedObserver(timerId);\n}", "function timerInit(){\n\t\ttimer = setTimeout(timeUp, timeToAnswer*1000);\n\t}", "function resetAndStartTimer(){\n myTimer.stop();\n myTimer.start(11).on('end',function(){\n io.sockets.in(gameId).emit('timer', { time: 10000 });\n resetAndStartTimer();\n //send name and score of next user and pass the turn\n var player = players[playingPlayer];\n var opponent = players[(player.index+1)%players.length];\n io.to(player.socket.id).emit('result', player.shots, player.score);\n io.to(opponent.socket.id).emit('update map', player.shots,player.score);\n\n nextTurn();\n });\n }", "function setTimer(roomId) {\n const room = rooms[roomId];\n room.currentClaims = [0, 0, 0, 0];\n let sec = turnTime;\n var timer = setInterval(function(){\n io.to(roomId).emit('turn-timer', sec);\n if (sec === 0){\n clearInterval(timer);\n room.timerElapsed = true;\n executeGreatestClaim(roomId);\n }\n sec--;\n }, 1000);\n}", "function timerSetup() {\n // MINIGAME 1: 35sec\n if (minigame1) {\n timer = 35;\n }\n // MINIGAME 2: 5sec\n else if (minigame2) {\n timer = 5;\n }\n}", "function init() {\n if(player1Turn === true ) {\n countdown();\n playerOne();\n player1Turn = false;\n $('#clicker').attr('id', 'clicker2');\n $('#clicker2').attr('id', 'clicker');\n } else {\n changePlayer();\n playerTwo();\n player2Turn = false;\n }\n }", "function startTimer() {\n\tif (timerSeconds.innerHTML === '00') {\n\t\tcountUp = setInterval(setTime, 1000); //allows us to call clearInerval on this variable later.\n\t}\n}", "function initializeTimer() {\n clockRunning = true;\n if (clockRunning = true) {\n timerInterval = setInterval(decrement, 1000);\n }\n }", "function startTimer(_timer){\n _timer.start({\n countdown: true,\n startValues: {\n seconds: 30\n }\n });\n }", "function startTimeoutTimer(who) {\n\tTIMER_STOPPED = true;\n\tTIMER_SHOTCLOCK_STOPPED = true;\n\n\t$('#start_timer').show();\n\t$('#stop_timer').hide();\n\t\n\tTIMEOUT_COUNTER = TIMEOUT_LENGTH;\n\tshowFouls(false);\n\tdisableButtons(true);\n\n\tif(who == HOME)\n\t\tonLED('#home_foul_count', TIMEOUT_ARROW[0]);\n\telse\n\t\tonLED('#away_foul_count', TIMEOUT_ARROW[1]);\n\n\tTIMEOUT_TIMER = setInterval(timeoutTimer, 1000);\n}", "function startTimer() {\n\tgameData.timer = setInterval(timerData.timeCounter, 1000);\n}", "function initSetTimerListeners() {\n\t$(\"#breakLength .fa-minus\").on(\"click\", function() {\n\t\tif(!running\t&& !$(\"#clock-container\").hasClass(\"paused\")) {\n\t\t\tif(breakTime > 1) {\n\t\t\t\tbreakTime -= 1;\n\t\t\t\t$(\"#break\").text(breakTime);\n\t\t\t}\n\t\t}\n\t});\t\n\n\t$(\"#breakLength .fa-plus\").on(\"click\", function() {\n\t\tif(!running\t&& !$(\"#clock-container\").hasClass(\"paused\")) {\n\t\t\tif(breakTime < 60) {\n\t\t\t\tbreakTime += 1;\n\t\t\t\t$(\"#break\").text(breakTime);\t\t\n\t\t\t}\n\t\t}\n\t});\t\n\t$(\"#sessionLength .fa-minus\").on(\"click\", function() {\n\t\tif(!running\t&& !$(\"#clock-container\").hasClass(\"paused\")) {\n\t\t\tif(sessionTime > 1) {\n\t\t\t\tsessionTime -= 1;\n\t\t\t\t$(\"#session\").text(sessionTime);\n\t\t\t}\n\t\t}\n\t});\t\n\t$(\"#sessionLength .fa-plus\").on(\"click\", function() {\n\t\tif(!running\t&& !$(\"#clock-container\").hasClass(\"paused\")) {\n\t\t\tif(sessionTime < 60) {\n\t\t\t\tsessionTime += 1;\n\t\t\t\t$(\"#session\").text(sessionTime);\n\t\t\t}\t\n\t\t}\n\t});\n}", "function initializeTimer() {\n //stopWatch = new DS.Utility.timer.Stopwatch(autoCompleteOnKeyPressDelay, onTimerCallBack, false);\n }", "function initTimer() {\n Consts.stockTime = 0;\n Consts.currStatus = Status.init;\n initRefresh = setInterval(refreshClock, 1);\n}", "function setTime() {\n //increments timer\n ++totalSeconds;\n //temporarily stops timer at 5 seconds for my sanity\n if (totalSeconds === 59) {\n totalMinutes += 1;\n totalSeconds = 0;\n }\n\n //stops timer when game is won\n if (gameWon === true) {\n return;\n }\n //calls function to display timer in DOM\n domTimer();\n }", "function startTimer() {\r\n\r\n timerControl = true;\r\n initTime = getCurrTime();\r\n btnReset.classList.add(\"inactive\");\r\n btnLap.classList.remove(\"inactive\");\r\n}", "function startTimer() {\n setTimeout(function () {\n //when game is stopped timer from previous game shouldn't infere\n if (!pausedGame) timerDone = true;\n }, 10000);\n}", "function startTimer() {\n currentTime = 0;\n timeoutStore = setInterval(updateTimer, timeIncrementInMs);\n }", "function startTimer() {\n if (timerID == -1) {\n timerID = setInterval(tickTimer, 1000);\n }\n }", "function startCounter() {\n timer = $('#timer').timer();\n}", "function Timers() {\n\n this.timers = {};\n this.idCounter = 0;\n\n}", "_switchTimer() {\n if (this.state.isRunning) {\n this._stopTimer();\n return;\n }\n this._startTimer();\n }", "function initializePolicyLockTimer() {\r\n // Create timer object\r\n objPolicyLockTimer = new policyLockTimerObj();\r\n objPolicyLockTimer.timeoutInMilliSeconds = policyLockDuration * 60 * 1000;\r\n objPolicyLockTimer.timeoutHandler = \"policyLockTimeoutHandler()\";\r\n\r\n // Start the timer\r\n if (objPolicyLockTimer.active) {\r\n objPolicyLockTimer.startTimer();\r\n }\r\n}", "function Timer(state, runTime) {\n // Public properties, assigned to the instance ('this')\n this.state = state;\n this.runTime = runTime;\n //this.cardId = cardId;\n this.timeManager = \"\";\n }", "function loadTimer() {\n currentTimerType = PEvents.nextTimer(currentTimerType);\n \n switch (currentTimerType) {\n case PEvents.Timers.pomodoro:\n minutes = 25;\n seconds = 0;\n break;\n \n case PEvents.Timers.short_break:\n minutes = 5;\n seconds = 0;\n break;\n\n case PEvents.Timers.long_break:\n minutes = 25;\n seconds = 0;\n break;\n }\n\n render();\n }", "function moveCounter(){\n moves++;\n counter.innerHTML= moves;\n //start timer on first click\n if(moves == 1){\n second = 0;\n minute = 0; \n hour = 0;\n startTimer();\n } \n}", "function _startTimer() {\n service.timer.start(times.ONE_MINUTE);\n }", "function fnTimerStart(strIdentifier) {\n if (typeof(arrTimer)==\"undefined\")\n arrTimer = new Array()\n if (typeof(arrTimer[strIdentifier])==\"undefined\")\n arrTimer[strIdentifier] = [(new Date()).getTime()]\n else\n arrTimer[strIdentifier][0] = (new Date()).getTime()\n}", "function startTimer() {\n // Set time remaining based on selection\n if (id(\"time-3\").checked) {\n timeLeft = 180;\n } else if (id(\"time-5\").checked) {\n timeLeft = 300;\n } else {\n timeLeft = 600;\n }\n // Set the timer for first second\n id(\"timer\").textContent = timeConvert(timeLeft);\n // Timer to update every second\n timer = setInterval(function() {\n timeLeft --;\n // If time runs out, end the game\n if (timeLeft === 0) {\n gameOver();\n }\n id(\"timer\").textContent = timeConvert(timeLeft);\n }, 1000); // function runs every 1000 ms\n}", "__startInternalTimer() {\n this.fireEvent(\"press\");\n\n this.__executed = false;\n\n this.__timer\n .set({\n interval: this.getInterval(),\n firstInterval: this.getFirstInterval(),\n minimum: this.getMinTimer(),\n decrease: this.getTimerDecrease()\n })\n .start();\n\n this.removeState(\"abandoned\");\n this.addState(\"pressed\");\n }", "setTimer(){\n $(\"#time\").text(`Time : ${player.getTimeForTurn()}`);\n\n timePass = setInterval(function(){\n player.timeForTurn--;\n $(\"#time\").text(`Time : ${player.getTimeForTurn()}`);\n //If time is even zero, then other player wins!\n if(player.getTimeForTurn() == 0){\n\n let winMessage;\n\n if(player.getPlayerColor() == \"white\"){\n winMessage = \"black\";\n }else{\n winMessage = \"white\";\n }\n\n socket.emit('gameEnded', {\n room: game.getRoomId(),\n message: winMessage,\n }); \n\n game.endGameMessage(winMessage);\n\n clearInterval(timePass);\n }\n },1000);\n }", "function startChallengeTimer() {\n // Set the global 'challengeRunning' variable state to on\n showPrompt();\n if (timerState === TIMER_STATES.PAUSED) {\n disableStartButton();\n }\n\n timerState = TIMER_STATES.ACTIVE;\n unSelectAllTimerButtons();\n\n // Get the selected time, turn it into a date object\n let challengeLengthMinutes = $('#timer .minutes').text();\n let challengeLengthSeconds = $('#timer .seconds').text();\n\n // Fast timer for dev purposes\n // let challengeLengthMinutes = 0;\n // let challengeLengthSeconds = 3;\n\n // start the timer based on what's already on the clock\n let challengeLength = new Date( Date.parse( new Date() ) + ( 1 * 1 * challengeLengthMinutes * 60 * 1000 ) + ( 1 * 1 * challengeLengthSeconds * 1000 ) );\n\n // If the challenge is 60m or greater, subtract a second so that the minutes doesn't show '00' in the first second\n if( challengeLengthMinutes >= 60 ) {\n challengeLength.setSeconds( challengeLength.getSeconds() - 1 );\n }\n\n // Call the start timer function\n initializeClock('timer', challengeLength);\n\n // Get the time remaining\n function getTimeRemaining(endtime) {\n let total = Date.parse(endtime) - Date.parse(new Date());\n let seconds = Math.floor((total / 1000) % 60);\n let minutes = Math.floor((total / 1000 / 60) % 60);\n return {\n total,\n minutes,\n seconds\n };\n }\n\n // Function to start the clock\n function initializeClock(id, endtime) {\n clearAllIntervals();\n $('.workoutman--animated').show();\n $('.workoutman--still').hide();\n\n let clock = document.getElementById(id);\n let minutesEl = clock.querySelector('.minutes');\n let secondsEl = clock.querySelector('.seconds');\n\n function updateClock() {\n let t = getTimeRemaining(endtime);\n minutesEl.innerHTML = ('0' + t.minutes).slice(-2);\n secondsEl.innerHTML = ('0' + t.seconds).slice(-2);\n\n if (t.total <= 0) {\n window.clearInterval(timeInterval);\n // $('.timesup').removeClass('hide');\n // $('.illo--animated').hide();\n // $('.illo--still').show();\n showOutOfTime();\n }\n }\n updateClock();\n let timeInterval = setInterval(updateClock, 1000);\n activeIntervals.push(timeInterval)\n }\n}", "function initGame()\n{\n\tturn = 0;\n\tgame_started = 0;\n player = 0;\n}", "function startTimer() {\n p.timeOut1 = setTimeout(() => {\n p.ready = true;\n p.timeOfStart = p.millis();\n p.timeOut2 = setTimeout(() => {\n p.ready = false;\n p.timeOfEnd = p.millis();\n const success = false;\n const time = ((p.timeOfEnd - p.timeOfStart) / 1000).toFixed(3);\n p.props.generateResult(success, time);\n }, p.props.gameTime * 1000);\n }, p.props.startTime * 1000);\n }", "function initializeTimer(hour, minutes) {\n timerHours = hour;\n timerMinutes = minutes;\n timerSeconds = 0;\n timerString = timerHours + \":\";\n if (timerMinutes < 10) {\n timerString += \"0\"\n }\n timerString += timerMinutes + \":0\" + timerSeconds;\n\n $(\"#timer\").text(timerString);\n $(\"title\").text(\"Clocky (\" + timerString + \")\");\n\n timerOn = false;\n}", "function startGame() {\r\n countUp = 0;\r\n setTimeout(endGame, 120000);\r\n startTimer();\r\n cancelTimer = false;\r\n triggerCrime();\r\n}", "function setTimer() {\n counter = 11;\n clearInterval(timer);\n timer = setInterval (countDown, 1000);\n }", "function TimerManager() {\n this.timers = {}; // Maps name: Timer\n this.runningTimers = {}; // Maps name: timerid\n}", "function mainTime(time, id) {\r\n\tlet session = \"work\";\r\n\tlet timeInterval;\r\n\t//let startingTime = sessionTime\r\n\tthis.id = id;\r\n\tlet breakTime = 5;\r\n\tlet workTime = 25;\r\n\tlet startingTime = workTime;\r\n\r\n\tthis.time = startingTime;\r\n\t//allows to set a new time\r\n\tthis.setTime = (objWork, objBreak) => { \r\n\t\t//startingTime = objectTime;\r\n\t\tworkTime = objWork.time;\r\n\t\tbreakTime = objBreak.time\r\n\tconsole.log(startingTime);\r\n\t };\r\n\t\r\n\tthis.count = () => {\r\n\r\n\t\tthis.display(this.id);\r\n\t\tconsole.log(this.getSession(), this.time);\r\n\t\tconsole.log(workTime, breakTime);\r\n\r\n\t\tif(this.time === 0 && this.getSession() === \"work\") {\r\n\t\t\tthis.time = this.getBreakTime();\r\n\t\t\tthis.setSession(\"break\");\r\n\r\n\t\t}\r\n\r\n\t\telse if(this.time === 0 && this.getSession() === \"break\") {\r\n\t\t\tthis.setSession(\"work\");\r\n\t\t\tthis.time = this.getWorkTime();\r\n\t\t}\r\n\t\tthis.time--; //decrease the time\r\n\r\n\t}\r\n\r\n\t//start countdown\r\n\tthis.startCount = (objWork, objBreak) => {\r\n\t\tobjWork.setSession(true);\r\n\t\tobjBreak.setSession(true);\r\n\t\tthis.setBreakTime(objBreak);\r\n\t\tthis.setWorkTime(objWork);\r\n\t\tif (this.getSession() === \"work\" && this.time === 0) {\r\n\t\t\tthis.time = this.getWorkTime();\r\n\t\t}\r\n\t\telse if (this.getSession() === \"work\" && this.time !== 0) {\r\n\t\t\tthis.time = this.getWorkTime();\r\n\t\t}\r\n\t\telse if(this.time === 0) {\r\n\t\t\tthis.time = this.getBreakTime();\r\n\t\t}\r\n\t\t//timerRunning = true;\r\n\t\ttimeInterval = setInterval(this.count, 1000);\r\n\t}\r\n\t//stop/pause the time\r\n\tthis.stopCount = (objWork, objBreak) => {\r\n\t\tobjWork.setSession(false);\r\n\t\tobjBreak.setSession(false);\r\n\t\tclearInterval(timeInterval)\r\n\t\t };\r\n\t//reset the time\r\n\tthis.reset = (objWork, objBreak, id) => { \r\n\t\tobjWork.setSession(false);\r\n\t\tobjBreak.setSession(false);\r\n\t\tthis.stopCount(objWork, objBreak);\r\n\t\tthis.time = startingTime;\r\n\t\tthis.display(id);\r\n\t\t }\r\n\t//displayon DOM\r\n\tthis.display = (id) => {\r\n\t\tdocument.getElementById(id).textContent = this.time;\r\n\t}\r\n\r\n\tthis.getSession = () => session;\r\n\r\n\tthis.setSession = (status) => { session = status};\r\n\r\n\tthis.setBreakTime = (obj) => {\r\n\t\tbreakTime = obj.time;\r\n\t};\r\n\r\n\tthis.setWorkTime = (obj) => {\r\n\t\tworkTime = obj.time;\r\n\t};\r\n\r\n\tthis.getBreakTime = () => breakTime;\r\n\r\n\tthis.getWorkTime = () => workTime;\r\n\r\n\t//takes the session and break\r\n\r\n\r\n}", "function startGame(){\n countStartGame = 30;\n correctAnswers = 0;\n wrongAnswers = 0;\n unanswered = 0;\n\n if (!timerRunning){ \n intervalId = setInterval(timer, 1000);\n timerRunning = true;\n }\n timer();\n console.log(\"game startiiing\");\n \n}", "function init() {\n\n\t// initial global variables\n\ttime = 0;\n\ttotalPlay = 0;\n\tplayed = [];\n\tstop = false;\n\tstarted = true;\n\tnumLife = 3;\n\n\t// set contents and start the timer\n\tsetScenario();\n\ttimer.text(time);\n\tlife.text(numLife);\n\tcountTime();\n}", "startCountdown() {\n this.setGameValues();\n this.timerStart = new Date().getTime();\n this.countdownInterval = setInterval(this.updateTime, 1000);\n }", "function startGameTimer(){\n var timer = setInterval(() => {\n console.log(GMvariables.timerSecs);\n $(\"#timer\").text(GMvariables.timerSecs);\n if(GMvariables.timerSecs == 0){\n $(\"#timer\").text(\"Go\");\n clearInterval(timer);\n setTimeout(() => {\n $(\"#timer\").css(\"display\", \"none\");\n reset();\n changePositionOfElement();\n headerUpdater();\n }, 1000);\n }\n GMvariables.timerSecs -= 1;\n }, 1000);\n \n}", "function createTimer() {\n debug(\"createTimer\");\n clock = document.createElement('span');\n clock.setAttribute(\"class\", \"timer\");\n clock.innerHTML = \"0 Seconds\";\n\n document.querySelector('.score-panel').appendChild(clock);\n startTime();\n }", "function initTimers(){\n Timers = [\n {\n tag: \"Work\",\n time: 25,\n seconds:0,\n defaultSound: true,\n soundType: \"ding\", \n volume: 80,\n index: 0\n },\n {\n tag: \"Short Break\",\n time: 5,\n seconds:0,\n defaultSound: false,\n soundType: \"elevator\", \n volume: 50,\n index: 1\n },\n {\n tag: \"Long Break\",\n time: 10,\n seconds:0,\n defaultSound: true,\n soundType: \"tone\", \n volume: 100,\n index: 2\n },\n {\n tag: \"Custom 1\",\n time: 25,\n seconds:0,\n defaultSound: true,\n soundType: \"bell\", \n volume: 100,\n index: 3,\n on: false\n },\n {\n tag: \"Custom 2\",\n time: 25,\n seconds:0,\n defaultSound: true,\n soundType: \"jingle\", \n volume: 100,\n index: 4,\n on: false\n }\n ]\n}", "function resetTimers() {\n startTime = new Date;\n startTime.setHours(0);\n startTime.setMinutes(0);\n startTime.setSeconds(0);\n startTime.setMilliseconds(0);\n \n stopTime = new Date;\n stopTime.setHours(config.timer.hour);\n stopTime.setMinutes(config.timer.minute);\n stopTime.setSeconds(0);\n stopTime.setMilliseconds(0);\n }", "function startTimer() {\n if (stoptime) {\n stoptime = false;\n runClock();\n }\n}", "function startTimer(){\n gameTimer= setInterval(countUpTimer, 1000);\n}", "init() {\n this.hrtimer = setInterval(this.hourTime, this.hourlyMs);\n this.daytimer = setInterval(this.dayTime, 24000);\n }", "function timer() {\n\n var from = socket.id;\n var to = user_games[from];\n if (typeof game_timer[from] != 'undefined' && typeof game_timer[to] != 'undefined') {\n\n clearInterval(game_timer[from]);\n clearInterval(game_timer[to]);\n }\n\n var timer_data = {\n 'counter': 15\n };\n \n game_timer[from] = game_timer[to] = setInterval(function() {\n\n io.sockets.socket(to).emit('timer', timer_data);\n io.sockets.socket(from).emit('timer', timer_data);\n if (timer_data['counter'] == 1) {\n\n clearInterval(game_timer[from]);\n clearInterval(game_timer[to]);\n timer_data['you_won'] = 0;\n timer_data['time_up'] = 1;\n timer_data['turn'] = 0;\n io.sockets.socket(to).emit('game_result', timer_data);\n timer_data['you_won'] = 1;\n timer_data['turn'] = 1;\n io.sockets.socket(from).emit('game_result', timer_data);\n }\n\n timer_data['counter']--;\n }, 1000);\n }", "function startedTimer(timer) {\n\t\tconst id = timer.id;\n\t\tconst start = document.querySelector(id + 'Start')\n\t\tstart.remove();\n\n\t\tconst cutId = id.substring(1);\n\t\tconst buttons = document.getElementById(cutId + \"Buttons\")\n\n\t\tconst stop = new controlButton(timer, \"Stop\");\n\t\tconst reset = new controlButton(timer, \"Reset\");\n\n\t\ttimer.startTimer();\n\n\t\tbuttons.appendChild(stop);\n\t\tbuttons.appendChild(reset);\n\n\t}", "function initTimer() {\n // debugger;\n if ($scope.duration > 0) {\n $scope.resetTimer();\n $scope.startTimer();\n }\n }", "function Timer() {\n\tthis.startTime = 0; // the time that this timer was started\n\t\n\tthis.Reset(); // initially reset our timer\n}", "function startTimer() {\n timeCounter = setTimeout(addTime, 1000);\n timerStatus = true;\n }", "function set_action_timer() {\n action_timer = action_timer_time;\n}", "startTimer() {\n if (!this.timerId) {\n this.timerId = setInterval(() => {\n this.setState({\n activeSlot: this.getTimeSlot(this.state.slots)\n });\n }, 60000);\n }\n }", "function resetTimer(){\n\n time = 31;\n }", "function createTimer() {\n\n if (typeof this.counter == 'undefined') {\n this.counter = 0;\n } else {\n this.counter++;\n }\n\n // \\\\\n // dangererous function \\\\\n // \\\\\n\n if (globalId) {\n QuestionInterval = setInterval(function () {\n\n askQuestionTimed();\n\n }, 10 * questionTime);\n } else {\n askQuestionTimed();\n }\n //\n //\n //\n}", "function setTimer() {\n \n const seconds = parseInt(this.dataset.time);\n timer(seconds);\n console.log(this.dataset.time)\n }", "function initTime() {\n currentTimer = setInterval(function() {\n $timer.text(`${second}`)\n second = second + 1\n }, 1000);\n}", "function swapTurns(){\n firstMove = false;\n playerTurn = !playerTurn;\n enemyTurn = !enemyTurn;\n if (enemyTurn)\n {\n AITimer = Math.floor(((Math.random() * 1.5) + 0.5) * 60);\n }\n}", "function onTimer(){\r\n\tif (turn == OPPONENT) return;\r\n\tupdate_handler({time:timer});\r\n\ttimer--;\r\n\tif (timer < 0){\r\n\t\tmissStep();\r\n }\r\n}", "setStartupTimer() {\n let self = this;\n //+ coerces the result to a number, making typescript happy.\n this.startupTimer = +setTimeout(() => {\n self.emit(\"timeout\");\n }, STARTUP_TIMEOUT_DURATION);\n }", "_startTimer () {\n // Clear previous intervalID and set time-limit for current interval\n clearInterval(this._intervalID)\n\n this._intervalID = setInterval(() => {\n this._time += (this._updateTime / 1000)\n this._timeArea.textContent = `Time: ${this._cropTime(this._time, this._dec)} s`\n }, this._updateTime)\n }", "function stopTimer (){\n if(currentPlayer == player1) {\n player1.time = seconds;\n $('#player1Time').text(seconds);\n switchTurns();\n } else {\n player2.time = seconds\n $('#player2Time').text(seconds);\n checkScore();\n switchTurns();\n }\n //return seconds = 0;\n clearInterval(timer);\n seconds=0;\n snitch.addEventListener('click', startTimer);\n}", "function autoStartTimer() {\r\n\tif (timerRunning === false) {\r\n\t\ttimerRunning = true;\r\n\t\tcountDown();\r\n\t}\r\n}", "function timerStart(){\n heatGenerate();\n dsec++;\n totalTime++;\n if(dsec == 10) {\n dsec = 0;\n sec++;\n if(sec == 60) {\n sec = 0;\n min++;\n }\n }\n \n if(totalTime % GAME_SPAWN_TIME == 0) {\n spawnRandomGame();\n }\n \n if(difficulty < MAX_DIFFICULTY && totalTime % DIFF_INCREASE == 0) {\n difficulty++;\n }\n \n timer.innerHTML = pad(min) + \" : \" + pad(sec) + \" : \" + dsec;\n\n\n if(min == TIME_GOAL){\n ironManAction();\n }\n}", "startTimer() {\n this.offset = Date.now();\n this.theTime = 0;\n this.theTimer = setInterval(() => { this.timer(); }, 100);\n }", "startTurn () { this.resetResources (); this._startTurn (); }", "function setShotclockTimer(time) {\n var sec_ten = Math.floor(time / 10);\n var sec_one = time % 10;\n\n\tonLED('#shotclock_tens', SMALL_NUMBERS[sec_ten]);\n\tonLED('#shotclock_ones', SMALL_NUMBERS[sec_one]);\n}", "function setupTimer(opts) {\n var name, timer;\n name = opts.name || node.game.timer.name;\n timer = node.timer.getTimer(name);\n\n if (!timer) {\n node.warn('setup(\"timer\"): timer not found: ' + name);\n return false;\n }\n\n if (opts.options) timer.init(opts.options);\n\n switch (opts.action) {\n case 'start':\n timer.start();\n break;\n case 'stop':\n timer.stop();\n break;\n case 'restart':\n timer.restart();\n break;\n case 'pause':\n timer.pause();\n break;\n case 'resume':\n timer.resume();\n }\n\n return true;\n }", "function InitSessionTimer() \n{\n /* mReschke 2010-09-29 */\n warn_sec = 12* 59 * 60 * 1000; //Warning time in milliseconds\n timeout_sec = 12*60 * 60 * 1000; //Actual timeout in milliseconds\n show_warning = true;\n start_time = new Date().getTime();\n CheckSessionStatus();\n}", "function startOpponentCheckTimer() {\n nIntervId = setInterval(checkForOpponent, 5000);\n }", "function startTimer() {\n status = 1;\n timer();\n }", "function resetTimer () {\n timerRunning = false;\n clearInterval(clockInterval);\n clearInterval(wpmInterval);\n}", "function init() {\n console.log('init!');\n setup();\n startTimer();\n }", "function toggleTimer() {\n !timerStarted ? startTimer() : stopTimer();\n }", "function init() {\n $.post(\n '/server/index.php',\n { action : 'timer_init' },\n function(data) {\n var d = JSON.parse(data);\n if(d.pause) {\n pause(d.pause);\n } else if(parseInt(d.seconds) > 0) {\n start(d.seconds);\n }\n }\n );\n }", "function startTimer(){\n\n // ParseInt to only get whole number\n const seconds = parseInt(this.dataset.time);\n timer(seconds);\n}", "function setTimer(time) {\n\tvar mins = parseInt(time / 60);\n var secs = parseInt(time % 60);\n var min_ten = Math.floor(mins / 10);\n var min_one = mins % 10;\n var sec_ten = Math.floor(secs / 10);\n var sec_one = secs % 10;\n\n onLED('#minute_ten', SMALL_NUMBERS[min_ten]);\n\tonLED('#minute_one', SMALL_NUMBERS[min_one]);\n\tonLED('#second_ten', SMALL_NUMBERS[sec_ten]);\n\tonLED('#second_one', SMALL_NUMBERS[sec_one]);\n}", "function initialize_timer(hrs,mins,seconds){\n // Set up expiry time\n expiryTime.setHours( expiryTime.getHours() + hrs );\n expiryTime.setMinutes( expiryTime.getMinutes() + mins );\n expiryTime.setSeconds( expiryTime.getSeconds() + seconds );\n\n timerElement.html(findTimeDifference(startTime,expiryTime));\n //console.log('timerElement.innerHTML:'+timerElement.innerHTML);\n }", "startTimer() {\n if (this.onStartCallback) {\n this.onStartCallback(this.timeRemaining);\n }\n\n this.tickWaktu();\n this.intervalId = setInterval(() => {\n this.tickWaktu();\n }, 20);\n }", "function startTimer(){\n t = setTimeout(timer, 1000)\n}", "function timerWrapper () {}", "function Timer() {\n this.gameTime = 0;\n this.maxStep = 0.05;\n this.wallLastTimestamp = 0;\n }", "function set_move_timer() {\n move_timer = move_timer_time;\n}", "function startTimer() {\n timer = setInterval(decrementTimer, 1000);\n remainingTime = 61;\n }", "resetTimer() {\n this.stopTimer();\n console.log(\"resetTimer() called, timer instance restarts from 0.\");\n this.mElapsedTime = 0;\n this.notifyTimerObservers(this.mElapsedTime);\n const handler = function () {\n this.mElapsedTime++;\n this.notifyTimerObservers(this.mElapsedTime);\n }\n this.mElapsedTime = 0;\n mTimerIntervalId = window.setInterval(handler.bind(this), 1000);\n }", "function startTimer (){\n clear = setInterval(timer, 1000)\n }", "function startTimer() {\n\tconst seconds = parseInt(this.dataset.time); //grab data attr value\n\ttimer(seconds); //set value to timer fn\n}", "function turnOnTimer(gameTimer) {\n\n console.log('Timer is to strat!');\n gameStarted = true;\n\n //00:00:00\n //minutes:seconds:centisecond(100 for each sec) just like centimeter :/\n let centisecond = 0;\n let seconds = 0;\n let minutes = 0;\n let interval =\n setInterval(() => {\n console.log(\"timer is running: \" + isTimerRunning);\n\n if (timerCheck) {\n killTimer = false;\n clearInterval(interval);\n } else if (seconds >= 15 || gameEnded) { // OR if gameOver \n //you can set minutes insted of seconds\n console.log('GameOver, timer is off');\n gameStarted = false;\n gameEnded = false;\n console.log('GAME ENDED set to: ' + gameEnded)\n clearInterval(interval);\n\n } else if (seconds <= 9) {\n gameTimer.innerHTML = minutes + \":0\" + seconds++;\n\n } else if (seconds <= 59) {\n gameTimer.innerHTML = minutes + \":\" + seconds++;\n\n } else {\n seconds = 0;\n minutes += 1;\n gameTimer.innerHTML = minutes + \":0\" + seconds++;\n }\n\n }, 1000);\n}", "function startTimer(){\n setTimeout(setIntervals, 300);\n setTimeout(rail_lights, 3000);\n setTimeout(getAudio, 3300);\n setTimeout(empty_window, 9000);\n}", "function shotclockTimer() {\n\tif(TIMER_SHOTCLOCK_STOPPED == false) {\n\t\tTIMER_SHOTCLOCK--;\n\t\tif(TIMER_SHOTCLOCK == 0) {\n\t\t\tTIMER_SHOTCLOCK_STOPPED = true;\n\t\t}\n\n\t\tsetShotclockTimer(TIMER_SHOTCLOCK);\n\t}\n}", "function startTimer() {\r\n gTime1 = Date.now();\r\n gMyTime = setInterval(timeCycle, 1);\r\n}", "function xTimerMgr()\r\n{\r\n this.tmr = null;\r\n this.timers = new Array();\r\n}", "function timerStart(){\n\t\n\t\t\n\t}", "function startTimer() {\n // Sets timer\n timer = setInterval(function() {\n timerCount--;\n timerElement.textContent = timerCount;\n if (timerCount === 0) {\n // Clears interval\n clearInterval(timer);\n nextQuestion();\n }\n }, 1000);\n }", "function setupTimeoutTimer() {\n updateTimeoutInfo(undefined);\n }", "function initTime() {\n nowTime = setInterval(function () {\n $timer.text(`${second}`)\n second = second + 1\n }, 1000);\n}" ]
[ "0.69657207", "0.6415698", "0.6256748", "0.62334555", "0.61666274", "0.6148235", "0.6038309", "0.6023115", "0.60155964", "0.60087466", "0.5994431", "0.5968748", "0.5964544", "0.5924045", "0.5791115", "0.57769287", "0.5763371", "0.5730712", "0.5725152", "0.5721867", "0.57150334", "0.5712649", "0.5712354", "0.57036114", "0.56838137", "0.5679625", "0.5673791", "0.56504005", "0.5622128", "0.55894876", "0.5584608", "0.55644125", "0.55592173", "0.5554932", "0.55544406", "0.55527306", "0.553735", "0.55308837", "0.5525399", "0.551473", "0.5510957", "0.5509359", "0.54905516", "0.54886234", "0.54777414", "0.54711527", "0.5468357", "0.54646254", "0.54621404", "0.54609835", "0.5456062", "0.5455603", "0.5454345", "0.54541737", "0.5444851", "0.54384816", "0.54356307", "0.54298353", "0.5427562", "0.5427297", "0.54259837", "0.54221654", "0.54149234", "0.5412672", "0.540476", "0.5402766", "0.54019827", "0.5394047", "0.5391585", "0.5388213", "0.5377199", "0.5376342", "0.53755337", "0.537214", "0.5364729", "0.5361423", "0.5360236", "0.5359377", "0.53535527", "0.5351557", "0.5351387", "0.53345525", "0.53301907", "0.53288233", "0.5326979", "0.53257036", "0.53251874", "0.5324736", "0.53234524", "0.53211606", "0.53192216", "0.5315639", "0.5315028", "0.5312167", "0.5307951", "0.53043026", "0.5303483", "0.5297547", "0.5293937", "0.5292719" ]
0.6997706
0
Helper functions, just in case:
function getCurrentPlayer() { return gameState.players[gameState.turnIndex]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "private public function m246() {}", "protected internal function m252() {}", "static private internal function m121() {}", "transient private protected internal function m182() {}", "static final private internal function m106() {}", "static private protected internal function m118() {}", "transient protected internal function m189() {}", "transient private internal function m185() {}", "function _____SHARED_functions_____(){}", "transient final protected internal function m174() {}", "static transient private protected internal function m55() {}", "function DWRUtil() { }", "static transient final private internal function m43() {}", "static protected internal function m125() {}", "function Utils() {}", "function Utils() {}", "function TMP(){return;}", "function TMP(){return;}", "function Helper() {}", "static transient final protected internal function m47() {}", "prepare() {}", "static final private protected internal function m103() {}", "transient private protected public internal function m181() {}", "expected( _utils ) {\n\t\t\treturn 'nothing';\n\t\t}", "transient final private protected internal function m167() {}", "function StupidBug() {}", "function AeUtil() {}", "static transient private protected public internal function m54() {}", "function Utils(){}", "function FunctionUtils() {}", "function Util() {}", "function __it() {}", "function customHandling() { }", "static private protected public internal function m117() {}", "function TMP() {\n return;\n }", "static transient final private protected internal function m40() {}", "static transient private internal function m58() {}", "obtain(){}", "static transient final protected public internal function m46() {}", "apply () {}", "static final private public function m104() {}", "function tempConvert(){\n \n}", "transient final private internal function m170() {}", "function miFuncion (){}", "function dummy(){}", "function dummy(){}", "function dummy(){}", "static final private protected public internal function m102() {}", "hacky(){\n return\n }", "function gatherStrings(obj) {\n\n}", "static final protected internal function m110() {}", "static transient private public function m56() {}", "transient private public function m183() {}", "function SigV4Utils() { }", "function l(){t={},u=\"\",w=\"\"}", "static private public function m119() {}", "static transient final protected function m44() {}", "function __func(){}", "expected(_utils) {\n return 'nothing';\n }", "function find() {}", "function miFuncion(){}", "function miFuncion(){}", "function miFuncion(){}", "function getFullNames(/* CODE HERE */) {\n /* CODE HERE */\n}", "function TMP(){}", "function TMP(){}", "function normal() {}", "lowX() {return this.stringX()}", "function oi(){}", "function dummy() {}", "function dummy() {}", "function dummy() {}", "_validate() {\n\t}", "function Hx(a){return a&&a.ic?a.Mb():a}", "function i(e,t){return t}", "static transient final private protected public internal function m39() {}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function ea(){}", "function fm(){}", "lastUsed() { }", "function GraFlicUtil(paramz){\n\t\n}", "function asd(thing,outf) \n{\nlet log =\"\";\n for(var propname in thing)\n {\n if (true)//(thing.hasOwnProperty(propname))\n {log += propname + \":\" + thing[propname] + \"<br>\" ;}\n }\n\nif (!outf){loginhtml(log);}else{outf(log);}\nlog=\"\";\n}", "async normalize () {\n\t}", "function Utils() {\n}", "function SBRecordsetPHP_analyzePlatformSpecific()\r\n{\r\n\r\n\r\n}", "function undici () {}", "function accessesingData2() {\n\n}", "function accessesingData2() {\n\n}" ]
[ "0.64457023", "0.61670953", "0.6145694", "0.5942318", "0.56866544", "0.5681822", "0.56045526", "0.55390525", "0.5401124", "0.5393439", "0.53122216", "0.5255313", "0.52533", "0.5202225", "0.5196518", "0.5155395", "0.5155395", "0.51252145", "0.51252145", "0.5108702", "0.509155", "0.50579107", "0.5049176", "0.5049078", "0.50258046", "0.50136316", "0.50050586", "0.50019544", "0.49999115", "0.4992309", "0.49901935", "0.49862608", "0.49711108", "0.4965718", "0.49578136", "0.4928494", "0.49239022", "0.49202994", "0.4918884", "0.49037108", "0.488295", "0.48481357", "0.48336253", "0.48240077", "0.4822144", "0.47933307", "0.47933307", "0.47933307", "0.4788667", "0.47885266", "0.47784588", "0.47653255", "0.47352958", "0.47338027", "0.47303462", "0.47281867", "0.47242832", "0.46964306", "0.46819305", "0.46705687", "0.46673405", "0.46648934", "0.46648934", "0.46648934", "0.46635363", "0.46449032", "0.46449032", "0.46448153", "0.4643032", "0.46429253", "0.46394593", "0.46394593", "0.46394593", "0.4629076", "0.46219313", "0.46203697", "0.45924595", "0.4591798", "0.4591798", "0.4591798", "0.4591798", "0.4591798", "0.4591798", "0.4591798", "0.4591798", "0.4591798", "0.4591798", "0.4591798", "0.4591798", "0.4591798", "0.45909837", "0.45775038", "0.45769724", "0.4576497", "0.45738828", "0.45700622", "0.45660794", "0.45646596", "0.45622855", "0.45610422", "0.45610422" ]
0.0
-1
creat footer to the table
function Footer() { var data = document.getElementById('aziz'); var tr7 = document.createElement('tr'); data.appendChild(tr7); var th6 = document.createElement('th'); tr7.appendChild(th6); th6.textContent = 'Totals'; var totalOfTotal = 0; for (var i = 0; i < hours.length; i++) { var sumHour = 0; for (let j = 0; j < loc.length; j++) { sumHour = sumHour + loc[j].numberofCookiespurchsedPerhour[i]; } var td8 = document.createElement('td'); tr7.appendChild(td8); td8.textContent = sumHour; totalOfTotal = totalOfTotal + sumHour; } var th9 = document.createElement('td'); tr7.appendChild(th9); th9.textContent = totalOfTotal; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function footer( conteudo ){\n\n tabela.find('tfoot').remove();\n\n var footer = elementoTfooter.clone();\n\n content = $('<tr>').html( $('<td>').attr('colspan',elementoLinha.find('td').length).html( conteudo ) );\n\n tabela.append( footer.append( content ) );\n\n }", "function makeFooter(dpid, table, ftr_format, cell_format) {\n\n var $footer = $('<table></table>').addClass('oneliner');\n\n var $col = $('<tr></tr>');\n for (var i in table.extra.labels) {\n var item = table.extra.labels[i];\n var $hdr = $('<td></td>');\n var label = ftr_format(item);\n var data = cell_format(table.extra.data[item]);\n $hdr.text(label + \" : \" + data);\n $col.append($hdr);\n }\n $footer.append($col);\n table['$footer'] = $footer;\n }", "function createFooter() {\r\n var foot = document.querySelector('tfoot');\r\n foot.innerHTML = '';\r\n newRow = addElement('tr', '', foot);\r\n addElement('th', 'Totals', newRow);\r\n for (var i = 0; i < times.length; i++) {\r\n var hourTotal = 0;\r\n for (var j = 0; j < Store.stores.length; j++) {\r\n hourTotal += Store.stores[j].hourlySales[i];\r\n }\r\n addElement('td', hourTotal, newRow);\r\n }\r\n}", "function addFooter() {\n DataRow = document.createElement('tr');\n table.appendChild(DataRow);\n\n emptycol = document.createElement('td');\n emptycol.textContent = 'Total';\n DataRow.appendChild(emptycol);\n\n for (var tot = 0; tot < colSum.length; tot++) {\n\n var TotalRow = document.createElement('td');\n TotalRow.textContent = colSum[tot];\n DataRow.appendChild(TotalRow);\n }\n\n}", "function commonFooter() {\n var text;\n text = botTable();\n text += \"<table style='margin-bottom:40px; margin-top:20px; width:100%;'>\";\n text += \"<tr><td style='text-align:left; vertical-align:bottom;'>\" + foot1() + \"</td>\";\n text += \"<td id='tdMathJaXFooter' style='text-align:center; vertical-align:bottom;'>\" + mathJaXImgAnchor + \"<br />beautiful math</td>\";\n text += \"<td id='tdJSXGraphFooter' style='text-align:center; vertical-align:bottom;'>\" + jsxGraphImgAnchor + \"<br />beautiful graphics</td>\";\n text += \"<td id='tdTermsOfUseFooter' style='text-align:right; vertical-align:bottom;'>\" + foot3() + \"<td></tr>\";\n text += \"</table>\";\n return text;\n}", "function createFooter() {\n\n let trfooEl =document.createElement('tr');\n let tdEl=document.createElement('td');\n tdEl.textContent = 'Totals';\n trfooEl.appendChild(tdEl);\n tableEl.appendChild(trfooEl);\n let megaTotal = 0;\n\n for (let h=0 ; h < openhours.length ; h++ ) {\n\n let tdEl=document.createElement('td');\n let sum=0;\n \n for (let s=0 ; s < locations.length ; s++){\n\n\n sum = sum + locations[s].cookiesinhour[h];\n\n }\n megaTotal += sum;\n tdEl.textContent = sum;\n trfooEl.appendChild(tdEl);\n\n }\n let totalTdEl = document.createElement('td');\n totalTdEl.textContent = megaTotal;\n trfooEl.appendChild(totalTdEl);\n }", "function createFooterTable(){\r\n tfoot =document.createElement('tfoot');\r\n trow=document.createElement('tr');\r\n \r\n let td=document.createElement('th');\r\n td.textContent='Total';\r\n trow.appendChild(td);\r\n let allTotal=0;\r\n for (let i =0 ;i <14 ; i++){\r\n //let element=document.querySelectorAll('tr td:nth-child('+i+')');\r\n totalColumn=0;\r\n for(let r =0 ;r<Location.allLocation.length;r++){\r\n // console.log(element[r].textContent);\r\n // totalColumn+=parseInt(element[r].textContent);\r\n totalColumn+=Location.allLocation[r].resultArr[i];\r\n allTotal+=Location.allLocation[r].resultArr[i];\r\n \r\n }\r\n console.log(totalColumn);\r\n tfooter=document.createElement('td');\r\n tfooter.textContent=totalColumn;\r\n trow.appendChild(tfooter);\r\n\r\n\r\n }\r\n tfooter=document.createElement('th');\r\n tfooter.textContent=allTotal;\r\n trow.appendChild(tfooter);\r\n tfoot.appendChild(trow);\r\n return tfoot;\r\n \r\n}", "updateFooter() {\n // Get new footer row HTML string\n let newFoot = footer.render();\n // Add new footer row to table footer\n this.footer.appendChild(newFoot);\n }", "function footer() {\n var footerRow = document.createElement('tr');\n var dailyTotalAllStores = document.createElement('td');\n dailyTotalAllStores.textContent = 'All Stores Hourly Total';\n footerRow.appendChild(dailyTotalAllStores);\n for (var i = 0; i < clock.length; i++) {\n var hourlyTotals = 0;\n for (var j = 0; j < allStores.length; j++) {\n hourlyTotals += allStores[j].hourlyCookies[i];\n }\n var footerData = document.createElement('td')\n footerData.textContent = hourlyTotals;\n footerRow.appendChild(footerData);\n }\n parentElement.appendChild(footerRow);\n}", "function makeTableFooter(){\n var table = document.getElementById('store-table');\n var theTableFooter = document.createElement('tr');\n var tableHourlyTotalFooter = document.createElement('th');\n tableHourlyTotalFooter.textContent = 'Hourly totals';\n theTableFooter.appendChild(tableHourlyTotalFooter);\n\n for (var i = 0; i < operatingHours.length; i++){\n var tableFooterTotals = document.createElement('td');\n var allBranchHourlySales = 0;\n for (var j = 0; j < allBranches.length; j++){\n allBranchHourlySales += allBranches[j].dailyHourSales[i];\n }\n tableFooterTotals.textContent = allBranchHourlySales;\n theTableFooter.appendChild(tableFooterTotals);\n }\n var tableFooterAllUpTotal = document.createElement('th');\n var allUpTotal = 0;\n for (var jj = 0; jj < allBranches.length; jj++){\n allUpTotal += allBranches[jj].dailyTotalSales;\n }\n tableFooterAllUpTotal.textContent = allUpTotal;\n theTableFooter.appendChild(tableFooterAllUpTotal);\n\n table.appendChild(theTableFooter);\n}", "function forFooter () {\n var tr = document.createElement('tr');\n var thTotal = document.createElement('th');\n thTotal.textContent = 'Total';\n tr.appendChild(thTotal);\n var tfoot = document.getElementById('totalfooter');\n for (var i=0; i<storeHours.length-1; i++) {\n var thtotals = document.createElement('th');\n var storeHourlyTotal = 0;\n for (var j=0; j < stores.length; j++){\n var singleStoreCookies = stores[j].sales[i];\n storeHourlyTotal = storeHourlyTotal + singleStoreCookies;\n }\n thtotals.textContent = storeHourlyTotal;\n tr.appendChild(thtotals);\n\n }\n if (tfoot.firstChild) {\n tfoot.removeChild(tfoot.firstChild);\n }\n tfoot.appendChild(tr);\n}", "function footerTable() {\n let rowFooter = document.createElement('tr');\n\n table.appendChild(rowFooter);\n let th3 = document.createElement('th');\n rowFooter.appendChild(th3);\n th3.textContent = \"Total\";\n\n\n for (let i = 0; i < workingHours.length; i++) {\n sumCookies = 0;\n for (let j = 0; j < shops.length; j++) {\n sumCookies += shops[j].cookiesPerHour[i];\n }\n let th4 = document.createElement('th');\n rowFooter.appendChild(th4);\n th4.textContent = sumCookies;\n }\n\n for (let i = 0; i < shops.length; i++) {\n total += shops[i].totalSold;\n }\n let th5 = document.createElement('th');\n rowFooter.appendChild(th5);\n th5.textContent = total;\n}", "function createFooter() {\n let footerEL = document.createElement('tfoot');\n let tdEL = document.createElement('td');\n\n tdEL.textContent='Totals'\n\n footerEL.appendChild(tdEL);\n tableEL.appendChild(footerEL)\n\n let maintotal = 0\n\n for(let i=0 ; i <hours.length ; i++){\n let summ = 0;\n let tdel = document.createElement('td');\n for(let j = 0 ; j < shopss.length ; j++){\n summ = summ + shopss[j].avgCookiesPerH[i]\n \n console.log(summ);\n }\n maintotal+=summ;\n tdel.textContent = summ ;\n footerEL.appendChild(tdel);\n }\n let totaltd = document.createElement('td')\n totaltd.textContent = maintotal;\n footerEL.appendChild(totaltd)\n\n}", "function foot() {\n\tvar columns, append, lastComm, tr, cell, i, end, total, id;\n\n\t// save typing\n\tcolumns = this.spec.columns;\n\tappend = (function( tagName, className ) {\n\t\t\t cell = document.createElement( tagName );\n\t\t\t if ( className ) cell.className = className;\n\t\t\t tr.appendChild( cell );\n\t\t }).bind(this);\n\n\tlastComm = columns.length - this.afterTotals;\n\n\ttr = this.doc.createElement( 'tr' );\n\tappend( 'td', 'r' );\n\tcell.colSpan = this.beforeTotals;\n\tfor ( i = this.beforeTotals, end = lastComm; i < end; i++ ) {\n\t\tappend( 'td' );\n\t\tid = this.commodities[ i - this.beforeTotals ];\n\t\ttotal = this.totals[ id ];\n\t\tif ( total !== undefined )\n\t\t\tsetCommodityTD( cell, id, total );\n\t\t}\n\tappend( 'td' );\n\tcell.colSpan = this.afterTotals;\n\tthis.tfoot.appendChild( tr );\n\n\t// Arbitrary limit\n\tif ( this.items.length > 24 ) {\n\t\ttr = this.doc.createElement( 'tr' );\n\t\tfor ( i = 0, end = columns.length; i < end; i++ ) {\n\t\t\tappend( 'th' )\n\t\t\tcolumns[ i ].header.call( this, cell );\n\t\t}\n\t\tthis.tfoot.appendChild( tr );\n\t}\n}", "function writeFooter() {\n var foot = document.getElementById('storefooter');\n //remove old footer content\n while (foot.firstChild) {\n //console.log('removing ' + foot.firstChild);\n foot.removeChild(foot.firstChild);\n }\n\n //get totals of the cells\n var totals = [-1, 0, 0, 0, 0, 0, 0, 0, 0, 0];\n var table = document.getElementById('stores_table');\n for (var i = 1; i < table.rows.length; i++) {\n var row = table.rows[i];\n for (var j = 1; j < row.cells.length; j++) {\n totals[j] += parseInt(row.cells[j].textContent);\n //console.log(i + ' ' + j + ' ' + row.cells[j].textContent);\n }\n }\n\n var row = document.createElement('tr');\n foot.appendChild(row);\n\n var storeC = document.createElement('td');\n storeC.textContent = 'Totals:';\n row.appendChild(storeC);\n\n for (var i = 1; i < totals.length; i++) {\n var timeC = document.createElement('td');\n timeC.textContent = totals[i];\n row.appendChild(timeC);\n }\n}", "function renderFooter() {\n var totalsRow = document.createElement('tr');\n table.append(totalsRow);\n var totalLabel = document.createElement('th');\n totalLabel.textContent = 'Total';\n totalsRow.append(totalLabel);\n\n var cooDeeGra = 0;\n for (var i = 0; i < hours.length; i++) {\n var totalByHour = 0;\n for (var j = 0; j < cities.length; j++) {\n totalByHour += cities[j].hourlyDailyTotal[i];\n }\n var storesHourTotal = document.createElement('th');\n storesHourTotal.textContent = totalByHour;\n cooDeeGra += totalByHour;\n totalsRow.append(storesHourTotal)\n }\n var addItAllUp = document.createElement('th');\n addItAllUp.textContent = cooDeeGra;\n totalsRow.append(addItAllUp)\n\n}", "function makeFooterRow () {\n var trEl = document.createElement('tr');\n trEl.id = 'footer';\n var thEl = document.createElement('th');\n thEl.id = 'footer-header';\n thEl.textContent = 'Hourly Total';\n trEl.appendChild(thEl);\n for (var i = 0; i < allLocations[0].arrCookies.length; i++) {\n var tdEl = document.createElement('td');\n tdEl.textContent = hourlyTotal(i);\n trEl.appendChild(tdEl);\n }\n var tdAllDailyTotal = document.createElement('td');\n var sum = 0;\n for (var j = 0; j < allLocations.length; j++) {\n sum += allLocations[j].cookiesTotal;\n }\n tdAllDailyTotal.textContent = sum;\n trEl.appendChild(tdAllDailyTotal);\n tableEl.appendChild(trEl);\n}", "function footerRow() {\n let tr = document.createElement('tr');\n table.appendChild(tr);\n let th = document.createElement('th');\n tr.appendChild(th);\n th.textContent = 'Total';\n\n /*\n let thTotal = document.createElement('th');\n tr.appendChild(thTotal)\n thTotal.textContent='Totals';\n */\n\n let sum;\n let megaTotal = 0;\n for (let i = 0; i < hourWork.length; i++) {\n sum = 0;\n\n for (let j = 0; j < arr.length; j++) {\n\n sum = sum + arr[j].arrcookiesPerHour[i];\n\n }\n\n megaTotal = megaTotal + sum;\n th = document.createElement('th');\n tr.appendChild(th);\n th.textContent = sum;\n }\n let Ttotal = document.createElement('th');\n tr.appendChild(Ttotal);\n Ttotal.textContent = megaTotal;\n\n\n}", "function generateTableFooter(nFoot, aasData, iStart, iEnd, aiDisplay ) {\n\t// Will be set as true if a sum is computed\n\tvar hasSums = false;\n\t\n\tif (aiDisplay.length > 0) {\n\t\t// Table which stores sums\n\t\tvar result = [];\n\t\t$('#dynamictable > thead > tr:first-child > th:visible').each(function (index, element) {\n\t\t\tif ($(element).hasClass('displaysum'))\n\t\t\t\tresult[index] = 0;\n\t\t\telse\n\t\t\t\tresult[index] = NaN;\n\t\t});\n\t\t\n\t\t// Sums computation of displayed data\n\t\tfor (var i = 0; i < aiDisplay.length; i++) {\n\t\t\tfor (var j = 0; j < result.length; j++) {\n\t\t\t\tif (!isNaN(result[j]))\n\t\t\t\t\tresult[j] += Number(aasData[aiDisplay[i]][j]);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Display of sums\n\t\tfor (var i = 0; i < result.length; i++) {\n\t\t\t// Replace NaN by \"\"\n\t\t\tvar colResult = result[i];\n\t\t\tif (isNaN(colResult))\n\t\t\t\tcolResult = \"\";\n\t\t\telse\n\t\t\t\thasSums = true;\n\t\t\t$('th', nFoot).eq(i).text(colResult);\n\t\t}\n\t}\n\t\n\t// Display the footer if there is sums to display\n\tif (!hasSums)\n \t$(nFoot).hide();\n\telse\n\t\t$(nFoot).show();\n}", "function printTableFooter() {\n\n const tr8Element = document.createElement( 'tr' );\n tableElement.appendChild( tr8Element );\n\n const th2Element = document.createElement( 'th' );\n tr8Element.appendChild( th2Element );\n th2Element.textContent = 'Totals';\n\n for ( let i = 0; i < workingHours.length; i++ ) {\n const thElement = document.createElement( 'th' );\n tr8Element.appendChild( thElement );\n\n let dailyHourTotalAllShops = 0;\n for ( let j = 0; j < Shop.allShop.length; j++ ) {\n dailyHourTotalAllShops += Shop.allShop[j].NumberOfCookiesPerHour[i];\n }\n thElement.textContent = dailyHourTotalAllShops;\n }\n\n // calculate the total of the Daily Location Total\n for ( let i = 0; i < dailyLocationTotal.length; i++ ) {\n totals += dailyLocationTotal[i];\n }\n const th3Element = document.createElement( 'th' );\n tr8Element.appendChild( th3Element );\n th3Element.textContent = totals;\n\n}", "function generateTableFooter(guilds)\n{\n let guildNameFootersHtml = '';\n let descriptionFootersHtml = '';\n for (let i = 0; i < guilds.length; i++)\n {\n guildNameFootersHtml += `\n <th colspan=\"3\" class=\"tableCellVerticalAlignMiddle\" style=\"background-color: ${guilds[i].backgroundColor}; font-size: 20px; padding: 5px 0px 5px 0px;\">\n <img src=\"${guilds[i].iconUrl}\" style=\"height: 20px;\"><span style=\"font-weight: bold; color: ${guilds[i].color};\"> ${guilds[i].name}</span>\n </th>\n `;\n descriptionFootersHtml += `\n <th style=\"background-color: ${guilds[i].backgroundColor};\">Contribution</th>\n <th style=\"background-color: ${guilds[i].backgroundColor};\">Difference From Last Entry (Average Per Day)</th>\n <th style=\"background-color: ${guilds[i].backgroundColor};\">Member<br>Count</th>\n `;\n }\n \n return `\n <tr style=\"border-top: 4px solid black;\">\n <th rowspan=\"2\" style=\"background-color: #DCDCDC;\">Date</th>\n ${descriptionFootersHtml}\n </tr>\n <tr>\n ${guildNameFootersHtml}\n </tr>\n `;\n}", "function makeFooterRow() {\n var trEl = document.createElement('tr');\n var thEl = document.createElement('th');\n thEl.textContent = 'Hourly Sales For All Locations';\n trEl.appendChild(thEl);\n\n var totalofTotals = 0;\n var hourlyTotal = 0;\n for (var i = 0; i < hours.length; i++) {\n hourlyTotal = 0;\n for (var j = 0; j < allStores.length; j++) {\n hourlyTotal += allStores[j].cookiesSoldHourlyArray[i];\n totalofTotals += allStores[j].cookiesSoldHourlyArray[i];\n }\n thEl = document.createElement ('th');\n thEl.textContent = hourlyTotal;\n trEl.appendChild(thEl);\n }\n\n for (var i = 0; i < hours.length; i++)\n thEl = document.createElement ('th');\n thEl.textContent = totalofTotals;\n trEl.appendChild(thEl);\n\n storeSalesTable.appendChild(trEl);\n}", "function accordionFooter() {\n return '</table></div></div></div></div>';\n}", "function TableFooter(props) {\n return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_2__TableHeader__[\"a\" /* default */], props);\n}", "function TableFooter(props) {\n var as = props.as;\n\n var rest = Object(__WEBPACK_IMPORTED_MODULE_2__lib__[\"q\" /* getUnhandledProps */])(TableFooter, props);\n\n return __WEBPACK_IMPORTED_MODULE_1_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_3__TableHeader__[\"a\" /* default */], __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { as: as }));\n}", "function TableFooter(props) {\n var as = props.as;\n\n var rest = (0, _lib.getUnhandledProps)(TableFooter, props);\n\n return _react2.default.createElement(_TableHeader2.default, (0, _extends3.default)({}, rest, { as: as }));\n}", "function TableFooter(props) {\n var as = props.as;\n\n var rest = (0, _lib.getUnhandledProps)(TableFooter, props);\n\n return _react2.default.createElement(_TableHeader2.default, (0, _extends3.default)({}, rest, { as: as }));\n}", "function TableFooter(props) {\n var as = props.as;\n var rest = lib_getUnhandledProps(TableFooter, props);\n return react_default.a.createElement(Table_TableHeader, extends_default()({}, rest, {\n as: as\n }));\n}", "function TableFooter(props) {\n var as = props.as;\n var rest = Object(_lib__WEBPACK_IMPORTED_MODULE_3__[\"getUnhandledProps\"])(TableFooter, props);\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_TableHeader__WEBPACK_IMPORTED_MODULE_4__[\"default\"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({}, rest, {\n as: as\n }));\n}", "function TableFooter(props) {\n var as = props.as;\n var rest = Object(_lib__WEBPACK_IMPORTED_MODULE_3__[\"getUnhandledProps\"])(TableFooter, props);\n return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_TableHeader__WEBPACK_IMPORTED_MODULE_4__[\"default\"], _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, rest, {\n as: as\n }));\n}", "function TableFooter(props) {\n var as = props.as;\n var rest = Object(_lib__WEBPACK_IMPORTED_MODULE_2__[\"getUnhandledProps\"])(TableFooter, props);\n return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_TableHeader__WEBPACK_IMPORTED_MODULE_3__[\"default\"], _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, rest, {\n as: as\n }));\n}", "createFooter(footer) {\n footer.appendChild(footerTemplate.content);\n }", "function TableFooter(props) {\n var as = props.as;\n\n var rest = Object(__WEBPACK_IMPORTED_MODULE_2__lib__[\"r\" /* getUnhandledProps */])(TableFooter, props);\n\n return __WEBPACK_IMPORTED_MODULE_1_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_3__TableHeader__[\"a\" /* default */], __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { as: as }));\n}", "function TableFooter(props) {\n var as = props.as;\n\n var rest = Object(__WEBPACK_IMPORTED_MODULE_2__lib__[\"r\" /* getUnhandledProps */])(TableFooter, props);\n\n return __WEBPACK_IMPORTED_MODULE_1_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_3__TableHeader__[\"a\" /* default */], __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { as: as }));\n}", "function TableFooter(props) {\n var as = props.as;\n var rest = (0, _lib.getUnhandledProps)(TableFooter, props);\n return _react[\"default\"].createElement(_TableHeader[\"default\"], (0, _extends2[\"default\"])({}, rest, {\n as: as\n }));\n}", "function TableFooter(props) {\n var as = props.as;\n var rest = (0, _lib.getUnhandledProps)(TableFooter, props);\n return _react[\"default\"].createElement(_TableHeader[\"default\"], (0, _extends2[\"default\"])({}, rest, {\n as: as\n }));\n}", "function makeFooterRow() {\n var trEl = document.createElement('tr');\n\n var thEl = document.createElement('th');\n thEl.textContent = 'All Stores Hourly Totals';\n trEl.appendChild(thEl);\n\n for(var i in hours) {\n thEl = document.createElement('th');\n thEl.textContent = allStoreTotals[i];\n trEl.appendChild(thEl);\n\n }\n\n thEl = document.createElement('th');\n thEl.textContent = totalTurtle;\n trEl.appendChild(thEl);\n\n storeTable.appendChild(trEl);\n}", "addFooters() {\n /* Add footers for modified rows */\n this.gridApi.forEachNodeAfterFilterAndSort((node) => {\n if (node.data.hadronDocument.isModified()) {\n this.addFooter(node, node.data, 'editing');\n }\n });\n }", "function TableFooter(props) {\n var as = props.as;\n var rest = Object(__WEBPACK_IMPORTED_MODULE_2__lib__[\"r\" /* getUnhandledProps */])(TableFooter, props);\n return __WEBPACK_IMPORTED_MODULE_1_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_3__TableHeader__[\"a\" /* default */], __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_extends___default()({}, rest, {\n as: as\n }));\n}", "function TableFooter(props) {\n var as = props.as;\n\n var rest = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__lib__[\"b\" /* getUnhandledProps */])(TableFooter, props);\n\n return __WEBPACK_IMPORTED_MODULE_1_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_3__TableHeader__[\"a\" /* default */], __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { as: as }));\n}", "function makeFooterRow(){\n var trEl = document.createElement('tr');\n var thEl = document.createElement('th');\n thEl.textContent=('Total Cookies sold per hour');//per hour\n trEl.appendChild(thEl);\n \n var totalTotal= 0 \n for(var i=0; i<hours.length;i++){\n // tdEl=document.createElement('td');\n var hrTotal = 0; \n\n for(var j=0; j<allPlaces.length;j++){\n // console.log(hrTotal,\"hour of total\")\n hrTotal += allPlaces[j].avgCookiesArrary[i]; \n }//console.log('avg cookies', hrTotal);\n \n \n totalTotal += hrTotal\n\n var thEl= document.createElement('th');\n thEl.textContent=(hrTotal);\n trEl.appendChild(thEl);\n }\n\n\n\n thEl =document.createElement('th');\n thEl.textContent=(totalTotal);//per location\n trEl.appendChild(thEl);\n cookiesStand.appendChild(trEl);\n}", "function TableFooter(props) {\n var as = props.as;\n var rest = getUnhandledProps(TableFooter, props);\n return React.createElement(TableHeader, _extends({}, rest, {\n as: as\n }));\n}", "footerAppend(element){\n\t\treturn this.table.footerManager.append(element);\n\t}", "function footerLoaded(){\n\tlet footer = document.createElement(\"FOOTER\");\n\tfooter.setAttribute(\"id\", \"footer\");\n\t\n\tlet outTable = document.createElement(\"TABLE\");\n\toutTable.setAttribute(\"style\", \"width: 100%; height:200px;\");\n\tfooter.appendChild(outTable);\n\t\n\tlet outTr = document.createElement(\"TR\");\n\toutTable.appendChild(outTr);\n\t\n\t//table logo and social media link\n\tlet outTd1 = document.createElement(\"TD\");\n\toutTd1.setAttribute(\"valign\", \"center\");\n\toutTd1.setAttribute(\"align\", \"center\");\n\toutTr.appendChild(outTd1);\n\t\n\t//tr logo\n\tlet inTable1 = document.createElement(\"TABLE\");\n\toutTd1.appendChild(inTable1);\n\t\n\tlet inTr1_1 = document.createElement(\"TR\");\n\tinTable1.appendChild(inTr1_1);\n\t\n\tlet inTh1_1 = document.createElement(\"TH\");\n\tinTr1_1.appendChild(inTh1_1);\n\t\n\tlet imglogo1 = document.createElement(\"IMG\");\n\timglogo1.setAttribute(\"src\", \"images/footer/Logo-removebg1.png\");\n\timglogo1.setAttribute(\"alt\", \"logo\");\n\timglogo1.setAttribute(\"width\", 25);\n\timglogo1.setAttribute(\"height\", 25);\n\tinTh1_1.appendChild(imglogo1);\n\t\n\tlet inTh1_2 = document.createElement(\"TH\");\n\tinTh1_2.setAttribute(\"colspan\", \"2\");\n\tinTr1_1.appendChild(inTh1_2);\n\t\n\tlet imglogo2 = document.createElement(\"IMG\");\n\timglogo2.setAttribute(\"src\", \"images/footer/Logo-removebg2.png\");\n\timglogo2.setAttribute(\"alt\", \"logo\");\n\timglogo2.setAttribute(\"width\", 150);\n\timglogo2.setAttribute(\"height\", 25);\n\tinTh1_2.appendChild(imglogo2);\n\t\n\t//tr social media link\n\tlet inTr1_2 = document.createElement(\"TR\");\n\tinTable1.appendChild(inTr1_2);\n\t\n\t//fb link\n\tlet inTd1_1 = document.createElement(\"TD\");\n\tinTd1_1.setAttribute(\"style\", \"text-align:right;\");\n\tinTr1_2.appendChild(inTd1_1);\n\t\n\tlet fbLink = document.createElement(\"A\");\n\tfbLink.setAttribute(\"href\", \"https://www.facebook.com/sanjosestate/\");\n\tinTd1_1.appendChild(fbLink);\n\t\n\tlet imgfb = document.createElement(\"IMG\");\n\timgfb.setAttribute(\"src\", \"images/footer/fb_icon.png\");\n\timgfb.setAttribute(\"alt\", \"fbicon\");\n\timgfb.setAttribute(\"width\", 30);\n\timgfb.setAttribute(\"height\", 30);\n\tfbLink.appendChild(imgfb);\n\t\n\t//ig link\n\tlet inTd1_2 = document.createElement(\"TD\");\n\tinTd1_2.setAttribute(\"style\", \"text-align:right;\");\n\tinTr1_2.appendChild(inTd1_2);\n\t\n\tlet igLink = document.createElement(\"A\");\n\tigLink.setAttribute(\"href\", \"https://www.instagram.com/sjsu/\");\n\tinTd1_2.appendChild(igLink);\n\t\n\tlet imgig = document.createElement(\"IMG\");\n\timgig.setAttribute(\"src\", \"images/footer/ig_icon.png\");\n\timgig.setAttribute(\"alt\", \"igicon\");\n\timgig.setAttribute(\"width\", 25);\n\timgig.setAttribute(\"height\", 25);\n\tigLink.appendChild(imgig);\n\t\n\t//twitter link\n\tlet inTd1_3 = document.createElement(\"TD\");\n\tinTd1_3.setAttribute(\"style\", \"text-align:right;\");\n\tinTr1_2.appendChild(inTd1_3);\n\t\n\tlet twLink = document.createElement(\"A\");\n\ttwLink.setAttribute(\"href\", \"https://twitter.com/sjsu\");\n\tinTd1_3.appendChild(twLink);\n\t\n\tlet imgtw = document.createElement(\"IMG\");\n\timgtw.setAttribute(\"src\", \"images/footer/twitter_icon.png\");\n\timgtw.setAttribute(\"alt\", \"twicon\");\n\timgtw.setAttribute(\"width\", 25);\n\timgtw.setAttribute(\"height\", 25);\n\ttwLink.appendChild(imgtw);\n\t\n\t//table contact info\n\t//tr contact head text\n\tlet outTd2 = document.createElement(\"TD\");\n\toutTd2.setAttribute(\"valign\", \"top\");\n\toutTd2.setAttribute(\"align\", \"center\");\n\toutTr.appendChild(outTd2);\n\t\n\tlet inTable2 = document.createElement(\"TABLE\");\n\toutTd2.appendChild(inTable2);\n\t\n\tlet inTr2_1 = document.createElement(\"TR\");\n\tinTr2_1.setAttribute(\"style\", \"height:50px; text-align:left;\");\n\tinTable2.appendChild(inTr2_1);\n\t\n\tlet inTh2 = document.createElement(\"TH\");\n\tinTh2.setAttribute(\"colspan\", \"2\");\n\tinTr2_1.appendChild(inTh2);\n\t\n\tlet heading3_1 = document.createElement(\"H3\");\n\tinTh2.appendChild(heading3_1);\n\t\n\tlet txthd1 = document.createTextNode(\"Contact us\");\n\theading3_1.appendChild(txthd1);\n\t\n\t//tr contact body text\n\t//email icon\n\tlet inTr2_2 = document.createElement(\"TR\");\n\tinTr2_2.setAttribute(\"style\", \"height:50px;\");\n\tinTable2.appendChild(inTr2_2);\n\t\n\tlet inTd2_1 = document.createElement(\"TH\");\n\tinTr2_2.appendChild(inTd2_1);\n\t\n\tlet imgemail = document.createElement(\"IMG\");\n\timgemail.setAttribute(\"src\", \"images/footer/email_icon.png\");\n\timgemail.setAttribute(\"alt\", \"emailicon\");\n\timgemail.setAttribute(\"width\", 30);\n\timgemail.setAttribute(\"height\", 30);\n\tinTd2_1.appendChild(imgemail);\n\t//email info\n\tlet inTd2_2 = document.createElement(\"TH\");\n\tinTr2_2.appendChild(inTd2_2);\n\t\n\tlet heading4_1 = document.createElement(\"H4\");\n\tinTd2_2.appendChild(heading4_1);\n\t\n\tlet txtinfo1 = document.createTextNode(\"[email protected]\");\n\theading4_1.appendChild(txtinfo1);\n\t\n\t//phone icon\n\tlet inTr2_3 = document.createElement(\"TR\");\n\tinTr2_3.setAttribute(\"style\", \"height:50px;\");\n\tinTable2.appendChild(inTr2_3);\n\t\n\tlet inTd2_3 = document.createElement(\"TH\");\n\tinTr2_3.appendChild(inTd2_3);\n\t\n\tlet imgphone = document.createElement(\"IMG\");\n\timgphone.setAttribute(\"src\", \"images/footer/phone_icon.png\");\n\timgphone.setAttribute(\"alt\", \"phoneicon\");\n\timgphone.setAttribute(\"width\", 30);\n\timgphone.setAttribute(\"height\", 30);\n\tinTd2_3.appendChild(imgphone);\n\t//phone info\n\tlet inTd2_4 = document.createElement(\"TH\");\n\tinTr2_3.appendChild(inTd2_4);\n\t\n\tlet heading4_2 = document.createElement(\"H4\");\n\tinTd2_4.appendChild(heading4_2);\n\t\n\tlet txtinfo2 = document.createTextNode(\"(408) 859-7420\");\n\theading4_2.appendChild(txtinfo2);\n\t\n\t//address icon\n\tlet inTr2_4 = document.createElement(\"TR\");\n\tinTr2_4.setAttribute(\"style\", \"height:50px;\");\n\tinTable2.appendChild(inTr2_4);\n\t\n\tlet inTd2_5 = document.createElement(\"TH\");\n\tinTr2_4.appendChild(inTd2_5);\n\t\n\tlet imgadd = document.createElement(\"IMG\");\n\timgadd.setAttribute(\"src\", \"images/footer/map_icon.png\");\n\timgadd.setAttribute(\"alt\", \"mapicon\");\n\timgadd.setAttribute(\"width\", 30);\n\timgadd.setAttribute(\"height\", 25);\n\tinTd2_5.appendChild(imgadd);\n\t//address info\n\tlet inTd2_6 = document.createElement(\"TH\");\n\tinTr2_4.appendChild(inTd2_6);\n\t\n\tlet heading4_3 = document.createElement(\"H4\");\n\tinTd2_6.appendChild(heading4_3);\n\t\n\tlet txtinfo3 = document.createTextNode(\"2836 Walnut Grove Ave\");\n\theading4_3.appendChild(txtinfo3);\n\tlet br=document.createElement(\"BR\");\n\theading4_3.appendChild(br);\n\tlet txtinfo3_2 = document.createTextNode(\"San Jose, CA 95128\");\n\theading4_3.appendChild(txtinfo3_2);\n\t\n\t//table update\n\t//tr update head text\n\tlet outTd3 = document.createElement(\"TD\");\n\toutTd3.setAttribute(\"valign\", \"top\");\n\toutTd3.setAttribute(\"align\", \"center\");\n\toutTr.appendChild(outTd3);\n\t\n\tlet inTable3 = document.createElement(\"TABLE\");\n\toutTd3.appendChild(inTable3);\n\t\n\tlet inTr3_1 = document.createElement(\"TR\");\n\tinTr3_1.setAttribute(\"style\", \"height:50px; text-align:left;\");\n\tinTable3.appendChild(inTr3_1);\n\t\n\tlet inTh3 = document.createElement(\"TH\");\n\tinTr3_1.appendChild(inTh3);\n\t\n\tlet heading3_2 = document.createElement(\"H3\");\n\tinTh3.appendChild(heading3_2);\n\t\n\tlet txthd2 = document.createTextNode(\"For updates\");\n\theading3_2.appendChild(txthd2);\n\t\n\t//tr form\n\tlet inTr3_2 = document.createElement(\"TR\");\n\tinTr3_2.setAttribute(\"style\", \"height:30px;\");\n\tinTable3.appendChild(inTr3_2);\n\t\n\tlet inTd3_1 = document.createElement(\"TD\");\n\tinTr3_2.appendChild(inTd3_1);\n\t\n\tlet formSub = document.createElement(\"FORM\");\n\tformSub.setAttribute(\"id\", \"inputform\");\n\tinTd3_1.appendChild(formSub);\n\t\n\tlet input1 = document.createElement(\"INPUT\");\n\tinput1.setAttribute(\"id\", \"useremail\");\n\tinput1.setAttribute(\"type\", \"email\");\n\tinput1.setAttribute(\"placeholder\", \"[email protected]\");\n\tformSub.appendChild(input1);\n\tlet br2 = document.createElement(\"BR\");\n\tformSub.appendChild(br2);\n\t\n\t//input button\n\tlet input2 = document.createElement(\"INPUT\");\n\tinput2.setAttribute(\"id\", \"subscribe\");\n\tinput2.setAttribute(\"type\", \"submit\");\n\tinput2.setAttribute(\"value\", \"SUBSCRIBE\");\n\tinput2.setAttribute(\"onclick\", \"buttonPressed()\");\n\tformSub.appendChild(input2);\n\t\n\t//copyright\n\tlet p = document.createElement(\"p\");\n\tp.setAttribute(\"style\", \"float:right;color:black;margin:3px;\");\n\tfooter.appendChild(p);\n\t\n\tlet txtword = document.createTextNode(\"© 2020 Superestate Corp. All rights reserved.\");\n\tp.appendChild(txtword);\n\t\n\tdocument.body.insertBefore(footer, document.body.nextSibling);\n\n\tvar form = document.getElementById(\"inputform\");\n\tfunction handleForm(event) { event.preventDefault(); } \n\tform.addEventListener('submit', handleForm);\n\t\n}", "function TableFooter(props) {\n return React.createElement(TableHeader, props);\n}", "function makeFooter() {\n var bigDaddyTotal = 0;\n var trEl = document.createElement('tr');\n var thEl = document.createElement('th');\n trEl.appendChild(thEl);\n thEl.textContent = 'Total:';\n\n for (var i in hourArray) {\n var totalHourly = 0;\n var tdEl = document.createElement('td');\n\n for (var j in storeArray) {\n totalHourly += storeArray[j].cookiesPerHour[i];\n }\n tdEl.textContent = totalHourly;\n trEl.appendChild(tdEl);\n\n }\n for (var k in storeArray) {\n bigDaddyTotal += storeArray[k].totalCookies;\n }\n thEl = document.createElement('th');\n thEl.textContent = bigDaddyTotal;\n trEl.appendChild(thEl);\n storeTable.appendChild(trEl);\n console.log(bigDaddyTotal);\n}", "function appendFooter(){\n var footer = \"<div class='footer'>\";\n footer += \"<center><div class='copyrightText'>&copy; 2017 ITEE Group Canada</div></center>\";\n footer += \"</div>\";\n $('body').append(footer);\n }", "function generateFooterRow() {\n // we need our row header\n let parentEl = document.getElementById('footer');\n parentEl.innerHTML = '';\n let rowEl = document.createElement('tr');\n\n generateElement('td', rowEl, 'Totals');\n\n // generate all hourly sums and grandtotal\n let grandTotal = 0;\n // loop thrugh hours\n for (let hour = 0; hour < storeHours.length; hour++) {\n let hourSum = 0;\n // loop through each store\n for (let store = 0; store < allStores.length; store++) {\n // sum up all hourly sales\n hourSum = hourSum + allStores[store].dailySales[hour];\n // add sum to grandTotal\n grandTotal = grandTotal + allStores[store].dailySales[hour];\n }\n generateElement('td', rowEl, hourSum);\n }\n generateElement('td', rowEl, grandTotal);\n parentEl.appendChild(rowEl);\n}", "function totalFooter() {\n var updateFooter = document.getElementById('hourly-totals');\n if (updateFooter) {\n updateFooter.parentNode.removeChild(updateFooter);\n }\n var tableFoot = document.createElement('tfoot');\n tableFoot.setAttribute('id', 'hourly-totals');\n var cookieTable = document.getElementById('cookie-table');\n cookieTable.appendChild(tableFoot);\n var hourlyTotals = document.getElementById('hourly-totals');\n var firstFoot = document.createElement('th');\n firstFoot.textContent = 'Total';\n hourlyTotals.appendChild(firstFoot);\n var grandTotal = 0;\n for (var i = 0; i < eachHour.length; i++) {\n var footerTotals = document.createElement('td');\n footerTotals.textContent = eachHour[i];\n hourlyTotals.appendChild(footerTotals);\n grandTotal += eachHour[i];\n }\n var finalFoot = document.createElement('td');\n finalFoot.textContent = grandTotal;\n tableFoot.appendChild(finalFoot);\n}", "displayFooter() {\n }", "function addFooterTooltips(nFoot)\n\t{\n\t\tvar qTipOptions = MutationViewsUtil.defaultTableTooltipOpts();\n\n\t\tvar qTipOptionsFooter = {};\n\t\tjQuery.extend(true, qTipOptionsFooter, qTipOptions);\n\t\tqTipOptionsFooter.position = {my:'top center', at:'bottom center', viewport: $(window)};\n\n\t\tcbio.util.addTargetedQTip($(nFoot).find(\"th\"), qTipOptionsFooter);\n\t}", "renderFooter() {\n return null;\n }", "function fixFoot() {\n var tfoot = $(settings.table).find(\"tfoot\");\n var tr = tfoot.find(\"tr\");\n var cells = tfoot.find(\"tr > *\");\n\n setBackground(cells);\n cells.css({\n 'position': 'relative'\n });\n }", "function addFooter(report) {\r\n report.getFooter().addClass(\"footer\");\r\n var versionLine = report.getFooter().addText(\"Banana Accounting 8\" + \" - \", \"description\");\r\n report.getFooter().addText(\"Pagina \", \"description\");\r\n report.getFooter().addFieldPageNr();\r\n}", "function displayTotalsFooter() {\n calcTotalTotal(); // this call can't be last b/c the outer function depends on them\n\n // heading: create a row\n var trEl = document.createElement('tr');\n // create, give content, and append header for 'Totals' cell (correctly align hourly totals for all 5 stores)\n var thEl = document.createElement('th');\n thEl.textContent = 'Total';\n trEl.appendChild(thEl);\n // give the column content - create, give content, and append cookie totals array for each hour\n for (var i = 0; i < hours.length; i++) {\n thEl = document.createElement('th');\n thEl.textContent = combinedHourlyCookies[i] + ' cookies';\n trEl.appendChild(thEl);\n }\n // bottom right cell: create, content, and append\n thEl = document.createElement('th');\n thEl.textContent = totalTotal + ' cookies';\n trEl.appendChild(thEl);\n // append row to table\n storeTable.appendChild(trEl);\n}", "function addFooter(report) {\n\tvar date = new Date();\n\tvar d = Banana.Converter.toLocaleDateFormat(date);\n\treport.getFooter().addClass(\"footer\");\n\tvar versionLine = report.getFooter().addText(d + \" - Trial balance - Page \", \"description\");\n\treport.getFooter().addFieldPageNr();\n}", "function makeFooterRow () {\n //Nested for loops read how many stores were input and calculates the sum for each hour of every store\n var hourlyTotalsArray = [];\n for (var j = 0; j < hours.length; j++){\n var hourlyTotal = 0;\n for (var k = 0; k < allStores.length; k++){\n hourlyTotal += allStores[k].perHourArray[j];\n }\n hourlyTotalsArray.push(hourlyTotal);\n }\n //For loop that reads how many stores there are and uses their daySum variable to calculate the total of all stores for that day\n var totalTotal = 0;\n for (var l = 0; l < allStores.length; l++){\n totalTotal += allStores[l].daySum;\n }\n var trEl = document.createElement('tr');\n var thEl = document.createElement('th');\n thEl.textContent = 'Total';\n trEl.appendChild(thEl);\n for(var i = 0; i < hours.length; i++){\n thEl = document.createElement('th');\n //Variable hourlyTotalsArray that was created and defined earlier in this function\n thEl.textContent = hourlyTotalsArray[i];\n trEl.appendChild(thEl);\n }\n thEl = document.createElement('td');\n //Variable totalTotal that was created and defined earlier in this function\n thEl.textContent = totalTotal;\n trEl.appendChild(thEl);\n storeTable.appendChild(trEl);\n}", "function _generateFooterReport() {\n\t\n\n\tthis.htmlFile.writeln( \"</body>\");\n\tthis.htmlFile.writeln( \"</html>\");\n}", "function buildFooter() {\r\n $(\"#footer\").html(\r\n `\r\n <hr>\r\n My Sheridan Program: <em>${meArr[0].program}</em><br>\r\n My Home Country: <em>${meArr[0].hCountry}</em>\r\n `\r\n );\r\n $(\"#footer\").addClass(\"bottom\");\r\n}", "function addFooter(report) {\n report.getFooter().addClass(\"footer\");\n var versionLine = report.getFooter().addText(\"Banana Accounting - Page \", \"description\");\n report.getFooter().addFieldPageNr();\n}", "getFooter() {\n return '</quiz>';\n }", "function footer() {\n var amountCompleted = ctrl.amountCompleted();\n var amountActive = ctrl.list.length - amountCompleted;\n \n return E('footer') . is ({ id: 'footer' }) . has([\n \n E('span') . is ({ id: 'todo-count' }) . has([\n// E('strong') . has (T(F`${count} items left`)) // jshint ignore:line\n ]),\n \n // Filters (all, active, completed)\n E('ul') . is({ id: 'filters' }) . has ([\n E('li') . has(T(\"All\")) . does({ click: _ => data.filter = 'all' }),\n E('li') . has(T(\"Active\")) . does({ click: _ => data.filter = 'active' }),\n E('li') . has(T(\"Completed\")) . does({ click: _ => data.filter = 'completed' })\n ]),\n \n /* jshint ignore:start */\n E('button') .\n has (T(F`Clear completed ${completedcount}`)) . // jshint ignore:line\n is ({ id: 'clear-completed' }) .\n does({ click: _ => 0 }) //clearCompleted })\n /* jshint ignore:end */\n ]);\n }", "function printFooter()\r\n{\r\n\ttry\r\n\t{\r\n\r\n\t\tpdfxml += '</body></pdf>';\r\n\t}\r\n\tcatch(e)\r\n\t{\r\n\t\terrorHandler('printFooter', e);\r\n\t}\r\n}", "_createFooterRow(existingFooter) {\r\n const that = this,\r\n footerRow = that.footerRow;\r\n\r\n if (!footerRow) {\r\n return;\r\n }\r\n\r\n if (existingFooter) {\r\n that.$.tableContainer.appendChild(existingFooter);\r\n return;\r\n }\r\n\r\n const potentialHTMLTemplate = document.getElementById(footerRow);\r\n\r\n if (potentialHTMLTemplate && potentialHTMLTemplate instanceof HTMLTemplateElement) {\r\n const tfoot = document.createElement('tfoot'),\r\n templateContent = document.importNode(potentialHTMLTemplate.content, true);\r\n\r\n tfoot.appendChild(templateContent);\r\n that.$.tableContainer.appendChild(tfoot);\r\n }\r\n else {\r\n that.footerRow = null;\r\n }\r\n }", "function createFooter() {\n var foot = document.createElement(\"footer\");\n foot.setAttribute(\"class\", \"footer fixed-bottom mt-auto py-2\");\n \n var footDiv = document.createElement(\"div\");\n footDiv.setAttribute(\"class\", \"container-fluid\");\n \n var footDivSpan = document.createElement(\"span\");\n footDivSpan.setAttribute(\"class\", \"text-muted\");\n footDivSpan.innerHTML =\n 'Designed with <i class=\"fas fa-heart\" style=\"color:red\"></i> by Prashant Gupta(<a href=\"https://github.com/codyprashant/new-york-times-api\" target=\"_blank\" style=\"color: crimson;\">@codyPrashant</a>)';\n \n footDiv.appendChild(footDivSpan);\n foot.appendChild(footDiv);\n \n return foot;\n }", "createFooter(buttons) {\n const footer = new Widget();\n footer.addClass('jp-Dialog-footer');\n each(buttons, button => {\n footer.node.appendChild(button);\n });\n Styling.styleNode(footer.node);\n return footer;\n }", "function insertFooter () {\n \"use strict\";\n try {\n var footer;\n\t\t\t/* There are at least one, and maybe more, courses that are developed in partnership with BYU or BYU-Hawaii and require that to be displayed in the copyright. Checking here for customCopyright allows for those courses to create this variable with the custom text in the course.js file before the online.js is appended and then will use the custom text */\n\t\t\tif (typeof customCopyright === \"undefined\") {\n\t\t\t\tfooter = \"<div id='footer'>Copyright &copy; \" + new Date().getFullYear() + \" by Brigham Young University - Idaho. All Rights Reserved.</div>\";\n\t\t\t} else {\n\t\t\t\tfooter = \"<div id='footer'>\" + customCopyright + \"</div>\";\n\t\t\t}\n document.getElementById(\"main\").insertAdjacentHTML(\"beforeend\", footer); \n } catch (ex) {\n console.log(ex.name + \": \" + ex.message);\n }\n }", "appendFooter(tagName){\n return this.footer.append(tagName);\n }", "chargerFooter(){\n $(\"#page\"+this.instrument.ref).append('<div data-role=\"footer\" data-position=\"fixed\" data-tap-toggle=\"false\" data-fullscreen=\"false\" data-theme=\"b\">\\\n <div data-role=\"navbar\" data-grid=\"\" data-iconpos=\"left\">\\\n <ul id=\"menu\">\\\n <li><a href=\"#pageEtat\">Etat</a></li>\\\n <li><a href=\"#pageInstruments\"> Instruments</a></li>\\\n <li><a href=\"#pageCommande\">Commande</a></li>\\\n <li><a href=\"#pageConfiguration\"> Configuration</a></li>\\\n </ul>\\\n </div>\\\n </div>');\n }", "genFooterContent() {\n return <Footer />;\n }", "function addFooter(banDoc, report) {\r\n\treport.getFooter().addClass(\"footer\");\r\n\treport.getFooter().addText(\"[Banana Accounting, v. \" + banDoc.info(\"Base\", \"ProgramVersion\") + \", \" + scriptVersion + \"] - Page \", \"footer\");\r\n\treport.getFooter().addFieldPageNr();\r\n}", "function sumFootRow(footRow, table) {\t\n\t// I set this on a slight delay to give DataTables time to do the actual sorting\n\tsetTimeout(function () {\t\t\n\t\t// figure out which columns contain numerical data\n\t\t// by testing the classes of the cells in the first row\n\t\tvar numericalCols = []\n\t\t$(\"tbody tr:visible:first td\", table).each(function(i, element) {\n\t\t\tif ($(element).hasClass(\"noSum\") == false) {\n\t\t\t\t// This element does not have the class \"noSum\"\n\t\t\t\tnumericalCols.push(i + 1); // increment index to get base-1 numbering\n\t\t\t}\n\t\t});\n\t\t\n\t\t// loop through and update each column that was identified as a numerical column\n\t\t$.each(numericalCols, function(i, colNumber) {\n\t\t\tvar colSum = 0;\n\t\t\t$(table).find('tbody tr:visible').each(function() {\n\t\t\t\tvar cell = $(this).find('td:nth-child('+colNumber+')');\n var value = numeral().unformat(cell.text());\n\n\t\t\t\tif (!isNaN(value)) {\n\t\t\t\t\tcolSum += value;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tvar footCell = $(footRow).find('td:nth-child('+colNumber+')');\n\t\t\tif (isNaN(colSum)) {\n\t\t\t\tcolSum = \"n/a\";\n\t\t\t}\n var sum = Math.round(colSum*100)/100;\n\n if ($(footCell).hasClass(\"currency\")) {\n sum = numeral(sum).format('$0,0.00');\n }\n\n\t\t\t$(footCell).text(sum);\n\t\t});\n\t\t\n\t\t// make sure the footers of the tables match the widths of the tables\n\t\t//var width = $(table).width() - 18;\n\t\t//$(table).parent().find(\"div.data-tables-footer\").css(\"width\", width);\n\t\n\t}, 0);\n}", "function generateTableBody(table, data) {\n table.border = '1';\n for (let element of data) {\n let row = table.insertRow();\n \n for (key in element) {\n let cell = row.insertCell();\n let text = document.createTextNode(element[key]);\n cell.appendChild(text);\n \n }\n \n }\n document.querySelector('.output').innerHTML = \"If you click on the \\\"Dy\\\" box or on the first box immediately below, you can read the result of the output\";\n }", "function footer( text ) {\n var textObject = game.add.text(\n game.world.width, game.world.height, text,\n { font: game.vars.font.footer(), fill: game.vars.font.fill, align: \"right\" }\n );\n textObject.anchor.set( 1, 1 );\n\n return textObject;\n }", "goToFooter() {\n this.owner.enableHeaderAndFooter = true;\n this.enableHeadersFootersRegion(this.start.paragraph.bodyWidget.page.footerWidget);\n }", "function buildBottomTable( ownPlaceholder )\n {\n var JSONrecords = nheap.content_data\n [ \"final-doc-info.txt\" ]\n [ \"final_info\" ];\n\n var clmNames = [ \"Widget Name\", \"Description\", \"Comments / Exclusions\" ];\n var keyNames = [ \"widget_name\", \"description\",\"comments_exclusions\" ];\n var columnsMeta = keyNames.map( (kn,kix) => {\n var mt = {};\n mt[kn] = { caption:clmNames[kix] };\n return mt;\n });\n\n methods.tableTpl_2_content({\n contentPlaceholderToAttach : ownPlaceholder,\n table : JSONrecords,\n caption : \"\",\n cellPaddingTop : 1,\n cellPaddingBottom : 1,\n cellFontSize:7,\n widthPercent: 85,\n margin : [0, 0, 0, 0], //above caption\n firstCellIncrease : 23, //%\n captionFontSize : 12,\n captionBold : true,\n columns : columnsMeta\n });\n }", "_getTbody(data, columnHeader, footer) {\n if (data !== undefined && data !== null && data.length > 0) {\n let ch = columnHeader ? 1 : 0,\n tbody;\n if (footer) {\n tbody = data.slice(ch, data.length - 1);\n this.__tfoot = data.slice(data.length - 1);\n } else {\n tbody = data.slice(ch, data.length);\n this.__tfoot = [];\n }\n return tbody;\n }\n return [];\n }", "function totalsRowCreate(){\n var tfoot= document.getElementsByTagName('tfoot')[0];\n while (tfoot.firstChild){\n tfoot.removeChild(tfoot.firstChild)\n };\n var tr = document.createElement('tr');\n var td = document.createElement('td');\n var txt = document.createTextNode('Totals');\n td.appendChild(txt);\n tr.appendChild(td);\n tfoot.appendChild(tr);\n for (i=0; i < 15; i++){\n var td = document.createElement('td');\n var txt = document.createTextNode(totals[i]);\n td.appendChild(txt);\n tr.appendChild(td);\n }\n}", "function callFooterFunctions() {\n columnSum();\n totalTotalSum();\n makeTotalsRender();\n}", "function FOOTER$static_(){ToolbarSkin.FOOTER=( new ToolbarSkin(\"footer\"));}", "function footerBottom(){\n\tvar $footer = $('.footer');\n\tif($footer.length){\n\t\tvar $tplSpacer = $('<div />', {\n\t\t\tclass: 'spacer'\n\t\t});\n\n\t\t$('.main').after($tplSpacer.clone());\n\n\t\t$(window).on('load resizeByWidth', function () {\n\t\t\tvar footerOuterHeight = $footer.outerHeight();\n\t\t\t$footer.css({\n\t\t\t\t'margin-top': -footerOuterHeight\n\t\t\t});\n\n\t\t\t$('.spacer').css({\n\t\t\t\t'height': footerOuterHeight\n\t\t\t});\n\t\t});\n\t}\n}", "function lastRow() {\r\n var cityRow = document.createElement('tr');\r\n var cityData = document.createElement('td');\r\n cityRow.id = 'lastrow';\r\n cityData.textContent = 'Totals';\r\n cityRow.appendChild(cityData);\r\n tableHolder.appendChild(cityRow);\r\n for (var i = 0; i < hrlyTotalArray.length; i++) {\r\n cityData = document.createElement('td');\r\n cityData.textContent = hrlyTotalArray[i];\r\n cityRow.appendChild(cityData);\r\n }\r\n}", "function class_addPagingFooter( tbl, numCol, searchPage )\r\n\t{\r\n\t\tvar activePicStyle;\r\n\t\tvar browsePicStyle;\r\n\t\tvar cellCount;\r\n\t\tvar endPt;\r\n\t\tvar i;\r\n\t\tvar innerHTMLStr;\r\n\t\tvar innertbl;\r\n\t\tvar innertblBody;\r\n\t\tvar itemStr;\r\n\t\tvar pageCellCount;\r\n\t\tvar pageRow;\r\n\t\tvar pagingTbl;\r\n\t\tvar pagingDiv;\r\n\t\tvar row;\r\n\t\tvar startPt;\r\n\t\tvar tblCell;\r\n\t\tvar pagePrefix;\r\n\r\n\t\ttry\r\n\t\t{ \r\n\t\t\t// Check to see if this is being rendered on the search results page\r\n\t\t\t// to setup variables appropriately\r\n\t\t\tif ( searchPage === undefined || searchPage == false )\r\n\t\t\t{\r\n\t\t\t\tsearchPage = false;\r\n\t\t\t\tpagePrefix = \"Browse\";\r\n\t\t\t}\r\n\t\t\t// Setup variables for search result page rendrind\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tpagePrefix = \"Result\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Check to see if there any actual rows being shown to the user. \r\n\t\t\t// If not then skip this section\r\n\t\t\tif ( ( class_myRows != null ) && ( class_myRows.length > 0 ) ) \r\n\t\t\t{\r\n\r\n\t\t\t\t// Try and get the reference to the table showing the details. If it exists then\r\n\t\t\t\t// remove the rows and if not then create a new one\r\n\t\t\t\ttbl = document.getElementById( pagePrefix + \"PageRowPagingSectionCellTable2\" );\r\n\r\n\t\t\t\tif ( null === tbl )\r\n\t\t\t\t{ \r\n\t\t\t\t\ttblCell = document.getElementById( pagePrefix + \"PageRowPagingSectionCell2\" );\r\n\r\n\t\t\t\t\tif ( null !== tblCell )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\ttbl = document.createElement(\"table\");\r\n\t\t\t\t\t\tinnertblBody = document.createElement(\"tbody\");\r\n\t\t\t\t\t\ttbl.appendChild( innertblBody );\r\n\t\t\t\t\t\ttbl.width = \"100%\";\r\n\t\t\t\t\t\ttbl.id = pagePrefix + \"PageRowPagingSectionCellTable2\";\r\n\t\t\t\t\t\ttbl.setAttribute(\"cellPadding\", \"0px\");\r\n\t\t\t\t\t\ttbl.setAttribute(\"cellSpacing\", \"0px\");\r\n\r\n\t\t\t\t\t\ttblCell.appendChild(tbl);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t// clear the rows of the existing table to recreate the rows\r\n\t\t\t\t\tvar x = tbl.rows.length;\r\n\r\n\t\t\t\t\tfor( i=0; i<x; i++ )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\ttbl.deleteRow(0);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif ( null !== tbl )\r\n\t\t\t\t{\r\n\t\t\t\t\t// Draw the header row\r\n\t\t\t\t\trow = tbl.insertRow(tbl.rows.length);\r\n\r\n\t\t\t\t\t// add the cell to span all of the detail columns\r\n\t\t\t\t\tcell = row.insertCell(0);\r\n\t\t\t\t\t// Make sure to count all of the columns\r\n\t\t\t\t\tif ( undefined !== numCol )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcell.colSpan = numCol;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Create the table for the data\r\n\t\t\t\t\tinnertbl = document.createElement(\"table\");\r\n\t\t\t\t\tinnertblBody = document.createElement(\"tbody\");\r\n\t\t\t\t\tinnertbl.appendChild( innertblBody );\r\n\t\t\t\t\tinnertbl.width = '100%';\r\n\t\t\t\t\tinnertbl.setAttribute(\"cellPadding\", \"0px\");\r\n\t\t\t\t\tinnertbl.setAttribute(\"cellSpacing\", \"0px\");\r\n\t\t\t\t\tinnertbl.visibility = \"hidden\";\r\n\t\t\t\t\tinnertbl.display = \"none\";\r\n\r\n\t\t\t\t\tcell.appendChild(innertbl);\r\n\r\n\t\t\t\t\t// Do not insert a row after the content area if we are not paging\r\n\t\t\t\t\tif ( class_isPaged )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t// reset the cell count for the next row\r\n\t\t\t\t\tcellCount = 0;\r\n\r\n\t\t\t\t\t// Draw the header row\r\n\t\t\t\t\trow = innertbl.insertRow(innertbl.rows.length);\r\n\r\n\t\t\t\t\t// add the cell for the pagesize dropdown\r\n\t\t\t\t\tcell = row.insertCell(cellCount++);\r\n\t\t\t\t\tcell.style.whiteSpace = 'nowrap';\r\n\r\n\t\t\t\t\t// Check to see if the total number of pages > 1 and\r\n\t\t\t\t\t// the number of objects on the page < smallestPageSize\r\n\t\t\t\t\t// then put in the dropdown\r\n\t\t\t\t\tif ( ( class_myRows.length >= smallestPageSize || currentPageNum > 1 ) && class_isPaged )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// Set the text\r\n\t\t\t\t\t\tcell.style.color = '#666666';\r\n\t\t\t\t\t\tcell.style.padding = \"2px 0 2px 0\";\r\n\t\t\t\t\t\tcell.innerHTML = LocString( \"Show\" );\r\n\t\t\t\t\t\tcell.innerHTML += \"<IMG SRC='\" + imgSrc + \"spacer.gif' TITLE='' WIDTH='4' HEIGHT='1' BORDER='0'>\";\r\n\r\n\t\t\t\t\t\t// add the cell for the actual pagesize dropdown\r\n\t\t\t\t\t\tcell = row.insertCell(cellCount++);\r\n\t\t\t\t\t\tcell.style.whiteSpace = 'nowrap';\r\n\r\n\t\t\t\t\t\t// Write out the page size selector\r\n\t\t\t\t\t\tbc_resetTextInMenu();\r\n\t\t\t\t\t\tbc_setMenuName( pagePrefix + \"PageSize\" );\r\n\r\n\t\t\t\t\t\tinnerHTMLStr = bc_menuTxtStart( \"\", LocString( \"Select number of items on page\" ) , pageSize, \"itemID\", \"\" );\r\n\t\t\t\t\t\tinnerHTMLStr += bc_optionsStart();\r\n\t\t\t\t\t\tfor ( i = 0;i<pageSizeArray.length;i++)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif ( searchPage == false )\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tinnerHTMLStr += bc_itemTxt( pageSizeArray[i], pageSizeArray[i], 0 );\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tinnerHTMLStr += bc_searchItemTxt( 'document.SearchForm', pageSizeArray[i], pageSizeArray[i] );\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tinnerHTMLStr += bc_menuEnd();\r\n\t\t\t\t\t\tcell.innerHTML = innerHTMLStr ;\r\n\r\n\t\t\t\t\t\tcell = row.insertCell(cellCount++);\r\n\t\t\t\t\t\tcell.innerHTML = \"<IMG SRC='\" + imgSrc + \"spacer.gif' ALT='' WIDTH='10' HEIGHT='1' BORDER='0'>\";\r\n\r\n\t\t\t\t\t\t// Set the text\r\n\t\t\t\t\t\tcell = row.insertCell(cellCount++);\r\n\t\t\t\t\t\tcell.style.whiteSpace = 'nowrap';\r\n\t\t\t\t\t\tcell.style.color = '#666666';\r\n\t\t\t\t\t\tcell.style.padding = \"2px 0 2px 0\";\r\n\t\t\t\t\t\tcell.innerHTML = \"items\";\r\n\t\t\t\t\t\tcell.innerHTML += \"<IMG SRC='\" + imgSrc + \"spacer.gif' TITLE='' WIDTH='4' HEIGHT='1' BORDER='0'>\";\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// - - - - - - - - add the spacer cell - - - - - - - -\r\n\t\t\t\t\tcell = row.insertCell(cellCount++);\r\n\t\t\t\t\tcell.width = '100%';\r\n\t\t\t\t\tcell.innerHTML = \"<IMG SRC='\" + imgSrc + \"spacer.gif' ALT='' WIDTH='3' HEIGHT='14' BORDER='0'>\";\r\n\r\n\t\t\t\t\tcell = row.insertCell(cellCount++);\r\n\t\t\t\t\tcell.width = '100%';\r\n\t\t\t\t\tcell.innerHTML = \"<IMG SRC='\" + imgSrc + \"spacer.gif' ALT='' WIDTH='3' HEIGHT='14' BORDER='0'>\";\r\n\r\n\t\t\t\t\tif ( totalPages > 1 )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// - - - - - - - - Start of the pagination selection control - - - - - - - -\r\n\t\t\t\t\t\tcell = row.insertCell( cellCount++ );\r\n\r\n\t\t\t\t\t\t// Need to figure out the classes and set the timer to set the focus\r\n\t\t\t\t\t\tif ( true === btmPickControlOpen )\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tactivePicStyle = 'activatePickDivHide';\r\n\t\t\t\t\t\t\tbrowsePicStyle = 'browsePickDivShow';\r\n\t\t\t\t\t\t\tsetTimeout( setPagePickFocus, 2 );\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tactivePicStyle = 'activatePickDivShow';\r\n\t\t\t\t\t\t\tbrowsePicStyle = 'browsePickDivHide';\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// Create a paging div to surround the entire page control table\r\n\t\t\t\t\t\t// This will allow easy hiding/showing of the entire control\r\n\t\t\t\t\t\tpagingDiv = document.createElement(\"div\");\r\n\t\t\t\t\t\tpagingDiv.id = \"classPageSelectDiv\";\r\n\t\t\t\t\t\tpagingDiv.className = activePicStyle;\r\n\t\t\t\t\t\tcell.appendChild(pagingDiv);\r\n\r\n\t\t\t\t\t\t// Create the table for the paging selections and attach it to the div\r\n\t\t\t\t\t\tpagingTbl = document.createElement(\"table\");\r\n\t\t\t\t\t\tinnertblBody = document.createElement(\"tbody\");\r\n\t\t\t\t\t\tpagingTbl.appendChild( innertblBody );\r\n\t\t\t\t\t\tpagingTbl.width = '100%';\r\n\t\t\t\t\t\tpagingTbl.setAttribute(\"cellPadding\", \"0px\");\r\n\t\t\t\t\t\tpagingTbl.setAttribute(\"cellSpacing\", \"0px\");\r\n\r\n\t\t\t\t\t\tpagingDiv.appendChild(pagingTbl);\r\n\t\t\t\t\t\tpageCellCount = 0;\r\n\r\n\t\t\t\t\t\t// Add the table row for the paging selection\r\n\t\t\t\t\t\tpageRow = pagingTbl.insertRow(pagingTbl.rows.length);\r\n\r\n\t\t\t\t\t\t// from here the paging control cells are added to pageRow NOT Row and the count needs to\r\n\t\t\t\t\t\t// be adding to pageCellCount\r\n\r\n\t\t\t\t\t\t// Put out the Prev tag\r\n\t\t\t\t\t\tcell = pageRow.insertCell( pageCellCount++ );\r\n\t\t\t\t\t\tif ( currentPageNum > 1 )\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tcell.onmouseover = function(){ imageCell(this, 'page_previous16_mo.gif', 'PagePrevImg', true); };\r\n\t\t\t\t\t\t\tcell.onmouseout = function(){ imageCell(this, 'page_previous16.gif', 'PagePrevImg', false); };\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif ( searchPage == false )\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tcell.onclick = function(){ class_getFolderContents( ( currentPageNum - 1 ), String.formatLoc( \"Retrieving page n\", currentPageNum - 1 ) ); };\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{ \r\n\t\t\t\t\t\t\t\tcell.onclick = function(){ DoSearch( document.SearchForm, 'func', 'NewSearch', ( currentPageNum - 2 ) * pageSize ); };\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcell.innerHTML = \"<IMG SRC='\" + imgSrc + \"page_previous16.gif' Alt='\"+ LocString( \"Previous Page\" ) +\"' Title='\"+ LocString( \"Previous Page\" ) +\"' ID='PagePrevImg' WIDTH='16' HEIGHT='16' BORDER='0'>\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tcell.innerHTML = \"<IMG SRC='\" + imgSrc + \"spacer.gif' ALT='' WIDTH='16' HEIGHT='16' BORDER='0'>\";\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// add the spacer cell\r\n\t\t\t\t\t\tcell = pageRow.insertCell( pageCellCount++ );\r\n\t\t\t\t\t\tcell.innerHTML = \"<IMG SRC='\" + imgSrc + \"spacer.gif' ALT='' WIDTH='2' HEIGHT='4' BORDER='0'>\";\r\n\r\n\t\t\t\t\t\t// Calculate the boundries of what the control will show\r\n\t\t\t\t\t\tvar startAt = Math.max( currentPageNum - 2, 1 );\r\n\t\t\t\t\t\tvar endAt = Math.min( totalPages + 1, startAt + 5 );\r\n\r\n\t\t\t\t\t\tif ( ( endAt - startAt ) < 5 )\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// Need to recalculate the startAt point if the calculated\r\n\t\t\t\t\t\t\t// start is less than 5 from the end\r\n\t\t\t\t\t\t\tstartAt = Math.max( endAt - 5, 1 );\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar clickHandler = function( e )\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tvar pgNum = this.getAttribute( 'pageNumAccess' ) ;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif ( searchPage == false )\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tclass_getFolderContents( pgNum , String.formatLoc( \"Retrieving page n\", pgNum ) );\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t{ \r\n\t\t\t\t\t\t\t\t\tDoSearch( document.SearchForm, 'func', 'NewSearch', ( pgNum - 1 ) * pageSize );\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar mouseoverHandler = function(){ colourCell(this); };\r\n\t\t\t\t\t\tvar mouseoutHandler = function(){ clearCell(this, true); };\r\n\r\n\t\t\t\t\t\tfor ( i = startAt; i < endAt; i++ )\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// NOTE: the mouseover effect by changing the css style doesn't seem to\r\n\t\t\t\t\t\t\t// work very well so in the mean time. Changing the styles directly\r\n\t\t\t\t\t\t\t// will have to do\r\n\r\n\t\t\t\t\t\t\tcell = pageRow.insertCell( pageCellCount++ );\r\n\t\t\t\t\t\t\tcell.className = 'pageSelectorReference';\r\n\t\t\t\t\t\t\tcell.setAttribute('pageNumAccess', i);\r\n\t\t\t\t\t\t\tcell.style.margin = \"0 4px 0 4px\";\r\n\t\t\t\t\t\t\tcell.style.padding = \"0 2px 0 2px\";\r\n\t\t\t\t\t\t\tcell.style.color = '#00609e';\r\n\t\t\t\t\t\t\tcell.title = String.formatLoc( \"Page n\", i );\r\n\r\n\t\t\t\t\t\t\tif ( i !== currentPageNum )\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tcell.onmouseover = mouseoverHandler;\r\n\t\t\t\t\t\t\t\tcell.onmouseout = mouseoutHandler;\r\n\t\t\t\t\t\t\t\tcell.style.border = \"solid 1px #F5F5F5\";\r\n\t\t\t\t\t\t\t\tcell.onclick = clickHandler;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tcell.style.backgroundColor = \"white\";\r\n\t\t\t\t\t\t\t\tcell.style.border = \"solid 1px #A9B7C6\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tcell.innerHTML = \"&nbsp;\" + i + \"&nbsp;\";\r\n\r\n\t\t\t\t\t\t\t// add the spacer cell\r\n\t\t\t\t\t\t\tcell = pageRow.insertCell( pageCellCount++ );\r\n\t\t\t\t\t\t\tcell.innerHTML = \"<IMG SRC='\" + imgSrc + \"spacer.gif' ALT='' WIDTH='2' HEIGHT='4' BORDER='0'>\";\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tcell = pageRow.insertCell( pageCellCount++ );\r\n\t\t\t\t\t\tif ( currentPageNum < totalPages )\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tcell.onmouseover = function(){ imageCell(this, 'page_next16_mo.gif', 'PageNextImg', true); };\r\n\t\t\t\t\t\t\tcell.onmouseout = function(){ imageCell(this, 'page_next16.gif', 'PageNextImg', false); };\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif ( searchPage == false )\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tcell.onclick = function(){ class_getFolderContents( ( currentPageNum + 1 ), String.formatLoc( \"Retrieving page n\", currentPageNum + 1 ) ); };\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{ \r\n\t\t\t\t\t\t\t\tcell.onclick = function(){ DoSearch( document.SearchForm, 'func', 'NewSearch', ( currentPageNum ) * pageSize ); };\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcell.innerHTML = \"<IMG SRC='\" + imgSrc + \"page_next16.gif' Alt='\"+ LocString( \"Next Page\" ) +\"' Title='\"+ LocString( \"Next Page\" ) +\"' ID='PageNextImg' WIDTH='16' HEIGHT='16' BORDER='0'>\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tcell.innerHTML = \"<IMG SRC='\" + imgSrc + \"page_next16_ds.gif' Title='' WIDTH='16' HEIGHT='16' BORDER='0'>\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// - - - - - - - - End of the pagination selection control - - - - - - - -\r\n\r\n\t\t\t\t\t\t// - - - - - - - - Start of the pagination goto/picker control - - - - - - - -\r\n\r\n\t\t\t\t\t\t// add the spacer cell\r\n\t\t\t\t\t\tcell = row.insertCell( cellCount++ );\r\n\t\t\t\t\t\tcell.innerHTML = \"<IMG SRC='\" + imgSrc + \"spacer.gif' ALT='' WIDTH='2' HEIGHT='4' BORDER='0'>\";\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// add the edit box cell to jump to a page\r\n\t\t\t\t\t\tcell = row.insertCell( cellCount++ );\r\n\t\t\t\t\t\tcell.id = \"PickPageCell\";\r\n\t\t\t\t\t\tcell.style.padding = \"0 2px 0 2px\";\r\n\t\t\t\t\t\tcell.style.color = '#666666';\r\n\t\t\t\t\t\tcell.style.whiteSpace = 'nowrap';\r\n\t\t\t\t\t\tcell.title = LocString( 'Go to page...' );\r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tif ( searchPage == false )\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tcell.innerHTML += \"<DIV ID='typePickDiv' CLASS='\" + browsePicStyle + \"'>\" + LocString( \"Go to page\" ) + \"&nbsp;&nbsp;<INPUT CLASS='browsePaginationBarEdit' autocomplete='off' TYPE='text' ID='pagePickEdit' TITLE='\" + LocString( 'Enter a page number here' ) + \"' SIZE='5' MAXLENGTH='20' LIMIT='20' VALUE='' ONKEYPRESS='return browsePageNumEnter( this.form, event, false )'></DIV>\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tcell.innerHTML += \"<DIV ID='typePickDiv' CLASS='\" + browsePicStyle + \"'>\" + LocString( \"Go to page\" ) + \"&nbsp;&nbsp;<INPUT CLASS='browsePaginationBarEdit' autocomplete='off' TYPE='text' ID='pagePickEdit' TITLE='\" + LocString( 'Enter a page number here' ) + \"' SIZE='5' MAXLENGTH='20' LIMIT='20' VALUE='' ONKEYPRESS='return browsePageNumEnter( this.form, event, true )'></DIV>\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// This cell contains the flip control icons\r\n\t\t\t\t\t\tcell = row.insertCell( cellCount++ );\r\n\t\t\t\t\t\tcell.style.padding = \"0 2px 0 2px\";\r\n\t\t\t\t\t\tcell.style.border = \"solid 1px #F5F5F5\";\r\n\t\t\t\t\t\tcell.onmouseover = function(){ imageCell(this, 'goto_page16_mo.gif', 'gotoPageLinkImg', true); imageCell(this, 'goto_close1216_mo.gif', 'browsePageLinkImg', true); };\r\n\t\t\t\t\t\tcell.onmouseout = function(){ imageCell(this, 'goto_page16.gif', 'gotoPageLinkImg', false);imageCell(this, 'goto_close1216.gif', 'browsePageLinkImg', false); };\r\n\t\t\t\t\t\tcell.innerHTML = \"<DIV ID='activatePickDiv' CLASS='\" + activePicStyle + \"'><a href='javascript:void(0)' onclick='javascript:flipPagePick();return false;' TITLE='\" + LocString( 'Go to page...' ) + \"'><IMG SRC='\" + imgSrc + \"goto_page16.gif' ID='gotoPageLinkImg' WIDTH='16' HEIGHT='16' BORDER='0' ALT='\" + LocString( 'Go to page...' ) + \"'></a></DIV>\";\r\n\t\t\t\t\t\tcell.innerHTML += \"<DIV ID='browsePickDiv' CLASS='\" + browsePicStyle + \"'><a href='javascript:void(0)' onclick='javascript:flipPagePickBack();return false;' TITLE='\" + LocString( 'Go to page...' ) + \"'><IMG SRC='\" + imgSrc + \"goto_close1216.gif' ID='browsePageLinkImg' WIDTH='16' HEIGHT='16' BORDER='0' ALT='\" + LocString( 'Close' ) + \"'></a></DIV>\";\r\n\r\n\t\t\t\t\t\tcell = row.insertCell( cellCount++ );\r\n\t\t\t\t\t\tcell.style.padding = \"0 0 0 2px\";\r\n\r\n\t\t\t\t\t\t// - - - - - - - - End of the pagination goto/picker control - - - - - - - -\r\n\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\trow = innertbl.insertRow(innertbl.rows.length);\r\n\t\t\t\t\tcellCount = 0;\r\n\r\n\t\t\t\t\tif ( searchPage == false )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// - - - - - - - - add the cell for the number of items - - - - - - - -\r\n\t\t\t\t\t\tcell = row.insertCell(cellCount++);\r\n\t\t\t\t\t\tcell.style.whiteSpace = 'nowrap';\r\n\t\t\t\t\t\tcell.style.color = '#666666';\r\n\t\t\t\t\t\tcell.style.padding = \"2px 0 2px 0\";\r\n\t\t\t\t\t\tcell.colSpan = '5';\r\n\r\n\t\t\t\t\t\tif ( currentPageNum === 1 )\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tstartPt = 1;\r\n\t\t\t\t\t\t\tendPt = class_myRows.length;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tstartPt = ( ( currentPageNum - 1 ) * pageSize ) + 1;\r\n\t\t\t\t\t\t\tendPt = ( ( currentPageNum - 1 ) * pageSize ) + class_myRows.length;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif ( !hideContainerSize )\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// At this point there are a number of conditions to look at before putting up the # of items\r\n\t\t\t\t\t\t\tif ( 1 === totalPages )\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tif ( 1 === totalCount )\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tif ( objFilter.length > 0 || filterValue.length > 0 )\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\titemStr = String.formatLoc( \"p item (filtered)\", totalCount );\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\titemStr = String.formatLoc( \"p item\", totalCount );\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tif ( objFilter.length > 0 || filterValue.length > 0 )\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\titemStr = String.formatLoc( \"p items (filtered)\", totalCount );\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\titemStr = String.formatLoc( \"p items\", totalCount );\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse if ( endPt === totalCount )\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tif ( objFilter.length > 0 || filterValue.length > 0 )\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\titemStr = String.formatLoc( \"n-m of p items (filtered)\", startPt, endPt, totalCount );\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\titemStr = String.formatLoc( \"n-m of p items\", startPt, endPt, totalCount );\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tif ( objFilter.length > 0 || filterValue.length > 0 )\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\titemStr = String.formatLoc( \"n-m of about p items (filtered)\", startPt, endPt, totalCount );\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\titemStr = String.formatLoc( \"n-m of about p items\", startPt, endPt, totalCount );\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tcell.innerHTML = itemStr;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// - - - - - - - - add the spacer cell - - - - - - - -\r\n\t\t\t\t\tcell = row.insertCell(cellCount++);\r\n\t\t\t\t\tcell.innerHTML = \"<IMG SRC='\" + imgSrc + \"spacer.gif' ALT='' WIDTH='15' HEIGHT='1' BORDER='0'>\";\r\n\r\n\t\t\t\t\tif ( searchPage == true )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcell.colSpan = '6';\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ( totalPages > 1 && !hideContainerSize )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// write out the current page indicator\r\n\t\t\t\t\t\tcell = row.insertCell( cellCount++ );\r\n\t\t\t\t\t\tcell.style.whiteSpace = 'nowrap';\r\n\t\t\t\t\t\tcell.align = 'right';\r\n\t\t\t\t\t\tcell.colSpan = '5';\r\n\t\t\t\t\t\tcell.width = '5%';\r\n\t\t\t\t\t\tcell.style.color = '#666666';\r\n\t\t\t\t\t\tcell.style.padding = \"2px 0 2px 0\";\r\n\t\t\t\t\t\tcell.innerHTML = \"<IMG SRC='\" + imgSrc + \"spacer.gif' ALT='' WIDTH='3' HEIGHT='12' BORDER='0'>\";\r\n\t\t\t\t\t\tif ( currentPageNum === totalPages )\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tcell.innerHTML += String.formatLoc( \"n of m pages\", currentPageNum, totalPages );\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tcell.innerHTML += String.formatLoc( \"n of about m pages\", currentPageNum, totalPages );\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// - - - - - - - - End of the pagination control - - - - - - - -\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif ( true === isDebugPaging && tbl != null )\r\n\t\t\t\t{\r\n\t\t\t\t\t// Draw the row\r\n\t\t\t\t\trow = tbl.insertRow(tbl.rows.length);\r\n\r\n\t\t\t\t\t// add the cell to span all of the detail columns\r\n\t\t\t\t\tcell = row.insertCell(0);\r\n\t\t\t\t\tcell.style.whiteSpace = 'nowrap';\r\n\t\t\t\t\t// Make sure to count all of the columns\r\n\t\t\t\t\tif ( undefined !== numCol )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcell.colSpan = numCol;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Create the table for the data\r\n\t\t\t\t\tinnertbl = document.createElement(\"table\");\r\n\t\t\t\t\tinnertblBody = document.createElement(\"tbody\");\r\n\t\t\t\t\tinnertbl.width = '100%';\r\n\t\t\t\t\tinnertbl.setAttribute(\"cellPadding\", \"0px\");\r\n\t\t\t\t\tinnertbl.setAttribute(\"cellSpacing\", \"0px\");\r\n\r\n\t\t\t\t\tcell.appendChild(innertbl);\r\n\t\t\t\t\tcellCount = 0;\r\n\r\n\t\t\t\t\t// Draw the header row\r\n\t\t\t\t\trow = innertbl.insertRow(innertbl.rows.length);\r\n\t\t\t\t\tif ( debugMsgs )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcell = row.insertCell(cellCount++);\r\n\t\t\t\t\t\tcell.style.whiteSpace = 'nowrap';\r\n\t\t\t\t\t\tcell.width = '20%';\r\n\t\t\t\t\t\tcell.innerHTML = \"<IMG SRC='\" + imgSrc + \"spacer.gif' ALT='' WIDTH='1' HEIGHT='17' BORDER='0'>&nbsp;Debug: <span id='loggingMsgId'>\" + loggingmessage + \"</span> \";\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// add the cell spacing\r\n\t\t\t\t\tcell = row.insertCell(cellCount++);\r\n\t\t\t\t\tcell.width = '20%';\r\n\t\t\t\t\tcell.innerHTML = \"&nbsp;<IMG SRC='\" + imgSrc + \"spacer.gif' ALT='' WIDTH='3' HEIGHT='17' BORDER='0'>\";\r\n\r\n\t\t\t\t\t// Now for the stats\r\n\t\t\t\t\tcell = row.insertCell(cellCount++);\r\n\t\t\t\t\tcell.width = '20%';\r\n\t\t\t\t\tcell.align = 'right';\r\n\t\t\t\t\tcell.style.whiteSpace = 'nowrap';\r\n\t\t\t\t\tcell.innerHTML = \"Total server [\" + timeTaken / 1000.0 + \"] sec&nbsp;|&nbsp;\";\r\n\t\t\t\t\tcell.innerHTML += \"RDB [\" + dbTimeTaken / 1000.0 + \"] sec&nbsp;|&nbsp;\";\r\n\t\t\t\t\tcell.innerHTML += \"Round Trip [\" + rtTimeTaken / 1000.0 + \"] sec&nbsp;|&nbsp;\";\r\n\t\t\t\t\tcell.innerHTML += \"Render [\" + renderTimeTaken + \"] ms&nbsp;|&nbsp;\";\r\n\t\t\t\t\tcell.innerHTML += \"Size [\" + packetSize + \"] bytes&nbsp;\";\r\n\r\n\t\t\t\t\tinnertbl.visibility = \"visible\";\r\n\t\t\t\t\tinnertbl.display = \"block\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tsetConfigUrl( pageSize );\r\n\t\t}\r\n\t\tcatch(e)\r\n\t\t{\r\n\t\t\tkillPopup();\r\n\t\t\texceptionAlert( e, \"Issue occured in classbrowse.js/addPagingFooter. An issue has occured in creating the paging footer. \" );\r\n\t\t}\r\n\t}", "function addFooter(footText){\n return \"<footer class=\\\"card_footer w3-container\\\">\" +\n \"<h5>\" + footText + \"</h5>\" +\n \"</footer>\";\n}", "closeHeaderFooter() {\n this.disableHeaderFooter();\n }", "addHeaderFooter(hf, hfType, id) {\n let hfColl = new Dictionary();\n this.headersFooters.add(hfType, hfColl);\n this.headersFooters.get(hfType).add(id, hf);\n }", "function updateTableHeaderFooter() {\n $(\".dataTables_info\").hide();\n $('.certHeader').html($(\"#certTable_info\").html());\n $('#certTable_filter input').css('width', '250px');\n }", "function updateTableHeaderFooter() {\n $(\".dataTables_info\").hide();\n $('.licenseHeader').html($(\"#licenseTable_info\").html());\n $('#licenseTable_filter input').css('width', '250px');\n }", "function createFtr (theTable) {\n\n var salesFoot = document.createElement('tfoot');\n var footRow = document.createElement('tr');\n var footHdr = document.createElement('th');\n footHdr.textContent = 'TOTALS:';\n footRow.appendChild(footHdr);\n\n // load zeros in for totals for now.\n for (var f = 0; f < footTotals.length; f++) {\n var footData = document.createElement('td');\n footData.textContent = footTotals[f];\n footRow.appendChild(footData);\n };\n // add one more data cell for the total column\n var tdTotal = document.createElement('td');\n tdTotal.textContent = footGrandTotal;\n footRow.appendChild(tdTotal);\n\n // put that footer row in the footer.\n salesFoot.appendChild(footRow);\n // and put the footer into the table.\n theTable.appendChild(salesFoot);\n}", "function setFooter(stats) {\n var footer = '';\n if (stats.show == 'true') {\n if (stats.type.value == \"image\") {\n footer = '<div id=\"footer\" style=\"z-index:30;text-align:' + stats.align.value + ';\"> <img src=\"' + basePath + 'images/' + stats.logo + '\" /></div>';\n }\n else {\n footer = '<div id=\"footer\" style=\"z-index:3;position:absolute;width:100%;text-align:' + stats.align.value + ';\"><div class=\"font-setter\" style=\"z-index:3;font-size:' + stats.size.value + ';\">' + stats.text + '</div></div>';\n }\n }\n return footer;\n }", "function footerData(sourcefile){\r\n\treturn `<div class='information' id='information'>\r\n\t\t\t\r\n\t\t<div style='float:right; padding-top: 28px; padding-right: 14px;'>\r\n\t\t\tRobert Calamari 2019\r\n\t\t</div>\r\n\r\n\t</div>\r\n`;\r\n}", "function getFooter() {\n return `</div>\n </div>\n </body>\n </html>`;\n}", "function outputFooter(todos) {\n const total = todos.length;\n if (!total) {\n return os.EOL + ' ' + logSymbols.success + ' No todos/fixmes found';\n }\n let msg = total + ' todo' + (total === 1 ? '' : 's');\n msg += '/fixme' + (total === 1 ? '' : 's') + ' found';\n return os.EOL + ' ' + (total ? logSymbols.error : logSymbols.success) + ' ' + msg;\n}", "function createDefaultFooter() {\n footer = document.createElement(\"footer\");\n\n let footerContainer = document.createElement(\"div\");\n footerContainer.setAttribute(\"id\", \"footerContainer\");\n footer.appendChild(footerContainer);\n\n let zaanLogo = document.createElement(\"img\");\n zaanLogo.setAttribute(\"src\", \"/img/ZAAN/ZAAN_Logo_Invert_NoText.svg\");\n zaanLogo.setAttribute(\"height\", \"60px\");\n zaanLogo.setAttribute(\"alt\", \"ZAAN Games Logo\");\n zaanLogo.setAttribute(\"onerror\", \"this.src='./img/ZAAN/ZAAN_Logo_Invert_NoText_Small.png\");\n footerContainer.appendChild(zaanLogo);\n\n let emailParagraph = document.createElement(\"p\");\n let emailText = document.createTextNode(\"General @ Mytholympics.com\");\n emailParagraph.appendChild(emailText);\n footerContainer.appendChild(emailParagraph);\n\n let copyrightHeader = document.createElement(\"h2\");\n let copyrightText = document.createTextNode(\"ZAAN Games \\u00A9 2018\");\n copyrightHeader.appendChild(copyrightText);\n footerContainer.appendChild(copyrightHeader);\n\n document.body.appendChild(footer);\n\n handleFooterPositioning();\n}", "fixFooterWidths() {\n this.fixCellWidths();\n }", "fixFooterWidths() {\n this.fixCellWidths();\n }", "function footer_func(){\n showfooter();\n hideicon();\n }", "function updateTableHeaderFooter() {\n $(\".dataTables_info\").hide();\n $('.outstandingAssessmentsHeader').html($(\"#assessmentsTable_info\").html());\n $('#assessmentsTable_filter input').css('width', '250px');\n }", "function updateTableHeaderFooter() {\n $(\".dataTables_info\").hide();\n $('.outstandingAssignmentsHeader').html($(\"#assignmentsTable_info\").html());\n $('#assignmentsTable_filter input').css('width', '250px');\n }", "function createTableBody(table) {\n // reset body containings\n let tableBody = $('#table-body');\n tableBody.html('');\n\n // displaying results\n headers = Object.keys(table[0].input).slice(2);\n let rowCount = 0;\n\n table.forEach(function(data) {\n let tr = document.createElement('tr');\n\n let indexTd = document.createElement('td');\n indexTd.innerHTML = rowCount++ + '.';\n $(tr).append(indexTd);\n\n headers.forEach(function(key) {\n let td = document.createElement('td');\n td.innerHTML = data.input[key];\n $(tr).append(td);\n });\n\n let resultTd = document.createElement('td');\n resultTd.innerHTML = data.result;\n\n $(tr).append(resultTd);\n\n tableBody.append(tr);\n });\n }" ]
[ "0.8113571", "0.79268444", "0.79246783", "0.7684201", "0.75547415", "0.75266427", "0.75158376", "0.73957175", "0.738576", "0.7353884", "0.7344595", "0.7330811", "0.73256516", "0.7284439", "0.72625464", "0.7135546", "0.7128146", "0.71010584", "0.70959985", "0.70781195", "0.7022201", "0.69814515", "0.69767034", "0.69677734", "0.69246554", "0.6887319", "0.6887319", "0.6887066", "0.68802947", "0.68514", "0.68496454", "0.68471664", "0.6846777", "0.6846777", "0.6846288", "0.6846288", "0.68411636", "0.6839778", "0.6808067", "0.67819417", "0.67432433", "0.67245126", "0.67072195", "0.6669239", "0.6642982", "0.6640325", "0.6632182", "0.6622346", "0.6594936", "0.65898615", "0.6559365", "0.6544937", "0.65396875", "0.65393704", "0.65236384", "0.6490899", "0.6489467", "0.64844954", "0.64378554", "0.6386013", "0.63472736", "0.63211036", "0.62415373", "0.6240247", "0.62327635", "0.6227746", "0.61801046", "0.6160324", "0.6109942", "0.6104133", "0.60941464", "0.60652465", "0.60444266", "0.6028215", "0.6026698", "0.6022328", "0.60125536", "0.59987926", "0.5991516", "0.59887016", "0.5970119", "0.5955681", "0.59481794", "0.59357136", "0.5930537", "0.59151506", "0.5890847", "0.585208", "0.5841013", "0.5838045", "0.58282363", "0.5816095", "0.58042127", "0.579643", "0.57846916", "0.57846916", "0.57784015", "0.5773087", "0.5772065", "0.5768194" ]
0.7471599
7
Function to draw the map with state
function drawMap(dataColumn) { var valueById = d3.map(); data.forEach(function(d) { var id = name_id_map[d[config.state]]; valueById.set(id, +d[dataColumn]); }); // Get the domain from the data set for setting up the color scale quantize.domain([d3.min(data, function(d){ return +d[dataColumn] }), d3.max(data, function(d){ return +d[dataColumn] })]); // Draw the states g.selectAll("path") .data(topojson.feature(us, us.objects.states).features) .enter().append("path") .attr("class", "feature") // .attr("transform", "scale(" + SCALE + ")") // .on("click", clicked) .style("fill", function(d) { return quantize(valueById.get(d.id)); // fill color based on number of petitions filed } ) .attr("d", path) .on("mousemove", function(d) { // tooltip var html = ""; html += "<div class=\"tooltip_kv\">"; html += "<span class=\"tooltip_key\">"; html += id_name_map[d.id]; html += "</span>"; html += "</div>"; for (var i = 0; i < Object.keys(data[0]).length -1 ; i++) { html += "<div class=\"tooltip_kv\">"; html += "<span class='tooltip_key'>"; html += Object.keys(data[0])[i]; html += "</span>"; html += "<span class=\"tooltip_value\">"; html += (dataMap[id_name_map[d.id]][Object.keys(data[0])[i]]); html += ""; html += "</span>"; html += "</div>"; } $("#tooltip-container").html(html); $(this).attr("fill-opacity", "0.7"); $("#tooltip-container").show(); var coordinates = d3.mouse(this); var map_width = $('.feature')[0].getBoundingClientRect().width; if (d3.event.layerX < map_width / 2) { d3.select("#tooltip-container") .style("top", (d3.event.layerY + 15) + "px") .style("left", (d3.event.layerX + 15) + "px"); } else { var tooltip_width = $("#tooltip-container").width(); d3.select("#tooltip-container") .style("top", (d3.event.layerY + 15) + "px") .style("left", (d3.event.layerX - tooltip_width - 30) + "px"); } }) .on("mouseout", function() { $(this).attr("fill-opacity", "1.0"); $("#tooltip-container").hide(); }); // draw the states mesh g.append("path") .datum(topojson.mesh(us, us.objects.states, function(a, b) { return a !== b; })) .attr("class", "mesh") // .attr("transform", "scale(" + SCALE + ")") .attr("d", path); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "drawMap(){\n\t\tthis.blocks.forEach(function (e) {\n\t\t\te.draw();\n\t\t});\n\t}", "function drawMap(){ ctx.innerHTML = dungeon.displayDungeon(); }", "render() {\n MapPlotter.setUpFilteringButtons();\n MapPlotter.readFiltersValues();\n\n MapPlotter.currentStateName = 'Texas';\n MapPlotter.drawRaceDoughnut();\n\n MapPlotter.drawMap();\n }", "function render() {\n debugMap(map, 10, 20);\n }", "drawMap() {\n\t\tlet width = this.mapWidth,\n\t\t\t\theight = width / 2,\n\t\t\t\tscale = this.scale;\n\n\t\tlet projection = d3.geoAlbers()\n\t\t\t\t .translate([width/2, height/2]) // translate to center of screen\n\t\t\t\t .scale([scale]); // scale things down so see entire US\n \n\t\t// Define path generator\n\t\tlet path = d3.geoPath() // path generator that will convert GeoJSON to SVG paths\n\t\t\t\t \t .projection(projection); // tell path generator to use albersUsa projection\n\n\n\t\tlet svg = d3.select(\"#us-map-d3\")\n\t\t\t\t\t\t\t\t.append(\"svg\")\n\t\t\t\t\t\t\t\t.attr(\"width\", width)\n\t\t\t\t\t\t\t\t.attr(\"height\", height);\n\n\n\t\td3.json(\"us-states.json\", function(us) {\n\n\t\t svg.selectAll(\"path\")\n\t\t\t\t.data(us.features)\n\t\t\t\t.enter()\n\t\t\t\t.append(\"path\")\n\t\t\t\t.attr(\"class\", \"states\")\n\t\t\t\t.attr(\"d\", path)\n\t\t\t\t.style(\"stroke\", \"#fff\")\n\t\t\t\t.style(\"stroke-width\", \"1\")\n\t\t\t\t.on(\"click\", function(){\n\t\t\t\t\tlet stateName = this.__data__.properties.name;\n\t\t\t\t\twindow.location = 'breweries/state?state=' + stateName;\n\t\t\t\t})\n\n\t\t});\n\n\t}", "function draw() {\n background(0);\n translate(width / 2., height / 2.);\n imageMode(CENTER);\n image(mapImg,0,0);\n for (var i = 0; i < locationData.length; i++)\n {\n //console.log(\"Drawing: \" + locationData[i].name);\n radius = map(locationData[i].checkins, checkInMin.value(), checkInMax.value(), rMin.value(), rMax.value());\n drawLocation(locationData[i], radius);\n }\n}", "function renderMap(map){\n\t\tcurrentMap = map;\n\t\tctx.clearRect(0, 0, canvas.width, canvas.height);\n\t\tctx.fillStyle = \"#363947\";\n\t\tfor (i = 0; i < mapDimension; i++) {\n\t\t\tfor (j = 0; j < mapDimension; j++) {\n\t\t\t\tif (map[i][j].charAt(0) == 'W'){\n\t\t\t\t\tctx.fillStyle = \"#3D6BBF\";\n\t\t\t\t\tctx.fillRect(j * tileDimension,i * tileDimension, tileDimension, tileDimension);\n\t\t\t\t}\telse if (map[i][j].charAt(0) == 'G'){\n\t\t\t\t\tctx.fillStyle = \"#B8A073\";\n\t\t\t\t\tctx.fillRect(j * tileDimension,i * tileDimension, tileDimension, tileDimension);\n\t\t\t\t}\n\t\t\t\tif (map[i][j].length > 1) {\n\t\t\t\t\tif (map[i][j].charAt(1) == 'P'){\n\t\t\t\t\t\tsetPlayer(j,i);\n\t\t\t\t\t} else if (map[i][j].charAt(1) == 'F'){\n\t\t\t\t\t\tsetFood(map[i][j].charAt(2), j, i);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function draw() {\n\n // Draw the map.\n ctx.clearRect(0, 0, width, height);\n createMap();\n\n drawSnake();\n drawFood();\n\n // Draw Grid for TESTING purposes\n drawGrid();\n}", "visibleMapDisplay() {\n vtx.fillStyle = \"pink\";\n vtx.beginPath();\n vtx.lineWidth = 5;\n vtx.moveTo(this.borders[0],this.borders[1]);\n\n for (var i = 2; i < (this.borders.length); i += 2){\n vtx.lineTo(this.borders[i],this.borders[i+1]);\n }\n\n vtx.lineTo(this.borders[0],this.borders[1]);\n vtx.strokeStyle = \"blue\";\n vtx.stroke();\n vtx.fill();\n }", "drawMap() {\n if (this.map && this.map.update) {\n this.map.draw(this.game.ctx)\n }\n }", "function drawGridMap(publication) {\n // filter data to return the object of publication of interest\n var selectPub = nest.find(function(d) {\n return d.key == publication;\n });\n\n\n // use a key function to bind rects to states\n var states = gridMap.selectAll(\".state\")\n .data(selectPub.values, function(d) { return d.code; });\n // draw state rects\n states.enter()\n .append(\"rect\")\n .attr(\"class\", function(d) {return \"state \" + d.code; })\n .attr(\"x\", function(d) { return (d.col - 1) * cellSize; })\n .attr(\"y\", function(d) { return (d.row - 1) * cellSize; })\n .attr(\"width\", cellSize)\n .attr(\"height\", cellSize)\n .on(\"click\", function(d) {\n var square = d3.select(this);\n square.classed(\"active\", !square.classed(\"active\"));\n if (square.classed(\"active\")) { \n let color = getColor(d.state); //determines appropriate color based on id \n popUpGraph(d.state, color); \n }\n });\n\n var labels = gridMap.selectAll(\".label\")\n .data(selectPub.values, function(d) { return d.code; });\n\n // add state labels\n labels.enter()\n .append(\"text\")\n .attr(\"class\", function(d) { return \"label \" + d.code; })\n .attr(\"x\", function(d) {\n return ((d.col - 1) * cellSize) + (cellSize / 2 - (margin.left*1.5));\n })\n .attr(\"y\", function(d) {\n return ((d.row - 1) * cellSize) + (cellSize /2 - (margin.top*1.15));\n })\n .style(\"text-anchor\", \"middle\")\n .text(function(d) { return d.code; });\n\n var labels = gridMap.selectAll(\".label\")\n .data(selectPub.values, function(d) { return d.code; });\n\n var map = gridMap.selectAll(\".map\")\n .data(selectPub.values, function(d) { return d.code; });\n\n // graphs for each state \n map.enter()\n .append(\"svg\")\n .attr(\"stateMap\", function(d) { \n var color = getColor(d.state); //determines appropriate color based on preloaded csv file\n x = ((d.col - 1) * cellSize) + (cellSize / 2 - 10);\n y = ((d.row - 1) * cellSize) + (cellSize /2 - 10);\n populate(x, y, d.state, color);\n })\n }", "function drawMap() {\n //Draw background tiles\n image(imgBackground, 0, 0, windowWidth, (windowWidth * 0.5));\n //Set tile size based on window size\n let tileSize = windowWidth / 20;\n // set grid dimensions based on tilesize\n let gridWidth = tileSize;\n let gridHeight = tileSize;\n // Draw vertical lines\n for (let i = 0; gridWidth < width; i++) {\n line(gridWidth, 0, gridWidth, height);\n gridWidth += tileSize;\n }\n // draw horizontal lines\n for (let i = 0; gridHeight < height; i++) {\n line(0, gridHeight, width, gridHeight);\n gridHeight += tileSize;\n }\n}", "async function drawMap() {\n var {dataset, layer, view} = state;\n const darkModeCheckbox = document.querySelector('#darkMode calcite-checkbox');\n const map = new Map({\n // choose a light or dark background theme as default\n basemap: darkModeCheckbox?.checked ? \"dark-gray-vector\" : \"gray-vector\",\n layers: layer,\n });\n if (view) {\n // update existing view, then exit\n view.map = map;\n state = {...state, view}\n // explicitly wait for bgColor to be updated, then update the layerView\n await getBgColor().then(color => {\n state.bgColor = color;\n updateLayerViewEffect();\n });\n return view;\n }\n var view = new MapView({\n container: \"viewDiv\",\n map: map,\n extent: getDatasetExtent(dataset),\n ui: { components: [] }\n });\n\n // add toggle checkboxes\n\n view.ui.add('zoomToData', 'top-right');\n const zoomToDataCheckbox = document.querySelector('#zoomToData calcite-checkbox');\n zoomToDataCheckbox.addEventListener('calciteCheckboxChange', () => {\n updateLayerViewEffect();\n });\n\n view.ui.add('darkMode', 'top-right');\n darkModeCheckbox.addEventListener('calciteCheckboxChange', async () => {\n state.view = await drawMap();\n autoStyle({fieldName: state.fieldName})\n });\n\n view.ui.add('labels', 'top-right');\n const labelsCheckbox = document.querySelector('#labels calcite-checkbox');\n labelsCheckbox.addEventListener('calciteCheckboxChange', () => {\n autoStyle({fieldName: state.fieldName})\n });\n\n\n // put vars on window for debugging\n Object.assign(window, { state, map, getDatasetField, getDatasetFieldUniqueValues, /*histogram, histogramValues,*/ generateHistogram, HistogramRangeSlider, uniqueValues });\n\n // Dataset info\n document.querySelector('#datasetName').innerHTML = dataset.attributes.name;\n document.querySelector('#orgName').innerHTML = dataset.attributes.orgName || '';\n document.querySelector('#recordCount').innerHTML = `${dataset.attributes.recordCount} records`;\n\n // update state\n state.view = view;\n // bgColor needs state.view to be set first\n state.bgColor = await getBgColor();\n return view;\n }", "function drawMap(mapName, mapHolder) {\n mapHolder.append('text')\n .attr('class', 'chart-label')\n .attr('dy', rem *1.5)\n .text(d => d.mapName);\n \n let cells = allCells.find((d) => {return d.mapName === mapName});\n\n const projection = d3.geoIdentity()\n .reflectY(true)\n .fitSize([mapDim[0], mapDim[1]], shapeData);\n\n const path = d3.geoPath(projection);\n\n //draw svg lines of the boundries\n const colleges = mapHolder\n .selectAll('.colleges')\n .data(shapeData.objects.colleges.features)\n .enter()\n .append('path')\n .attr('class','colleges')\n .attr('id', (d) => {\n return d.properties.fips + ' ' + d.properties.stateNameS})\n .attr('d', path)\n .attr('fill', d => lookup(cells.mapData, d.properties.fips))\n .attr('stroke-width', 0.4);\n \n const states = mapHolder\n .selectAll('.states')\n .data(shapeData.objects.states.features)\n .enter()\n .append('path')\n .attr('id', (d) => {\n return d.properties.fips + ' ' + d.properties.stateNameL\n })\n .attr('class', 'states')\n .attr('d', path) \n\n function lookup(row, idName) {\n const uniqueCell = row.find((d) => { return d.cellId === idName});\n if(!uniqueCell || uniqueCell.value === '') {\n return 'none'\n }\n return colourScale(uniqueCell.value)\n }\n\n }", "function draw() {\n // waits to start drawing so that location won't be empty\n if (frameCount > 35) {\n clear();\n noFill();\n stroke(250, 10, 10, opac);\n strokeWeight(w);\n\n // const userLocation = myMap.latLngToPixel(\n // locationData.latitude,\n // locationData.longitude\n // );\n // // Using that position, draw an ellipse\n // ellipse(userLocation.x, userLocation.y, x, x);\n\n // const userLocation3 = myMap.latLngToPixel(-22.983911, -43.201888);\n // ellipse(userLocation3.x, userLocation3.y, x, x);\n\n for (let i = 0; i < locations.length; i++) {\n const pos = myMap.latLngToPixel(locations[i].lat, locations[i].lon);\n ellipse(pos.x, pos.y, x, x);\n }\n\n //dot animation\n if (x < 100) {\n x = x + 1;\n w = w - 0.1;\n } else if ((x = 99)) {\n x = 10;\n opac = 255;\n w = 5;\n }\n if (opac > 0) {\n opac = opac - 4;\n }\n }\n}", "handleMap() {\r\n this.setState({displayMap: true});\r\n this.setState({displayedState: 'Map'});\r\n this.setState({displayedData: []});\r\n this.setState({output: []});\r\n this.setState({submitted: false});\r\n this.setState({allEntries: false});\r\n this.clearSearchFields();\r\n }", "function _draw() {\n _map.baseLayer.container.appendChild(_self.container);\n _redraw();\n }", "function renderMap() {\n //function called on load to create the svg and draw an initial set of line charts. trendsData is passed in from a csv, and startYear/endYear are just for the file uploader (will be constants in final features)\n\n // generateButtons(trendsData, startYear, endYear) //just for the file uploader\n $(\"#vis\").empty();\n mapSvg = d3.select(\"#vis\")\n .data([trendsData])\n .append(\"svg\")\n .attr(\"width\", mapWidth + mapMargin.left + mapMargin.right)\n .attr(\"height\", mapHeight + mapMargin.top + mapMargin.bottom)\n .append(\"g\")\n .attr(\"transform\", \"translate(\" + mapTranslateX + \",\" + mapTranslateY+ \")\");\n\n\n //reshape data, nesting by State\n var trendsDataNest = d3.nest()\n .key(function(d) {return d.State})\n .entries(trendsData);\n\n var trendsDataNestBlank = d3.nest()\n .key(function(d) { return d.State})\n .entries(blankStateData);\n\n\n //generate a list of states in the dataset. For any states not in the dataset (stored temporarily in tmpKeys) but in the `stateData` object (which is in the global scope, stored in `stateData.js`, create a new data set, just for the blank states (not in data csv), which wil be greyed out\n var tmpKeys = []\n for(var i = 0; i < trendsDataNest.length; i++){\n var obj = trendsDataNest[i]\n if(obj.hasOwnProperty(\"key\")){\n tmpKeys.push(obj.key)\n }\n }\n\n\n //tile grid map projection and geo path\n var projection = d3.geoEquirectangular()\n .scale(mapSizes[pageSize][\"scale\"])\n .center([-96.03542,41.69553])\n .translate(mapSizes[pageSize][\"translate\"]);\n\n var geoPath = d3.geoPath()\n .projection(projection);\n\n //for each non blank state, create a group which will hold the line chart\n var chartWidth = mapSizes[pageSize][\"chartWidth\"]\n var chartMargin = mapSizes[pageSize][\"chartMargin\"]\n var map = mapSvg\n .selectAll(\".state\")\n .data(trendsDataNest)\n .enter()\n .append(\"g\")\n .attr(\"class\", function(d){ return \"state \" + d.key })\n .attr(\"transform\", function(d,i){\n //grab the element in statesData corresponding to the correct trendsData state, and position accordingly\n var tmp = stateData.features.filter(function(o) { return o.properties.abbr == d.key} )\n return \"translate(\" + geoPath.centroid(tmp[0]) + \")\"\n })\n map\n .on(\"click\", function(d) {\n var newCategory = getCurrentCategory();\n var stateName = d.values[0][\"state_full\"]\n var clickedState = d3.select(this).attr(\"class\").split(\" \")[1]\n if (clickedState == \"AK\") {\n d3.select(\"#ak-disclaimer\")\n .classed(\"show\", true)\n }\n d3.select(\".nonblank-rect.\" + clickedState)\n .classed(\"hovered-state\", false)\n .classed(\"selected-state\", function(){\n if (d3.select(\".nonblank-rect.\" + clickedState).classed(\"selected-state\") == true) {\n if (clickedState == \"AK\") {\n d3.select(\"#ak-disclaimer\")\n .classed(\"show\", false)\n //AT WIDTHS < 500PX, REMOVE STATE LABEL WHEN UNCLICKING STATE\n d3.select(\".mapLabel.\" + clickedState)\n .classed(\"show\", false)\n .classed(\"selected-text\", false)\n .classed(\"hovered-text\", false)\n labelG.select(\".g-\" + clickedState)\n .remove();\n removeStateList(clickedState);\n return false;\n }else {\n //AT WIDTHS < 500PX, REMOVE STATE LABEL WHEN UNCLICKING STATE\n d3.select(\".mapLabel.\" + clickedState)\n .classed(\"show\", false)\n .classed(\"selected-text\", false)\n .classed(\"hovered-text\", false)\n labelG.select(\".g-\" + clickedState)\n .remove();\n removeStateList(clickedState);\n return false\n }\n }else { //IF NOT SELECTED THEN SELECT STATE\n var chartWidth = mapSizes[pageSize][\"chartWidth\"]\n var chartMargin = mapSizes[pageSize][\"chartMargin\"]\n var tileWidth = chartWidth-2*chartMargin+8\n if (IS_PHONE_500){\n d3.select(\".mapLabel.\" + clickedState)\n .classed(\"show\", true)\n .attr(\"transform\", function() {\n var textWidth = (this.getBoundingClientRect().width)\n return \"translate(\"+ (chartMargin-4 + textWidth + (tileWidth-textWidth)*.5) +\", \"+ 0 +\")\"\n })\n }\n addStateList(clickedState, stateName);\n return true;\n }\n })\n if ((d3.select(\".nonblank-rect.\" + clickedState).classed(\"selected-state\") == false) && (IS_MOBILE_768)) {\n // for (var i= stateLinesArray.length-1; i>=0; i--) { //DELETE EXISTING STATE IN ARRAY\n // if (stateLinesArray[i] === clickedState) {\n // stateLinesArray.splice(i, 1);\n // }\n // }\n graphSvg.select(\"path.line-\" + clickedState)\n .remove()\n labelG.select(\".g-\" + clickedState)\n .remove();\n }else {\n updateStateLine(clickedState, clickedState)\n updateLineGraph(newCategory, newCategory, \"click\", clickedState)\n }\n })\n .on(\"mouseover\", function() {\n var newCategory = getCurrentCategory();\n var hoveredState = d3.select(this).attr(\"class\").split(\" \")[1]\n var hoveredStateName = trendsDataFull.filter(function(d) {\n return d.State == hoveredState\n })\n if (IS_MOBILE_768){\n }else {\n d3.select(\".nonblank-rect.\" + hoveredState)\n .classed(\"hovered-state\", true)\n d3.select(\".mapLabel.standard.\" + hoveredState)\n .classed(\"hovered-text\", true)\n hoverState(hoveredState)\n updateStateLine(hoveredState)\n updateLineGraph(newCategory, newCategory, \"hover\", hoveredState)\n }\n })\n .on(\"mouseout\", function() {\n var newCategory = getCurrentCategory();\n var hoveredState = d3.select(this).attr(\"class\").split(\" \")[1]\n if (IS_MOBILE_768){\n }else{\n d3.select(\".nonblank-rect.\" + hoveredState)\n .classed(\"hovered-state\", false)\n d3.select(\".nonblank-rect.\" + hoveredState)\n .style(\"fill\", function(){\n if (d3.select(\"#revratio_\").classed(\"current\") == true){\n if (d3.select(\".nonblank-rect.\" + hoveredState).classed(\"selected-state\") == true) {\n return \"#000\"\n }else {\n return \"#a2d3eb\"\n }\n }else if (d3.select(\"#revpp_\").classed(\"current\") == true){\n if (d3.select(\".nonblank-rect.\" + hoveredState).classed(\"selected-state\") == true) {\n return \"#fbbe15\"\n }else {\n return \"#094c6a\"\n }\n }\n })\n d3.select(\".mapLabel.standard.\" + hoveredState)\n .style(\"fill\", function(){\n if (d3.select(\"#revratio_\").classed(\"current\") == true){\n if (d3.select(\".mapLabel.standard.\" + hoveredState).classed(\"selected-text\") == true) {\n return \"#ffffff\"\n }else {\n return \"#000\"\n }\n }else if (d3.select(\"#revpp_\").classed(\"current\") == true){\n if (d3.select(\".mapLabel.standard.\" + hoveredState).classed(\"selected-text\") == true) {\n return \"#000\"\n }else {\n return \"#ffffff\"\n }\n }\n })\n // d3.selectAll(\".state-name\")\n // .html(\"\")\n //IF LINE IS ADDED THEN REMOVE\n if (d3.select(\".nonblank-rect.\" + hoveredState).classed(\"selected-state\") == false) {\n for (var i= stateLinesArray.length-1; i>=0; i--) { //DELETE EXISTING STATE IN ARRAY\n if (stateLinesArray[i] === hoveredState) {\n stateLinesArray.splice(i, 1);\n }\n }\n graphSvg.select(\"path.line-\" + hoveredState)\n .remove()\n labelG.select(\".g-\" + hoveredState)\n .remove();\n }\n d3.select(\".mapLabel.standard.\" + hoveredState)\n .classed(\"hovered-text\", false)\n if(d3.select(\".nonblank-rect.\" + hoveredState).classed(\"selected-state\") == false){\n updateLineGraph(newCategory, newCategory, \"remove\", hoveredState)\n }\n dehoverState(hoveredState)\n }\n })\n // //draw greyed out blank states for HI and DC\n var blank = mapSvg\n .selectAll(\".blank\")\n .data(trendsDataNestBlank)\n .enter()\n .append(\"g\")\n .attr(\"class\",\"blank\")\n .attr(\"transform\", function(d,i){\n //grab the element in statesData corresponding to the correct trendsData state, and position accordingly\n var tmp = stateData.features.filter(function(o) { return o.properties.abbr == d.key} )\n return \"translate(\" + geoPath.centroid(tmp[0]) + \")\"\n })\n\n //blank sate background\n blank.append(\"rect\")\n .attr(\"width\",chartWidth-2*chartMargin + 8)\n .attr(\"height\",chartWidth-2*chartMargin + 8)\n .attr(\"x\",chartMargin - 4)\n .attr(\"y\",chartMargin - 4)\n .style(\"fill\",\"#b3b3b3\")\n blank.append(\"text\")\n .text(function(d){ return d.key })\n .attr(\"class\", function(d) {\n return \"mapLabel standard \" + d.key\n })\n .attr(\"text-anchor\", \"end\")\n .attr(\"x\", function() {\n if (IS_PHONE_500) {\n return chartWidth+chartMargin - chartWidth/2.2\n }\n else if (IS_MOBILE_768) {\n return chartWidth+chartMargin - chartWidth/2.4\n }else {\n return chartWidth+chartMargin - chartWidth/2.4\n }\n })\n .attr(\"y\", function() {\n if (IS_PHONE_500) {\n return chartWidth+chartMargin - chartWidth/2.2\n }else if (IS_MOBILE_768) {\n return chartWidth+chartMargin - chartWidth/2.4\n }else {\n return chartWidth+chartMargin - chartWidth/2.4\n }\n })\n\n //chart background\n map\n .append(\"rect\")\n .attr(\"width\", chartWidth-2*chartMargin + 8)\n .attr(\"height\", chartWidth-2*chartMargin + 8)\n .attr(\"x\",chartMargin - 4)\n .attr(\"y\",chartMargin - 4)\n .style(\"fill\", function(){\n if (d3.select(\"#revratio_\").classed(\"current\") == true){\n return \"#a2d3eb\"\n }else {\n return \"#094c6a\"\n }\n })\n .attr(\"class\", function(d) {\n return \"nonblank-rect \" + d.key\n })\n\n //set up scales for charts. THe code here assumes all states are on the same x/y scale. Alaska and the US avg will prob need to have special scales written for them, since they will be on a separate scale (I think). Also note currently there is no US average chart/tile.\n var mapX = (IS_PHONE_500) ? d3.scaleLinear().range([chartMargin-4, chartWidth-chartMargin+4]).nice() : d3.scaleLinear().range([chartMargin, chartWidth-chartMargin]).nice();\n var mapY = d3.scaleLinear().range([chartWidth-chartMargin, chartMargin]).nice();\n var mapY2 = d3.scaleLinear().range([chartWidth-chartMargin, chartMargin]).nice();\n\n\n //this is just for the file uploader, setting the key onload to whatever column is first in the data file, other than State/Year. In the real feature, firstKey will just be a constant\n // var firstKey = \"adj_revratio_all\"\n var keys = Object.keys(trendsData[0])\n\n mapX.domain([startYear,endYear]);\n //NEED TWO Y-AXES:\n //ALL STATES EXCEPT AK\n mapY.domain([d3.min(trendsDataFiltered, function(d) {return d[selectedCategory]; }), d3.max(trendsDataFiltered, function(d) { return d[selectedCategory]; })]);\n //AK ONLY\n var min2 = d3.min([1, d3.min(trendsDataAK, function(d) {return d[selectedCategory]; })]);\n var max2 = d3.max(trendsDataAK, function(d) { return d[selectedCategory]; })\n mapY2.domain([min2, max2]);\n\n\n //line chart axes\n var mapXAxis = d3.axisBottom(mapX)\n var mapYAxis = d3.axisLeft(mapY)\n\n //for each map chart line\n var mapline = d3.line()\n .x(function(d) { return mapX(d.Year); })\n .y(function(d) { return mapY(d[selectedCategory]); });\n var mapline2 = d3.line()\n .x(function(d) { return mapX(d.Year); })\n .y(function(d) { return mapY2(d[selectedCategory]); });\n\n // A white line at y=1. This is just a placeholder. In the final feature, we want some sort of distinction of y=1 for the ratio graphs, but not the level graphs. Will likely be two rects (above and below y=1) instead of a line, but TBD\n //DRAWING THE RATIO LINE FOR ALL STATES BUT AK\n d3.selectAll(\".state:not(.AK)\").append(\"line\")\n .attr(\"x1\", function() {\n return (IS_PHONE_500) ? chartMargin - 4 : chartMargin\n })\n .attr(\"x2\", function() {\n return (IS_PHONE_500) ? chartWidth-chartMargin+4 : chartWidth-chartMargin\n })\n .attr(\"y1\",mapY(1))\n .attr(\"y2\",mapY(1))\n .attr(\"class\", function(d) {\n return \"ratioOneLine ratioOneLine-\" + d.key\n })\n\n //DRAWING THE RATIO LINE FOR AK\n d3.select(\".state.AK\").append(\"line\")\n .attr(\"x1\",chartMargin-4)\n .attr(\"x2\",chartWidth-chartMargin-4)\n .attr(\"y1\",mapY2(1))\n .attr(\"y2\",mapY2(1))\n .attr(\"class\", function(d) {\n return \"ratioOneLine ratioOneLine-\" + d.key\n })\n d3.selectAll(\".ratioOneLine\")\n .style(\"opacity\", function() {\n return (d3.select(\"#revpp_\").classed(\"current\") == true) ? 0 : 1;\n })\n //DRAWING THE GRAPH LINE FOR ALL STATES BUT AKK\n d3.selectAll(\".state:not(.AK)\").append(\"path\")\n .attr(\"class\", function(d){ return \"standard line \" + d.key })\n .attr(\"d\", function(d){ return mapline(d.values)})\n .classed(\"progressivity\", function() {\n return (d3.select(\"#revpp_\").classed(\"current\") == true) ? false : true;\n })\n //DRAWING THE GRAPH LINE FOR AK\n d3.select(\".state.AK\").append(\"path\")\n .attr(\"class\", function(d){ return \"standard line \" + d.key })\n .attr(\"d\", function(d){ return mapline2(d.values)})\n .classed(\"progressivity\", function() {\n return (d3.select(\"#revpp_\").classed(\"current\") == true) ? false : true;\n })\n //NEED TO HIDE THE GRAPH LINE FOR DC AND HI FOR THE RATIO TAB\n map.selectAll(\".standard.line.DC, .standard.line.HI\")\n .style(\"opacity\", function() {\n return (d3.select(\"#revpp_\").classed(\"current\") == true) ? 1 : 0;\n })\n\n\n // see drawBackMapCurtain for explanation--draw a \"curtain\" on top of the line, which can be animated away to simulate the line animating left to right\n map.append(\"rect\")\n .attr(\"class\", function(d) {\n return \"mapCurtain \" + d.key\n })\n .attr(\"width\",0)\n .attr(\"height\",chartWidth-2*chartMargin)\n .attr(\"x\",0)\n .attr(\"y\",chartMargin)\n .style(\"fill\", \"#a2d3eb\")\n\n var chartWidth = mapSizes[pageSize][\"chartWidth\"]\n var chartMargin = mapSizes[pageSize][\"chartMargin\"]\n var tileWidth = chartWidth-2*chartMargin+8\n\n //draw the state name on the tile\n map.append(\"text\")\n .text(function(d){ return d.key })\n .attr(\"class\", function(d) {\n return \"mapLabel standard \" + d.key\n })\n .attr(\"text-anchor\", \"end\")\n .attr(\"x\", function() {\n if (IS_PHONE_500) {\n return 0;\n }else if (IS_MOBILE_768) {\n return chartWidth+chartMargin - chartWidth/2.4\n }else {\n return chartWidth+chartMargin - chartWidth/2.4\n }\n })\n .attr(\"y\", function() {\n if (IS_PHONE_500) {\n return chartWidth+chartMargin - chartWidth/1.45\n }else if (IS_MOBILE_768) {\n return chartWidth+chartMargin - chartWidth/2.4\n }else {\n return chartWidth+chartMargin - chartWidth/2.4\n }\n })\n .style(\"fill\", function(){\n if (d3.select(\"#revratio_\").classed(\"current\") == true){\n return \"#353535\"\n }else if (d3.select(\"#revpp_\").classed(\"current\") == true){\n return \"#ffffff\"\n }\n })\n //add the X axis\n\n //add the Y Axis\n map.append(\"g\")\n .attr(\"class\", function(d){ return \"y axis \" + d.key})\n .attr(\"transform\", \"translate(\" + chartMargin + \",0)\")\n .call(mapYAxis);\n map.append(\"g\")\n .attr(\"class\", \"x axis\")\n .attr(\"transform\", \"translate(0,\" + (chartWidth-chartMargin) + \")\")\n .call(mapXAxis);\n\n d3.select(\"#vis\")\n .append(\"div\")\n .attr(\"id\", \"ak-disclaimer\")\n .html(\"Alaska data are displayed on a separate y-axis scale (from <span id =\\\"ak-min\\\">\" + RATIO_FORMAT(min2)+ \"</span> to <span id =\\\"ak-max\\\">\" + RATIO_FORMAT(max2) + \"</span>) from the other 49 states.\")\n\n\n d3.select(\"#vis\")\n .append(\"div\")\n .attr(\"id\", \"note-blank\")\n .html(function() {\n return (d3.select(\"#revratio_\").classed(\"current\") == true) ? blankNote_1 : blankNote_2\n })\n }", "function changeLayersDraw() {\n \tshowloading();\n var mapurl = PM_XAJAX_LOCATION + 'x_load.php?'+SID+'&zoom_type=zoompoint';\n updateMap(mapurl);\n}", "function _cpdDraw() \n{\n\t// Get tile dimension\n\ttiledim = cpGetTileDimension();\n\t// Draw\n\t_cpdErase();\n\t_cpdDrawMap(\n\t (_cpCanvasObj.width - (_cpMapData.General.Size.X * tiledim)) / 2,\n\t (_cpCanvasObj.height - (_cpMapData.General.Size.Y * tiledim)) / 2);\n}", "returnToMap(){\n\t\tthis.setState({in: 87, out: 83, left: 65, right: 68});\n\t\tdocument.getElementById(\"over\").setAttribute('set_bind','true');\n\t}", "function mapDraw() {\n var bounds = path.bounds(accidents),\n topLeft = bounds[0],\n bottomRight = bounds[1];\n\n console.log(bounds);\n console.log('bottom right ' + bottomRight);\n console.log('top let' + topLeft);\n\n svg.attr(\"width\", bottomRight[0] - topLeft[0])\n .attr(\"height\", bottomRight[1] - topLeft[1])\n .style(\"left\", topLeft[0] + \"px\")\n .style(\"top\", topLeft[1] + \"px\");\n\n g.attr(\"transform\", \"translate(\" + -topLeft[0] + \",\" + -topLeft[1] + \")\");\n console.log(\"here\");\n feature.attr(\"d\", path);\n feature.attr(\"pointer-events\", \"visible\");\n feature.attr(\"date\", function (d) {\n return parseTimeDayMonthYear(d.properties.ACCIDENTDATE)\n });\n\n feature.on(\"mouseover\", function(d) {\n div.transition()\n .duration(200)\n .style(\"opacity\", .9);\n div\t.html('Date: ' + d.properties.ACCIDENTDATE + '<br>Street: ' + d.properties.ROAD_NAME + ' ' + d.properties.ROAD_TYPE)\n .style(\"left\", (d3.event.pageX) + \"px\")\n .style(\"top\", (d3.event.pageY - 28) + \"px\");\n })\n }", "function drawMap() {\n //Clears the canvas of drawn things\n console.log(\"drawing\");\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n //Draws tresuremap on canvas\n ctx.drawImage(treasuremap, 0, 0);\n}", "function createMap() {\n\tctx.fillStyle = 'black';\n\n // Create top and bottom borders.\n for (i = 0; i < width; i += side) {\n ctx.fillRect(i, 0, side, side);\n ctx.fillRect(i, height - side, side, side);\n }\n\n // Create left and right borders.\n for (i = 0; i < height; i += side) {\n ctx.fillRect(0, i, side, side);\n ctx.fillRect(width - side, i, side, side);\n }\n}", "function draw() {\n background(255);\n\n //call state machine function\n drawFunction();\n}", "function render() {\n loop(function (row, col) {\n x = (col * tileSize);\n y = (row * tileSize);\n\n // draw placements\n if (map[row][col] == 1) {\n context.fillStyle = \"#aa0000\";\n context.fillRect(x + tileOffset, y + tileOffset, tileSize - tileOffset, tileSize - tileOffset);\n }\n });\n }", "paintCanvas() {\n // Draw the tile map\n this.game.map.drawMap();\n\n // Draw dropped items\n this.game.map.drawItems();\n\n // Draw the NPCs\n this.game.map.drawNPCs();\n\n // Draw the player\n this.game.map.drawPlayer();\n\n // Draw the mouse selection\n this.game.map.drawMouse();\n }", "function draw_map(map) {\n for (let i = 0; i < map.length; i++) {\n let x1 = parseInt(i % 100);\n let x2 = parseInt(i / 100);\n drawcell(x1, x2, map[i]);\n }\n}", "function draw() {\n background(192);\n\n // will call your state machine function\n drawFunction();\n}", "function drawStates(states = []) {\n const mesh = topojson.mesh(atlas, createGeometryCollection(stateGeoms, states));\n return drawMesh(mesh);\n }", "function drawMap () {\n const winHill=new Point([ -1.721040,53.362571]).transform( 'EPSG:4326','EPSG:3857');\n const activityLayer = new LayerVector({\n style: function(feature) {\n return styles[feature.get('type')];\n },\n source: new VectorSource({}),\n name: 'activity' \n });\n const animationLayer = new LayerVector({\n updateWhileAnimating: true,\n updateWhileInteracting: true,\n source: new VectorSource({}),\n name: 'animation' \n });\n \n const osmLayer = new LayerTile({\n title: 'Open Steet Map',\n type: 'base',\n source: new OSM()\n });\n\n const osmTopoLayer = new LayerTile({\n title: 'OSM Topo',\n type: 'base',\n visible: false,\n source: new XYZ({\n url: 'https://{a-c}.tile.opentopomap.org/{z}/{x}/{y}.png'\n })\n });\n // OSMImpl.CycleMap(name)\n //{\n // \"url\" : \"http://tile2.opencyclemap.org/transport/{z}/{x}/{y}.png\"\n // }\n // https://a.tile.thunderforest.com/cycle/15/16234/10624.png?apikey=a5dd6a2f1c934394bce6b0fb077203eb\n const arcGISEsriTopoLayer=new LayerTile({\n title: 'ArcGIS Esri Topographical',\n type: 'base',\n visible: false,\n source: new XYZ({\n attributions:\n 'Tiles © <a href=\"https://services.arcgisonline.com/ArcGIS/' +\n 'rest/services/World_Topo_Map/MapServer\">ArcGIS</a>',\n url:\n 'https://server.arcgisonline.com/ArcGIS/rest/services/' +\n 'World_Topo_Map/MapServer/tile/{z}/{y}/{x}',\n }),\n });\n const arcGISEsriImagaryLayer=new LayerTile({\n title: 'ArcGIS Esri Image',\n type: 'base',\n visible: false,\n source: new XYZ({\n attributions:\n 'Tiles © <a href=\"https://services.arcgisonline.com/ArcGIS/' +\n 'rest/services/World_Imagery/MapServer\">ArcGIS</a>',\n url:\n 'https://server.arcgisonline.com/ArcGIS/rest/services/' +\n 'World_Imagery/MapServer/tile/{z}/{y}/{x}',\n }),\n }); \n\n\n const map = new Map({\n target: document.getElementById('map'),\n view: new View({\n center: winHill.flatCoordinates,\n zoom: 14,\n minZoom: 2,\n maxZoom: 19\n }),\n layers: [\n arcGISEsriTopoLayer,osmTopoLayer,arcGISEsriImagaryLayer,osmLayer\n ]\n });\n \n var layerSwitcher = new LayerSwitcher();\n map.addControl(layerSwitcher);\n\n return map;\n}", "function draw() {\n background(0);\n\n fill(255);\n rectMode(CENTER)\n rect(windowWidth/2,windowHeight/2,500,400)\n\n fill(0);\n\n // will call your state machine function\n drawFunction();\n fill(255);\n text(\"X: \" + mouseX + \" Y: \" + mouseY, 80, height - 20);\n}", "function generateMap()\r\n{\r\n\tif(ctx==null)\r\n\t{\r\n\t\treturn;\r\n\t}\r\n\tfor(var y = 0; y < mapH; y++)\r\n\t{\r\n\t\tfor(var x = 0; x < mapW; x++)\r\n\t\t{\r\n\t\t\tfor(var i = 0; i < gameTiles.length;i++)\r\n\t\t\t{\r\n\t\t\t\tswitch(gameTiles[((y*mapW)+x)].type)\r\n\t\t\t\t{\r\n\t\t\t\t\tcase 0:\r\n\t\t\t\t\t\tctx.fillStyle=\"green\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 1:\r\n\t\t\t\t\t\tctx.fillStyle=\"purple\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 2:\r\n\t\t\t\t\t\tctx.fillStyle=\"blue\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 3:\r\n\t\t\t\t\t\tctx.fillStyle=\"red\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tctx.fillStyle=\"black\";\r\n\t\t\t\t}\r\n\t\t\t\tctx.fillRect(x*tileW, y*tileH, tileW, tileH);\r\n\t\t\t}\t\r\n\t\t}\r\n\t}\r\n\trequestAnimationFrame(generateMap);\r\n}", "function drawMap(){\n\t\tvar height = gameArea.canvas.height();\n\t\tvar width = gameArea.canvas.width();\n\n var innerPaths = {\n strokeStyle : settings.wallColor,\n strokeWidth: settings.innerWallWidth,\n rounded : true,\n layer :true,\n name: 'map'\n };\n\n var borderPaths = {\n strokeStyle: settings.wallColor,\n strokeWidth: settings.outerWallWidth,\n rounded: true,\n layer: true,\n name: 'mapBorder'\n };\n \n var pathCount = 0;\n var borderPathCount = 0;\n \n for (var col = 0; col < settings.columns; col++) {\n for (var row = 0; row < settings.rows; row++) {\n \n var walls = gameMap.getTile([row, col]).getWalls();\n\n var y = row * (height / settings.rows);\n var x = col * (width / settings.columns);\n\n //north\n if (walls[0] && row !=0 ) {\n var yLineTo = (y + height / settings.rows);\n var xLineTo = (x + width / settings.columns);\n pathCount++;\n innerPaths[\"p\" + pathCount] = {\n type: 'line',\n x1: x, y1: y,\n x2: xLineTo, y2: y\n };\n } else if (walls[0] && row == 0){\n var yLineTo = (y + height / settings.rows);\n var xLineTo = (x + width / settings.columns);\n borderPathCount++;\n borderPaths[\"p\" + borderPathCount] = {\n type: 'line',\n x1: x, y1: y,\n x2: xLineTo, y2: y\n };\n }\n\n\n //east\n if (walls[1] && col != settings.columns-1) {\n var yLineTo = (y + height / settings.rows);\n var xLineTo = (x + width / settings.columns);\n\n pathCount++;\n innerPaths[\"p\" + pathCount] = {\n type: 'line',\n x1: xLineTo, y1: y,\n x2: xLineTo, y2: yLineTo\n };\n } else if (walls[1] && col == settings.columns - 1) {\n var yLineTo = (y + height / settings.rows);\n var xLineTo = (x + width / settings.columns);\n\n borderPathCount++;\n borderPaths[\"p\" + borderPathCount] = {\n type: 'line',\n x1: xLineTo, y1: y,\n x2: xLineTo, y2: yLineTo\n };\n }\n\n //south\n if (walls[2] && row != settings.rows-1) {\n var yLineTo = (y + height / settings.rows);\n var xLineTo = (x + width / settings.columns);\n\n pathCount++;\n innerPaths[\"p\" + pathCount] = {\n type: 'line',\n x1: x, y1: yLineTo,\n x2: xLineTo, y2: yLineTo\n };\n } else if (walls[2] && row == settings.rows - 1) {\n var yLineTo = (y + height / settings.rows);\n var xLineTo = (x + width / settings.columns);\n\n borderPathCount++;\n borderPaths[\"p\" + borderPathCount] = {\n type: 'line',\n x1: x, y1: yLineTo,\n x2: xLineTo, y2: yLineTo\n };\n }\n\n //west\n if (walls[3] && col != 0) {\n var yLineTo = (y + height / settings.rows);\n var xLineTo = (x + width / settings.columns);\n\n pathCount++;\n innerPaths[\"p\" + pathCount] = {\n type: 'line',\n x1: x, y1: y,\n x2: x, y2: yLineTo\n };\n\n } else if (walls[3] && col == 0) {\n var yLineTo = (y + height / settings.rows);\n var xLineTo = (x + width / settings.columns);\n\n borderPathCount++;\n borderPaths[\"p\" + borderPathCount] = {\n type: 'line',\n x1: x, y1: y,\n x2: x, y2: yLineTo\n };\n }\n \n }\n }\n\n gameArea.canvas.drawPath(innerPaths);\n gameArea.canvas.drawPath(borderPaths);\n\t}", "function drawMap (map, data, selectedMinYear, selectedMaxYear) {\n // Create object to hold each state and it corresponding value\n // based on a single year {\"statename\": value, ...}\n var valuesByState = window.vbs = {};\n\n // Iterate over the full dataset and move state name and value into object for the selectedMaxYear\n data.forEach(function (d, i) {\n valuesByState[d.GeoName] = +d.Years[selectedMaxYear];\n });\n \n // Create an array containing the min and max values \n var yearValuesRange = d3.extent(d3.values(valuesByState));\n console.log('yearvalrange', yearValuesRange);\n var color = setQuantileColorScale(yearValuesRange,viewColors.econ);\n var states = topojson.feature(map, map.objects.units).features;\n\n g.selectAll(\".states\")\n .data(states)\n .enter().append(\"path\")\n .attr(\"d\", path)\n .style('stroke', '#FFF')\n .style('stroke-width', 1)\n .style('fill', function (d) {\n console.log('color', color(valuesByState[d.properties.name]),'val',valuesByState[d.properties.name]);\n return color(valuesByState[d.properties.name]);\n });\n }", "function drawMapAt(new_left, new_top) {\n// statusMessage(' A:'+new_left+' / ' + mapSize.width + ' ,'+new_top);\n\t// troppo a destra\n\tif (-new_left + MAP_AREA_WIDTH > mapSize.width) {\n\t\tnew_left = MAP_AREA_WIDTH - mapSize.width;\n\t}\n\t// troppo a sinistra\n\tif (new_left > 0) {\n\t\tnew_left = 0;\n\t}\n\t// troppo in basso\n\tif (-new_top + MAP_AREA_HEIGHT > mapSize.height) {\n\t\tnew_top = MAP_AREA_HEIGHT - mapSize.height;\n\t}\n\t// troppo in alto\n\tif (new_top > 0) {\n\t\tnew_top = 0;\n\t}\n\tcurrentMap.style.top = new_top + 'px';\n\tcurrentMap.style.left = new_left + 'px';\n\tcurrentMapPosition = {x:new_left, y:new_top};\t\n}", "function DrawMap() {\n\n map = document.createElement('div');\n\n let tiles = this.CreateTiles(gameData);\n\n for (let tile of tiles) {\n map.appendChild(tile);\n }\n\n document.body.appendChild(map);\n}", "function MapDisplay() {\n //setup map dims from html form\n let mapHeight = document.getElementById('height').value;\n let mapWidth = document.getElementById('width').value;\n\n var mapArray = FullMap(mapHeight, mapWidth);\n\n const mapTable = document.getElementById(\"mapTable\");\n \n //clears old map, if it exists\n while(mapTable.firstChild) {\n mapTable.removeChild(mapTable.firstChild);\n }\n \n //draw the map out\n for (let i = 0; i < mapArray.length; i++ ) {\n var newRow = mapTable.insertRow(i);\n newRow.setAttribute(\"id\", \"mapRow\");\n\n for (let j = 0; j < mapArray[i].length; j++) {\n var newCell = newRow.insertCell(j);\n if (mapArray[i][j].cellValue == 1) {\n newCell.setAttribute(\"id\", \"mapCellWall\");\n }\n else {\n newCell.setAttribute(\"id\", \"mapCellSpace\");\n }\n }\n }\n}", "function drawMap() {\n am4core.useTheme(am4themes_animated);\n //Making properties amCharts readable...\n mapData = [];\n for (var i = 0; i < window[mortalityData].length; i++) {\n mapData.push({\n name: window[mortalityData][i][\"Country Name\"],\n id: window[mortalityData][i].id,\n value: window[mortalityData][i][currentYear]\n });\n }\n // console.log(mapData);\n //Start map creation\n mapChart = am4core.create(\"mapdiv\", am4maps.MapChart);\n mapChart.geodata = am4geodata_worldLow;\n mapChart.projection = new am4maps.projections.Miller();\n\n //Configure map's data...\n mapPolygonSeries = mapChart.series.push(new am4maps.MapPolygonSeries());\n mapPolygonSeries.useGeodata = true;\n mapPolygonSeries.data = mapData;\n mapPolygonSeries.exclude = [\"AQ\"];\n\n polygonTemplate = mapPolygonSeries.mapPolygons.template;\n polygonTemplate.applyOnClones = true;\n polygonTemplate.togglable = true;\n polygonTemplate.tooltipText = \"[bold]{name} ({id})[/]\";\n polygonTemplate.nonScalingStroke = true;\n polygonTemplate.strokeOpacity = 0.6;\n // polygonTemplate.fill = mapChart.colors.getIndex(0);\n\n //Create heat rules for country colors\n mapPolygonSeries.heatRules.push({\n property: \"fill\",\n target: polygonTemplate,\n min: am4core.color(\"#ff4e50\"),\n max: am4core.color(\"#f9d423\")\n });\n\n var heatLegend = mapChart.createChild(am4maps.HeatLegend);\n heatLegend.series = mapPolygonSeries;\n heatLegend.width = am4core.percent(100);\n heatLegend.valueAxis.renderer.labels.template.fontSize = 20;\n // heatLegend.valueAxis.renderer.minGridDistance = 3000;\n // heatLegend.orientation = \"vertical\";\n heatLegend.markerCount = 10;\n heatLegend.valueAxis.stroke = \"#000000\";\n\n var selectState = polygonTemplate.states.create(\"active\");\n selectState.properties.fill = mapChart.colors.getIndex(2);\n var hoverState = polygonTemplate.states.create(\"hover\");\n hoverState.properties.fill = mapChart.colors.getIndex(4);\n\n polygonTemplate.events.on(\"hit\", function(event) {\n target = event.target;\n target.isActive = target.isActive;\n var id = target.dataItem.dataContext.id;\n toggleLineSeries(id);\n });\n\n //Configure legend tooltip\n var legendTooltip = heatLegend.valueAxis.tooltip;\n legendTooltip.background.stroke = am4core.color(\"#ffffff\");\n legendTooltip.text = \"[bold]{value}[/]\";\n legendTooltip.fontSize = 20;\n\n //Add tooltip animation for value axis\n polygonTemplate.events.on(\"over\", function(ev) {\n if (!isNaN(ev.target.dataItem.value)) {\n heatLegend.valueAxis.showTooltipAt(ev.target.dataItem.value);\n } else {\n heatLegend.valueAxis.hideTooltip();\n }\n });\n\n polygonTemplate.events.on(\"out\", function(ev) {\n heatLegend.valueAxis.hideTooltip();\n });\n\n // mapChart.smallMap = new am4maps.SmallMap();\n // mapChart.smallMap.align = \"right\";\n // mapChart.smallMap.valign = \"top\";\n // mapChart.smallMap.series.push(mapPolygonSeries);\n // mapChart.smallMap.background = am4core.color(\"#000000\");\n\n //Zoom controls\n mapChart.zoomControl = new am4maps.ZoomControl();\n\n //Add Home Button for Map\n var homeButton = new am4core.Button();\n homeButton.events.on(\"hit\", function() {\n mapChart.goHome();\n });\n homeButton.icon = new am4core.Sprite();\n homeButton.padding(7, 5, 7, 5);\n homeButton.width = 30;\n homeButton.icon.path =\n \"M16,8 L14,8 L14,16 L10,16 L10,10 L6,10 L6,16 L2,16 L2,8 L0,8 L8,0 L16,8 Z M16,8\";\n homeButton.marginBottom = 5;\n homeButton.parent = mapChart.zoomControl;\n homeButton.insertBefore(mapChart.zoomControl.plusButton);\n\n //Add timeline slider to the chart\n //Create slider in new DIV\n var slider = am4core.create(\"map_slider\", am4core.Slider);\n slider.valign = \"bottom\";\n slider.paddingLeft = 15;\n slider.paddingRight = 15;\n slider.startGrip.background.fill = mapChart.colors.getIndex(2);\n slider.startGrip.background.states.getKey(\n \"hover\"\n ).properties.fill = mapChart.colors.getIndex(4);\n var yearText = document.getElementById(\"year_text\");\n slider.events.on(\"up\", function() {\n updateChart();\n });\n slider.events.on(\"rangechanged\", function() {\n currentYear = getYearFromSlider(slider.start);\n yearText.innerHTML = currentYear;\n });\n}", "function draw() {\n background(172, 233, 255);\n textSize(size);\n fill(0);\n\n // will call your state machine function\n drawFunction();\n}", "draw(state)\n {\t\n\t\tconst _context = state.context;\n\t\t_context.save();\n\t\t_context.fillStyle = \"#fff\";\n\t\tvar starNum = this.stars.length,\n\t\tzoom = state.zoom,\n\t\tx = state.zx,\n\t\ty = state.zy;\n\t\t\t\n\t\tfor(var star = 0; star < starNum; star++){\n\t\t\t_context.fillRect((this.stars[star].x - x) * zoom, (this.stars[star].y*zoom)-y, this.stars[star].size, this.stars[star].size);\n\t\t}\n\t\t_context.restore();\n }", "function showMap() {\n\tupdateMoneyInfo();\n\n\tdocument.getElementById(\"top_section\").innerHTML = MAP_UPPER_SECTION_HTML;\n\n\tinitMap();\n\tresizeAllCells();\n\tredrawMap();\n\n\tvar arrowSize = document.getElementById(\"arrow_left\").offsetWidth;\n\tdocument.getElementById(\"arrow_up\").style.height = arrowSize + \"px\";\n\tdocument.getElementById(\"arrow_down\").style.height = arrowSize + \"px\";\n\n\tblockAllButtons();\n\tunblockAllButtons();\n}", "function addUSMap(usmap, args) {\n if (args == null) args = {};\n var numCanvas = \"county\" in usmap ? 2 : 1;\n if (\"pyramid\" in args && args.pyramid.length != numCanvas)\n throw new Error(\n \"Adding USMap: args.pyramid does not have matching number of canvases\"\n );\n\n // add to project\n this.usmaps.push(usmap);\n\n // rendering params\n var rpKey = \"usmap_\" + (this.usmaps.length - 1);\n var rpDict = {};\n rpDict[rpKey] = usmap.params;\n this.addRenderingParams(rpDict);\n\n // ================== state map canvas ===================\n var canvases = [];\n var stateMapCanvas;\n if (\"pyramid\" in args) stateMapCanvas = args.pyramid[0];\n else {\n stateMapCanvas = new Canvas(\n \"usmap\" + (this.usmaps.length - 1) + \"_\" + \"state\",\n usmap.stateMapWidth,\n usmap.stateMapHeight\n );\n this.addCanvas(stateMapCanvas);\n }\n if (\n stateMapCanvas.w != usmap.stateMapWidth ||\n stateMapCanvas.h != usmap.stateMapHeight\n )\n throw new Error(\"Adding USMap: state canvas sizes do not match\");\n\n // static legends layer\n var stateMapLegendLayer = new Layer(null, true);\n stateMapCanvas.addLayer(stateMapLegendLayer);\n stateMapLegendLayer.addRenderingFunc(\n usmap.getUSMapRenderer(\"stateMapLegendRendering\")\n );\n stateMapLegendLayer.setUSMapId(this.usmaps.length - 1 + \"_\" + 0);\n\n // state boundary layer\n var stateMapTransform = new Transform(\n `SELECT name, ${usmap.stateRateCol}, geomstr \n FROM ${usmap.stateTable}`,\n usmap.db,\n usmap.getUSMapTransformFunc(\"stateMapTransform\"),\n [\"bbox_x\", \"bbox_y\", \"name\", \"rate\", \"geomstr\"],\n true\n );\n var stateBoundaryLayer = new Layer(stateMapTransform, false);\n stateMapCanvas.addLayer(stateBoundaryLayer);\n stateBoundaryLayer.addPlacement({\n centroid_x: \"col:bbox_x\",\n centroid_y: \"col:bbox_y\",\n width: `con:${usmap.stateMapWidth / usmap.zoomFactor}`,\n height: `con:${usmap.stateMapWidth / usmap.zoomFactor}`\n });\n stateBoundaryLayer.addRenderingFunc(\n usmap.getUSMapRenderer(\"stateMapRendering\")\n );\n stateBoundaryLayer.addTooltip(\n [\"name\", \"rate\"],\n [\"State\", usmap.tooltipAlias]\n );\n stateBoundaryLayer.setUSMapId(this.usmaps.length - 1 + \"_\" + 0);\n\n // add to canvases (return)\n canvases.push(stateMapCanvas);\n\n // ========== Views ===============\n if (!(\"view\" in args)) {\n var view = new View(\n \"usmap\" + (this.usmaps.length - 1),\n usmap.stateMapWidth,\n usmap.stateMapHeight\n );\n this.addView(view);\n this.setInitialStates(view, stateMapCanvas, 0, 0);\n } else if (!(args.view instanceof View)) {\n throw new Error(\"Adding USMap: view must be a View object\");\n }\n\n // ================== county map canvas ===================\n if (\"countyTable\" in usmap) {\n var countyMapCanvas;\n if (\"pyramid\" in args) countyMapCanvas = args.pyramid[1];\n else {\n countyMapCanvas = new Canvas(\n \"usmap\" + (this.usmaps.length - 1) + \"_\" + \"county\",\n usmap.stateMapWidth * usmap.zoomFactor,\n usmap.stateMapHeight * usmap.zoomFactor\n );\n this.addCanvas(countyMapCanvas);\n }\n if (\n countyMapCanvas.w != usmap.stateMapWidth * usmap.zoomFactor ||\n countyMapCanvas.h != usmap.stateMapHeight * usmap.zoomFactor\n )\n throw new Error(\"Adding USMap: county canvas sizes do not match\");\n\n // static legends layer\n var countyMapLegendLayer = new Layer(null, true);\n countyMapCanvas.addLayer(countyMapLegendLayer);\n countyMapLegendLayer.addRenderingFunc(\n usmap.getUSMapRenderer(\"countyMapLegendRendering\")\n );\n countyMapLegendLayer.setUSMapId(this.usmaps.length - 1 + \"_\" + 1);\n\n // thick state boundary layer\n var countyMapStateBoundaryTransform = new Transform(\n `SELECT geomstr FROM ${usmap.stateTable}`,\n usmap.db,\n usmap.getUSMapTransformFunc(\"countyMapStateBoundaryTransform\"),\n [\"bbox_x\", \"bbox_y\", \"bbox_w\", \"bbox_h\", \"geomstr\"],\n true\n );\n var countyMapStateBoundaryLayer = new Layer(\n countyMapStateBoundaryTransform,\n false\n );\n countyMapCanvas.addLayer(countyMapStateBoundaryLayer);\n countyMapStateBoundaryLayer.addPlacement({\n centroid_x: \"col:bbox_x\",\n centroid_y: \"col:bbox_y\",\n width: \"col:bbox_w\",\n height: \"col:bbox_h\"\n });\n countyMapStateBoundaryLayer.addRenderingFunc(\n usmap.getUSMapRenderer(\"countyMapStateBoundaryRendering\")\n );\n countyMapStateBoundaryLayer.setUSMapId(\n this.usmaps.length - 1 + \"_\" + 1\n );\n\n // county boundary layer\n var countyMapTransform = new Transform(\n `SELECT name, ${usmap.countyRateCol}, geomstr\n FROM ${usmap.countyTable};`,\n usmap.db,\n usmap.getUSMapTransformFunc(\"countyMapTransform\"),\n [\"bbox_x\", \"bbox_y\", \"bbox_w\", \"bbox_h\", \"name\", \"rate\", \"geomstr\"],\n true\n );\n var countyBoundaryLayer = new Layer(countyMapTransform, false);\n countyMapCanvas.addLayer(countyBoundaryLayer);\n countyBoundaryLayer.addPlacement({\n centroid_x: \"col:bbox_x\",\n centroid_y: \"col:bbox_y\",\n width: \"col:bbox_w\",\n height: \"col:bbox_h\"\n });\n countyBoundaryLayer.addRenderingFunc(\n usmap.getUSMapRenderer(\"countyMapRendering\")\n );\n countyBoundaryLayer.addTooltip(\n [\"name\", \"rate\"],\n [\"County\", usmap.tooltipAlias]\n );\n countyBoundaryLayer.setUSMapId(this.usmaps.length - 1 + \"_\" + 1);\n\n // add to canvases (return)\n canvases.push(countyMapCanvas);\n\n // =============== jump ===============\n if (usmap.zoomType == \"literal\") {\n this.addJump(\n new Jump(stateMapCanvas, countyMapCanvas, \"literal_zoom_in\")\n );\n this.addJump(\n new Jump(countyMapCanvas, stateMapCanvas, \"literal_zoom_out\")\n );\n } else if (usmap.zoomType == \"jump\") {\n var selector = new Function(\n \"row\",\n \"args\",\n `return args.layerId = ${stateMapCanvas.layers.length - 1}`\n );\n var newPredicates = function() {\n return {};\n };\n var newViewportBody = function(row, args) {\n var zoomFactor = REPLACE_ME_zoomfactor;\n var vpW = args.viewportW;\n var vpH = args.viewportH;\n return {\n constant: [\n row.bbox_x * zoomFactor - vpW / 2,\n row.bbox_y * zoomFactor - vpH / 2\n ]\n };\n };\n var newViewport = new Function(\n \"row\",\n \"args\",\n getBodyStringOfFunction(newViewportBody).replace(\n /REPLACE_ME_zoomfactor/g,\n usmap.zoomFactor\n )\n );\n var jumpName = function(row) {\n return \"County map of \" + row.name;\n };\n this.addJump(\n new Jump(\n stateMapCanvas,\n countyMapCanvas,\n \"geometric_semantic_zoom\",\n {\n selector: selector,\n viewport: newViewport,\n predicates: newPredicates,\n name: jumpName\n }\n )\n );\n }\n }\n\n return {pyramid: canvases, view: args.view ? args.view : view};\n}", "displayMap() {\n // show the toolbar by pressing H.\n if (keys[keyH]) {\n if (this.map.length == 0)\n this.creatorMode();\n this.hide = false;\n }\n // draw tiles from the tilemap on the canvas\n if (this.map.length == 0)\n return;\n for (let y = 0; y < round(height / this.tileH); y++) {\n for (let x = 0; x < round(width / this.tileW); x++) {\n this.drawTile(this.map[y][x].name, x * this.tileW, y * this.tileH);\n }\n }\n // display toolbar if it's not in hidden mode\n if (this.hide)\n return;\n stroke(0, 0, 0);\n fill(0);\n rect(0, height - this.tileH, width, this.tileH);\n for (let i = 0; i < this.tiles.length; i++) {\n image(this.img, i * this.tileW + i, height - this.tileH, this.tileW, this.tileH,\n this.tiles[i].xOff, this.tiles[i].yOff, this.tileW, this.tileH);\n }\n fill(255);\n rect(width - this.tileW, height - this.tileH, this.tileW, this.tileH);\n fill(255, 0, 0);\n textAlign(CENTER);\n textSize(this.tileW / 3);\n text(\"hide\", width - this.tileW + (this.tileW / 2), height - (this.tileH / 2));\n // draw grid lines\n for (let i = 0; i < round(height / this.tileH); i++) {\n line(0, i * this.tileH, width, i * this.tileH);\n }\n for (let i = 0; i < round(width / this.tileW); i++) {\n line(i * this.tileW, 0, i * this.tileW, height - this.tileH);\n }\n noFill();\n stroke(255, 0, 0);\n strokeWeight(2);\n try {\n rect(round(mouseX / this.tileW) * this.tileW, round(mouseY / this.tileH) * this.tileH, this.tileW, this.tileH);\n } catch (err) {\n console.log(\"mouse out of canvas. - indicator unshown.\");\n }\n stroke(0);\n strokeWeight(1);\n }", "function updateStateMaps() {\n // XXX\n }", "function draw_map(dataset)\n{\n\tif(dataset == 'Divvy')\n\t\tcenter_coords = [41.84,-87.65]\n\telse if(dataset == 'New York Taxi')\n\t\tcenter_coords = [40.68,-73.8]\n\n\tmap = L.map('mapid').setView(center_coords, 11);\n\tL.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoiZW5pc24iLCJhIjoiY2l1NXRqOWowMDAxejJ0cWoyNmNhdGwxdSJ9.6AImF4A-ZBf_VmKTHGJLOA', {\n\t\tmaxZoom: 15,\n\t\tattribution: 'Map data &copy; <a href=\"http://openstreetmap.org\">OpenStreetMap</a> contributors, ' +\n\t\t\t'<a href=\"http://creativecommons.org/licenses/by-sa/2.0/\">CC-BY-SA</a>, ' +\n\t\t\t'Imagery © <a href=\"http://mapbox.com\">Mapbox</a>',\n\t\tid: 'mapbox.streets'\n\t}).addTo(this.map);\n\tsidebar = L.control.sidebar('sidebar').addTo(this.map);\n}", "function recolorMap(candyIndex) {\n assembleRatings(candyIndex);\n d3.json(\"Assets/states-10m.json\", drawMap); \n}", "function drawMap() {\n\tvar path = d3.geo.path();\n\n\tvar svg = d3.select(\"#choroplethGraph\")\n\t\t.append(\"svg\")\n\t\t.attr(\"id\", \"chosvg\")\n\t\t.attr(\"height\", xHeight) \n\t\t.attr(\"viewBox\", \"0 0 960 500\")\n\t .attr(\"width\", xWidth)\n\t .attr(\"preserveAspectRatio\", \"true\");\n\n\tcounties = svg.append(\"g\")\n\t\t\t.attr(\"id\", \"counties\")\n\t\t\t.attr(\"class\", \"Blues\");\n\n\tvar states = svg.append(\"g\")\n\t\t\t.attr(\"id\", \"states\");\n\n\ttooltip = d3.select(\"body\")\n\t\t.append(\"div\")\n\t\t.attr(\"id\",\"tooltip\")\n\n\td3.json(\"us-counties.json\", function(json) {\n\t\tcounties.selectAll(\"path\")\n\t\t\t\t.data(json.features)\n\t\t\t.enter().append(\"path\")\n\t\t\t\t.attr(\"class\", data ? quantize : null)\n\t\t\t\t.attr(\"d\", path)\n\t\t\t \t.on(\"mouseover\", function(d){\n\t\t\t \t\ttooltip.text(d.properties.name + \" County: \" + data[d.id]['sum'] + \" Signers\");\n\t\t\t \t\td3.select(this).style('stroke-width','4px');\n\t\t\t \t\td3.select(this).style('stroke','red');\n\t\t\t \t\ttooltip.style(\"visibility\", \"visible\");\n\t\t\t \t})\n\t\t\t\t.on(\"mousemove\", function(){\n\t\t\t\t\ttooltip.style(\"top\", (event.pageY-10)+\"px\").style(\"left\",(event.pageX+10)+\"px\");})\n\t\t\t\t.on(\"mouseout\", function(){\n\t\t\t\t\td3.select(this).style('stroke-width','.25px');\n\t\t\t\t\td3.select(this).style('stroke','grey');\n\t\t\t\t\ttooltip.style(\"visibility\", \"hidden\");});\n\t;\n\t});\n\n\td3.json(\"us-states.json\", function(json) {\n\t\tstates.selectAll(\"path\")\n\t\t\t\t.data(json.features)\n\t\t\t.enter().append(\"path\")\n\t\t\t\t.attr(\"d\", path);\n\t});\n}", "drawMap() {\n for (let row = 0; row < this.tilemapSize.rows; row++) {\n for (let col = 0; col < this.tilemapSize.cols; col++) {\n const tile = this.tilemap[row][col];\n const srcY = tile[0] * this.tileSize;\n const srcX = tile[1] * this.tileSize;\n const dstY = row * this.tileSize;\n const dstX = col * this.tileSize;\n \n this.buffer.drawImage(this.tileset,\n srcX, srcY, this.tileSize, this.tileSize,\n dstX, dstY, this.tileSize, this.tileSize);\n }\n }\n }", "function view_contact_draw_map() {\n\n // Draw San Francisco Map\n\n var element = document.getElementById(\"contact-location-map-san-francisco\");\n var latitude = 37.7893041;\n var longitude = -122.4003783;\n var tooltip_content =\n \"<div id='content'>\"+\n \"<h5 class='flush-top short'>Mesosphere San Francisco Office</h5>\" +\n \"<p class='flush-bottom'>\" +\n \"88 Stevenson St</br>\" +\n \"San Francisco, CA 94107\" +\n \"</p>\" +\n \"</div>\";\n\n draw_map(element, latitude, longitude, tooltip_content);\n\n // Draw Hamburg Map\n\n element = document.getElementById(\"contact-location-map-germany\");\n latitude = 53.54386;\n longitude = 10.02979;\n tooltip_content =\n \"<div id='content'>\"+\n \"<h5 class='flush-top short'>Mesosphere Hamburg Office</h5>\" +\n \"<p class='flush-bottom'>\" +\n \"Friesenstraße 13, 20097</br>\" +\n \"Hamburg, Germany\" +\n \"</p>\" +\n \"</div>\";\n\n draw_map(element, latitude, longitude, tooltip_content);\n\n // Draw NY Map\n\n element = document.getElementById(\"contact-location-map-new-york\");\n latitude = 40.7483005;\n longitude = -73.990655;\n tooltip_content =\n \"<div id='content'>\"+\n \"<h5 class='flush-top short'>Mesosphere New York Office</h5>\" +\n \"<p class='flush-bottom'>\" +\n \"132 West 31st St</br>\" +\n \"New York, NY 10001\" +\n \"</p>\" +\n \"</div>\";\n\n draw_map(element, latitude, longitude, tooltip_content);\n\n }", "function DrawMiniMap()\n{\n\tvar localPosition = WorldToLocal(mapOrigin.x, mapOrigin.y, 1);\n\tvar color=0x47474F;\n\tvar size= miniMapBorder;\n\te.lineStyle(size, color);\n\te.beginFill(0x40420);\n\te.drawCircle(mapOrigin.x, mapOrigin.y, miniMapRadius);\n\te.endFill();\n}", "function makeMyMap(error, states, points) {\n svg\n .append(\"path\")\n .datum(topojson.feature(states, states.objects.usStates))\n .attr(\"d\", path)\n .attr(\"class\", \"states\");\n svg\n .selectAll(\".points\")\n .data(points.features)\n .enter()\n .append(\"path\")\n .attr(\"d\", path.pointRadius(10))\n .attr(\"class\", \"points\");\n}", "function renderMap(){\n clearMap();\n var currentVertice\n for(var y = 0; y < scaledHeight+1; y++){\n for(var x = 0; x < scaledHeight+1; x++){\n if(renderTopLeft[0]+x >= 0 && renderTopLeft[0] + x < vertices.length){\n if(renderTopLeft[1]+y >= 0 && renderTopLeft[1]+y < vertices[x].length){\n currentVertice = vertices[renderTopLeft[0]+x][renderTopLeft[1]+y];\n\n // check rooms\n for(var i = 0; i < allRooms.length; i++){\n if(allRooms[i].getTopLeft() == currentVertice && allRooms[i].found == true){\n allRooms[i].activateAllVertice();\n allRooms[i].draw();\n }\n }\n // check passageways\n for(var i = 0; i < allPassageways.length; i++){\n if(allPassageways[i].getTopLeft() == currentVertice && allPassageways[i].found == true){\n allPassageways[i].draw();\n }\n }\n\n // check doors\n for(var i = 0; i < allDoors.length; i++){\n if(allDoors[i].getTopLeft() == currentVertice && allDoors[i].found === true){\n allDoors[i].draw(allDoors[i].getDirection());\n }\n }\n\n // check all chests\n for(var i = 0; i < allChests.length; i++){\n if(allChests[i].found == true){\n if(allChests[i].getTopLeft() == currentVertice){\n allChests[i].draw();\n }\n }\n }\n\n // checks all traps\n for(var i = 0; i < allTraps.length; i++){\n if(allTraps[i].found === true){\n if(allTraps[i].getTopLeft() == currentVertice){\n allTraps[i].draw();\n }\n }\n }\n\n }\n }\n }\n }\n}", "function drawmap(ASes, Links, canvas, title, order, is_init) {\n\tif( is_init ) {\n\t makeTable(ASes, canvas, title);\n\t}\n\tASCoreMap(canvas, ASes, Links, order);\n\t$('canvas#'+canvas).parent().find('h2.loading').hide();\n\t$('canvas#'+canvas).show();\n\t$('body > h2.loading').append(\".\");\n\taddEvents();\n\tif( is_init && canvas == data[data.length-1][3]) {\n\t $('body > h2.loading').html(\"Now loading .\");\n\t $('h2.loading').hide();\n\t $('.container').fadeIn('slow');\n\t CountryRank('ccrank', ccRank);\n\t is_init = null;\n\t}\n }", "function drawBaseMap() {\n svgMap.append(\"path\")\n .datum(topojson.feature(data, data.objects.countries))\n .attr('d', path);\n\n svgMap.append(\"path\")\n .datum(topojson.feature(data, data.objects.territories))\n .attr('d', path);\n\n // Create paths for all countries + territories in the dataset\n svgMap.selectAll('.country')\n .data(features)\n .enter().append('path')\n .attr('class', function(d) { return \"country \" + d.properties.iso_a2.toLowerCase(); })\n .attr('d', path);\n }", "function draw()\n {\n var ctx = $(\"map-overview\").getContext('2d');\n \n var halfWidthMap = overviewImage.width/2;\n var halfHeightMap = overviewImage.height/2;\n\n // mapping between 1 px and 1 'world unit'\n // the following values come from \"cl_leveloverview\"\n var posX = -overviewInfo[\"pos_x\"];\n var posY = overviewInfo[\"pos_y\"];\n \n var x_unit_to_pixel = (halfWidthMap/posX);\n var y_unit_to_pixel = (halfHeightMap/posY);\n \n ctx.clearRect(0,0, overviewImage.width, overviewImage.height);\n ctx.drawImage(overviewImage, 0, 0);\n \n ctx.save();\n \n // move the drawing cursor to the center of the image\n ctx.translate(halfWidthMap, halfHeightMap);\n \n for (var i = 0, len = interpolatedPlayers.length; i < len; i++)\n {\n var iplayer = interpolatedPlayers[i];\n \n ctx.save();\n \n // Position\n ctx.translate(iplayer[\"iposx\"]*x_unit_to_pixel, -iplayer[\"iposy\"]*y_unit_to_pixel);\n\n // Team\n switch (iplayer[\"player\"][\"teamNumber\"])\n {\n case 0:\n ctx.strokeStyle = ctx.fillStyle = \"red\";\n break;\n case 1:\n ctx.strokeStyle = ctx.fillStyle = \"blue\";\n break;\n default:\n ctx.strokeStyle = ctx.fillStyle = \"yellow\";\n break;\n }\n \n // Name\n ctx.font = \"7pt Arial\";\n var str = iplayer[\"player\"][\"name\"];\n var strSize = ctx.measureText(str);\n ctx.fillText(str, -Math.round(strSize.width)/2, -10);\n \n // Rotation\n ctx.rotate(-iplayer[\"iyaw\"] * (Math.PI/180));\n \n // Circle + direction drawing\n ctx.beginPath();\n var wCursor = 3;\n ctx.lineTo(-wCursor, 0);\n ctx.lineTo(wCursor*2, 0);\n ctx.arc(0, 0, wCursor, 0, Math.PI*2);\n ctx.stroke(); // or fill();\n ctx.closePath();\n \n // \"Look at\" drawing\n //ctx.translate(-sight.width/2, -sight.height/2);\n //ctx.drawImage(sight, 0, 0);\n //ctx.drawImage(cursor, 0, 0);\n \n ctx.restore();\n }\n ctx.restore();\n }", "function draw() {\n background(0);\n\n for(let i = 0; i < values.length; i++) {\n noStroke();\n if(states[i] === 0) {\n fill('#E0777D')\n } else if(states[i] === 1) {\n fill('#00E640')\n } else {\n fill(255);\n }\n strokeWeight(1);\n stroke(51);\n rect(i * w, height - values[i], w, values[i])\n }\n}", "function draw() {\n if (mapReady) {\n clear();\n let zoom = myMap.zoom();\n\n // show current year/month\n textSize(28);\n fill(50);\n text(str(year) + ' - ' + monthsnames[month], 20, height - 50);\n\n // draw asylum seekers\n noStroke();\n for (let entry of monthly_flow[year][month]) {\n let [from, to, count] = entry;\n let start_coord = countries2coord[from];\n let end_coord = countries2coord[to];\n\n if (count > 100) {\n if (start_coord != undefined && end_coord != undefined) {\n // Only draw them if the position is inside the current map bounds. We use a\n // Leaflet method to check if the lat and lng are contain inside the current\n // map. This way we draw just what we are going to see and not everything. See\n // getBounds() in http://leafletjs.com/reference-1.1.0.html\n if (\n myMap.map\n .getBounds()\n .contains({ lat: start_coord[0], lng: start_coord[1] }) ||\n myMap.map.getBounds().contains({ lat: end_coord[0], lng: end_coord[1] })\n ) {\n // Transform lat/lng to pixel position\n start = myMap.latLngToPixel(start_coord);\n end = myMap.latLngToPixel(end_coord);\n\n stroke(100, 30);\n //strokeWeight(count / 100);\n line(start.x, start.y, end.x, end.y);\n let alpha = sin(progress * HALF_PI);\n let px = start.x * (1 - alpha) + end.x * alpha;\n let py = start.y * (1 - alpha) + end.y * alpha;\n noStroke();\n fill(lerpColor(start_color, end_color, progress));\n ellipse(px, py, (count * zoom) / scaling);\n //ellipse(start.x, start.y, 10);\n //ellipse(end.x, end.y, 10);\n }\n }\n }\n }\n // show next month asylum seekers to smoothen transition\n if (month < 11) {\n fill(start_color);\n noStroke();\n for (let entry of monthly_flow[year][month + 1]) {\n let [from, _, count] = entry;\n let start_coord = countries2coord[from];\n\n if (count > 100) {\n if (start_coord != undefined) {\n start = myMap.latLngToPixel(start_coord);\n ellipse(start.x, start.y, ((count * zoom) / scaling) * progress);\n }\n }\n }\n }\n\n // show slider selection\n if (selecting_year && mouseIsPressed) {\n textSize(28);\n fill(50);\n text(str(slider.value()), mouseX, mouseY - 20);\n }\n\n // update progress\n if (progress < 1) {\n progress += 0.01;\n } else {\n progress = 0;\n if (month < 11) {\n month += 1;\n } else {\n month = 0;\n if (year < 2017) {\n year += 1;\n } else {\n year = 1999;\n }\n slider.value(year);\n }\n }\n }\n}", "function mapButton()\n{\n ctx.strokeStyle = \"white\";\n ctx.strokeRect = (770,30,70,70);\n}", "function paint() {\n\n\t\t\tpaintStones();\n\n\t\t\t// Tag the current move\n\t\t\tif (goMap.currentMoveIndex > 0) {\n\t\t\t\tpaintCurrentMove();\n\t\t\t}\n\n\t\t\tif (displayNum) {\n\t\t\t\tpaintNumbers();\n\t\t\t}\n\t\t}", "function brushend() {\n mapUpdate();\n}", "drawMap() {\n // Calculate total market cap of each state \n this.stateData.forEach(function (element) {\n element.marketCap = 0;\n });\n for (let company of this.companyData) {\n this.company_id_dict[company.company_id] = company.company;\n for (let state of this.stateData) {\n if (company.state.includes(state.abbreviation)) {\n state.marketCap += parseInt(company.market_cap);\n }\n }\n }\n for (let state of this.stateData) {\n this.totalMarketCap += state.marketCap;\n }\n\n // Filter company links for companies we have\n let newCompLinks = [];\n for (let link of this.compLinks) {\n let fr = link.from_company_id;\n let to = link.to_company_id;\n let from_lat = false;\n let from_lng = false;\n let to_lat = false;\n let to_lng = false;\n for (let company of this.companyData) {\n if (company.company_id === fr) {\n from_lat = company.lat;\n from_lng = company.lng;\n } else if (company.company_id === to) {\n to_lat = company.lat;\n to_lng = company.lng;\n }\n }\n if (from_lat && to_lat) {\n link.from_lat = from_lat;\n link.from_lng = from_lng;\n link.to_lat = to_lat;\n link.to_lng = to_lng;\n newCompLinks.push(link);\n }\n }\n this.compLinks = newCompLinks;\n\n let that = this;\n let us = this.mapData;\n let path = d3.geoPath();\n let map = d3.select(\"#map-view\");\n map = map.append('svg')\n .attr('id', 'map')\n .attr('viewBox', '-90 -30 1100 700');\n\n // Bounding rect\n let map_width = map.node().getBoundingClientRect().width; //1100\n let map_height = map.node().getBoundingClientRect().height; // 700\n\n map.on('click', function () {\n //If the map (but not a state) is clicked, clear company table/reset sector table\n if (!that.stateClicked) {\n d3.selectAll('path').classed('outline-state', false);\n that.stateInfo(null);\n d3.select('#comp-dropdown').select('tbody').selectAll('tr').remove();\n d3.select('#map').selectAll('line').remove();\n d3.selectAll('circle').classed('selected', false);\n that.findSectors(that.companyData);\n that.currentState = null;\n that.resetView();\n that.companyDropdown.elements = that.companyDropdown.countryData;\n that.companyDropdown.stateData = that.companyDropdown.countryData;\n that.companyDropdown.makeTable();\n that.companyDropdown.clicked = false;\n d3.select('#help-text').text('Tip: Click on a state to see companies in that state');\n }\n that.sectorTable.clicked = false;\n d3.select('#sectors').selectAll('tr').classed('bold', false);\n that.stateClicked = false;\n });\n\n\n let mapGroup = map.append(\"g\")\n .attr(\"class\", \"states\");\n\n //Scale for coloring states by market cap\n let minMcap = d3.min(this.stateData, (d) => d.marketCap);\n let maxMcap = d3.max(this.stateData, (d) => d.marketCap);\n let scaleStateColor = d3.scaleLinear()\n .domain([minMcap, maxMcap])\n .range([0, 1]);\n\n // let scaleLegend = d3.scaleLinear()\n // .domain([minMcap, maxMcap])\n // .range([0, 100]);\n\n // let xAxis = d3.axisBottom(scaleLegend)\n // // .tickSize(16)\n // // .tickValues(xTicks);\n\n\n // Draw US map\n mapGroup.selectAll(\"path\")\n .data(topojson.feature(us, us.objects.states).features)\n .enter().append(\"path\")\n .attr('class', 'state')\n // //Color states by market cap\n .attr('style', function (d, i) {\n return 'fill: ' + d3.interpolateRgb('#EEEFEE', 'gray')(scaleStateColor(that.stateData[i].marketCap))\n })\n .attr(\"d\", path)\n //Display state name and companies in that state when clicked\n .on('click', function (d, i) {\n d3.selectAll('path').classed('outline-state', false);\n d3.select(this).classed('outline-state', true);\n that.stateClicked = true;\n that.currentState = that.stateData[i];\n that.stateInfo(that.stateData[i]);\n let companies = that.findCompanies(that.stateData[i].abbreviation, \"Address\");\n that.findSectors(companies);\n that.clicked(d, this);\n d3.select('#help-text').text('Tip: Click on the ocean to reset selection');\n });\n\n // Draw all interior state borders\n mapGroup.append(\"path\")\n .attr(\"class\", \"state-borders\")\n .attr(\"d\", path(topojson.mesh(us, us.objects.states, function (a, b) {\n return a !== b;\n })));\n\n // Remove universities with lat lng outside of our US bounding box\n let i = this.univData.length;\n while (i--) {\n if (!this.projection([this.univData[i].lng, this.univData[i].lat])) {\n this.univData.splice(i, 1);\n }\n }\n\n // Make the map view zoomable\n const zoom = d3.zoom()\n .scaleExtent([1, 6])\n .translateExtent([[0, 0], [map_width, map_height]])\n .extent([[0, 0], [map_width, map_height]])\n .on(\"zoom\", function () {\n mapGroup.attr(\"transform\", d3.event.transform);\n });\n map.call(zoom);\n\n // Draw companies on the map\n this.drawNodes(this.companyData);\n\n //Draw infoBox to display company information\n this.infoBox = new companyInfoBox;\n\n // // Give university and company toggle buttons functionality\n // d3.select('#univ-button').on('click', () => this.drawNodes(this.univData));\n // d3.select('#comp-button').on('click', () => this.drawNodes(this.companyData));\n\n // Create sector table\n this.findSectors(this.companyData);\n\n // Create company table\n this.companyDropdown = new Table(this.companyData, \"#comp-dropdown\", this);\n this.companyDropdown.countryData = this.companyData;\n this.companyDropdown.stateData = this.companyData;\n this.companyDropdown.makeTable();\n\n d3.select(\"#map-view\").append(\"div\").attr('id', \"company-in-state\").append(\"text\")\n // .attr(\"x\", 0).attr(\"y\", 0)\n .text('United States');\n\n // Give the user tips about how to explore our visualization\n let title_height = d3.select('#title').node().getBoundingClientRect().height;\n d3.select('#map-view').append('div')\n .attr('id', 'help-text')\n .attr('style', 'top: ' + (map_height + title_height - 20) + 'px; left: 1%; position: absolute;')\n .append('text')\n .text('Tip: Click on a state to see companies in that state');\n\n // Add color gradient legend\n let legendTitle = d3.select('#map-view').append('div')\n .attr('style', 'top: ' + (map_height + title_height - 40) + 'px; left: ' + (map_width - 260) + 'px; position: absolute;')\n .append('text')\n .classed('legend-text', true)\n .text('Aggregate market cap in millions');\n\n let legend = d3.select('#map-view').append('div')\n .attr('id', 'gradient-legend')\n .attr('style', 'top: ' + (map_height + title_height - 20) + 'px; left: ' + (map_width - 300) + 'px; position: absolute;');\n legend.append('text')\n .classed('legend-text', true)\n .text('$' + minMcap);\n\n let legSVG = legend.append('svg')\n .attr('width', '200')\n .attr('height', '10');\n\n legend.append('text')\n .classed('legend-text', true)\n .text('$' + maxMcap);\n //Append a defs element to the svg\n let defs = legSVG.append(\"defs\");\n //Append a linearGradient element\n let linearGradient = defs.append(\"linearGradient\")\n .attr(\"id\", \"linear-gradient\");\n linearGradient\n .attr(\"x1\", \"0%\")\n .attr(\"y1\", \"0%\")\n .attr(\"x2\", \"100%\")\n .attr(\"y2\", \"0%\");\n //Set the color for the start \n linearGradient.append(\"stop\")\n .attr(\"offset\", \"0%\")\n .attr(\"stop-color\", \"#EEEEEE\");\n //Set the color for the end\n linearGradient.append(\"stop\")\n .attr(\"offset\", \"100%\")\n .attr(\"stop-color\", () => d3.interpolateRgb('#EEEFEE', 'gray')(scaleStateColor(maxMcap)));\n //Draw the rectangle and fill with gradient\n legSVG.append(\"rect\")\n .attr(\"width\", 200)\n .attr(\"height\", 10)\n .style(\"fill\", \"url(#linear-gradient)\");\n }", "function showAreaOnMap()\n{\n fillPoly(areaIDData,pointArray);\n}", "drawMap(color) {\n const scaledVectorA = scaleToScreen(this.vectorA, this.map);\n const scaledVectorB = scaleToScreen(this.vectorB, this.map);\n this.map.ctx.strokeStyle = color;\n this.map.ctx.beginPath();\n this.map.ctx.moveTo(scaledVectorA.x, scaledVectorA.y);\n this.map.ctx.lineTo(scaledVectorB.x, scaledVectorB.y);\n this.map.ctx.closePath();\n this.map.ctx.stroke();\n }", "function refresh_map() {\n var ly_id = 1\n var ly_parts = [\n \"1235\", \"2475\", \"2455\", \"1110\", \"1240\", \"2460\", \"2470\", \"1120\",\n \"1101\", \"2465\", \"1125\", \"1350\", \"1230\", \"1105\", \"1115\", \"1345\"\n ]\n var ly_values = [141, 140, 155, 147, 132, 146, 151, 137, 146,\n 136, 145, 141, 149, 151, 138, 164]\n var ly_type = 1 // Palestine\n var ly_label = ''\n var ly_color = 'rgb(255,0,0)'\n map.add_layer(1,ly_id,ly_label,ly_color,ly_type,ly_parts,ly_values)\n\n var ly_id = 1345\n var ly_parts = [\n 13452415\n ]\n var ly_values = [1041]\n var ly_type = 2 // localities\n var ly_label = 'Econmics'\n var ly_color = 'rgb(0,0,255)'\n map.add_layer(2,ly_id,ly_label,ly_color,ly_type,ly_parts,ly_values)\n}", "function renderFlagpole()\n{\n checkFlagpole(); \n push();\n strokeWeight(5);\n stroke(180);\n line(flagpole.x_pos, floorPos_y, flagpole.x_pos, floorPos_y-250);\n noStroke();\n fill(250,0, 250);\n if (flagpole.isReached)\n { \n rect(flagpole.x_pos,floorPos_y-250, 50, 50);\n }\n else\n { \n rect(flagpole.x_pos,floorPos_y-50, 50, 50);\n }\n pop(); \n}", "draw(){\n for(let y = 0; y < this.map.length; y++){\n for(let x = 0; x < this.map[y].length; x++){\n ctx.fillStyle = this.legendChar(x,y).color;\n ctx.fillRect(x*this.sqsize - this.xpos,y*this.sqsize - this.ypos,this.sqsize +1,this.sqsize+1);\n }\n }\n }", "function markMap() {\n for (let key in Memory.warControl) {\n if (Memory.warControl[key]) {\n new RoomVisual(key).text(\n Memory.warControl[key].type,\n 25,\n 25,\n {align: 'left', opacity: 0.8}\n );\n }\n if (Memory.warControl[key].siegePoint) {\n new RoomVisual(Memory.warControl[key].siegePoint).text(\n 'Siegepoint',\n 25,\n 25,\n {align: 'left', opacity: 0.8}\n );\n }\n }\n}", "function setMap(){\n\t\t//set the map frame dimension\n\t\tvar width=window.innerWidth*0.8,\n\t\t\theight=540;\n\n\t\t//append the map bloack to a svg container \n\t\tvar map=d3.select(\"body\")\n\t\t\t.append(\"svg\")\n\t\t\t.attr(\"class\",\"map\")\n\t\t\t.attr(\"width\",width)\n\t\t\t.attr(\"height\",height);\n\n\t\t//create a projection for the map using the US. centric composite projection to also\n\t\t\t//include Hawaii and Alaska for the purpose of cretaing a choropleth map later\n\t\tvar projection=d3.geoAlbersUsa()\n\t\t\t//this projection does not need to take in the following parameters\n\t\t\t//.center([0,39])\n\t\t\t//.rotate([-2,0,0])\n\t\t\t//.parallels([43,62])\n\t\t\t//.scale([2500])*/\n\t\t\t.translate([width/2,height/2]);\n\n\t\t//create a path generator and pass in the projection from the projection operator \n\t\tvar path=d3.geoPath()\n\t\t\t.projection(projection);\n\n\t\t//use d3.queue to load in data from different files at the same time\n\t\td3.queue()\n\t .defer(d3.csv, \"data/stateData.csv\") //load attribute data from the csv file\n\t .defer(d3.json, \"data/country.topojson\") //load the North America background spatial data\n\t .defer(d3.json, \"data/usState.topojson\") //load choropleth spatial data of the US states\n\t .await(callback); //fires after all the data is loaded and sends the data to the callback function \n\n\t //a callback function with the loaded data from above \n\t\tfunction callback(error, csvData, countries, state){\n\t\t\tconsole.log(error); //if there is any error\n\t\t\tconsole.log(csvData); //attribute data\n\t\t\tconsole.log(countries);\n\t\t\tconsole.log(state);\n\n\n\t\t\t//translate the topojson data back to geojson data within DOM with the obejcts within the data that we want to convert\n\t\t\t//var northAmerica=topojson.feature(countries,countries.objects.ne_50m_admin_0_countries),\n\t\t\tvar\tusStates=topojson.feature(state,state.objects.ne_50m_admin_1_states_provinces_lakes).features;\n\n\t\t\t//examine the resulting geojson\n\t\t\tconsole.log(usStates);\n\n\t\t\t//join csv data to geojson enumeration units\n\t\t\tusStates=joinData(usStates,csvData);\n\n\t\t\t//create the color scale\n\t\t\tvar colorScale=makeColorScale(csvData);\n\n\t\t\t//add enumeration units to the map\n\t\t\tsetEnumerationUnits(usStates,map, path, colorScale);\n\n\t\t\t//set coordinated visualization to the map\n\t\t\tsetChart(csvData,colorScale);\n\t\t\tsunChart(csvData, colorScale);\n\t\t};\n\n\t}", "function drawmap(world) {\r\n var world=world;\r\n \r\n let color = function (value) { \r\n let cf=d3.scaleLog().domain([1, 1600]).range([1,0]);\r\n return value>0?d3.interpolateRdGy(cf(value)):0;\r\n }\r\n width=innerWidth;\r\n height=innerHeight;\r\n var projection=d3.geoMercator().scale([width/(2.5*Math.PI)]).translate([width/2,height/2]).precision(0.01);\r\n var path = d3.geoPath().projection(projection);\r\n function center(d){\r\n let dx=d3.geoCentroid(d)[0];\r\n let dy=d3.geoCentroid(d)[1];\r\n return projection([dx,dy]);\r\n }\r\n var radiusScale = d3.scaleQuantize().domain([1, 1500]).range([5,15,40,60]);\r\n var rscale=function(value){\r\n return value==0?0:radiusScale(value);\r\n }\r\n // let g = painter.append(\"g\")\r\n\r\n const svg = d3.create(\"svg\")\r\n .attr(\"viewBox\",\"0 0 2000 1200\")\r\n .attr(\"id\",\"Mapsvg\");\r\n \r\n \r\n /** Awesome tooltip idea from Eric Porter https://codepen.io/EricPorter/pen/xdJLaG?editors=1000*/ \r\n function msg(ctr,rec){\r\n return\"<div class='tooltipcontent'><li><span>Country : \"+ctr+\"</span></li><li><span>Records : \"+rec+\"</span></li></div>\";\r\n }\r\n \r\n //outline group\r\n \r\n\r\n const g = svg.append('g')\r\n .attr('class', 'map')\r\n .attr(\"clip-path\",\"url(#map-glowclip)\")\r\n .attr(\"fill\",\"url(#map-gradient)\")\r\n .attr(\"id\",\"Map-outlayer\");\r\n const outline=g.append(\"path\")\r\n .datum(topojson.mesh(world, world.objects.countries, (a, b) => a !== b))\r\n .attr(\"stroke\", \"white\")\r\n .attr(\"stroke-linejoin\", \"round\")\r\n .attr(\"id\",\"countryoutline\")\r\n .attr(\"stroke-width\",2)\r\n .attr(\"d\", path);\r\n \r\n const cg= svg.append(\"g\")\r\n .attr(\"class\", \"countries-layer\")\r\n .selectAll(\"path\")\r\n .data(Feature)\r\n .enter()\r\n .append(\"g\")\r\n .attr(\"class\",\"countryg requiretooltip\")\r\n .attr(\"id\",d=>d.id)\r\n .attr(\"message\",d=>msg(d.name,d.nrecord));\r\n\r\n \r\n \r\n const cp=cg\r\n .append(\"path\")\r\n .attr(\"fill\", d => color(d.nrecord))\r\n .attr(\"fill-opacity\",0.6)\r\n .attr(\"stroke\", \"white\")\r\n .attr(\"stroke-linejoin\", \"round\")\r\n .attr(\"stroke-width\",2)\r\n .attr(\"d\", path)\r\n .attr(\"class\",\"countryborder\")\r\n .attr(\"id\",d=>d.id)\r\n .attr(\"name\",d=>CodeMap.get(d.id));\r\n \r\n \r\n //bind the results\r\n const cirg=svg.append(\"g\").attr(\"class\",\"circle-layer\")\r\n .selectAll(\"circle-wrapper\")\r\n .data(Feature)\r\n .enter()\r\n .append(\"g\");\r\n\r\n cirg.append(\"circle\")\r\n .attr(\"class\",\"pins glow-pins\")\r\n .attr(\"cx\",d=> center(d)[0])\r\n .attr(\"cy\",d=> center(d)[1])\r\n .attr(\"r\", d=>rscale(d.nrecord))\r\n .attr(\"fill\",\"red\")\r\n .attr(\"fill-opacity\",0.6)\r\n .attr(\"records\",d=>rscale(d.nrecord));\r\n \r\n cirg\r\n .append(\"circle\")\r\n .attr(\"class\",\"pins solid-pins\")\r\n .attr(\"cx\",d=> center(d)[0])\r\n .attr(\"cy\",d=> center(d)[1])\r\n .attr(\"r\", d=>rscale(d.nrecord))\r\n .attr(\"fill\", \"red\")\r\n .attr(\"fill-opacity\",0.6)\r\n .attr(\"records\",d=>rscale(d.nrecord));\r\n return svg.node();\r\n\r\n\r\n }", "function drawMap(lon, lat, elem, layers) {\n\tvar LayersArray = [];\n\t// Map initialization\n\tvar map = new OpenLayers.Map(elem);\n\t// Add layers on map\n\tmap.addLayers(layers);\n\t// WGS 1984 projection\n\tvar epsg4326 = new OpenLayers.Projection(\"EPSG:4326\");\n\t//The map projection (Spherical Mercator)\n\tvar projectTo = map.getProjectionObject();\n\t// Max zoom = 17\n\tvar zoom=10;\n\tmap.zoomToMaxExtent();\n\t// Set longitude/latitude\n\tvar lonlat = new OpenLayers.LonLat(lon, lat);\n\tmap.setCenter(lonlat.transform(epsg4326, projectTo), zoom);\n\tvar layerGuest = new OpenLayers.Layer.Vector(\"You are here\");\n\t// Define markers as \"features\" of the vector layer:\n\tvar guestMarker = new OpenLayers.Feature.Vector(\n\t\tnew OpenLayers.Geometry.Point(lon, lat).transform(epsg4326, projectTo)\n\t);\n\tlayerGuest.addFeatures(guestMarker);\n\tLayersArray.push(layerGuest);\n\tmap.addLayers(LayersArray);\n\t// If map layers > 1 then show checker\n\tif (layers.length > 1){\n\t\tmap.addControl(new OpenLayers.Control.LayerSwitcher({'ascending':true}));\n\t}\n\t// Link to current position\n\tmap.addControl(new OpenLayers.Control.Permalink());\n\t// Show current mouse coords\n\tmap.addControl(new OpenLayers.Control.MousePosition({ displayProjection: epsg4326 }));\n\treturn map;\n}", "function init() {\n // create an svg element in our main `d3-container` element\n svg = d3\n .select(\"#d3-container\")\n .append(\"svg\")\n .attr(\"width\", width)\n .attr(\"height\", height);\n\n // + SET UP PROJECTION\n const projection = d3.geoAlbersUsa().fitSize([width, height],state.geojson)\n\n // + SET UP GEOPATH\n const path = d3.geoPath().projection(projection);\n console.log(projection([-73.9833,40.7423]))\n\n // + DRAW BASE MAP PATH\n svg.selectAll(\".state\")\n .data(state.geojson.features)\n .join(\"path\")\n .attr(\"d\", path)\n .attr(\"class\",\"state\")\n .attr(\"fill\",\"transparent\")\n .attr(\"stroke\",\"lightgrey\")\n .on(\"mouseover\", d => {\n state.hover[\"state\"] = d.properties.NAME;\n draw();\n })\n\n //adding circles\n\n svg\n .selectAll(\"circle\")\n .data(state.extremes, d => d)\n .enter()\n .append(\"circle\")\n .attr(\"fill\", d => {return d[\"Change in 95 percent Days\"] < 1 ? \"steelblue\": \"green\"} )\n .attr(\"opacity\",\"0.5\")\n .attr(\"r\", d => Math.abs(d[\"Change in 95 percent Days\"]/4))\n .attr(\"cx\", d => projection([d[\"Long\"],d[\"Lat\"]])[0])\n .attr(\"cy\", d => projection([d[\"Long\"],d[\"Lat\"]])[1])\n .on(\"mouseover\", d => {\n state.hover[\"change\"] = d[\"Change in 95 percent Days\"];\n draw();\n })\n\n \n\n // + ADD EVENT LISTENERS (if you want)\n svg.on(\"mousemove\", () => {\n const [x,y] = d3.mouse(svg.node())\n const proj = projection.invert([x,y])\n state.hover[\"latitude\"] = proj[0]\n state.hover[\"longitude\"] = proj[1]\n })\n\n draw(); // calls the draw function\n}", "draw () {\n\n // loop over the x coordinates\n for (let x = 0; x < this.config.get(colsKey); ++x) {\n\n // loop over the y coordinates\n for (let y = 0; y < this.config.get(rowsKey); ++y) {\n\n // get the current index\n let index = (x + y * this.config.get(colsKey));\n\n // get the current state\n let state = this.grid.get(index);\n\n // do we have a living being?\n if (state === 1) {\n\n // fill black\n fill(0);\n\n // get the resolution\n let resolution = this.config.get('resolution');\n\n // prepare the x coordinate\n let xPos = (x * resolution);\n \n // prepare the y coordinate\n let yPos = (y * resolution);\n\n // draw a rect\n rect(xPos, yPos, resolution, resolution);\n }\n }\n }\n }", "function draw(topo) {\n\n svg.append(\"path\")\n .datum(graticule)\n .attr(\"class\", \"graticule\")\n .attr(\"d\", path);\n\n\n g.append(\"path\")\n .datum({type: \"LineString\", coordinates: [[-180, 0], [-90, 0], [0, 0], [90, 0], [180, 0]]})\n .attr(\"class\", \"equator\")\n .attr(\"d\", path);\n\n draw_countries();\n\n //charles_de_gaulle\n //frankfurt_main\n //tansonnhat_intl\n\n layer_route = g.append(\"g\").attr(\"id\", \"layer_route\").attr(\"visibility\", \"hidden\");\n\n layer_airport.push(g.append(\"g\").attr(\"id\", \"layer_airport_0\").attr(\"visibility\", \"hidden\"));\n layer_airport.push(g.append(\"g\").attr(\"id\", \"layer_airport_1\").attr(\"visibility\", \"hidden\")); \n layer_airport.push(g.append(\"g\").attr(\"id\", \"layer_airport_2\").attr(\"visibility\", \"hidden\"));\n layer_airport.push(g.append(\"g\").attr(\"id\", \"layer_airport_3\").attr(\"visibility\", \"hidden\"));\n layer_airport.push(g.append(\"g\").attr(\"id\", \"layer_airport_4\").attr(\"visibility\", \"visible\"));\n\n //swap\n var temp = layer_airport[0];\n layer_airport[0] = layer_airport[2];\n layer_airport[2] = temp;\n\n infoColorMeaning = d3.select(\"#container_map\").append(\"div\").attr(\"class\", \"cssinfo hidden\");\n\n var offsetL = document.getElementById(\"container_map\").offsetLeft + 20;\n var offsetT = document.getElementById(\"container_map\").offsetTop + 20;\n\n infoColorMeaning.classed(\"hidden\", false)\n .attr(\"style\", \"left:\" + offsetL + \"px;top:\" + offsetT + \"px\")\n .html(\"\");\n}", "constructor(props) {\n super(props);\n this.state = {\n markers: [],\n polygon: [{\n strokeColor: \"#000\",\n path: [],\n key: 'key',\n id: 'id',\n }],\n polyline: [{\n strokeColor: \"#000\",\n path: [],\n key: 'key',\n id: 'id',\n }],\n zoom: undefined,\n center: {\n lat: 8.460555,\n lng: -11.779889,\n },\n id: 'id',\n parentId: undefined,\n makeNew: false,\n open: false,\n reload: false,\n };\n this.handleMapLoad = this.handleMapLoad.bind(this);\n this.onLoad = this.onLoad.bind(this);\n this.handlePolyClick = this.handlePolyClick.bind(this);\n this.drawDistrict = this.drawDistrict.bind(this);\n this.setMarkers = this.setMarkers.bind(this);\n this.updateMap = this.updateMap.bind(this);\n this.handleMapClick = this.handleMapClick.bind(this);\n this.returnSingleDistrict = this.returnSingleDistrict.bind(this);\n this.handleMarkerClick = this.handleMarkerClick.bind(this);\n this.updateBounds = this.updateBounds.bind(this);\n this.handlePolyRightClick = this.handlePolyRightClick.bind(this);\n this.drawPolyLine = this.drawPolyLine.bind(this);\n this.handleMapRightClick = this.handleMapRightClick.bind(this);\n }", "update(map)\n {\n if (this.container === null)\n {\n this.init(map);\n }\n\n this.coins.graphics.clear();\n this.treasures.graphics.clear();\n const info_arr = map.eData();\n const size_x = map.SIZE_X;\n const size_y = map.SIZE_Y;\n\n for (let i = 0; i < size_x; i++)\n {\n const screen_y = this.size * i;\n for (let j = 0; j < size_y; j++)\n {\n const screen_x = this.size * j;\n if (info_arr[i][j] === BaseMapInfo.getElementsByTagName(\"gold\"))\n {\n this.paintCoin(screen_x, screen_y);\n }\n else if (info_arr[i][j] === BaseMapInfo.getElementsByTagName(\"end\"))\n {\n this.paintFinish(screen_x, screen_y);\n }\n }\n }\n }", "refreshMap() {\n\t\tif (typeof this.map_ptr.doors !== 'undefined') {\n\t\t\tthis.map_ptr.doors.forEach((element, index, array) => {\n\t\t\t\tif (SaveState.doorsOpened.indexOf(element.id) > -1) {\n\t\t\t\t\tthis.map_ptr.layout[element.x + (element.y * this.map_ptr.width)] = Data.mapTiles.BRICK;\n\t\t\t\t} else {\n\t\t\t\t\tthis.map_ptr.layout[element.x + (element.y * this.map_ptr.width)] = Data.mapTiles.DOOR;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tif (typeof this.map_ptr.chests !== 'undefined') {\n\t\t\tthis.map_ptr.chests.forEach((element, index, array) => {\n\t\t\t\tif (SaveState.chestsOpened.indexOf(element.id) > -1) {\n\t\t\t\t\tthis.map_ptr.layout[element.x + (element.y * this.map_ptr.width)] = Data.mapTiles.BRICK;\n\t\t\t\t} else {\n\t\t\t\t\tthis.map_ptr.layout[element.x + (element.y * this.map_ptr.width)] = Data.mapTiles.CHEST;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}", "function downloadMap(){\r\n ctx.clearRect(0, 0, canvas.width, canvas.height);\r\n ctx.fillStyle = \"black\";\r\n ctx.fillRect(0, 0, 1000, 1000);\r\n ctx.fillStyle = \"green\";\r\n ctx.font = \"50px Arial\";\r\n\r\n ctx.fillText(\"Creating map... Please wait...\",50,300);\r\n //download map to display\r\n\r\n //1. fill x and y array\r\n //2. fill map array with xy value as place holders (mainly to get correct array size)\r\n //3. call scale map\r\n //4. fill coordOG array\r\n //5. call scale coord\r\n\r\n}", "function drawMap(lat,lon){\n\t$(\"#fake-map\").text(lat + \", \" + lon)\n}", "drawState(){\n if(this.getTracer().stateStructure && this.getNode(this.currentId)){\n NodeStateService.process(this.getNode(this.currentId).state_variables);\n }\n }", "function draw() {\n background(255, 255, 255);\n fill(0, 0, 0);\n ellipse(width/2,map(latestData, 0, 1023, 0, height) , 20);\n}", "function drawMap(sLat, sLon, rLat, rLon, durationTime, elapssedTime) {\n // what kind of info is gonna come to this part? \n var lerp = function (a, b, t) {\n var len = a.length;\n if(b.length != len) return;\n\n var x = [];\n for(var i = 0; i < len; i++)\n x.push(a[i] + t * (b[i] - a[i]));\n return x;\n }\n var curRate = Math.min(Math.max(elapssedTime / durationTime, 0), 1.0);\n var currPos = lerp([sLat, sLon], [rLat, rLon], curRate);\n var currPosLat = currPos[0];\n var currPosLon = currPos[1];\n\n //figure out current Index\n var currGeocode = new Vector(currPosLat,currPosLon);\n var currDist = getDistanceBtw(currGeocode.x,currGeocode.y,nyGeocode.x,nyGeocode.y);\n var totalDist = getDistanceBtw(nyGeocode.x,nyGeocode.y,seoulGeocode.x,seoulGeocode.y);\n var dCurr = (currDist/totalDist) *(points.length-1);\n \n\n var currIndex = Math.ceil(dCurr);\n\n\n drawPath(currIndex);\n }", "function redraw() {\n width = document.getElementById('container_map').offsetWidth;\n height = width / 2;\n d3.select('svg').remove();\n setup(width,height);\n draw(topo);\n}", "function map(div, id) {\n\n var margin = {\n top: 10,\n right: 5,\n bottom: 10,\n left: 5\n };\n\n if ($GRAPHDIV.width() <= MOBILE_THRESHOLD) {\n isMobile = true;\n } else {\n isMobile = false;\n }\n\n if (isMobile) {}\n\n\n var width = $GRAPHDIV.width() - margin.left - margin.right,\n height = Math.ceil((width * map_aspect_height) / map_aspect_width) - margin.top - margin.bottom;\n\n $GRAPHDIV.empty();\n\n var svg = d3.select(div).append(\"svg\")\n .attr(\"width\", width + margin.left + margin.right)\n .attr(\"height\", height + margin.top + margin.bottom)\n .append(\"g\")\n .attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\n\n var color = d3.scale.threshold()\n .domain(BREAKS)\n .range(COLORS);\n\n var projection = d3.geo.albersUsa()\n .scale(width * 1.3)\n .translate([width / 2, height / 2]);\n\n var path = d3.geo.path()\n .projection(projection);\n\n svg.selectAll(\"path\")\n .data(topojson.feature(us, us.objects.cb_2014_us_state_20m).features)\n .enter().append(\"path\")\n .attr(\"d\", path)\n .attr(\"id\", function (d) {\n return d.properties.abbrev;\n })\n .attr(\"class\", \"boundary_paired\")\n .attr(\"fill\", function (d) {\n //NH doesn't give grant aid\n if (VAL == \"grants_pctneedbased\" & d.properties.abbrev == \"NH\") {\n return \"#fff\";\n } else {\n return color(d.properties[VAL]);\n }\n })\n .on(\"click\", function (d) {\n dispatch.clickState(this.id);\n })\n .on(\"mouseover\", function (d) {\n if (isIE != false) {\n d3.selectAll(\".hovered\")\n .classed(\"hovered\", false);\n d3.selectAll(\"#\" + this.id)\n .classed(\"hovered\", true);\n tooltip(this.id);\n //this.parentNode.appendChild(this);\n\n } else {\n dispatch.hoverState(this.id);\n }\n })\n .on(\"mouseout\", function (d) {\n dispatch.dehoverState(this.id);\n })\n .on(\"mouseleave\", function (d) {\n if (isIE != false) {\n d3.selectAll(\".hovered\")\n .classed(\"hovered\", false);\n menuId = selecter.property(\"value\");\n tooltip(menuId);\n d3.selectAll(\"[id='\" + menuId + \"']\")\n .moveToFront();\n }\n });\n}", "function draw() {\n translate(width / 2, height / 2);\n imageMode(CENTER);\n image(mapimg, 0, 0);\n // this.rms = this.amp.getLevel();\n // console.log(rms);\n for (i = 0; i < circleButtonArray.length; i++) {\n\n circleButtonArray[i].drawCircle();\n circleButtonArray[i].update();\n // console.log(\"the speed is\" + circleButtonArray[i].speedX);\n circleButtonArray[i].circleIsHovered();\n }\n}", "function renderMap(i, el) {\r\n\t var data = $(el).data();\r\n\t getState(el, data);\r\n\t }", "draw() { }", "draw() { }", "draw() { }", "draw(){\n\t\tvar context = this.canvas.getContext('2d');\n\t\t//context.fillStyle = \"#007900\";\n\t\t//context.fillRect(0, 0, this.width, this.height);\n\n\t\tvar c = context;\n\n\t\tvar startCol = Math.floor(this.camera.x / map.tsize);\n \tvar endCol = startCol + (this.camera.width / map.tsize);\n \tvar startRow = Math.floor(this.camera.y / map.tsize);\n\t\tvar endRow = startRow + (this.camera.height / map.tsize);\n\t\t\n\t\tvar offsetX = -this.camera.x + startCol * map.tsize;\n \tvar offsetY = -this.camera.y + startRow * map.tsize;\n\n\t\tfor (var x = startCol; x < endCol; x++) {\n\t\t\tfor (var y = startRow; y < endRow; y++) {\n\t\t\t var drawx = x - startCol * 50 + offsetX;\n\t\t\t var drawy = y - startRow * 50 + offsetY;\n\n\t\t\t var colour = null;\n\t\t\t // Different colours for diverse terrain\n\t\t\t if (this.map[x][y] === 0 ) colour = \"#444\";\n\t\t\t else if (this.map[x][y] === 1 ) colour = \"#555\";\n\t\t\t else if (this.map[x][y] === 2 ) colour = \"#667\";\n\t\t\t else if (this.map[x][y] === 3 ) colour = \"#777\";\n\n\t\t\t // Damaging terrain: nuclear waste and map shrinking\n\t\t\t else if (this.map[x][y] === 8 ) colour = \"#FF8C00\";\n\t\t\t else if (this.map[x][y] === 9 ) colour = \"#707\";\n\n\n\t\t\t c.beginPath();\n\t\t\t c.rect(drawx*this.map.tsize, drawy *this.map.tsize, 50, 50);\n\t\t\t c.fillStyle = colour;\n\t\t\t c.fill();\n\t\t\t}\n\t\t\tthis.player.draw(c);\n\t\t}\n\n\t\t//context.clearRect(0, 0, this.width, this.height);\n\t\tfor(var i=0;i<this.actors.length;i++){\n\t\t\tthis.actors[i].draw(context);\n\t\t}\n\n\t\t// Call the drawUI method to render the user interface\n\t\tthis.drawUI();\n\t}", "function drawBase() {\n\t\tmap.selectAll(\"path\")\n\t\t.data(geojson.features)\n\t\t.enter()\n\t\t.append(\"path\")\n\t\t\t.attr(\"d\", path)\n\t\t\t.attr(\"stroke\", \"#fff\")\n\t\t\t.attr(\"stroke-width\", \"1\")\n\t\t\t.attr(\"fill\", \"#f6f6f6\")\n\t}", "function initMap() {\n var data = new google.visualization.DataTable()\n data.addColumn('string','State');\n data.addColumn('number', 'value');\n data.addColumn({type:'string', role: 'tooltip'})\n data.addRows(initData);\n\n let options = {\n sizeAxis: { minValue: 1, maxValue: 4 },\n resolution:\"provinces\",\n region:\"US\",\n tooltip:{isHtml: true},\n legend: 'none',\n backgroundColor: '#f8f8f8',\n colorAxis: {minValue: 1, maxValue: 4, colors: ['#f4e573', '#f4a473', '#f47573', '#c3f473']}\n };\n chart = new google.visualization.GeoChart(document.getElementById('regions_div'));\n\n chart.draw(data, options);\n}", "function on_draw()\n{\n\tdrawCounter++;\n\t\n\tif(drawCounter >= drawOnCount)\n\t{\n\t\tdrawCounter = 0;\n\t\tClearMiniMap();\n\t\t\n\t\tif(parent.miniMap.length == 0)\n\t\t{\n\t\t\te=new PIXI.Graphics();\n\t\t\te.zIndex = 999;\n\t\t\tDrawMiniMap();\n\t\t\tDrawWalls();\n\t\t\tDrawEntities();\n\t\t\tDrawNPCs();\n\t\t\tDrawCharacter();\n\t\t\tparent.stage.addChild(e);\n\t\t\tparent.miniMap.push(e);\n\t\t}\n\t}\n}", "function drawGame()\n{\n if(canvas==null) {return;}\n \n //Iterates over the map\n for(var y = 0; y < mapHeight; y++)\n {\n for(var x = 0; x < mapWidth; x++)\n {\n if (revealAll == true || fogmask[((y*mapWidth)+x)] != 1)\n {\n //Revealed area\n switch(map[((y*mapWidth)+x)])\n {\n case 0:\n canvas.fillStyle = \"#ffffff\";\n break;\n case 1:\n canvas.fillStyle = \"#444444\";\n break;\n case 4:\n canvas.fillStyle = \"#ffab00\";\n break;\n case 5:\n canvas.fillStyle = \"#00c853\";\n break;\n case 8:\n canvas.fillStyle = \"#03adfc\";\n break;\n case 9:\n canvas.fillStyle = \"#f50057\";\n break;\n default:\n canvas.fillStyle = \"#000000\";\n break; \n }\n }\n //Covered by fog\n else\n {\n switch(map[((y*mapWidth)+x)])\n {\n case 0:\n canvas.fillStyle = \"#bbbbbb\";\n break;\n case 1:\n canvas.fillStyle = \"#444444\";\n break;\n default:\n canvas.fillStyle = \"#bbbbbb\";\n break; \n }\n }\n \n //Draw the Tile\n canvas.fillRect(x*tileWidth, y*tileHeight, tileWidth, tileHeight);\n }\n }\n}", "function updateMap() {\n\t\t\tid = trail_select.value;\n\t\t\tconsole.log(id);\n\t\t\tvar newlayer = layer.getLayer(id);\n\t\t\tnewlayer.removeFrom(map);\n\t\t\tnewlayer.setStyle({\n\t\t\t\t\tweight: 5,\n\t\t\t\t\tcolor: '#00ff00',\n\t\t\t\t\topacity: 1.0\n\t\t\t});\n\t\t\tnewlayer.addTo(map)\n\t\t\tvar prevlayer = layer.getLayer(previd);\n\t\t\tif (previd !== id) {\n\t\t\t\tprevlayer.setStyle({\n\t\t\t\t\tcolor: '#ff7800',\n\t\t\t\t\topacity: 1.0,\n\t\t\t\t\tweight: (prevlayer.feature.properties.annual*0.17)**4\n\t\t\t\t});\n\t\t\t\tprevlayer.addTo(map);\n\t\t\t\tprevid = id;\n\t\t\t}\n\t\t}", "function renderFlagpole()\n{\n \n push()\n stroke(150);\n strokeWeight(5);\n line(flagpole.x_pos, floorPos_y, flagpole.x_pos, floorPos_y - 200);\n \n if(flagpole.isReached)\n {\n fill(255,0,0);\n rect(flagpole.x_pos, floorPos_y -200, 50,50);\n }\n \n else\n {\n fill(255,0,0);\n rect(flagpole.x_pos, floorPos_y -50, 50,50);\n }\n \n pop();\n \n}", "function redrawMap(mapProvider, map){\r\n\r\n // $('.map-canvas').toggleClass('results-collapsed');\r\n\r\n}", "function debugMap(map, x, y, color, font) {\n game.debug.text('map: ' + map.properties.map_name, x, y, color, font);\n game.debug.text('layers: ' + map.layers.length, x, y + game.debug.lineHeight, color, font);\n game.debug.text('tilesize: ' + map.tileWidth + 'x' + map.tileHeight, x, y + (game.debug.lineHeight * 2), color, font);\n game.debug.text('size (tiles): ' + map.width + 'x' + map.height, x, y + (game.debug.lineHeight * 3), color, font);\n game.debug.text('size (pixels): ' + map.widthInPixels + 'x' + map.heightInPixels, x, y + (game.debug.lineHeight * 4), color, font);\n }", "setMap(map) {\n super.setMap(map);\n this.map = map;\n this.map.on('postrender', () => {\n this.renderPanel();\n });\n }", "show() {\n fill(255);\n noStroke();\n let sx = map(this.x/this.z, 0, 1, 0, width);\n let sy = map(this.y/this.z, 0, 1, 0, height);\n let r = map(this.z, 0, width, 8, 0);\n //ellipse(sx, sy, r, r);\n stroke(255);\n let px = map(this.x/this.pz, 0, 1, 0, width);\n let py = map(this.y/this.pz, 0, 1, 0, height);\n line(px,py, sx, sy);\n this.pz = this.z;\n }" ]
[ "0.72234654", "0.71786165", "0.71266085", "0.7116646", "0.7102464", "0.7073265", "0.69769585", "0.69706786", "0.68775374", "0.68589884", "0.6838313", "0.6717955", "0.6686259", "0.65446484", "0.6511566", "0.6486987", "0.6483987", "0.64721763", "0.6456711", "0.64558625", "0.6434417", "0.64298755", "0.63954896", "0.63913697", "0.6391119", "0.63686496", "0.63546544", "0.63530105", "0.6348314", "0.6347655", "0.63312984", "0.63273734", "0.63208133", "0.6319395", "0.631534", "0.6313687", "0.63036245", "0.6296488", "0.62867624", "0.6284123", "0.6281562", "0.62810004", "0.6271097", "0.6266894", "0.62602335", "0.62521625", "0.62422633", "0.621759", "0.62128806", "0.6208883", "0.6207834", "0.6197653", "0.6184456", "0.61841834", "0.6179374", "0.6161264", "0.6157212", "0.61563087", "0.6148514", "0.6147336", "0.61391634", "0.61361027", "0.6126105", "0.6123575", "0.6116566", "0.6112979", "0.6112642", "0.61110663", "0.60965556", "0.6095873", "0.60914344", "0.6091373", "0.6087452", "0.6082991", "0.6082693", "0.6074547", "0.6073124", "0.607267", "0.60688406", "0.6067746", "0.6067441", "0.6065476", "0.60641664", "0.6063799", "0.6063298", "0.6022286", "0.60153174", "0.60153174", "0.60153174", "0.6011044", "0.6001386", "0.5996211", "0.59961665", "0.59951824", "0.59949994", "0.59900284", "0.5984521", "0.5976006", "0.59734845", "0.59702826" ]
0.67057353
12
specify what to do when zoom event listener is triggered
function zoom_actions(){ circles.attr("transform", d3.event.transform); zoomed(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function zoomChangedListener(thisWithMap,action) {\n //console.log(\"detected zoom change\")\n twitter_geomap.ac.logUserActivity(\"map zoom changed\", \"zoom\",twitter_geomap.ac.WF_EXPLORE);\n if (thisWithMap) {\n throttledRetrieveData();\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 }", "zoomIn () {}", "function handleZoom(e) {\n // Limit panning so the visualization remains on the screen.\n // TODO: Redo this as part of the d3.zoom() call above: http://bl.ocks.org/garrilla/11280861.\n if (e.transform.x > width * 0.5) {\n e.transform.x = width * 0.5;\n }\n if (e.transform.y > height * 0.05) {\n e.transform.y = height * 0.05;\n }\n currentZoom = e.transform;\n d3.select(\"svg g\")\n .attr(\"transform\", e.transform);\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 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 zoom_changed_handler ( )\n\t{\n\t\tclearAllMarkers();\n\t\tg_main_map.init_listener = google.maps.event.addListener ( g_main_map, \"tilesloaded\", tiles_loaded_handler );\n\t}", "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 }", "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 }", "zoomOut () {}", "function evtzoomend(oldzoom, newzoom) {\r\n\r\n\t//Handle zoom change\r\n\thandlezoomchange(newzoom);\r\n\r\n}", "refreshZoom() {}", "function zoomSliderChange(event) {\n let scale = event.target.value / 10;\n canvasControl.setZoomScaler(scale);\n}", "addZoomAndMapPanHandling() {\n\n this.getMap().on(\"zoomend\", (event) => {\n // console.log(\"zoomend\");\n this.updateMarkersToShowOnMapChange(event);\n\n });\n\n this.getMap().on(\"moveend\", (event) => {\n this.updateMarkersToShowOnMapChange(event);\n });\n\n\n }", "function zoomTo(event) {\n\n\t\tsetTimeout(function() {\n\t\t\tif ($('.magazine-viewport').data().regionClicked) {\n\t\t\t\t$('.magazine-viewport').data().regionClicked = false;\n\t\t\t} else {\n\t\t\t\tif ($('.magazine-viewport').zoom('value')==1) {\n\t\t\t\t\t$('.magazine-viewport').zoom('zoomIn', event);\n\t\t\t\t} else {\n\t\t\t\t\t$('.magazine-viewport').zoom('zoomOut');\n\t\t\t\t}\n\t\t\t}\n\t\t}, 1);\n\n}", "function zoomHere(){\n\tconsole.log('zoom here');\n\tif(map){\n\t\tvar currentZoom = map.getZoom();\n\t\tmap.setZoom(currentZoom+1);\n\t\tmap.panTo(contextualMenuEvtPosition);\n\n\t}\n\tremoveContextualMenu()\n}", "function zoomInHandler(e) {\n plugin.updateStaticLayers();\n }", "function zoomTo(event) {\n\tsetTimeout(function() {\n\t\tif ($('.magazine-viewport').data().regionClicked) {\n\t\t\t$('.magazine-viewport').data().regionClicked = false;\n\t\t} else {\n\t\t\tif ($('.magazine-viewport').zoom('value') == 1) {\n\t\t\t\t$('.magazine-viewport').zoom('zoomIn', event);\n\t\t\t} else {\n\t\t\t\t$('.magazine-viewport').zoom('zoomOut');\n\t\t\t}\n\t\t}\n\t}, 1);\n}", "function openlayerszoomchange(event) {\r\n\r\n\tif ( (currtrackerunit > 0) && (currdate != undefined) ) {\r\n\r\n\t\t//If on history page\r\n\t\tif (handlezoomchangeonmap == true) {\r\n\r\n\t\t\t//Handle zoom change\r\n\t\t\thandlezoomchange(mapstraction.getZoom());\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n}", "function multimapzoomchange(type, target, oldzoom, newzoom) {\r\n\r\n\t//Handle zoom change\r\n\thandlezoomchange(newzoom);\r\n\r\n}", "function setZoom() {\r\n zoom = 2.0;\r\n}", "function setZoom() {\r\n zoom = 2.0;\r\n}", "function addZoom() {\n svg.call(d3.zoom()\n .extent([\n [0,0],\n [1000,1000],\n ])\n .scaleExtent([1,8])\n .on(\"zoom\", zoomed)\n );\n}", "function zoomListener(event) {\n // Adjust size of position icon depending on zoom.\n if (googleMapObject.getZoom() < 17) {\n user.center.setIcon(zoomImages[0]);\n } else if (googleMapObject.getZoom() >= 17 && googleMapObject.getZoom() < 20) {\n user.center.setIcon(zoomImages[1]);\n } else {\n user.center.setIcon(zoomImages[2]);\n }\n\n if (dropMode) {\n if ($(\"#guide-footer\").hasClass('active') == false) {\n $(\"#guide-footer\").addClass('active');\n }\n if (googleMapObject.getZoom() < 17) {\n user.radius.setVisible(false);\n $(\"#guide-text\").text(\"Too far zoomed out!\");\n $(\"#guide-text\").css('color', 'rgba(209, 44, 29, 1)');\n } else {\n user.radius.setVisible(true);\n $(\"#guide-text\").text(\"Drop a cow within the gray area.\");\n $(\"#guide-text\").css('color', 'rgba(43, 132, 237, 1)');\n }\n }\n}", "_animatePanZoomEvent() {\n var event = this._lastPanZoomEvent;\n this._lastPanZoomEvent = null; // nullify to indicate that the event has been processed\n\n var subtype = event.subtype;\n var actionDone = subtype === 'panEnd' || subtype === 'zoom' || subtype === 'pinchEnd';\n\n // Calculate the bounds and update the viewport\n var bounds;\n if (DvtChartBehaviorUtils.isLiveScroll(this)) {\n // live\n bounds = DvtChartEventUtils.getAxisBoundsByDelta(\n this,\n event.dxMin,\n event.dxMax,\n event.dyMin,\n event.dyMax\n );\n this._setScrollbarViewport(bounds);\n this._setViewport(bounds, actionDone);\n } else {\n // delayed\n bounds = DvtChartEventUtils.getAxisBoundsByDelta(\n this,\n event.dxMinTotal,\n event.dxMaxTotal,\n event.dyMinTotal,\n event.dyMaxTotal\n );\n this._setScrollbarViewport(bounds); // always update the scrollbars\n if (actionDone) this._setViewport(bounds, actionDone);\n }\n\n if (actionDone) {\n // Event handlers have to be reset because the plot area space may change\n DvtChartRenderer._setEventHandlers(this);\n\n // Clear the touch target, if there's one\n if (this._panZoomTarget != this._plotArea) {\n this._container.removeChild(this._panZoomTarget);\n this._panZoomTarget = null;\n }\n }\n\n // Fire viewport change event\n if (actionDone || !bounds.unchanged) {\n var viewportChangeEvent;\n if (DvtChartTypeUtils.isBLAC(this))\n viewportChangeEvent = dvt.EventFactory.newChartViewportChangeEvent(\n actionDone,\n bounds.xMin,\n bounds.xMax,\n bounds.startGroup,\n bounds.endGroup,\n null,\n null\n );\n else\n viewportChangeEvent = dvt.EventFactory.newChartViewportChangeEvent(\n actionDone,\n bounds.xMin,\n bounds.xMax,\n null,\n null,\n bounds.yMin,\n bounds.yMax\n );\n\n this.dispatchEvent(viewportChangeEvent);\n }\n }", "function zoomEndListener() {\n var map = _config.getMap();\n var currentZoomLevel = map.getZoom();\n var minZoom = map.getMinZoom();\n var maxZoom = minZoom + map.getNumZoomLevels() - 1;\n jQuery(\".olControlZoomOut\").removeClass(\"animatorControlZoomDisable\");\n jQuery(\".olControlZoomIn\").removeClass(\"animatorControlZoomDisable\");\n if (currentZoomLevel <= minZoom) {\n jQuery(\".olControlZoomOut\").addClass(\"animatorControlZoomDisable\");\n }\n if (currentZoomLevel >= maxZoom) {\n jQuery(\".olControlZoomIn\").addClass(\"animatorControlZoomDisable\");\n }\n }", "_zoomEventListener() {\r\n // CLASS REFERENCE\r\n let that = this;\r\n\r\n // ZOOM LISTENER\r\n d3.select('.zoom-display').on('keyup', function () {\r\n if (that.zoomState == false) return false;\r\n let zoom = d3.select(this).property('value') / 100;\r\n let newX = Utility.centerOfCanvas(that.canvasSize, (that.canvasSize.width * zoom), (that.canvasSize.height * zoom)).x;\r\n let newY = Utility.centerOfCanvas(that.canvasSize, (that.canvasSize.width * zoom), (that.canvasSize.height * zoom)).y;\r\n let newK = zoom\r\n that.svg.call(that.zoom.transform, d3.zoomIdentity.translate(newX, newY).scale(newK));\r\n that.zoomData.x = newX, that.zoomData.y = newY, that.zoomData.k = newK;\r\n })\r\n\r\n\r\n d3.selectAll('[data-zoom]').on('click', function () {\r\n if (that.zoomState == false) return false;\r\n\r\n let zoom = d3.select(this).attr('data-zoom');\r\n\r\n switch (zoom) {\r\n case \"35\": {\r\n let newX = Utility.centerOfCanvas(that.canvasSize, (that.canvasSize.width * 0.35), (that.canvasSize.height * 0.35)).x;\r\n let newY = Utility.centerOfCanvas(that.canvasSize, (that.canvasSize.width * 0.35), (that.canvasSize.height * 0.35)).y;\r\n let newK = 0.35\r\n that.svg.call(that.zoom.transform, d3.zoomIdentity.translate(newX, newY).scale(newK));\r\n that.zoomData.x = newX, that.zoomData.y = newY, that.zoomData.k = newK;\r\n $(\".zoom-display\").val(35);\r\n }\r\n break;\r\n case \"50\": {\r\n let newX = Utility.centerOfCanvas(that.canvasSize, (that.canvasSize.width * 0.5), (that.canvasSize.height * 0.5)).x;\r\n let newY = Utility.centerOfCanvas(that.canvasSize, (that.canvasSize.width * 0.5), (that.canvasSize.height * 0.5)).y;\r\n let newK = 0.5\r\n that.svg.call(that.zoom.transform, d3.zoomIdentity.translate(newX, newY).scale(newK));\r\n that.zoomData.x = newX, that.zoomData.y = newY, that.zoomData.k = newK;\r\n $(\".zoom-display\").val(50);\r\n }\r\n break;\r\n case \"100\": {\r\n let newX = Utility.centerOfCanvas(that.canvasSize, (that.canvasSize.width * 1), (that.canvasSize.height * 1)).x;\r\n let newY = Utility.centerOfCanvas(that.canvasSize, (that.canvasSize.width * 1), (that.canvasSize.height * 1)).y;\r\n let newK = 1\r\n that.svg.call(that.zoom.transform, d3.zoomIdentity.translate(newX, newY).scale(newK));\r\n that.zoomData.x = newX, that.zoomData.y = newY, that.zoomData.k = newK;\r\n $(\".zoom-display\").val(100);\r\n }\r\n break;\r\n case \"200\": {\r\n let newX = Utility.centerOfCanvas(that.canvasSize, (that.canvasSize.width * 2), (that.canvasSize.height * 2)).x;\r\n let newY = Utility.centerOfCanvas(that.canvasSize, (that.canvasSize.width * 2), (that.canvasSize.height * 2)).y;\r\n let newK = 2\r\n that.svg.call(that.zoom.transform, d3.zoomIdentity.translate(newX, newY).scale(newK));\r\n that.zoomData.x = newX, that.zoomData.y = newY, that.zoomData.k = newK;\r\n $(\".zoom-display\").val(200);\r\n }\r\n break;\r\n case \"fit\": {\r\n let newX = Utility.centerOfCanvas(that.canvasSize, (that.canvasSize.width * 1), (that.canvasSize.height * 1)).x;\r\n let newY = Utility.centerOfCanvas(that.canvasSize, (that.canvasSize.width * 1), (that.canvasSize.height * 1)).y;\r\n let newK = 1\r\n that.svg.call(that.zoom.transform, d3.zoomIdentity.translate(newX, newY).scale(newK));\r\n that.zoomData.x = newX, that.zoomData.y = newY, that.zoomData.k = newK;\r\n $(\".zoom-display\").val(200);\r\n }\r\n break;\r\n default:\r\n break;\r\n }\r\n })\r\n\r\n // ZOOM STATE\r\n d3.select('#zoom-state').on('click', function () {\r\n let element = d3.select(this);\r\n let state = element.attr('data-zoom-state');\r\n if (state === 'enable') {\r\n that.zoomState = false;\r\n that.svg.on('.zoom', null);\r\n element.attr('data-zoom-state', 'disable');\r\n element.select('img').attr('src', `${that.BASE_URL}assets/icons/zoom-disable.svg`);\r\n } else {\r\n that.zoomState = true;\r\n that.svg.call(that.zoom)\r\n that.zoom.transform(that.canvas, d3.zoomIdentity.translate(that.zoomData.x, that.zoomData.y).scale(that.zoomData.k));\r\n element.attr('data-zoom-state', 'enable');\r\n element.select('img').attr('src', `${that.BASE_URL}assets/icons/zoom-enable.svg`);\r\n }\r\n })\r\n\r\n }", "_zoomEndEvent(){\n\t\tlet zoom = this.map.getZoom();\n\n\t\tObject.keys(this.layers).forEach(layer => {\n\t\t\tlet el = this.layers[layer].options.pane;\n\n\t\t\tif(zoom >= 4){\n\t\t\t\tPrototypeElement.removeClassName(el, 'half');\n\t\t\t}\n\t\t\telse if(zoom < 4 && zoom >= 2){\n\t\t\t\tPrototypeElement.removeClassName(el, 'quarter');\n\t\t\t\tPrototypeElement.addClassName(el, 'half');\n\t\t\t}\n\t\t\telse if(zoom < 2 && zoom >= 1){\n\t\t\t\tPrototypeElement.removeClassName(el, 'half');\n\t\t\t\tPrototypeElement.removeClassName(el, 'invis');\n\t\t\t\tPrototypeElement.addClassName(el, 'quarter');\n\t\t\t}\n\t\t\telse if(zoom < 1){\n\t\t\t\tPrototypeElement.removeClassName(el, 'quarter');\n\t\t\t\tPrototypeElement.addClassName(el, 'invis');\n\t\t\t}\n\n\t\t\t// i hate this.\n\t\t\tif(['map_label', 'sector_label'].includes(layer)){\n\t\t\t\tObject.keys(el.children).forEach(c => {\n\t\t\t\t\tlet origin = window.getComputedStyle(el.children[c]).perspectiveOrigin.split(' ');\n\n\t\t\t\t\tel.children[c].style.left = '-'+origin[0];\n\t\t\t\t\tel.children[c].style.top = '-'+origin[1];\n\t\t\t\t});\n\t\t\t}\n\n\t\t});\n\n\t}", "function zoomActual()\n\t{\n\t\t_3dApp.script(_scriptGen.zoom(_options.defaultZoom));\n\t}", "function changeZoomHandler(event) {\n if(event.target.value == '.25') {\n map.setZoom(18);\n }\n else if(event.target.value == '.5') {\n map.setZoom(17);\n }\n else if(event.target.value == '1') {\n map.setZoom(16);\n }\n}", "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}", "zoomIn() {\n this.zoom *= 1.25;\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 onZoomPlotFrame() {\n if (map.graphics.graphics.length > 0) {\n var extentOfAllPlotFrames = getExtentOfAllPlotFrames();\n var extentOfCurrentPlotFrame = getExtentOfCurrentPlotFrame();\n var deltaX = (extentOfCurrentPlotFrame.xmax - extentOfCurrentPlotFrame.xmin) / 2;\n var deltaY = (extentOfCurrentPlotFrame.ymax - extentOfCurrentPlotFrame.ymin) / 2;\n zoomToExtent(extentOfAllPlotFrames.xmin - deltaX,\n extentOfAllPlotFrames.ymin - deltaY,\n extentOfAllPlotFrames.xmax + deltaX,\n extentOfAllPlotFrames.ymax + deltaY);\n }\n onMovePlotFrame();\n}", "function ZoomableView() { }", "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 on_map_zoom(map) {\n console.log(\"[map-zoom] Current level: [\" + map.zoom + \"]\");\n}", "zoomOut() {\n this.zoom *= 0.8;\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}", "onZoomSliderChange(evt) {\n if (this.debugMode) console.log(\"onZoomSliderChange\", evt)\n\n this.stageScaleNum = (evt.target.value * 0.1) + 1\n this.props.onZoomUpdate(this.stageScaleNum);\n\n var evt = new CustomEvent('zoomOccured', { detail: this.stageScaleNum });\n window.dispatchEvent(evt);\n\n document.querySelector('#zoom-slider').MaterialSlider.change((this.stageScaleNum - 1) * 10);\n }", "function zoomToFeature(e){\n map.fitBounds(e.target.getBounds());\n }", "function zoom_limit(){\n\tgoogle.maps.event.addListener(map, 'change_zoom', function(){\n\t\tif(map.getZoom()<min_zoom){\n\t\t\tmap.setZoom(min_zoom);\n\t\t}\n\t});\n}", "function zoomFocus(e) {\n\t\t\tmap.fitBounds(e.target.getBounds().pad(1.5));\n\t\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 zoomed() {\n //create new scale objects based on event\n that.new_xScale = d3.event.transform.rescaleX(that.xScale);\n\n //update axes\n that.gX.call(that.x_axis.scale(that.new_xScale));\n\n //If the user selects one or more enzymes\n if (that.dataset.length != 0) {\n that.svg.selectAll(\"circle\").data(that.dataset)\n .attr('cx', function (d) { return that.new_xScale(d) })\n .attr('cy', that.xAxisTranslate);\n }\n }", "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 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 }", "_zoomEventListener() {\n // CLASS REFERENCE\n let that = this;\n\n // ZOOM LISTENER\n d3.select('.zoom-display').on('keyup', function () {\n if (that.zoomState == false) return false;\n let zoom = d3.select(this).property('value') / 100;\n let newX = Utility.centerOfCanvas(that.canvasSize, (that.canvasSize.width * zoom), (that.canvasSize.height * zoom)).x;\n let newY = Utility.centerOfCanvas(that.canvasSize, (that.canvasSize.width * zoom), (that.canvasSize.height * zoom)).y;\n let newK = zoom\n that.svg.call(that.zoom.transform, d3.zoomIdentity.translate(newX, newY).scale(newK));\n that.zoomData.x = newX, that.zoomData.y = newY, that.zoomData.k = newK;\n })\n\n\n d3.selectAll('[data-zoom]').on('click', function () {\n if (that.zoomState == false) return false;\n\n let zoom = d3.select(this).attr('data-zoom');\n let mVariable = parseFloat(`.${zoom}`);\n if (zoom >= 100) {\n mVariable = mVariable * 10;\n }\n console.log(mVariable)\n let newK = parseInt(zoom) / 100;\n // let newX = Utility.centerOfCanvas(that.canvasSize, (that.canvasSize.width * mVariable), (that.canvasSize.height * mVariable)).x;\n // let newY = Utility.centerOfCanvas(that.canvasSize, (that.canvasSize.width * mVariable), (that.canvasSize.height * mVariable)).y;\n let newX = Utility.centerOfCanvas(that.canvasSize, (that.canvasSize.width * mVariable), (that.canvasSize.height * mVariable)).x;\n let newY = Utility.centerOfCanvas(that.canvasSize, (that.canvasSize.width * mVariable), (that.canvasSize.height * mVariable)).y;\n // let newK = 0.75\n that.svg.call(that.zoom.transform, d3.zoomIdentity.translate(newX, newY).scale(newK));\n that.zoomData.x = newX, that.zoomData.y = newY, that.zoomData.k = newK;\n $(\".zoom-display\").val(newK * 100);\n\n })\n\n // ZOOM STATE\n d3.select('#zoom-state').on('click', function () {\n let element = d3.select(this);\n let state = element.attr('data-zoom-state');\n if (state === 'enable') {\n that.zoomState = false;\n that.svg.on('.zoom', null);\n element.attr('data-zoom-state', 'disable');\n element.select('img').attr('src', `${that.BASE_URL}assets/icons/zoom-disable.svg`);\n } else {\n that.zoomState = true;\n that.svg.call(that.zoom)\n that.zoom.transform(that.canvas, d3.zoomIdentity.translate(that.zoomData.x, that.zoomData.y).scale(that.zoomData.k));\n element.attr('data-zoom-state', 'enable');\n element.select('img').attr('src', `${that.BASE_URL}assets/icons/zoom-enable.svg`);\n }\n })\n\n }", "function zoomToFeature(e) {\n map.fitBounds(e.target.getBounds());\n }", "function zoomToFeature(e) {\n \tmap.fitBounds(e.target.getBounds());\n }", "function zoomTo(e) {\n map.fitBounds(e.layer.getBounds());\n}", "function onZoomInClicked()\n {\n onMapActivityOccuring();\n\n var view = map.getView();\n var zoom = view.getZoom();\n\n if (zoom < MAX_ZOOMLEVEL)\n view.setZoom(zoom + 1);\n }", "function ControllerMagDown(e) {\n var sel = this.parentNode.zoomsel;\n if (sel.selectedIndex == 0 || sel.selectedIndex == 1) {\n magzoom = this.parentNode.canvas.origZoom;\n }\n\n if (haveZoomed)\n magzoom -= 1;\n if (magzoom <= 1) magzoom = 2;\n\n checkZoomLevel(magzoom, this.parentNode);\n sel.selectedIndex = magzoom;\n ZoomImage(sel.options[sel.selectedIndex].value, this.parentNode.canvas);\n haveZoomed = true;\n}", "setupZoom () {\n const mainViewerZoom = getZoom(\n MAIN_VIEWER_DIMENSIONS.width,\n MAIN_VIEWER_DIMENSIONS.height,\n zoomedAll,\n [this]\n )\n this.axisElements['plot-marker'].call(mainViewerZoom)\n }", "function start() {\n d3_v3_behavior_zoomXyz = xyz;\n d3_v3_behavior_zoomExtent = extent;\n d3_v3_behavior_zoomDispatch = event.zoom;\n d3_v3_behavior_zoomEventTarget = d3_v3.event.target;\n d3_v3_behavior_zoomTarget = this;\n d3_v3_behavior_zoomArguments = arguments;\n }", "function zoomToFeature(e) {\n map.fitBounds(e.target.getBounds());\n }", "function zoomToFeature(e) {\r\n map.fitBounds(e.target.getBounds());\r\n }", "function zoomFunction() {\n\t\tvar transform = d3.event.transform;\n\t\td3.select(\"#map_g\")\n\t\t.attr(\"transform\", \"translate(\" + transform.x + \",\" + transform.y + \") scale(\" + transform.k + \")\")\n\t}", "setZoom(zoom){\n this.zoom = zoom;\n }", "addEventListeners() {\n const { width, height, padding, offsetTop, offsetRight } = this.props;\n const $template = d3Select(this.svgEl.current);\n\n const zoom = d3Zoom()\n // .translateExtent([\n // [-Infinity, offsetTop],\n // [width - offsetRight, Infinity],\n // ])\n .scaleExtent([0.5, 20])\n .extent([\n [padding, offsetTop],\n [width - offsetRight, height - padding],\n ])\n .on('zoom', this.onZoom);\n\n $template.call(zoom);\n }", "function onMove() {\t\t\t\n\t\tWGL.mcontroller.zoommove(map.getZoom(), getTopLeftTC(), WGL.filterByExt);\n}", "function onMove() {\t\t\t\n\t\tWGL.mcontroller.zoommove(map.getZoom(), getTopLeftTC(), WGL.filterByExt);\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 ControllerMagDown(e) {\r\n 'use strict';\r\n var sel = this.parentNode.zoomsel;\r\n if (sel.selectedIndex === 0 || sel.selectedIndex === 1) {\r\n magzoom = this.parentNode.canvas.origZoom;\r\n }\r\n if (haveZoomed) {\r\n magzoom -= 1;\r\n }\r\n if (magzoom <= 1) {\r\n magzoom = 2;\r\n }\r\n checkZoomLevel(magzoom, this.parentNode);\r\n sel.selectedIndex = magzoom;\r\n zoomImage(sel.options[sel.selectedIndex].value, this.parentNode.canvas);\r\n haveZoomed = true;\r\n}", "function clickZoom(e) {\r\n map.setView(e.target.getLatLng(),13);\r\n var clicked_lat = (e.target.getLatLng()['lng']);\r\n var clicked_lng = (e.target.getLatLng()['lat']);\r\n\r\n //console.log(\"got here\")\r\n \r\n // remove everything inside #gauge so we can update it with new info\r\n d3.selectAll('#gauge > *').remove();\r\n // Calling gauge functions\r\n buildGauge(gaugeSetup(clicked_lat,clicked_lng));\r\n }", "function zoomToFeature(e) {\n myMap.fitBounds(e.target.getBounds());\n }", "function start() {\n d3_behavior_zoomXyz = xyz;\n d3_behavior_zoomExtent = extent;\n d3_behavior_zoomDispatch = event.zoom;\n d3_behavior_zoomEventTarget = d3.event.target;\n d3_behavior_zoomTarget = this;\n d3_behavior_zoomArguments = arguments;\n }", "function onZoomChanged(e, Panzoom, zoom) {\n instance.setZoom(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 adjustZoom() {\n var listener = google.maps.event.addListener(namespace.map, \"zoom_changed\", function() {\n if (zoomIgnore) {\n zoomIgnore = false;\n return;\n }\n if (namespace.map.getZoom() > 16) {\n zoomIgnore = true;\n namespace.map.setZoom(16);\n }\n google.maps.event.removeListener(listener);\n });\n}", "function zoomToFeature(e) {\r\n\t\tmap1.fitBounds(e.target.getBounds());\r\n\t}", "function zoom() {\n svgGroup.attr(\"transform\", `translate(${d3.event.translate})scale(${d3.event.scale})`);\n }", "function bounds_changed_handler ( )\n\t{\n\t\tgoogle.maps.event.removeListener ( g_main_map.init_listener );\n\t\tg_main_map.init_listener = google.maps.event.addListener\t( g_main_map, \"tilesloaded\", tiles_loaded_handler );\n\t\tfit_markers();\n\t\t// The markers get drawn during the \"zoom_changed\" event.\n\t\tgoogle.maps.event.addListener ( g_main_map, \"zoom_changed\", zoom_changed_handler );\n\t}", "function zoomed() {\n\n var zoom_x = d3.event.scale,\n zoom_y = d3.event.scale,\n trans_x = d3.event.translate[0] - params.viz.clust.margin.left,\n trans_y = d3.event.translate[1] - params.viz.clust.margin.top;\n\n // apply transformation\n apply_transformation(trans_x, trans_y, zoom_x, zoom_y);\n }", "zoomIn(x, y){ return this.zoom(x, y, this.Scale.current + this.Scale.factor) }", "function zoomToFeature(e) {\r\n map.fitBounds(e.target.getBounds());\r\n}", "function zoomIn()\n\t{\n\t\t_3dApp.script(_scriptGen.defaultZoomIn());\n\t}", "zoomIn() {\n this.zoomWithScaleFactor(0.5)\n }", "function ControllerZoomLevel(e) {\n var sel = this.parentNode.zoomsel;\n magzoom = sel.selectedIndex;\n checkZoomLevel(magzoom, this.parentNode);\n ZoomImage(sel.options[sel.selectedIndex].value, this.parentNode.canvas);\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 AdjustZoomLevel() {\n\tcurrentZoomLevel = map.getZoom();\n}", "function zoom() {\n svgGroup.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n }", "function zoomToFeature(e) {\n map.fitBounds(e.target.getBounds());\n info_panel.update(layer.feature.properties);\n}", "function zoom() {\n //console.log(\"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 svgGroup.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n }", "_onMouseUpWithZoomMode() {\n let { zoomLevel } = this;\n const { zoomArea } = this;\n const { moveZoom, stopZoom } = this._listeners;\n const canvas = this.getCanvas();\n const center = this._getCenterPoint();\n const { x, y } = center;\n\n if (!this._isMaxZoomLevel()) {\n this._centerPoints.push({\n x,\n y,\n prevZoomLevel: zoomLevel,\n zoomLevel: zoomLevel + 1,\n });\n zoomLevel += 1;\n canvas.zoomToPoint({ x, y }, zoomLevel);\n\n this._fireZoomChanged(canvas, zoomLevel);\n\n this.zoomLevel = zoomLevel;\n }\n\n canvas.off({\n 'mouse:move': moveZoom,\n 'mouse:up': stopZoom,\n });\n\n canvas.remove(zoomArea);\n this._startPoint = null;\n }", "function zoomed(){\n if (zoomHelpText){\n zoomHelpText.remove();\n }\n\n // Get current zoom scale\n currScale = {\n x: d3.event.transform.rescaleX(xScale),\n y: d3.event.transform.rescaleY(yScale)\n };\n\n // Transform contour plot, minimum circles, axes and Nelder-Mead triangles according to zoom\n contourPlot.attr(\"transform\", d3.event.transform);\n\n radarCircle.attr(\"transform\", d3.event.transform);\n minCircle.attr(\"transform\", d3.event.transform);\n\n gX.call(xAxis.scale(currScale.x));\n gY.call(yAxis.scale(currScale.y));\n\n d3.select(\"#triangle\").attr(\"transform\", d3.event.transform);\n\n // Hide crosshair/coordinate display while zooming\n showCrosshair(this, false);\n showCoords(this, false);\n}", "function zoomToFeature(e) {\n map.fitBounds(e.target.getBounds());\n}", "function zoomToFeature(e) {\n map.fitBounds(e.target.getBounds());\n}", "function zoomToFeature(e) {\n map.fitBounds(e.target.getBounds());\n}", "function zoom() {\n svgGroup.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n }", "onZoom($event, direction) {\n if (this.enableTrackpadSupport && !$event.ctrlKey) {\n this.pan($event.deltaX * -1, $event.deltaY * -1);\n return;\n }\n const zoomFactor = 1 + (direction === 'in' ? this.zoomSpeed : -this.zoomSpeed);\n // Check that zooming wouldn't put us out of bounds\n const newZoomLevel = this.zoomLevel * zoomFactor;\n if (newZoomLevel <= this.minZoomLevel || newZoomLevel >= this.maxZoomLevel) {\n return;\n }\n // Check if zooming is enabled or not\n if (!this.enableZoom) {\n return;\n }\n if (this.panOnZoom === true && $event) {\n // Absolute mouse X/Y on the screen\n const mouseX = $event.clientX;\n const mouseY = $event.clientY;\n // Transform the mouse X/Y into a SVG X/Y\n const svg = this.chart.nativeElement.querySelector('svg');\n const svgGroup = svg.querySelector('g.chart');\n const point = svg.createSVGPoint();\n point.x = mouseX;\n point.y = mouseY;\n const svgPoint = point.matrixTransform(svgGroup.getScreenCTM().inverse());\n // Panzoom\n this.pan(svgPoint.x, svgPoint.y, true);\n this.zoom(zoomFactor);\n this.pan(-svgPoint.x, -svgPoint.y, true);\n }\n else {\n this.zoom(zoomFactor);\n }\n }", "function handleMouseWheel(e) {\r\n e.preventDefault()\r\n e.stopPropagation()\r\n var zoomDelta = parseInt(e.deltaY) / 10\r\n zoomlevel = parseInt(zoomlevel)\r\n zoomlevel = zoomlevel + zoomDelta / 10\r\n\r\n log(\"zoomDelta: \" + zoomDelta.toString())\r\n log(\"zoomlevel: \" + zoomlevel.toString())\r\n\r\n if (zoomlevel >= 400) {\r\n zoomlevel = 400\r\n log(\"Full Zoom\")\r\n } else if (zoomlevel <= 5) {\r\n zoomlevel = 5\r\n log(\"Full Zoom\")\r\n }\r\n $(\"#myRange\").eq(0).val(zoomlevel)\r\n recalc()\r\n}", "function adjustForZoomDelayed() {\n clearTimeout(zoomTimeout);\n zoomTimeout = setTimeout(\"adjustForZoom()\", 10);\n}", "function move_screen()\r\n{\r\n\tzoomClicked = true;\r\n\tzoomCount++;\r\n\r\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 zoomToFeature(e) {\n popMap.fitBounds(e.target.getBounds());\n}", "zoomSvg (d3Event) {\n if (d3Event.deltaY > 0) {\n this.currentZoom -= this.currentZoom > 0.3 ? 0.2 : 0\n } else {\n this.currentZoom += this.currentZoom < 1.6 ? 0.2 : 0\n }\n this.svg.attr('transform', 'translate(' + this.movement.x + ' ' + this.movement.y + ') scale(' + this.currentZoom + ' ' + this.currentZoom + ')')\n }" ]
[ "0.77054757", "0.7683496", "0.7528863", "0.7322875", "0.72404444", "0.72291535", "0.72169966", "0.71679544", "0.71493906", "0.7140538", "0.71404344", "0.71395624", "0.70767236", "0.7068506", "0.70560664", "0.7050216", "0.7036339", "0.7033562", "0.7031384", "0.70246893", "0.6962952", "0.6962952", "0.6929281", "0.6910898", "0.6908618", "0.6894766", "0.6885143", "0.68829787", "0.6871053", "0.6869151", "0.6868338", "0.6866812", "0.68580407", "0.6831968", "0.6816895", "0.68060464", "0.6805061", "0.6803174", "0.6802063", "0.67994136", "0.6799131", "0.6798741", "0.67751676", "0.6772436", "0.67697734", "0.6767567", "0.6761393", "0.6756951", "0.6740289", "0.673806", "0.67308664", "0.67277974", "0.6722526", "0.6711214", "0.6707265", "0.66995174", "0.66985774", "0.6697286", "0.66968024", "0.6693339", "0.6691685", "0.6691685", "0.6686776", "0.66863036", "0.6679315", "0.6677013", "0.66763806", "0.6676316", "0.66665787", "0.66619706", "0.66604805", "0.66485375", "0.66416675", "0.6634959", "0.6617643", "0.6615796", "0.6596854", "0.65962815", "0.6594363", "0.65942097", "0.6588724", "0.6588011", "0.6581387", "0.6578014", "0.6578014", "0.6578014", "0.6578014", "0.6578014", "0.6559795", "0.6559429", "0.65592486", "0.65592486", "0.65592486", "0.65539515", "0.65530485", "0.6552441", "0.65474", "0.6547335", "0.65470994", "0.6524938", "0.6520638" ]
0.0
-1
change drawing to start from on drag to on mouse down. EVENT CALLBACK FUNCTIONS
function doMousedown(e){ dragging = true; let mouse = getMouse(e); ctx.beginPath(); ctx.moveTo(mouse.x, mouse.y); //points currentLayer.push(mouse); allPoints.push(currentLayer); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function win_drag_start(ftWin){draggingShape = true;}", "startDrag(x, y) {}", "function onMouseDown(e){\n drawing = true;\n current.x = e.clientX;\n current.y = e.clientY;\n }", "function mousemove() {\n if (isMouseDown) {\n draw();\n }\n}", "function drag_start(d) {\n\t\t\t if (!d3.event.active) simulation.alphaTarget(0.3).restart();\n\t\t\t d.fx = d.x;\n\t\t\t d.fy = d.y;\n\t\t\t}", "mouseDrag(prev, pt) {}", "mouseDrag(prev, pt) {}", "function OnMouseDown(){\n\tbeingDragged = true;\n}", "function drag_start(d) {\n if (!d3.event.active) simulation.alphaTarget(0.3).restart();\n d.fx = d.x;\n d.fy = d.y;\n }", "function dragStarted () {\n d3.select(this).raise()\n d3.select(this).attr('cursor', 'grabbing')\n }", "function startDrawing(event) {\n\tdrawingMode = true;\n\tmouseUpDownLabel.innerHTML = \"Mouse Button Down (drawing mode)\";\n}", "function drag_start(d) {\n if (!d3.event.active) simulation.alphaTarget(0.3).restart();\n d.fx = d.x;\n d.fy = d.y;\n}", "function drag_start(d) {\n if (!d3.event.active) simulation.alphaTarget(0.3).restart();\n d.fx = d.x;\n d.fy = d.y;\n}", "onDragStarted(mousePosition) {\n }", "function drag_start(d) {\n if (!d3.event.active) simulation.alphaTarget(0.3).restart();\n d.fx = d.x;\n d.fy = d.y;\n}", "function onMouseDown(event)\n{\n dragging = true;\n var pos = getRelative(event);\n mouseDragStartX = pos.x;\n mouseDragStartY = pos.y;\n}", "function mouseDown(event) {\n mouseIsDown = true;\n // if (drawHandle === -1) {\n // drawHandle = setInterval(mousePressed, 100);\n // }\n }", "_onMouseMove(event) {\n super._onMouseMove(event);\n if (event.data.createState >= 1) {\n let drawing = event.data.object;\n let [gx, gy] = [event.data.originalEvent.x, event.data.originalEvent.y];\n\n // If the cursor has moved close to the edge of the window\n this._panCanvasEdge(gx, gy);\n\n drawing.updateDragPosition(event.data.destination)\n drawing.refresh();\n event.data.createState = 2;\n }\n }", "function start_animation()\n{\n \tvar element = document.getElementById(\"canvas\");\n\t// implement mouse drag\t\n\tvar flag = 0;\n\telement.addEventListener(\"mousedown\", function(event){\n flag = 1;\n\t}, false);\n\telement.addEventListener(\"mousemove\", function(event){\n\tif(flag === 1)\n\t{\n console.log(\"drag\");\n mouseX = event.layerX;\n mouseY = event.layerY;\n\n\t}\n\n\t}, false);\n\telement.addEventListener(\"mouseup\", function(event){\n \tflag=0;\n\t}, false);\n\n\tcontext = element.getContext(\"2d\");\n\n\tdrawFunction(mouseX, mouseY);\n}", "function dragstarted(event, d) {\n if (!event.active) simulation.alphaTarget(.03).restart();\n d.fx = d.x;\n d.fy = d.y;\n }", "function drag_start(d) {\n if (!d3.event.active) simulation.alphaTarget(0.3).restart();\n d.fx = d.x;\n d.fy = d.y;\n \n}", "function dragstarted(event, d) {\n if (!event.active) simulation.alphaTarget(.03).restart();\n d.fx = d.x;\n d.fy = d.y;\n }", "function dragStart(e) {\n defaultX = e.clientX - xOffset;\n defaultY = e.clientY - yOffset;\n\n if (e.target === canvas) {\n active = true;\n }\n}", "function dragStart(d) {\n if (!d3.event.active) {\n simulation.alphaTarget(0.3).restart();\n }\n d.fx = d.x;\n d.fy = d.y;\n }", "function dragStarted(d) {\n if (!d3.event.active) simulation2.alphaTarget(0.2).restart();\n d.fx = d.x;\n d.fy = d.y;\n }", "function dragStart(event) {\n draggingDraw = true;\n dragStartLocation = getCanvasCoordinates(event);\n\tcolor = \"rgb(\" + Math.floor(Math.random()*200) + \",\" + Math.floor(Math.random()*200) + \",\" + Math.floor(Math.random()*200) +\")\";\n getImage();\n}", "function dragstarted() {\n v0 = versor.cartesian(projection.invert(d3.mouse(this)));\n r0 = projection.rotate();\n q0 = versor(r0);\n}", "function handleDragStart(){\n this.isMouseDown = true\n}", "function dragstarted() {\n v0 = versor.cartesian(projection.invert(d3.mouse(this)));\n r0 = projection.rotate();\n q0 = versor(r0);\n}", "dragToStart(e) {\n this.drag.status = true;\n this.drag.x = e.clientX - this.center.x;\n this.drag.y = e.clientY - this.center.y;\n }", "function startDrawing(event) {\n isDrawing = true;\n [lastX, lastY] = [event.offsetX, event.offsetY];\n}", "function mouseDragged() {\r\n\tif (!blockDrawing) {\r\n\t\tswitch (state) {\r\n\t\t\tcase 'pencil':\r\n\t\t\t\tvar newObject = new PencilObj(mouseX, mouseY, document.getElementById(\"slid\").value, pmouseX, pmouseY, myCol, 0, fileName); //0 ist hinten\r\n\t\t\t\tdrawObject(newObject);\r\n\t\t\t\tpencilObj.push(newObject);\r\n\t\t\t\tstroke = true;\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'rect':\r\n\t\t\t\tactiveObj = new RectObj(startPosX, startPosY, document.getElementById(\"slid\").value, mouseX - startPosX, mouseY - startPosY, myCol, filled, 1, fileName);\r\n\t\t\t\tdrawObject(activeObj);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'circle':\r\n\t\t\t\tactiveObj = new CircleObj(startPosX, startPosY, document.getElementById(\"slid\").value, mouseX - startPosX, mouseY - startPosY, myCol, filled, 1, fileName);\r\n\t\t\t\tdrawObject(activeObj);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'line':\r\n\t\t\t\tactiveObj = new LineObj(startPosX, startPosY, document.getElementById(\"slid\").value, mouseX, mouseY, myCol, 1, fileName);\r\n\t\t\t\tdrawObject(activeObj);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n}", "function dragging(event) { \n if (!start) { \n return; \n } \n if (!outline) { \n outline = svgWrapper.rect(0, 0, 0, 0, \n {fill: 'none', stroke: '#c0c0c0', strokeWidth: 1, strokeDashArray: '2,2'}); \n $(outline).mouseup(endDrag); \n } \n svgWrapper.change(outline, {x: Math.min(event.clientX - offset.left, start.X), \n y: Math.min(event.clientY - offset.top, start.Y), \n width: Math.abs(event.clientX - offset.left - start.X), \n height: Math.abs(event.clientY - offset.top - start.Y)});\n event.preventDefault(); \n}", "function drag_start(d) {\n\t\t\t\td3.select(this).raise().classed(\"active\", true);\n\t\t\t\t\n\n\t\t\t}", "function startDrawing(e) {\n\tcontext.moveTo(e.clientX, e.clientY);\n\tlastDrawing.push(new Array(e.clientX, e.clientY));\n\tdraw = true;\n\tmouseDraw(e);\n}", "function dragStart() {\n mx = d3.event.x;\n my = d3.event.y;\n }", "function mouseReleased(){\n\tdrawing = false;\n}", "function mousedown(e) {\n\tif (!e) var e = window.event;\n\te.preventDefault();\t\t// Tries to prevent I-beam\n\t\t\n\tisDrawing = true;\n console.log(isDrawing);\n\tstate.canvasX = e.pageX - state.canvas.offsetLeft;\n state.canvasY = e.pageY - state.canvas.offsetTop;\n\tstate.context.beginPath();\n state.context.moveTo(state.canvasX, state.canvasY);\n}", "function dragstarted(d) {\n if (!d3.event.active) simulation.alphaTarget(.03).restart();\n d.fx = d.x;\n d.fy = d.y;\n }", "function dragstarted(d) {\n\tif (!d3.event.active) simulation.alphaTarget(0.3).restart();\n\td.fx = d.x;\n\td.fy = d.y;\n}", "onDrag(mousePosition) {\n }", "function canvas_mouseDown(){\r\n drawing = true;\r\n context.moveTo(event.pageX, event.pageY);\r\n context.beginPath();\r\n}", "function editOnDragStart(){this._internalDrag=true;this.setMode('drag');}", "function wall_drag_start(ftWall){draggingShape = true;}", "function mousedown(e){\n e.preventDefault();\n state.dragging = {};\n state.dragging.start = {\n x: e.pageX,\n y: e.pageY\n }\n state.dragging.original_x = state.center.x;\n state.dragging.original_y = state.center.y;\n $(document).bind(\"mousemove\", mousemove);\n $(document).bind(\"mouseup\", mouseup);\n }", "function startPainting(event){ \n paint = true; \n getPosition(event); \n}", "function dragStarted() {\n if (!d3.event.active) simulationPointer.alphaTarget(1).restart();\n d3.event.subject.fx = d3.event.subject.x;\n d3.event.subject.fy = d3.event.subject.y;\n}", "function handleMouseDown(event) {\n var lLabel = document.getElementById( \"debug-label-2\" );\n gMmouseDown = true;\n var oldX = gLastMouseXdown;\n var oldY = gLastMouseYdown; \n\n if (event.x != undefined && event.y != undefined) {\n gLastMouseXdown = event.x + document.body.scrollLeft +\n document.documentElement.scrollLeft;\n gLastMouseYdown = event.y + document.body.scrollTop +\n document.documentElement.scrollTop;\n lLabel.innerHTML = \"event.x=\" + event.x + \" event.y=\" + event.y;\n } else {\n // Firefox method to get the position\n gLastMouseXdown = event.clientX + document.body.scrollLeft +\n document.documentElement.scrollLeft;\n gLastMouseYdown = event.clientY + document.body.scrollTop +\n document.documentElement.scrollTop;\n lLabel.innerHTML = \"event.clientX=\" + event.clientX + \" event.clientY=\" + event.clientY;\n }\n\n gLastMouseXdown -= gCanvas.offsetLeft;\n gLastMouseYdown -= gCanvas.offsetTop;\n lLabel.innerHTML += \" handleMouseDown: old(\"+oldX+\",\"+oldY+\")\"+\" new(\"+gLastMouseXdown+\",\"+gLastMouseYdown+\")\"\n\n if (lProx) {\n lEdit = true;\n } else if (vGProx || !moved) {\n vEdit = true;\n } else {\n gLineVertices = [\n oldX, oldY,\n gLastMouseXdown, gLastMouseYdown\n ]; \n }\n\n// refreshCanvas();\n}", "onMouseDown(coord, event) {\n if (this.mouseUp == true) {\n \n this.startX = [];\n this.startY = [];\n this.contextReal.moveTo(coord[0], coord[1])\n this.contextReal.beginPath();\n this.mouseUp = false;\n }\n }", "_onDragStart() {\n this._isDragged = true;\n }", "function mouseUp(event) {\n mouseIsDown = false;\n // if (drawHandle !== -1) {\n // clearInterval(drawHandle);\n // drawHandle = -1;\n // }\n }", "function mysketchpad_mouseUp() {\n mouseDown = 0;\n lastX=-1;\n lastY=-1;\n }", "function dragstarted (d) {\n if (!d3.event.active) simulation.alphaTarget(0.03).restart()\n d.fx = d.x\n d.fy = d.y\n }", "function startDrawing(x,y){\n // console.log(e);\n isDrawing = true;\n startX = x;\n startY = y;\n}", "function dragstarted(d) {\n if (!d3.event.active) simulation.alphaTarget(0.3).restart();\n d.fx = d.x;\n d.fy = d.y;\n}", "function dragstarted(d) {\n if (!d3.event.active) simulation.alphaTarget(0.3).restart();\n d.fx = d.x;\n d.fy = d.y;\n}", "function mouseDownEvent(eb){\r\n dragging = eb\r\n}", "function dragStart() {\n\t\tconsole.log('started draggin');\n\t}", "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 }", "function startDrag(clientX,clientY) {\n var r = canvas.getBoundingClientRect();\n var x = clientX - r.left;\n var y = clientY - r.top;\n dragbox = new DragBox(x,y);\n doDraw();\n }", "function dragstarted(d) {\n //console.log(\"started\")\n if(click) unclick_auth()\n if(clickP)\n d3.select(\"#p\"+d.id)\n .attr(\"r\", 10)\n //if(clickP) unclick_pap(clkPp)\n /*if (!d3.event.active) */simulation.alpha(1).alphaMin(0.1).alphaDecay(0.0001).restart();\n d.fx = d.x;\n d.fy = d.y;\n}", "function bindDrag(){\n var currentPoint = this;\n window.zr.on('mousemove', function(params){\n var targetX = params.event.offsetX;\n var targetY = params.event.offsetY;\n currentPoint.style.x = targetX\n currentPoint.style.y = targetY\n zr.modShape(currentPoint);\n if(currentPoint == _startPoint){\n _this.style.xStart = targetX\n _this.style.yStart = targetY;\n }else if(currentPoint == _endPoint){\n _this.style.xEnd = targetX\n _this.style.yEnd = targetY;\n }\n\n zr.modShape(_this)\n });\n }", "function dragOrResizeStart (){\n lastChangeX = 0, lastChangeY = 0;\n isDraggingOrResizing = true;\n }", "listenDragging() {\n this.pointRender.pause();\n }", "function mousemove() {\n if(!mousedown_node) return;\n\n // update drag line\n drag_line.attr('d', 'M' + mousedown_node.x + ',' + mousedown_node.y + 'L' + d3.mouse(this)[0] + ',' + d3.mouse(this)[1]);\n\n /////////////////restart();\n }", "function drag_start(d) {\n if (!d3.event.active) simulation.alphaTarget(0.3).restart();//alpha will go up to 0.3, keeping the graph active!!\n d.fx = d.x;//a node with a defined node.fx has node.x reset to this value and node.vx set to zero\n d.fy = d.y;\n}", "function mouse_down(e) {\n var h = e.pageX - Number($('#can').css('left').replace('px', ''));\n var w = e.pageY - Number($('#can').css('top').replace('px', ''));\n draw = true;\n context.beginPath();\n context.lineWidth = 3;\n context.lineJoin = context.lineCap = 'round';\n context.shadowBlur = 0;\n context.shadowColor = 'rgb(0, 0, 0)';\n context.moveTo(h, w);\n }", "function dragstarted(d) {\n if (!d3.event.active) forceSim.alphaTarget(0.3).restart();\n d.fx = d.x;\n d.fy = d.y;\n }", "function onMouseUp(event)\n{\n onMouseMove(event); // just reusing the above code\n dragging = false; // adding one line here\n}", "function onMouseUp(e){\n if (!drawing) { return; }\n drawing = false;\n drawLine(current.x, current.y, e.clientX, e.clientY, current.color, getLineWidth(), true);\n }", "function dragStart(event, d) {\n d3.select(this)\n .classed('active', true)\n .attr(\"stroke-width\", 8);\n }", "function mouseDragged() {\n onceMoved = true;\n mouseMove = true;\n \n xCentreCoord -= (1/coordToPixelRatio)*(mouseX - startMouseX);\n yCentreCoord += (1/coordToPixelRatio)*(mouseY - startMouseY);\n\n startMouseX = mouseX;\n startMouseY = mouseY;\n }", "_onMouseUp () {\n Actions.changeDragging(false);\n }", "function dragstarted(d) {\r\n if (!d3.event.active) simulation.alphaTarget(0.5).restart();\r\n p1 = d.x;\r\n p2 = d.y;\r\n d.fx = d.x;\r\n d.fy = d.y;\r\n\r\n}", "function file_drag_start(){\n\n\tdrag_flag();\n\n}", "function dragstarted(d) {\n if (!d3.event.active) force06_3.alphaTarget(0.3).restart();\n d.fx = d.x;\n d.fy = d.y;\n }", "startDrawing() {\n\n this.clearCanvas();\n //use because funtions was lost in methods\n var that = this;\n //event of mous click\n this.canvas.addEventListener(\"mousedown\", function(e) {\n //show confirmation button after first click\n document.getElementById(\"station-confirmer-btn\").style.display = \"initial\";\n document.getElementById(\"canvas\").style.borderColor = \"#5CB85C\";\n //switch on\n that.test = true;\n //begin of drawing\n that.context.beginPath();\n that.context.moveTo(e.offsetX, e.offsetY);\n //get the movement of mouse\n that.canvas.addEventListener(\"mousemove\", function(event) {\n //condition to check switch\n if (that.test === true) {\n var x = event.offsetX;\n var y = event.offsetY;\n //draw line to every next point od movement\n that.context.lineTo(x, y);\n that.context.stroke();\n }\n });\n });\n //mouse up event\n this.canvas.addEventListener(\"mouseup\", function() {\n //switch of\n that.test = false;\n });\n }", "function mouseDown(e, rectangle) {\n \n rectangle.Width = 0;\n rectangle.Height = 0;\n rectangle.StartX = e.pageX - canvas.offsetLeft;\n rectangle.StartY = e.pageY - canvas.offsetTop;\n \n drag = true;\n }", "function moveDraw(x,y,t){\n\tif (isDrag){\n\t\tmySel.x = x;\n\t\tmySel.y = y; \n\t\t// something is changing position so we better invalidate the canvas!\n\t\tinvalidate();\n\t}\n}", "function onDragStart(event) {\n //Store data to record movement\n this.data = event.data;\n this.alpha = 0.5;\n this.dragging = true;\n \n}", "function onMouseUp() {\n // sets the new location to default till moved again\n mouseDown = false;\n }", "function startPressPen(event) {\n isDrawning = true\n\n // start draw here, go make some dots\n draw(event)\n }", "function drag_drag(d) {\n\t\t\t d.fx = d3.event.x;\n\t\t\t d.fy = d3.event.y;\n\t\t\t}", "function CdkDragEnter() {}", "function CdkDragEnter() {}", "function mouseMove(e) {\n if (drag) {\n rect.w = (e.pageX - this.offsetLeft) - rect.startX;\n rect.h = (e.pageY - this.offsetTop) - rect.startY;\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n draw();\n }\n}", "function _onMousedown(event) {\n if (event.button === 0 && !isMouseDown && _injectors.$state.current.data.mode == \"record\") {\n isMouseDown = true;\n intervalId = setInterval(_extendSpline, 50);\n lastPoint = _stage.getPointerPosition();\n pointCount = 1;\n drawingStarted = new Date().getTime();\n }\n }", "function onDrag() {\r\n\t\t\t//Gets the top left corner of square that you're in (x, y)\r\n\t\t\tmoving = true;\r\n\t\t\tlet x_check = Math.floor((d3.event.x - graph.offset.x + graph.cell_size / 2) / graph.cell_size);\r\n\t\t\tlet y_check = Math.floor((d3.event.y - graph.offset.y + graph.cell_size / 2) / graph.cell_size);\r\n\t\t\tif(x_check <= 0) {\r\n\t\t\t\tpoint.x = 0;\r\n\t\t\t} else if(x_check >= graph.numCols) {\r\n\t\t\t\tpoint.x = graph.numCols;\r\n\t\t\t} else {\r\n\t\t\t\tpoint.x = x_check;\r\n\t\t\t}\r\n\t\t\tif(y_check <= 0) {\r\n\t\t\t\tpoint.y = 0;\r\n\t\t\t} else if(y_check >= graph.numRows) {\r\n\t\t\t\tpoint.y = graph.numRows;\r\n\t\t\t} else {\r\n\t\t\t\tpoint.y = y_check;\r\n\t\t\t}\r\n\t\t\tupdatePosition();\r\n\t\t\tgraph.update();\r\n\t\t}", "function mouseDown() {\n var rect = this;\n var snap = self.snap;\n var sale = !rect.sale;\n\n updateIcon(rect);\n\n window.xsnap = snap;\n window.xrect = rect;\n console.log(rect);\n }", "_MouseDown(x, y){\n this.mousedown = true;\n this.originX = x;\n this.originY = y;\n }", "function dragGo(event) {\n var x, y;\n // Get cursor position with respect to the page.\n y = event.clientY + window.scrollY;\n\n //d.elNode.style.left = (d.elStartLeft + x - d.cursorStartX) + \"px\";\n if ((d.elStartTop + y - d.cursorStartY)>=(dims.headerw? (dims.headert+16) : (dims.top+16)) && (d.elStartTop + y - d.cursorStartY)<(dims.height+(dims.headerw? (dims.headert+16) : (dims.top+16)))-height) {\n if ((d.elStartTop + y - d.cursorStartY)<=3)\n y = d.cursorStartY - d.elStartTop;\n d.cp.style.top = (d.elStartTop + y - d.cursorStartY) + \"px\";\n if ((d.elStartTop + y - d.cursorStartY)>0)\n d.cp.setAttribute('style',setTopBorder(d.cp.getAttribute('style')));\n else\n d.cp.setAttribute('style',removeTopBorder(d.cp.getAttribute('style')));\n d.cph.style.top = (d.elStartTop + y - d.cursorStartY + d.baseH - 3) + \"px\";\n savePos(d.elStartTop + y - d.cursorStartY);\n }\n event.preventDefault();\n}", "function start() {\n d3_behavior_dragEvent = event;\n d3_behavior_dragEventTarget = d3.event.target;\n d3_behavior_dragTarget = this;\n d3_behavior_dragArguments = arguments;\n d3_behavior_dragOrigin = d3_behavior_dragPoint();\n if (origin) {\n d3_behavior_dragOffset = origin.apply(d3_behavior_dragTarget, d3_behavior_dragArguments);\n d3_behavior_dragOffset = [d3_behavior_dragOffset.x - d3_behavior_dragOrigin[0], d3_behavior_dragOffset.y - d3_behavior_dragOrigin[1]];\n } else {\n d3_behavior_dragOffset = [0, 0];\n }\n d3_behavior_dragMoved = 0;\n }", "onMouseDown(e) {\n // start dragging\n this.isMouseDown = true;\n\n // apply specific styles\n this.options.element.classList.add(\"dragged\");\n\n // get our touch/mouse start position\n var mousePosition = this.getMousePosition(e);\n // use our slider direction to determine if we need X or Y value\n this.startPosition = mousePosition[this.direction];\n\n // drag start hook\n this.onDragStarted(mousePosition);\n }", "function on_down(event){\n \tif (mode =='EDIT'){\n //EDIT MODE\n \t\tmouseDown = true;\n \t\tonMouseDownPosition = [event.clientX, event.clientY];\n \t\tonMouseDownTheta = theta;\n \t\tonMouseDownPhi = phi;\n\n \t\tif (cursorMode =='edit'){\n handleCursorEdit();\n \t\t} else if (cursorMode == 'pan'){\n handleCursorPan();\n \t\t}\n \t} else{\n //PLAY MODE\n \t\t domElement.style.cursor = \"default\";\n \t}\n window.addEventListener( \"mousemove\", on_move );\n }", "function pointerDown(event) {\n dragging = true;\n pointerMove(event);\n \n }", "onMouseDrag(e) {}", "onMouseDown(e) {\n this.initX = this.prevX = e.pageX - this.offsetX;\n this.initY = this.prevY = e.pageY - this.offsetY;\n this.canvas.addEventListener(\"mouseup\", this.onUpHandler);\n this.canvas.addEventListener(\"mousemove\", this.onMoveHandler);\n }", "function dragstarted(d) {\n //d3.select(d).raise().classed(\"active\", true);\n }", "function dragstarted(d) {\n //d3.select(d).raise().classed(\"active\", true);\n }", "onDragEnded(mousePosition) {\n }" ]
[ "0.7787101", "0.7570723", "0.75316006", "0.74736786", "0.73840016", "0.7383776", "0.7383776", "0.73804694", "0.7369859", "0.7367871", "0.734733", "0.72757125", "0.72757125", "0.72712064", "0.72459584", "0.72350466", "0.71971494", "0.71751845", "0.71346754", "0.7119397", "0.71025574", "0.71020526", "0.7095753", "0.70871747", "0.70816374", "0.7078698", "0.7068408", "0.7045463", "0.7041513", "0.7030313", "0.7029673", "0.7029606", "0.70258456", "0.7025596", "0.7022602", "0.70064235", "0.69828475", "0.6971374", "0.6970188", "0.69545054", "0.69475466", "0.6937378", "0.6926823", "0.6924886", "0.6912142", "0.69056827", "0.6896552", "0.6893173", "0.68878406", "0.68849045", "0.68731004", "0.6859336", "0.685835", "0.68557787", "0.684276", "0.684276", "0.683564", "0.68344367", "0.68337667", "0.68317664", "0.6826277", "0.6815421", "0.68056464", "0.67785364", "0.6762292", "0.6758985", "0.67559206", "0.6743903", "0.6739912", "0.67370164", "0.6733822", "0.6728206", "0.67266583", "0.67222756", "0.6714119", "0.67034954", "0.66954046", "0.6693345", "0.6689477", "0.66813296", "0.66799027", "0.6678839", "0.66783226", "0.6677948", "0.6677948", "0.6675778", "0.6672243", "0.6662115", "0.6660407", "0.66582334", "0.66564375", "0.66430414", "0.6638631", "0.66301274", "0.66296303", "0.6628438", "0.66283834", "0.6627652", "0.6627652", "0.66217685" ]
0.67628956
64
if the user drags out of the canvas
function doMouseout(e) { ctx.closePath(); if(dragging){ //points currentLayer = []; console.log(allPoints); dragging = false; } //points currentLayer = []; console.log(allPoints); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function droppedOnCanvas(x, y) {\n $canvas = $draw_canvas;\n var border_left = $canvas.offset().left;\n var border_top = $canvas.offset().top;\n var border_right = $canvas.offset().left + $canvas.width();\n var border_bottom = $canvas.offset().top + $canvas.height();\n if (x > border_left && x < border_right && y > border_top && y < border_bottom) {\n return true;\n }\n return false;\n }", "function doTouchout(e) {\n console.log(e.type);\n //ctx.closePath();\n dragging = false;\n}", "function canvasMouseUp(event){\r\n MOUSE_IS_DOWN = false;\r\n }", "function mouseDragged() {\n if (!running) {\n var x = parseInt(mouseX / w);\n var y = parseInt(mouseY / h);\n if (pencil) {\n try {\n grid[x][y].obstacle = true;\n start.obstacle = false;\n } catch (error) {\n console.log(\"Click out of canvas\");\n }\n } else if (eraser) {\n try {\n grid[x][y].obstacle = false;\n } catch (error) {\n console.log(\"Click out of canvas\");\n }\n }\n\n if (cursorX !== x || cursorY !== y) {\n cursorX = x.valueOf();\n cursorY = y.valueOf();\n }\n }\n\n return false;\n}", "dragleave_feedback(){\r\n this.dragging = false;\r\n }", "function onMouseUpCanvas(o) {\n isMouseDown = false;\n\n if(selectedTool == TOOL.PENCIL) {\n canvas.clearContext(canvas.contextTop);\n finishPencilDrawing(pencilDrawingPoints,{strokeStyle: selectedColor, lineWidth: selectedStrokeWidth});\n }\n\n if(isBoardOwner) {\n onMouseUpExtraEventForOwner();\n } else {\n onMouseUpExtraEventForGuest();\n }\n\n if(isDebugged) {\n dbIsDrawing.innerHTML = false + \"\";\n }\n}", "function OnMouseDown(){\n\tbeingDragged = true;\n}", "function handleDragEnd(){\n this.isMouseDown = false\n this.lastX = null\n}", "onDragEnded(mousePosition) {\n }", "function onCanvasTouchEnd() {\n window.mouseDown = false;\n window.lastCellClicked = null;\n event.preventDefault();\n}", "function touchMoved() {\n return false;\n}", "_onMouseMove(event) {\n super._onMouseMove(event);\n if (event.data.createState >= 1) {\n let drawing = event.data.object;\n let [gx, gy] = [event.data.originalEvent.x, event.data.originalEvent.y];\n\n // If the cursor has moved close to the edge of the window\n this._panCanvasEdge(gx, gy);\n\n drawing.updateDragPosition(event.data.destination)\n drawing.refresh();\n event.data.createState = 2;\n }\n }", "function mouseReleased(){\n\t//if (mouseX >= canvasWidth/2 - tappy.width/2 && mouseX <= canvasWidth/2 + tappy.width/2 &&\n\t//\tmouseY >= canvasHeight/2 - tappy.height/2 && mouseY <= canvasHeight/2 + tappy.height/2){\n\t\ttappy.width = imageWidth;\n\t\ttappy.height = imageHeight;\n\t\ttappy.x -= 8; \n\t\ttappy.y -= 8;\n\t//}\n}", "function myUp(){\n canvas.onmousemove=null;\n}", "function mouseReleased(){\n\tdrawing = false;\n}", "function myUp() {\n canvas.onmousemove = null;\n}", "outsideCanvas() {\n if(this.y > 400){\n this.y = 380;\n }\n if(this.x > 400){\n this.x = 400;\n }\n else if(this.x < 0){\n this.x = 0;\n }\n }", "function checkDrop(object)\n{\n\tvar mousePos = stage.getMousePosition();\n\n\tif((mousePos.x >= 175 && mousePos.x <= 225) && (mousePos.y >= 175 && mousePos.y <= 225))\n\t{\n\t\tdoDrop(object, leftDrop);\n\t}\n\n\telse if((mousePos.x >= 375 && mousePos.x <= 425) && (mousePos.y >= 175 && mousePos.y <= 225))\n\t{\n\t\tdoDrop(object, rightDrop);\n\t}\n\n\telse\n\t{\n\t\tresetXY(object);\t\n\t}\n}", "function CdkDragExit() {}", "function CdkDragExit() {}", "disengage (e){\n this.dragging=false;\n this.ctx.closePath();\n\n\n\n \n \n\n console.log(\"j'aii fini de dessiner\")\n }", "isOut() {\n if (this.offsetX < -this.limitx()) this.offsetX = -this.limitx();\n if (this.offsetX > this.limitx()) this.offsetX = this.limitx();\n if (this.offsetY < -this.limity()) this.offsetY = -this.limity();\n if (this.offsetY > this.limity()) this.offsetY = this.limity();\n }", "function onDrawingBoard() {\n return (pmouseX > 0 && pmouseX < 400 && mouseX > 0 && mouseX < 400 &&\n pmouseY > 0 && pmouseY < 400 && mouseY > 0 && mouseY < 400);\n}", "function touchMoved() {\n // Only if the user drags within the user pixels area\n\n const x = PADDING;\n const y = PADDING + 24 + PADDING;\n const w = DIGIT_UI_SIZE;\n\n if (mouseX > x && mouseY > y && mouseX < x + w && mouseY < y + w) {\n // Draw a white circle\n DIGIT_UI.ellipse(mouseX - x, mouseY - y, 24, 24);\n }\n}", "handleMouseUp() {\n let { map, isDrawingEnabled, option } = this.state;\n\n /**\n * We track it only for \"Draw\" drawing mode\n */\n if ( ! (isDrawingEnabled && option === \"draw\") ) return;\n\n this.refs.map.leafletElement.dragging.enable();\n map.mouseDown = false;\n this.setState({\n map: map,\n isDrawingEnabled: false\n });\n }", "function touchMoved() {\n // do some stuff\n return false;\n }", "onDragEnd(e) {\n this.isDown = false;\n }", "function mouseDragged(e) {\n\t\n\t// Define variables.\n\tvar parent = e.target.parentElement,\n\t\tparentID = parent ? parent.id : '';\t\n\n\t// Move control enabled.\n\tif (board.moving) {\t\t\n\t\tboard.move();\n\t}\n\t\n\t// Only draw/erase if the click/touch is not on the controls or swatches. \n\tif (parentID.toUpperCase() != 'CONTROLSBACKGROUND' && parentID.toUpperCase() != 'SWATCHES') {\n\t\n\t\t// Draw control enabled.\n\t\tif (board.drawing) {\n\t\t\tboard.draw(true);\n\t\t}\n\t\n\t\t// Erase control enabled.\n\t\tif (board.erasing) {\n\t\t\tboard.erase();\t\n\t\t}\n\t\t\n\t}\n\n\t// Prevent default functionality.\n\treturn false;\n\t\n}", "function outBounds() {\r\n if (x + 60 >= canvas.width + 10 || x <= 10 || y + 30 >= canvas.height || y - 15 <= 40) {\r\n cancelAnimationFrame();\r\n }\r\n}", "function dragEnd() {\n mouseX = d3.event.x - mx + mouseX;\n mouseY = d3.event.y - my + mouseY;\n }", "function doTouchup(e) {\n console.log(e.type);\n //drawing tmp Canvas to the main canvas\n ctx.drawImage(tmpCanvas, 0, 0);\n //clearing tmp canvas\n tmpCtx.clearRect(0, 0, tmpCanvas.width, tmpCanvas.height);\n //emptying the pencil points\n ppts = [];\n\n dragging = false;\n canvasPush();\n}", "function CdkDragEnd() {}", "function CdkDragEnd() {}", "function mouseupForCanvas(event)\n{\n //console.log('mouseup event on canvas');\n \n global_mouseButtonDown = false;\n global_startedDrawing = false;\n event.preventDefault(); //need? (maybe not on desktop)\n}", "function overPaint(e){\n\n\tcanvas.removeEventListener(\"touchmove\",paint,false);\n\tcanvas.removeEventListener(\"mousemove\",paint,false);\n }", "function tearOffExceeded(rect, event) {\n return ((event.clientX < rect.left - TEAR_OFF_THRESHOLD) ||\n (event.clientX >= rect.right + TEAR_OFF_THRESHOLD) ||\n (event.clientY < rect.top - TEAR_OFF_THRESHOLD) ||\n (event.clientY >= rect.bottom + TEAR_OFF_THRESHOLD));\n}", "function stopDraw(e) {\n\t\tbrush_size = 1;\n\t\te.preventDefault();\n\t\tcanvas.onmousemove = null;\t\n\t}", "handleDragLeave(e) {\n e.preventDefault();\n\n if (this.isDragInProgress) {\n this.isOver = false;\n }\n\n return false;\n }", "function canvasMouseUpEv(event) {\n // Finish editing annotation\n if (this.point_move) {\n this.last_segm = null;\n this.last_baseline = null;\n this.last_segm_type = null;\n this.emitAnnotationEditedEvent(this.last_active_annotation); // TODO: not always\n\n this.point_move = false;\n }\n}", "function doCanvasUp()\n{\n\t// Conditionally watch for tablets\n\tcanvas.removeEventListener( touch ? 'touchmove' : 'mousemove', doCanvasMove );\n\tcanvas.removeEventListener( touch ? 'touchend' : 'mouseup', doCanvasUp );\t\n}", "onMinimapDragMouseDown() {\n this.isMinimapPanning = true;\n }", "function mouseReleased() {\n if (!running) {\n // Quit dragging\n draggingStart = false;\n draggingEnd = false;\n }\n}", "endDrag(x, y) {}", "function isMouseDragged() {\n\tif (isMouseDown && !vector3Equals(previousMousePosition, Input.mousePosition)) {\n\t\treturn true;\n\t}\n\treturn false;\n}", "onTouchEnd(event) {\n this.isPanning = false;\n }", "function touch_end_handler(e) {\n if (!e.touches) mouse.down = false; //If there are no more touches on the screen, sets \"down\" to false.\n }", "function touchMoved() {\n // do some stuff\n return false;\n}", "function touchMoved() {\n // do some stuff\n return false;\n}", "function touchMoved() {\n // do some stuff\n return false;\n}", "function myDown(e){\n console.log(mx, my);\n mx_e = mx;\n my_e = my;\n getMouse(e);\n clear(gctx);\n var l = boxes.length;\n for (var i = l-1; i >= 0; i--) {\n // draw shape onto ghost context\n drawshape(gctx, boxes[i], 'black');\n\n // get image data at the mouse x,y pixel\n var imageData = gctx.getImageData(mx, my, 1, 1);\n var index = (mx + my * imageData.width) * 4;\n\n // if the mouse pixel exists, select and break\n if (imageData.data[3] > 0) {\n mySel = boxes[i];\n offsetx = mx - mySel.x;\n offsety = my - mySel.y;\n mySel.x = mx - offsetx;\n mySel.y = my - offsety;\n isDrag = true;\n canvas.onmousemove = myMove;\n invalidate();\n clear(gctx);\n return;\n }\n\n }\n\n // havent returned means we have selected nothing\n mySel = null;\n // clear the ghost canvas for next time\n clear(gctx);\n // invalidate because we might need the selection border to disappear\n invalidate();\n}", "function MouseUpHandler(e) {\n pan_context = false;\n}", "function touchMoved() {\n // do some stuff\n return false;\n}", "function OutOfCanvas(a) {\n return (a.x< (-jaws.width/3));\n }", "function mouseReleased() {\n stamped =false;\n}", "onDragOver(e){\n e.preventDefault();\n }", "function mouseReleased() {\r\n mouseIsDown = false;\r\n}", "_onMouseUp () {\n Actions.changeDragging(false);\n }", "function onMouseUpWindow(event)\n{\n dragging = false;\n}", "function touchendForCanvas(event)\n{\n //console.log('touchend event on canvas');\n \n global_startedDrawing = false;\n \n event.preventDefault();\n}", "function mysketchpad_mouseUp() {\n mouseDown = 0;\n lastX=-1;\n lastY=-1;\n }", "function pointerUp(event) {\n dragging = false;\n }", "function dragstop() {\r\n dragobjekt=null;\r\n}", "function CdkDragEnter() {}", "function CdkDragEnter() {}", "onDragAbort() {}", "onDragAbort() {}", "onMouseUp(event) {\n this.isDragging = false;\n this.isPanning = false;\n this.isMinimapPanning = false;\n if (this.layout && typeof this.layout !== 'string' && this.layout.onDragEnd) {\n this.layout.onDragEnd(this.draggingNode, event);\n }\n }", "function dragEnd(e) {\n active = false;\n}", "function canvas_mouseUp() {\n mouseDown=0;\n\n // Reset lastX and lastY to -1 to indicate that they are now invalid\n lastX=-1;\n lastY=-1;\n\n //Canvas should be cleared when stopping the touch\n /*drawLine(ctx,mouseX,mouseY,12);*/\n /*ctx.clearRect(window.innerWidth/6, 0, window.innerWidth/1.5, window.innerHeight);*/\n /*ctx.clearRect(0, 0, ctx.innerWidth, ctx.window.innerHeight);*/\n /*ctx.clearLine(0, 0, ctx.width, ctx.height);*/\n /*ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);*/\n}", "function canvasMouseMoveEv(event) {}", "handlemouseMove(e) {\n const rect = this.canvas.getBoundingClientRect();\n if (this.flag) {\n this.prevX = this.currX;\n this.prevY = this.currY;\n this.currX = e.clientX - rect.left;\n this.currY = e.clientY - rect.top;\n this.draw(this.template, this.ctx);\n }\n }", "isDragAvailable() {\n return true;\n }", "function onCanvasMouseUp() {\n window.mouseDown = false;\n window.lastCellClicked = null;\n}", "function mouseUp(event) {\n mouseIsDown = false;\n // if (drawHandle !== -1) {\n // clearInterval(drawHandle);\n // drawHandle = -1;\n // }\n }", "function canvas_touchMove(e) {\n // Update the touch co-ordinates\n getTouchPos(e);\n\n // During a touchmove event -> don't need to check if the touch is engaged\n drawLine(ctx,touchX,touchY,12);\n if(touchX > bereichDarunter && touchX < bereichDarueber){\n /*ctx.fillStyle = \"blue\";\n ctx.fill();\n var rechteck2 = ctx.fillRect(x, y, w, h);*/\n ctx.clearRect(window.innerWidth/6, 0, window.innerWidth/1.5, window.innerHeight);\n }\n // Prevent a scrolling action as a result of this touchmove triggering.\n event.preventDefault();\n}", "function draggingUp(e) {\n if (!module.isDragging) {\n return;\n }\n module.draggingMouseDown = {};\n // e.preventDefault();\n module.isDragging = false;\n // reset the mouse out state\n module.mouseOutState = 0;\n // if the area is too small, it is judged as invalid area then delete\n if (module.currentDraggingNode.getWidth() < 5 || module.currentDraggingNode.getHeight() < 5) {\n module.removeById(module.currentDraggingNode.id);\n }\n return false\n }", "function handleMouseUp(e) {\n this.beingDragged = false;\n if (this.mode == 'pan') {\n // save these so we don't need to compute it later\n var img = this.image;\n lastLeft = parseInt(img.style.left);\n lastTop = parseInt(img.style.top);\n\n if (navigator.appName == 'Netscape') img.style.cursor = '-moz-grab';\n\n } else {\n var mag = this.magnifier;\n mag.shadow.style.display = 'none';\n mag.style.display = 'none';\n }\n}", "function touchMove(e) {\n if (e.target == canvas) {\n e.preventDefault();\n putPoint(e);\n }\n }", "stopdraw(ev) {\n this.is_drawing = false;\n }", "function controls(e) {\n\t\tvar x = null;\n\t\tvar y = null;\n\t\tif(e.offset)\n\t\t{\n\t\t var offset = e.offset();\n\t\t x = offset.x;\n\t\t y = offset.y;\n\t\t}\n\t\telse if(e.touches && e.touches[0] && e.touches[0].pageX && e.touches[0].pageY )\n\t\t{\n\t\t try\n\t\t {\n\t\t var canvasoffset = $(cd.canvas).offset();\n\t\t x = e.touches[0].pageX-canvasoffset.left;\n\t\t y = e.touches[0].pageY-canvasoffset.top;\n\t\t }\n\t\t catch(error)\n\t\t {\n\t\t console.log(error);\n\t\t console.log(e);\n\t\t }\n\t\t}\n\n //this fuckss with the range controll on the site, so i disabled it\n\tif (e.preventDefault && e.srcElement && e.srcElement.id==canvasId) { e.preventDefault(); }\n\t//e.preventDefault();\n\t\n\tif(x&&y)\n\t{\n\t\tswitch (e.type) {\n\t\t\n\t\t case \"mousedown\": \n\t\t\tcase \"onmousedown\":\n cd.drawStart(x, y);\n\t\t\t\tbreak;\n\t\t\n\t\t case \"mousemove\": \n\t\t\tcase \"onmousemove\":\n\t\t\t\tcd.draw(x, y);\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase \"touchmove\":\n\t\t\t if(!cd.drawing){cd.drawStart(x, y);}\n\t\t\t //if(console){console.log('tm'+x+'-'+y);}\n\t\t\t cd.draw(x, y);\n\t\t\t break;\n\n\t case \"touchstart\":\n\t cd.drawStart(x, y);\n\t\t\t break;\n\t\t\t\n\t\t\tcase \"touchend\":\n\t\t\t cd.drawStop();\n\t\t\t break;\n \n case \"mouseup\": \n\t\t\tcase \"onmouseup\":\n\t\t\t\tcd.drawStop();\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"mouseout\":\n\t\t\t\tcd.drawPause();\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"mouseover\":\n\t\t\t\tcd.drawResume(x, y);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\t}", "function dontDraw() {\n coordinates = getCanvasMousePosition(canvas, event)\n\n //For loop to loop through panels and check if the mouse position is at the bottom right corner of one of the panels\n for(let i = 0; i < panels[whichPanel].length; i++)\n {\n if(coordinates.x > (panels[whichPanel][i].width + panels[whichPanel][i].x - 5) && coordinates.x < (panels[whichPanel][i].width + panels[whichPanel][i].x + 5))\n {\n if(coordinates.y > (panels[whichPanel][i].height + panels[whichPanel][i].y - 5) && coordinates.y < (panels[whichPanel][i].height + panels[whichPanel][i].y + 5))\n {\n changeCursor(\"nw-resize\")\n document.removeEventListener('mousedown', whileDrawing)\n break\n }\n }\n //Loop to check if the cursor is in the top left for moving\n else if(coordinates.x > panels[whichPanel][i].x - 5 && coordinates.x < panels[whichPanel][i].x + 5)\n {\n if(coordinates.y > panels[whichPanel][i].y - 5 && coordinates.y < panels[whichPanel][i].y + 5)\n {\n changeCursor(\"move\")\n document.removeEventListener('mousedown', whileDrawing)\n break\n }\n }\n else if(coordinates.y > canvas.height*0.93)\n {\n document.removeEventListener('mousedown', whileDrawing)\n }\n else\n {\n changeCursor(\"default\")\n document.addEventListener('mousedown', whileDrawing)\n }\n }\n}", "canvasPressed() {\n let rowClicked = floor(this.beatLength * (mouseY - this.yOffset) / this.lineEnd);\n let columnClicked = floor(this.beatLength * (mouseX - this.xOffset) / this.lineEnd);\n\n this.mouseIsDragged = true;\n\n if (this.polyMatrix[rowClicked][columnClicked] === 1) {\n this.lastCellState = 1;\n } else if (this.polyMatrix[rowClicked][columnClicked] === 0) {\n this.lastCellState = 0;\n }\n cnv.mouseReleased = function() {\n this.mouseIsDragged = false;\n }\n\n }", "function canvasMouseDown(event) {\r\n MOUSE_IS_DOWN = true;\r\n var pos = mousePos(event);\r\n LAST_X = pos[0];\r\n LAST_y = pos[1];\r\n userMove(event, pos[0], pos[1]);\r\n }", "onMouseDragged(event){\n let lastPoint = this.command.points[this.command.points.length - 1];\n if(p5Instance.dist(lastPoint.x ,lastPoint.y, event.offsetX, event.offsetY)> 4){\n this.command.points.push({x: event.offsetX, y: event.offsetY});\n }\n }", "endDrag(props, monitor, component) {\n if(!monitor.didDrop()){\n return;\n }\n }", "onMouseUp(event) {\n\t\t// console.log(\"mouse up\");\n\t\tthis.props.setIsDrawing(false);\n\t}", "function mousedown(e) {\n\tif (!e) var e = window.event;\n\te.preventDefault();\t\t// Tries to prevent I-beam\n\t\t\n\tisDrawing = true;\n console.log(isDrawing);\n\tstate.canvasX = e.pageX - state.canvas.offsetLeft;\n state.canvasY = e.pageY - state.canvas.offsetTop;\n\tstate.context.beginPath();\n state.context.moveTo(state.canvasX, state.canvasY);\n}", "function doCanvasDown()\n{\n\t// Random color generation\n\tfill = {\n\t\tred: Math.round( Math.random() * 255 ),\n\t\tgreen: Math.round( Math.random() * 255 ),\n\t\tblue: Math.round( Math.random() * 255 )\n\t};\n\t\n\t// Event listeners for drawing\n\t// Conditional check for tablets\n\tcanvas.addEventListener( touch ? 'touchmove' : 'mousemove', doCanvasMove );\n\tcanvas.addEventListener( touch ? 'touchend' : 'mouseup', doCanvasUp );\n}", "function hoverOutCanvas() {\n onMouseUp();\n canvas.unmousedown(onMouseDown);\n }", "dragToStop() {\n this.drag.status = false;\n }", "function outSideCanvas(ev) {\n\t\tif (ev.toElement === lns.renderer.canvas) return;\n\t\tif (isDrawing) endPoint(ev);\n\t}", "function touchEnd() {\n var changeY = originalCoord.y - finalCoord.y,\n changeX,\n threshold = options.threshold,\n y = threshold.y,\n x = threshold.x;\n if (changeY < y && changeY > (- y)) {\n changeX = originalCoord.x - finalCoord.x;\n if (changeX > x) {\n options.swipeLeft.call(self);\n } else if (changeX < (- x)) {\n options.swipeRight.call(self);\n }\n }\n }", "function canvasMouseMove(event){\r\n var pos = mousePos(event);\r\n if (MOUSE_IS_DOWN && ((LAST_X !== pos[0]) || (LAST_Y !== pos[1]))){\r\n userMove(event, pos[0], pos[1]);\r\n LAST_X = pos[0];\r\n LAST_Y = pos[1];\r\n }\r\n }", "function mousedownForCanvas(event)\n{\n global_mouseButtonDown = true;\n event.preventDefault(); //need? (maybe not on desktop)\n}", "dragEnd(event) {\n this.dragStarted = false;\n if (this.currentX < 150 && this.currentX > -150) { // card not dragged far enough\n event.currentTarget.classList.add(\"bounce\");\n }\n else { // card dragged far enough\n this.app.nextCard(this.correct);\n const appContainer = document.querySelector('body');\n appContainer.style.backgroundColor = \"#d0e6df\";\n }\n }", "function mouseDown(e, rectangle) {\n \n rectangle.Width = 0;\n rectangle.Height = 0;\n rectangle.StartX = e.pageX - canvas.offsetLeft;\n rectangle.StartY = e.pageY - canvas.offsetTop;\n \n drag = true;\n }", "function OnMouseUp() {\n\tisMouseDown = false;\n\t\n}", "drag_feedback(){\r\n this.dragging = true;\r\n }", "onDragOver(event) {\r\n if (this.state.inDropMode)\r\n event.preventDefault(); // Allows for dropping\r\n }", "function mouseDragged() {\n\tif (circle.active) {\n\t\tcircle.x = constrain(circle.x + (mouseX - circle.x) * 0.1, 80, 600)\n\n\t\tcircle.y = constrain(circle.y + (mouseY - circle.y) * 0.1, 450, 450)\n\n\t}\n\treturn false;\n}", "function isInside(curs, dropTarget){\n\t // check for x, then y.\n\tvar dt_x = dropTarget.getX(), dt_y = dropTarget.getY();\n\t\n\treturn (curs.x >= dt_x && curs.x < dt_x + dropTarget.getWidth())\n\t\t&& // now check for y.\n\t\t(curs.y >= dt_y && curs.y < dt_y + dropTarget.getHeight());\n}" ]
[ "0.71460116", "0.712604", "0.68792766", "0.6746542", "0.6617145", "0.65910155", "0.65847796", "0.6584404", "0.6486763", "0.6483796", "0.64604145", "0.6448419", "0.64298344", "0.6414306", "0.6401812", "0.6394529", "0.6375023", "0.6364158", "0.635562", "0.635562", "0.6348289", "0.63393307", "0.63364774", "0.63228", "0.6314651", "0.6295622", "0.62911326", "0.62909627", "0.6287235", "0.6278381", "0.62783664", "0.6267545", "0.6267545", "0.6264847", "0.626181", "0.6243095", "0.6235791", "0.6221801", "0.6210806", "0.61935914", "0.61866635", "0.61836046", "0.61825377", "0.61824065", "0.6180129", "0.61766124", "0.61692595", "0.61692595", "0.61692595", "0.6153358", "0.6138181", "0.6134248", "0.6124073", "0.6123928", "0.6117792", "0.61089647", "0.6107975", "0.6103354", "0.6094812", "0.6091219", "0.6087346", "0.6079252", "0.6077929", "0.6077929", "0.6064434", "0.6064434", "0.60537696", "0.6053319", "0.6052638", "0.60519946", "0.6048685", "0.6038493", "0.6032895", "0.60269", "0.6025625", "0.60247743", "0.6016193", "0.6012089", "0.6007988", "0.5997163", "0.59957695", "0.59917694", "0.598977", "0.59880584", "0.59866476", "0.59849364", "0.59788084", "0.5971028", "0.5967791", "0.59672076", "0.5957641", "0.5957302", "0.5956706", "0.5937768", "0.5930515", "0.59259784", "0.59171283", "0.5904515", "0.5901378", "0.58997935", "0.58952934" ]
0.0
-1
NAME: Measurement PURPOSE: Measure selection on screen and place marks indicating measurement
function theScript() { /////////////////////////////////////////////////// // BEGIN THE SCRIPT //================================================= //////////////////////////////////////////////////////////////////////////////// // INITIAL REQUIREMENTS //////////////////////////////////////////////////////////////////////////////// // Require open document try { if (app.documents.length > 0 ) { // OK to proceed to arguments setup and run main function var args = {}; args.SCRIPT_NAME = "MEASUREMENT"; args.DOC_REF = app.activeDocument; args.SELECTION = args.DOC_REF.selection; args.ACTIVE_LAYER = args.DOC_REF.activeLayer; args.ACTIVE_LAYER_NAME = args.ACTIVE_LAYER.name; // Call the main function main(args); } else { throw new Error('There are no documents open!'); } } catch(e) { alert( e.message, "Script Alert", true); } //////////////////////////////////////////////////////////////////////////////// // SCRIPT MAIN PROCESS //////////////////////////////////////////////////////////////////////////////// // Main Process // The beginning of the script starts here // Add main logic routine to this function function main(args){ var selectedItem = args.DOC_REF.selection[0]; var selectionName; if (selectedItem.name) { // Use name selectionName = selectedItem.name; } else { // Use type because name property is empty selectionName = selectedItem.typename; } var myDialog = sfDialogFactory(mainDialog(selectionName)); myDialog.show(); } //////////////////////////////////////////////////////////////////////////////// // SCRIPT SUPPORTING FUNCTIONS //////////////////////////////////////////////////////////////////////////////// // Supporting Functions // Include functions that offer partial functionality // These functions are called and acted upon within the mainProcess function function objReflection(obj, display) { // Function for easy object reflection // USAGE EXAMPLE: // var objectInfo = objReflection(someObject, "none"); // or // objReflection(someObject, "alert"); var KVOs = []; for(var member in obj){ KVOs.push("\n" + member + ":" + obj[member]); }; switch(display) { case "alert": alert("Object Reflection: " + KVOs); break; case "none": break; default: return undefined; } return KVOs; } function sfDialogFactory(dialog) { // A factory method for creating dialog screens // Dialog Window var d = new Window("dialog", dialog.title); // alert("Number of Inputs" + dialog.inputs.length); // alert("Number of Options" + dialog.options.length); var i; // counter var len; // length of array elements // Generate Groups if (dialog.groups.length > 0) { len = dialog.groups.length; for (i = 0; i < len; i++ ) { var currentGroup = dialog.groups[i]; var inputGroup = d.add ("panel", undefined, currentGroup.title); inputGroup.alignChildren = ["fill","fill"]; if (currentGroup.elements.length > 0) { // Add Elements var ii; var elemLen = currentGroup.elements.length; for (ii = 0; ii < elemLen; ii++ ) { var currentElement = currentGroup.elements[ii]; var el = inputGroup.add(currentElement.type, undefined, currentElement.value); // Additional properties added for future reflection el.elName = currentElement.name; el.elIndex = ii; switch(currentElement.type) { case "statictext": el.visible = currentElement.visible; break; case "edittext": el.visible = currentElement.visible; break; case "dropdownlist": el.visible = currentElement.visible; el.selection = currentElement.selection; el.onChange = currentElement.onChange; break; default: throw new Error('Unknown Dialog Element Type'); } } } } } function getControlValues(set) { var elementsData = {}; elementsData.controls = []; // TO DO Add more types var giLen = set.children.length; for (var gi = 0; gi < giLen; gi++ ) { var child = set.children[gi]; // alert(objReflection(child, "none", false)); // alert(child.type); var control = {}; control.name = child.elName; control.index = child.elIndex; control.type = child.type; control.visible = child.visible; switch(child.type) { case "statictext": control.value = child.text; break; case "edittext": control.value = child.text; break; case "dropdownlist": control.value = child.selection.text; break; default: throw new Error('Unknown Dialog Element Type'); } elementsData.controls.push(control); // alert(objReflection(control, "none", false)); } return elementsData; } // Buttons Group var buttonGroup = d.add("group"); var bOK = buttonGroup.add("button", undefined, "Continue"); var bCANCEL = buttonGroup.add("button", undefined, "Cancel"); // Button Click Handlers bOK.onClick = function(){ d.close(); dialog.callback("continue", getControlValues(inputGroup)); return true; }; bCANCEL.onClick = function (){ d.close(); dialog.callback("cancel"); return false; }; return d; } function mainDialog(selectionName) { // Main Dialog var dialogObj = {}; dialogObj.groups = []; // An array of dialog groups dialogObj.title = "Measurement"; var group1 = {}; group1.title = "Take Measurement"; // Add Elements using JSON shorthand syntax group1.elements = [ { "name":"MeasureSelectedItem", "type":"statictext", "value":"Measure Selected Item?", "visible":true }, { "name":"Selected", "type":"statictext", "value":"Selected: " + selectionName, "visible":true }, { "name":"UnitOfMeasurement", "type":"statictext", "value":"Unit of Measurement", "visible":true }, { "name":"UnitType", "type":"dropdownlist", "value":["inches","points","millimeters","centimeters","picas","pixels"], "visible":true, "selection":0, // "onChange":function(){ alert("My Drop Downdown change"); return true;} }, { "name":"ScreenDPI", "type":"statictext", "value":"Screen DPI (if measuring in pixels)", "visible":true }, { "name":"ScreenDPIValue", "type":"edittext", "value":150, "visible":true }, { "name":"ColorOfMeasurement", "type":"statictext", "value":"Color Of Measurement Lines", "visible":true }, { "name":"ColorType", "type":"dropdownlist", "value":["MAGENTA","CYAN","RED","WHITE","BLACK"], "visible":true, "selection":0, // "onChange":function(){ alert("My Drop Downdown change"); return true;} }, { "name":"ColorModeOfMeasurement", "type":"statictext", "value":"Color Mode", "visible":true }, { "name":"ColorMode", "type":"dropdownlist", "value":["CMYK","RGB"], "visible":true, "selection":0, // "onChange":function(){ alert("My Drop Downdown change"); return true;} }, { "name":"MarkerOffset", "type":"statictext", "value":"Amount to offset measurement marks", "visible":true }, { "name":"MarkerOffsetValue", "type":"dropdownlist", "value":[0,5,10,20], "visible":true, "selection":1, // "onChange":function(){ alert("My Drop Downdown change"); return true;} } ]; // Add to group list dialogObj.groups.push(group1); dialogObj.callback = function(type, formData) { if (type === "continue"){ var unit; var screenDPI; var color; var colorMode; var markerOffset; // Do something with formData values here var cLen = formData.controls.length; var formValues = ''; for (var c = 0; c < cLen; c++ ) { if (formData.controls[c].name === "UnitType") { unit = formData.controls[c].value; } if (formData.controls[c].name === "ScreenDPIValue") { screenDPI = formData.controls[c].value; } if (formData.controls[c].name === "ColorType") { color = formData.controls[c].value; } if (formData.controls[c].name === "ColorMode") { colorMode = formData.controls[c].value; } if (formData.controls[c].name === "MarkerOffsetValue") { markerOffset = formData.controls[c].value; } } takeMeasurement(args.DOC_REF, unit, screenDPI, color, colorMode, markerOffset); } else { // Cancel return false; } } return dialogObj; } function findLayerContext(obj) { // alert("findLayerContext: \n" + obj.name + "\n" + obj.typename); var theContext = undefined; if (obj.layers) { // alert("USING OBJECT FOR LAYER CONTEXT..."); theContext = obj; } else { // alert("SEARCHING PARENTS FOR LAYER..."); theContext = findLayerContext(obj.parent); } return theContext; } function takeMeasurement(doc_ref, unit, screenDPI, colorName, colorMode, markerOffset) { // alert("takeMeasurement: \n" + "[markerOffset] " + markerOffset); var selectedItem = doc_ref.selection[0]; if (selectedItem) { var referenceContext = findLayerContext(selectedItem); } else { alert("You must select an item before taking a measurement."); return false; } var myBounds = selectedItem.geometricBounds; // Set up X and Y co-ordinates var x1 = myBounds[0]; var x2 = myBounds[2]; var y1 = myBounds[1]; var y2 = myBounds[3]; // Set up data for the Measurements var ptWidth = myBounds[2] - myBounds[0]; var ptHeight = myBounds[1] - myBounds[3]; // The default unit is points // Default values var tmpWidth = ptWidth; var tmpHeight = ptHeight; var unitSuffix = "pts"; var unitSuffixSingular = "pt"; // Convert the unit of measure depending on the setting. // Adobe Illustrator Measures everything in Points. Use the following conversion formulas // // Unit Conversion formula // centimeters 28.346 points = 1 centimeter // inches 72 points = 1 inch // millimeters 2.834645 points = 1 millimeter // picas 12 points = 1 pica // Qs 1 Q (1 Q equals 0.23 millimeter) // pixels conversion // points = (pixels / 150) * 72 assuming 150dpi system switch(unit) { case "points": tmpWidth = ptWidth; tmpHeight = ptHeight; unitSuffix = "pts"; unitSuffixSingular = "pt"; break; case "millimeters": tmpWidth = Math.round(ptWidth / 0.02834645); tmpHeight = Math.round(ptHeight / 0.02834645); unitSuffix = "mm"; unitSuffixSingular = "mm"; break; case "centimeters": tmpWidth = Math.round(ptWidth / 0.2834645); tmpHeight = Math.round(ptHeight / 0.2834645); unitSuffix = "cm"; unitSuffixSingular = "cm"; break; case "picas": tmpWidth = Math.round(ptWidth / 0.12); tmpHeight = Math.round(ptHeight / 0.12); unitSuffix = "picas"; unitSuffixSingular = "pica"; break; case "inches": tmpWidth = Math.round(ptWidth / 0.72); tmpHeight = Math.round(ptHeight / 0.72); unitSuffix = "inches"; unitSuffixSingular = "inch"; break; case "pixels": tmpWidth = Math.round(ptWidth / 0.72); tmpHeight = Math.round(ptHeight / 0.72); var dpi = parseInt(screenDPI); tmpWidth = tmpWidth * dpi; tmpHeight = tmpHeight * dpi; unitSuffix = "pixels (" + dpi + " dpi)"; unitSuffixSingular = "pixel (" + dpi + " dpi)"; break; default: tmpWidth = ptWidth; tmpHeight = ptHeight; unitSuffix = "pts"; unitSuffixSingular = "pt"; } var finalWidth = tmpWidth / 100; var finalHeight = tmpHeight / 100; // Find Centre of Object var xCentre = x1 + (ptWidth / 2); var yCentre = y1 - (ptHeight / 2); var colorObj = getColorByName(colorMode, colorName); // Make the dimension lines makeDimensions(doc_ref, myBounds, referenceContext, colorObj, markerOffset); function makeDimensions(doc_ref, objBounds, context, measurementColor, lineOffset) { // alert("makeDimensions: \n" + "[lineOffset] " + lineOffset); var x1 = objBounds[0]; var x2 = objBounds[2]; var y1 = objBounds[1]; var y2 = objBounds[3]; // Create Measurements Layer var measurementLayerName = "MEASUREMENT OF "; if (selectedItem.name) { // Use name measurementLayerName = measurementLayerName + selectedItem.name; } else { // Use type because name property is empty measurementLayerName = measurementLayerName + selectedItem.typename; } var theMeasurementLayer = measurementLayerCreate(context, measurementLayerName); // Create groups for Measurements var yMeasure = theMeasurementLayer.groupItems.add(); yMeasure.name = "Height"; var xMeasure = theMeasurementLayer.groupItems.add(); xMeasure.name = "Width"; var xLineOffset = parseInt(lineOffset); var yLineOffset = parseInt(lineOffset); var xLabelOffset = xLineOffset + 15; var yLabelOffset = yLineOffset + 3; // X Measurement Line and Endpoints var xLine1 = xMeasure.pathItems.add(); xLine1.stroked = true; xLine1.strokeColor = measurementColor; xLine1.setEntirePath ([[x1,y1 + xLineOffset],[xCentre - 30,y1 + xLineOffset]]); var xLine2 = xMeasure.pathItems.add(); xLine2.stroked = true; xLine2.strokeColor = measurementColor; xLine2.setEntirePath ([[xCentre + 30,y1 + xLineOffset],[x2,y1 + xLineOffset]]); var xLineEnd1 = xMeasure.pathItems.add(); xLineEnd1.stroked = true; xLineEnd1.strokeColor = measurementColor; xLineEnd1.setEntirePath ([[x1,y1 + (xLineOffset + 4)],[x1,y1 + (xLineOffset - 4)]]); var xLineEnd2 = xMeasure.pathItems.add(); xLineEnd2.stroked = true; xLineEnd2.strokeColor = measurementColor; xLineEnd2.setEntirePath ([[x2,y1 + (xLineOffset + 4)],[x2,y1 + (xLineOffset - 4)]]); // Y Measurement Line and Endpoints var yLine1 = yMeasure.pathItems.add(); yLine1.stroked = true; yLine1.strokeColor = measurementColor; yLine1.setEntirePath ([[x2 + yLineOffset,y1],[x2 + yLineOffset,yCentre + 30]]); var yLine2 = yMeasure.pathItems.add(); yLine2.stroked = true; yLine2.strokeColor = measurementColor; yLine2.setEntirePath ([[x2 + yLineOffset,yCentre - 30],[x2 + yLineOffset,y2]]); var yLineEnd1 = yMeasure.pathItems.add(); yLineEnd1.stroked = true; yLineEnd1.strokeColor = measurementColor; yLineEnd1.setEntirePath ([[x2 + (yLineOffset - 4),y1],[x2 + (yLineOffset + 4),y1]]); var yLineEnd2 = yMeasure.pathItems.add(); yLineEnd2.stroked = true; yLineEnd2.strokeColor = measurementColor; yLineEnd2.setEntirePath ([[x2 + (yLineOffset - 4),y2],[x2 + (yLineOffset + 4),y2]]); // Create Text for X Measurement var xText = xMeasure.textFrames.add(); if (finalWidth === 1) { xText.contents = finalWidth + " " + unitSuffixSingular; } else { xText.contents = finalWidth + " " + unitSuffix; } xText.top = y1 + xLabelOffset; xText.left = xCentre; xText.paragraphs[0].paragraphAttributes.justification = Justification.CENTER; for (i=0;i<xText.textRange.characters.length;i++) { xText.characters[i].characterAttributes.fillColor = measurementColor; } // Create Text for Y Measurement var yText = yMeasure.textFrames.add(); if (finalHeight === 1) { yText.contents = finalHeight + " " + unitSuffixSingular; } else { yText.contents = finalHeight + " " + unitSuffix; } yText.rotate (-90); //, true, false, false, false, Transformation.CENTER); yText.top = yCentre; yText.left = x2 + yLabelOffset; yText.paragraphs[0].paragraphAttributes.justification = Justification.CENTER; for (i=0;i<yText.textRange.characters.length;i++) { yText.characters[i].characterAttributes.fillColor = measurementColor; } } function measurementLayerCreate(context, layerName) { var measurementLayer = context.layers.add(); measurementLayer.name = layerName; return measurementLayer; } } // END takeMeasurement() function getColorByName(type, name) { var color = undefined; // Color Type if (type == undefined) { alert("ERROR: getColorByName[type not specified]"); return undefined; } else { if (type == "CMYK") { color = new CMYKColor(); color = getCMYKColorByName(name); return color; } else if (type == "RGB") { color = new RGBColor(); color = getRGBColorByName(name); return color; } else { alert("ERROR: getColorByName[unknown type] " + type); return undefined; } } } function getCMYKColorByName(name) { // "MAGENTA","CYAN","RED","WHITE","BLACK" var colorDef = undefined; switch(name) { case "MAGENTA": colorDef = {C:0, M:100, Y:0, K:0}; break; case "CYAN": colorDef = {C:100, M:0, Y:0, K:0}; break; case "RED": colorDef = {C:0, M:100, Y:100, K:0}; break; case "WHITE": colorDef = {C:0, M:0, Y:0, K:0}; break; case "BLACK": colorDef = {C:0, M:0, Y:0, K:100}; break; default: colorDef = {C:0, M:0, Y:0, K:100}; } var color = new CMYKColor(); color.cyan = colorDef.C; color.magenta = colorDef.M; color.yellow = colorDef.Y; color.black = colorDef.K; return color; } function getRGBColorByName(name) { // "MAGENTA","CYAN","RED","WHITE","BLACK" var colorDef = undefined; switch(name) { case "MAGENTA": colorDef = {R:236, G:0, B:140}; break; case "CYAN": colorDef = {R:0, G:174, B:239}; break; case "RED": colorDef = {R:255, G:0, B:0}; break; case "WHITE": colorDef = {R:255, G:255, B:255}; break; case "BLACK": colorDef = {R:0, G:0, B:0}; break; default: colorDef = {R:0, G:0, B:0}; } var color = new RGBColor(); color.red = colorDef.R; color.green = colorDef.G; color.blue = colorDef.B; return color; } //================================================= // END THE SCRIPT /////////////////////////////////////////////////// }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startMeasure() {\r\n var md;\r\n if (m_measureDisplay!=null) {\r\n md = document.getElementById(m_measureDisplay);\r\n }\r\n\tif (m_currentMeasureToolbarTool==\"point\") {\r\n\t\t//alert(\"MeasurePoint\");\r\n if (md!=null) md.innerHTML = \"Click on the map to return the coordinate location of the point.<br />\";\r\n\t\tMeasurePoint(map.controlName);\r\n\t} else if (m_currentMeasureToolbarTool==\"polyline\") {\r\n\t\t//alert(\"MeasurePolyline\");\r\n if (md!=null) md.innerHTML = \"Click on the map and draw a line. Double-click to end the line.<br />\";\r\n\t\tMeasurePolyline(map.controlName);\r\n\t} else {\r\n\t\t//alert(\"MeasurePolygon\");\r\n if (md!=null) md.innerHTML = \"Click on the map and draw a polygon. Double-click to end the polygon.<br />\";\r\n\t\tMeasurePolygon(map.controlName);\r\n\t}\r\n}", "function SwitchMeasurementUnits(){\n\tvar placeholderMm = '0.0';\n\tvar placeholderInches = '0.000';\n\t\t\n\t// Disable print view when switching between units\n\tEnablePrintView(false);\n\t\t\n\t// Flip the toggle\n\t_buttonState = !_buttonState;\n\t\n\t// Null out all current values when toggling between units\n\t// We don't wish to convert them\n\tjQuery('#item-length').val(null);\n\tjQuery('#item-width').val(null);\n\tjQuery('#item-height').val(null);\n\tjQuery('#item-length').attr(\"placeholder\", _buttonState ? placeholderMm : placeholderInches);\n\tjQuery('#item-width').attr(\"placeholder\", _buttonState ? placeholderMm : placeholderInches);\n\tjQuery('#item-height').attr(\"placeholder\", _buttonState ? placeholderMm : placeholderInches);\n\tjQuery('#plywood-thickness').val(null);\n\tjQuery('#frame-thickness').val(null);\n\tjQuery('#padding-thickness').val(null);\n\tjQuery('#plywood-thickness').attr(\"placeholder\", _buttonState ? \"9.5\" : \"0.375\");\n\tjQuery('#frame-thickness').attr(\"placeholder\", _buttonState ? \"38.0\" : \"1.500\");\n\tjQuery('#padding-thickness').attr(\"placeholder\", _buttonState ? \"25.4\" : \"1.000\");\n\n\tUpdatePageText();\n}", "function toggleMeasurement() {\n let currentUnit = document.querySelector('#unit-wrapper').getAttribute('data-measure');\n if(currentUnit == 'imperial') {\n // Metric\n measureUpdate('metric');\n document.querySelector('#unit-wrapper').setAttribute('data-measure', 'metric');\n writeCookie('canitube_Settings_Unit Measure', 'metric', 10000000);\n } else {\n // Imperial\n measureUpdate('imperial');\n document.querySelector('#unit-wrapper').setAttribute('data-measure', 'imperial');\n writeCookie('canitube_Settings_Unit Measure', 'imperial', 10000000);\n }\n\n}", "function customMeasureUpdate() {\n // Extracts numbers, works with comma-seperated digits\n // and decimals.\n var numbers = $('#measure-custom').val().replace(',', '').match(/[-]{0,1}[\\d.]*[\\d]+/g);\n updateMeasure(numbers[0]);\n }", "get measure () {\n\t\treturn this._measure;\n\t}", "function MeasurePoint(divid) {\r\n\tmap = Maps[divid];\r\n\tif (map!=null) {\r\n vectortoolbar = \"MeasureToolbar\";\r\n //MapPoint(map.controlName, \"Measure\", false, \"pointer\");\r\n map.setTool(\"Measure\", false, \"Point\", \"pointer\", -1, \"visible\",\"\");\r\n map.divObject.onmousedown = MapCoordsClick;\r\n map.mode = \"MeasurePoint\";\r\n var vo = map.vectorObject;\r\n showLayer(vo.divId);\r\n vo.clear();\r\n vo.draw();\r\n\t} \r\n}", "function measurementModified(e, eventObject){\n var start = new Date();\n\n var enabledElement = eventObject.enabledElement;\n var lineIndex = eventObject.lineIndex;\n var type = eventObject.type;\n\n // if we have no toolData for this element, return immediately as there is nothing to do\n var toolData = cornerstoneTools.getToolState(e.currentTarget, toolType);\n if (toolData === undefined) {\n return;\n }\n\n //If type is delete, remove measurement\n if(type === \"delete\") {\n var deletedDataIndex = -1;\n\n for (var i = 0; i < toolData.data.length; i++) {\n var data = toolData.data[i];\n\n //When click a row of table measurements, measurement will be active and color will be green\n if (data.index === eventObject.lineIndex && eventObject.type !== \"active\") {\n data.visible = false;\n deletedDataIndex = i;\n }\n }\n\n if (deletedDataIndex >= 0 && deletedDataIndex < toolData.data.length) {\n toolData.data.splice(deletedDataIndex, 1);\n }\n } else {\n for (var i = 0; i < toolData.data.length; i++) {\n var data = toolData.data[i];\n\n //When click a row of table measurements, measurement will be active and color will be green\n if (data.index === eventObject.lineIndex && eventObject.type === \"active\") {\n data.active = true;\n } else{\n data.active = false;\n }\n }\n }\n\n\n enabledElement.image.render(enabledElement, true);\n\n var context = enabledElement.canvas.getContext('2d');\n\n var end = new Date();\n var diff = end - start;\n //console.log(diff + ' ms');\n\n var eventData = {\n viewport : enabledElement.viewport,\n element : enabledElement.element,\n image : enabledElement.image,\n enabledElement : enabledElement,\n canvasContext: context,\n measurementText: \"\",\n renderTimeInMs : diff,\n lineIndex : lineIndex,\n type : type //Holds image will be deleted or active\n };\n\n enabledElement.invalid = false;\n\n onImageRendered(e, eventData);\n }", "get measure() {\n\t\treturn this.__measure;\n\t}", "function parseMeasure(m) {\n var o = parseMeasure2(m);\n if (isNaN(o.value)) {\n stop('Invalid parameter:', m);\n }\n return o;\n }", "__init() {this._measurements = {};}", "__init() {this._measurements = {};}", "__init() {this._measurements = {};}", "function selMeasure() { // function that writes the data based on the dropdown selection\n var m = document.getElementById(\"sel\").value;\n writeData(m); \n }", "requestMeasure() {\n this.isMeasureRequested_ = true;\n }", "function measure(measureName, startMarkName, endMarkName) {\n if (enabled) {\n var end = endMarkName && marks[endMarkName] || ts.timestamp();\n var start = startMarkName && marks[startMarkName] || profilerStart;\n measures[measureName] = (measures[measureName] || 0) + (end - start);\n }\n }", "function activateMeasure(){\n mapImplementation.ActivateMeasure();\n }", "_getMeasurements() {\n const that = this,\n measurements = that._measurements,\n measureLabel = document.createElement('div');\n let minLabel, maxLabel, minLabelWidth, maxLabelWidth, minLabelHeight, maxLabelHeight;\n\n measureLabel.className = 'jqx-label';\n measureLabel.style.position = 'absolute';\n measureLabel.style.visibility = 'hidden';\n that.$.svgContainer.appendChild(measureLabel);\n\n if (that.selection === 'hour') {\n minLabel = '1';\n maxLabel = '23';\n\n that.max = 12;\n that._drawMax = '12';\n that._range = 12;\n }\n else {\n minLabel = '00';\n maxLabel = '55';\n\n that.max = 60;\n that._drawMax = '60';\n that._range = 60;\n }\n\n measureLabel.innerHTML = minLabel;\n minLabelWidth = measureLabel.offsetWidth;\n minLabelHeight = measureLabel.offsetHeight;\n measureLabel.innerHTML = maxLabel;\n maxLabelWidth = measureLabel.offsetWidth;\n maxLabelHeight = measureLabel.offsetHeight;\n\n that._largestLabelSize = Math.max(minLabelWidth, minLabelHeight, maxLabelWidth, maxLabelHeight);\n that._tickIntervalHandler.labelsSize.minLabelSize = minLabelHeight;\n that._tickIntervalHandler.labelsSize.maxLabelSize = maxLabelHeight;\n\n const measureElementStyle = window.getComputedStyle(measureLabel);\n\n measurements.fontSize = measureElementStyle.fontSize;\n measurements.fontFamily = measureElementStyle.fontFamily;\n measurements.fontWeight = measureElementStyle.fontWeight;\n measurements.fontStyle = measureElementStyle.fontStyle;\n that.$.svgContainer.removeChild(measureLabel);\n }", "setMeasurement(name) {\n /* @_POST_ */\n return new Promise((resolve, reject) => {\n this._measurement = name\n resolve()\n })\n }", "getMeasuremetns() {\n\t\tvar newMeasurement = this.newValue;\n\t\tvar oldMeasurement = localStorage.getItem('measureValue');\n\n\t\treturn {new: newMeasurement, old: oldMeasurement};\n\t}", "function changeMeasureUnits() {\r\n var f = document.forms[docFormID];\r\n var i = f.MeasureUnits2.selectedIndex;\r\n var m = f.MeasureUnits2.options[i].value;\r\n f.MeasureUnits.value = m; \r\n coordString = map.coords;\r\n if (coordString==null) coordString=\"\";\r\n var argument = \"ControlID=\" + map.controlName + \"&EventArg=\" + m_currentMeasureToolbarTool + \"&ControlType=Map&coords=\" + coordString + \"&VectorMode=\" + map.mode + \"&VectorAction=AddPoint&MeasureUnits=\" + m;\r\n if (checkForFormElement(document, 0, \"AreaUnits\")) {\r\n argument += \"&AreaUnits=\" + f.AreaUnits.value;\r\n } \r\n var context = map.controlName + \",\" + m_currentMeasureToolbarTool;\r\n\r\n \t// Debug stuff to be removed, or at least commented out\r\n \tif (checkForFormElement(document, 0, \"MapDebugBox\")) document.forms[0].MapDebugBox.value += (\"Vector Request: \" + context + \": MeasureUnits=\" + m + \"\\n\"); \r\n\t\t \r\n eval(map.vectorCallbackFunctionString); \r\n}", "function AppUpdateMeasurement1() {\n Metrics.Measurement.call(this);\n}", "function changeMeasure(measure) {\n activeMeasure = measure;\n if (!HUCMeta[activeMeasure].style.avg) calcAverage(activeMeasure);\n geojson.setStyle(Style);\n legend.update();\n info.update();\n var layer = getLayer(activeRecord.id);\n updateData(HUCMeta[activeMeasure]);\n if (activeRecord.id) highlightSelected(layer);\n hashChange(activeMeasure, activeRecord.id ? activeRecord.id : \"\");\n}", "function DJUIElementVUMeter(name, x, y, width, height) {\n\n DJUIElement.call(this, name, x, y, width, height);\n\n \n this.value = 0.0;\n this.UIType =\"VUMeter\";\n}", "function update_measure_end()\n{\n\tvar measure_start=document.getElementById(\"measure_start\");\n\tvar measure_end=document.getElementById(\"measure_end\");\n\tvar start=measure_start.value;\n\t\n}", "addMeasure(newMeasure) {\n this.measures.push(newMeasure);\n }", "function showmeasureInfo(showPnt, data, unit) {\n\t\tvar measureDiv = $(\"#measure\");\n\t\t\n\t\tvar screenPnt = mapConstant.map.toScreen(showPnt);\n\t\tmeasureDiv.css(\"left\", screenPnt.x + \"px\");\n\t\tmeasureDiv.css(\"top\", screenPnt.y + \"px\");\n\t\tmeasureDiv.css(\"position\", \"absolute\");\n\t\tmeasureDiv.css(\"height\", \"30px\");\n\t\tmeasureDiv.css(\"background\", \"#fff\");\n\t\tmeasureDiv.css(\"border\", \"1px solid\");\n\t\tmeasureDiv.css(\"display\", \"block\");\n\t\tmeasureDiv.css(\"line-height\", \"30px\");\n\t\tmapConstant.isShow = true;\n\t\tmeasureDiv.css(\"z-index\", \"999\");\n\t\tif (unit === \"千米\") {\n\t\t\tmeasureDiv.css(\"width\", \"104px\");\n\t\t} else {\n\t\t\tmeasureDiv.css(\"width\", \"150px\");\n\t\t}\n\t\t$(\"#result\").html(data + unit);\n\t\t$(\"#infoclose\").click(function() {\n\t\t\tmapConstant.map.graphics.clear();\n\t\t\tmeasureDiv.css(\"display\", \"none\");\n\t\t\tmapConstant.isShow = false;\n\t\t});\n\n\t\tmapConstant.map.on(\"pan-start\", function() {\n\t\t\tmeasureDiv.css(\"display\", \"none\");\n\t\t});\n\n\t\tmapConstant.map.on(\"pan-end\", function(panend) {\n\t\t\tif (mapConstant.isShow == true) {\n\t\t\t\tscreenPnt = mapConstant.map.toScreen(showPnt);\n\t\t\t\tmeasureDiv.css(\"left\", screenPnt.x-20 + \"px\");\n\t\t\t\tmeasureDiv.css(\"top\", screenPnt.y-20 + \"px\");\n\t\t\t\tmeasureDiv.css(\"position\", \"absolute\");\n\t\t\t\tmeasureDiv.css(\"height\", \"30px\");\n\t\t\t\tmeasureDiv.css(\"display\", \"block\");\n\t\t\t}\n\t\t});\n\t\tmapConstant.map.on(\"zoom-start\", function() {\n\t\t\tmeasureDiv.css(\"display\", \"none\");\n\t\t});\n\t\tmapConstant.map.on(\"zoom-end\", function() {\n\t\t\tif (mapConstant.isShow == true) {\n\t\t\t\tscreenPnt = mapConstant.map.toScreen(showPnt);\n\t\t\t\tmeasureDiv.css(\"left\", screenPnt.x + \"px\");\n\t\t\t\tmeasureDiv.css(\"top\", screenPnt.y + \"px\");\n\t\t\t\tmeasureDiv.css(\"position\", \"absolute\");\n\t\t\t\tmeasureDiv.css(\"height\", \"30px\");\n\t\t\t\tmeasureDiv.css(\"display\", \"block\");\n\t\t\t}\n\t\t});\n\t}", "function handleMeasurementsPartial(event) {\n var geometry = event.geometry;\n var units = event.units;\n var order = event.order;\n var measure = event.measure;\n var element = document.getElementById('salidaMedicion');\n var out = \"\";\n var geometriaAnterior = new OpenLayers.Geometry.LineString();\n if (order == 1) {\n var longitudAnterior = 0;\n var longitudUltimoTramo = 0;\n if (event.geometry.components.length > 2) {\n\n geometriaAnterior.components = event.geometry.components.slice(0, event.geometry.components.length - 1);\n longitudAnterior = this.getBestLength(geometriaAnterior)[0];\n console.log(longitudAnterior);\n longitudUltimoTramo = measure - longitudAnterior;\n }\n\n out += \"Longitud total: \" + measure.toFixed(2) + \" \" + units + \"<br>\" +\n \"Longitud anterior: \" + parseFloat(longitudAnterior).toFixed(2) + \" \" + units + \"<br>\" +\n \"Longitud tramo: \" + parseFloat(longitudUltimoTramo).toFixed(2) + \" \" + units + \"<br>\";\n }\n\n else {\n var perimetro = this.getBestLength(event.geometry);\n out += \"Área: \" + measure.toFixed(2) + \" \" + units + \"<sup>2</\" + \"sup><br>\" +\n \"Perímetro: \" + perimetro[0].toFixed(2) + \" \" + perimetro[1];\n }\n element.innerHTML = out;\n}", "function tempMeasurement(height, width) {\n this.Height = height;\n this.Width = width;\n }", "measure(measureName, againstMarkName, saveAsMark = null) {\n\n const againstMark = this.marks[againstMarkName]\n\n // Validate that the mark exists\n if (!againstMark) throw new Error(`Mark ${againstMarkName} does not exist`)\n\n const mark = new Mark()\n\n if (saveAsMark) {\n this.marks[saveAsMark] = mark\n }\n\n // Difference of current memory usage against a specified captured mark\n const resultMemoryUsage = {\n rss: mark.memoryUsage.rss - againstMark.memoryUsage.rss,\n heapTotal: mark.memoryUsage.heapTotal - againstMark.memoryUsage.heapTotal,\n heapUsed: mark.memoryUsage.heapUsed - againstMark.memoryUsage.heapUsed,\n external: mark.memoryUsage.external - againstMark.memoryUsage.external\n }\n\n // Difference of current time against specified captured mark time to get execution time\n const resultTimestamp = mark.timestamp - againstMark.timestamp\n\n // Add the results to a new measure\n this.measures[measureName] = new Mark(resultMemoryUsage, resultTimestamp)\n }", "function kt(e,t){var a=e.display.externalMeasured;return a&&a.line==t.line?(e.display.externalMeasured=null,t.measure=a.measure,a.built):ct(e,t)}", "function AppInfoMeasurement1() {\n Metrics.Measurement.call(this);\n}", "function setCurrentMeasure(newMeasure)\n{\n\tcurrentMeasure = newMeasure;\n\tdelay = (currentMeasure - 1) * delayPerMeasure;\n\t//console.log(\"setCurrentMeasure: currentMeasure=\"+currentMeasure);\n\n\tif (currentMeasure < startMeasure)\n\t\tsetStartMeasure(currentMeasure);\n\n\tif (currentMeasure > endMeasure)\n\t\tsetEndMeasure(currentMeasure);\n\tresetNotesStart = new Date().getTime();\n\tresetNotes();\n\t//console.log(\"resetNotesTime: \" + (new Date().getTime() - resetNotesStart));\n\tif ($(\"#playBtn\").attr(\"src\") == \"./images/pauseButton.png\")\n\t\tplayMusic();\n}", "function getMeasure(index) {\n return window.song.getMeasures()[index];\n }", "_setMeasurements() {\n const that = this;\n\n that._measurements = {};\n\n if (that.orientation === 'horizontal') {\n that._measurements.dimension = 'height';\n that._measurements.minDimension = 'minHeight';\n that._measurements.maxDimension = 'maxHeight';\n that._measurements.restricredDimension = 'Width';\n that._measurements.size = 'offsetHeight';\n that._measurements.offset = 'offsetTop';\n that._measurements.position = 'top';\n that._measurements.position2 = 'bottom';\n that._measurements.pagePosition = 'pageY';\n that._measurements.scroll = 'scrollTop';\n }\n else {\n that._measurements.dimension = 'width';\n that._measurements.minDimension = 'minWidth';\n that._measurements.maxDimension = 'maxWidth';\n that._measurements.restricredDimension = 'Height';\n that._measurements.size = 'offsetWidth';\n that._measurements.offset = 'offsetLeft';\n that._measurements.position = 'left';\n that._measurements.position2 = 'right';\n that._measurements.pagePosition = 'pageX';\n that._measurements.scroll = 'scrollLeft';\n }\n\n that._measurements.overflow = getComputedStyle(that).getPropertyValue('overflow');\n }", "function getMeasureUnit(type) {\n switch (type) {\n case 2: // Temperature\n return '°C';\n case 1: // Intensity\n case 4: // Curtains aperture\n default:\n return '%';\n }\n }", "function getMeasureNumber(measure) {\n return measure.getAttribute(\"number\");\n}", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view;\n } // Get a {top, bottom, left, right} box (in line-local coordinates)", "function updateExternalMeasurement(cm, line) {\n\t\t line = visualLine(line);\n\t\t var lineN = lineNo(line);\n\t\t var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n\t\t view.lineN = lineN;\n\t\t var built = view.built = buildLineContent(cm, view);\n\t\t view.text = built.pre;\n\t\t removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n\t\t return view\n\t\t }", "function setCellMeasure(value) {\r\n\t_file.cell.typeSystem = \"\";\r\n\tvar i = _file.frameValue;\r\n\tvar StringUnitcell = \"auxiliaryinfo.models[\" + (i || 1) + \"].infoUnitCell\";\r\n\tvar cellparam = extractInfoJmol(StringUnitcell);\r\n\t_file.cell.a = cellparam[0];\r\n\t_file.cell.b = cellparam[1];\r\n\t_file.cell.c = cellparam[2];\r\n\tif (value == \"a\") {\r\n\t\tsetValue(\"cell.a\", roundNumber(_file.cell.a));\r\n\t\tsetValue(\"cell.b\", roundNumber(_file.cell.b));\r\n\t\tsetValue(\"cell.c\", roundNumber(_file.cell.c));\r\n\t} else {\r\n\t\t_file.cell.a *= 1.889725989;\r\n\t\t_file.cell.b *= 1.889725989;\r\n\t\t_file.cell.c *= 1.889725989;\r\n\t\tsetValue(\"cell.a\", roundNumber(_file.cell.a));\r\n\t\tsetValue(\"cell.b\", roundNumber(_file.cell.b));\r\n\t\tsetValue(\"cell.c\", roundNumber(_file.cell.c));\r\n\t}\r\n}", "addMeasure(measureIndex) {\n var measureIndex = measureIndex || this.measures.length;\n if(measureIndex > this.measures.length) {\n throw new Error(\"Measure cannot be inserted into an invalid position: \" + measureIndex);\n }\n // var measure = measure || new Measure();\n var measure = new Measure(this.timeSig);\n\n // Sets the measure to be editable or not based off of the staff's this.editable property \n measure.setMeasureEditable(this.editable)\n\n // Set id of <table> measure to be the index of the measure in the staff (e.g. measure0)\n measure.measure.setAttribute(\"id\", \"measure\" + measureIndex);\n\n // Add end of measure vertical line to previous measure\n if(this.measures.length > 0 && measureIndex !== 0) {\n Object.values(this.measures[measureIndex-1].measure.rows).map( (tr, index) => {\n if(!tr.className.includes(\"museMeasurePointerContainer\")) {\n if(index >= 3 && index <= 11) {\n const lastTdChild = getNonHiddenTds(tr.cells)[getNonHiddenTds(tr.cells).length-1]\n if(!lastTdChild.className.includes(\"endMeasureLine\")){\n lastTdChild.setAttribute('class', lastTdChild.className + \" endMeasureLine\");\n }\n }\n }\n })\n }\n\n // If Measure inserted before other Measures\n if(measureIndex < this.measures.length) {\n // change the ids of the <table> measures after the inserted measure to be correctly numbered\n for(var i=measureIndex; i < this.measures.length; i++) {\n this.measures[i].measure.setAttribute(\"id\", \"measure\" + parseInt(i+1))\n }\n\n // Add end of measure vertical line to the inserted measure\n Object.values(measure.measure.rows).map( (tr, index) => {\n if(!tr.className.includes(\"museMeasurePointerContainer\")) {\n if(index >= 3 && index <= 11) {\n const lastTdChild = getNonHiddenTds(tr.cells)[getNonHiddenTds(tr.cells).length-1]\n if(!lastTdChild.className.includes(\"endMeasureLine\")){\n lastTdChild.setAttribute('class', lastTdChild.className + \" endMeasureLine\");\n }\n }\n }\n })\n }\n\n // Insert Measure into staff's list of Measures\n this.measures.splice(measureIndex, 0, measure);\n\n // Move pointer to beginning of newly created measure\n if(this.editable) {\n this.setMeasurePointedOn(measureIndex, 0);\n }\n\n this.staff.insertBefore(measure.measure, this.staff.querySelectorAll(\".museMeasure\")[measureIndex]);\n }", "function measureUpdate(unitSet) {\n let unitsTo = {\n \"length\": \"\",\n \"speed\": \"\",\n \"temperature\": \"\",\n \"volume_flow_rate\": \"\"\n }\n if(unitSet == 'imperial') {\n // Imperial\n // Speed: mile/hour\n // Length: feet\n // Volume Flow Rate: cubic feet/second\n // Temperature: Fahrenheit\n unitsTo.length = 'ft';\n unitsTo.speed = 'm/h';\n unitsTo.temperature = 'F';\n unitsTo.volume_flow_rate = 'ft3/s';\n } else {\n // Metric\n // Speed: metre/second\n // Length: meter\n // Volume Flow Rate: cubic meter/second\n // Temperature: Celsius\n unitsTo.length = 'm';\n unitsTo.speed = 'm/s';\n unitsTo.temperature = 'C';\n unitsTo.volume_flow_rate = 'm3/s';\n }\n let unitBase = 'FT';\n if(unitSet == 'metric') {\n unitBase = 'M';\n }\n\n // Select values of all the items that need to have their units update\n // Height range\n let heightUnit = document.querySelector('.height-wrapper').getAttribute('data-unit');\n let highHeightMeasure = parseInt(document.querySelector('#high-height').textContent);\n let lowHeightMeasure = parseInt(document.querySelector('#low-height').textContent);\n // Convert\n highHeightMeasure = Math.round(convert(highHeightMeasure).from(heightUnit).to(unitsTo.length)*10)/10;\n lowHeightMeasure = Math.round(convert(lowHeightMeasure).from(heightUnit).to(unitsTo.length)*10)/10;\n // Set\n document.querySelector('.height-wrapper').setAttribute('data-unit', unitsTo.length);\n document.querySelector('#high-height').innerHTML = highHeightMeasure;\n document.querySelector('#low-height').innerHTML = lowHeightMeasure;\n // Measurement\n document.querySelector('#height-unit').innerHTML = '';\n document.querySelector('#height-unit').insertAdjacentText('afterbegin', unitBase);\n\n // Flow range\n let rangeFlowUnit = document.querySelector('.range-wrapper').getAttribute('data-unit');\n let highRangeFlowMeasure = parseInt(document.querySelector('#high-range').textContent);\n let lowRangeFlowMeasure = parseInt(document.querySelector('#low-range').textContent);\n // Convert\n highRangeFlowMeasure = Math.round(convert(highRangeFlowMeasure).from(rangeFlowUnit).to(unitsTo.volume_flow_rate));\n lowRangeFlowMeasure = Math.round(convert(lowRangeFlowMeasure).from(rangeFlowUnit).to(unitsTo.volume_flow_rate));\n // Set\n document.querySelector('.range-wrapper').setAttribute('data-unit', unitsTo.volume_flow_rate);\n document.querySelector('#high-range').innerHTML = highRangeFlowMeasure;\n document.querySelector('#low-range').innerHTML = lowRangeFlowMeasure;\n // Measurement\n document.querySelector('#range-unit').innerHTML = '';\n document.querySelector('#range-unit').insertAdjacentText('afterbegin', unitBase);\n document.querySelector('#range-unit').insertAdjacentHTML('beforeend', '<span class=\"superscript\">3</span>');\n document.querySelector('#range-unit').insertAdjacentText('beforeend', '/S');\n\n // Current temp\n let currentTempUnit = document.querySelector('.weather-subtitle').getAttribute('data-unit');\n let currentWaterTempMeasure = document.querySelector('#water-temp').textContent.split('o')[0].split(' ')[1];\n let currentAirTempMeasure = parseInt(document.querySelector('#air-temp').textContent.split('o')[0].split(' ')[1]);\n // Convert\n if(currentWaterTempMeasure !== '-') {\n // Water temp is not a null value\n currentWaterTempMeasure = Math.round(convert(parseInt(currentWaterTempMeasure)).from(currentTempUnit).to(unitsTo.temperature));\n }\n currentAirTempMeasure = Math.round(convert(currentAirTempMeasure).from(currentTempUnit).to(unitsTo.temperature));\n // Set\n document.querySelector('.weather-subtitle').setAttribute('data-unit', unitsTo.temperature);\n // Water\n document.querySelector('#water-temp').innerHTML = '';\n document.querySelector('#water-temp').insertAdjacentText('afterbegin', 'Water: ' + currentWaterTempMeasure);\n document.querySelector('#water-temp').insertAdjacentHTML('beforeend', '<span class=\"degree\">o</span>');\n document.querySelector('#water-temp').insertAdjacentText('beforeend', unitsTo.temperature);\n // Air\n document.querySelector('#air-temp').innerHTML = '';\n document.querySelector('#air-temp').insertAdjacentText('afterbegin', 'Air: ' + currentAirTempMeasure);\n document.querySelector('#air-temp').insertAdjacentHTML('beforeend', '<span class=\"degree\">o</span>');\n document.querySelector('#air-temp').insertAdjacentText('beforeend', unitsTo.temperature);\n\n // Current flow\n let currentFlowUnit = document.querySelector('#current-flow').getAttribute('data-unit');\n let currentFlowMeasure = parseInt(document.querySelector('#current-flow > .container').textContent);\n // Convert\n currentFlowMeasure = Math.round(convert(currentFlowMeasure).from(currentFlowUnit).to(unitsTo.volume_flow_rate));\n // Set\n document.querySelector('#current-flow').setAttribute('data-unit', unitsTo.volume_flow_rate);\n document.querySelector('#current-flow > .container').textContent = currentFlowMeasure;\n}", "function updateExternalMeasurement(cm, line) {\n\t\t line = visualLine(line);\n\t\t var lineN = lineNo(line);\n\t\t var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n\t\t view.lineN = lineN;\n\t\t var built = view.built = buildLineContent(cm, view);\n\t\t view.text = built.pre;\n\t\t removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n\t\t return view;\n\t\t }", "_getMeasurements() {\n const that = this;\n\n if (!that._isVisible() || that._renderingSuspended) {\n that._renderingSuspended = true;\n return;\n }\n\n const measurements = that._measurements;\n\n measurements.cachedWidth = that.offsetWidth;\n measurements.cachedHeight = that.offsetHeight;\n\n measurements.radius = measurements.cachedWidth / 2;\n\n const measureElement = document.createElement('div');\n\n if (that.enableShadowDOM) {\n that.shadowRoot.appendChild(measureElement);\n }\n else {\n that.appendChild(measureElement);\n }\n\n // ticks\n measureElement.className = 'jqx-tick';\n measurements.majorTickSize = measureElement.offsetWidth;\n measureElement.className += ' jqx-tick-minor';\n measurements.minorTickSize = measureElement.offsetWidth;\n\n // labels\n measureElement.className = 'jqx-label';\n const measureElementStyle = window.getComputedStyle(measureElement);\n measurements.fontSize = measureElementStyle.fontSize;\n measurements.fontFamily = measureElementStyle.fontFamily;\n measurements.fontWeight = measureElementStyle.fontWeight;\n measurements.fontStyle = measureElementStyle.fontStyle;\n\n measurements.trackWidth = 0;\n measurements.trackBorderWidth = 0;\n\n if (that.analogDisplayType === 'needle') {\n // needle\n measureElement.className = 'jqx-needle';\n measurements.needleWidth = measureElement.offsetWidth;\n measurements.needleLength = measureElement.offsetHeight;\n\n // ranges\n measureElement.className = 'jqx-range';\n measurements.rangeSize = measureElement.offsetWidth;\n }\n else { // 'fill' and 'line' case\n // track\n measureElement.className = 'jqx-track';\n measurements.trackBorderWidth = parseFloat(measureElementStyle.strokeWidth);\n measurements.trackWidth = Math.min(measureElement.offsetWidth, measurements.radius - measurements.trackBorderWidth)\n measurements.lineSize = measurements.trackWidth + measurements.trackBorderWidth;\n\n if (that.ticksPosition === 'track') {\n measurements.majorTickSize = measurements.lineSize;\n measurements.minorTickSize = measurements.majorTickSize / 2;\n }\n }\n\n if (that.enableShadowDOM) {\n that.shadowRoot.removeChild(measureElement);\n }\n else {\n that.removeChild(measureElement);\n }\n }", "function activateMeasure(options) {\n mapImplementation.ActivateMeasure(options);\n }", "function PlacesMeasurement() {\n Metrics.Measurement.call(this);\n}", "getMeasureDef(measure_id, sub_id){\n throw \"Implement me\";\n }", "function isMeasurementValue(value) {\n\t return typeof value === 'number' && isFinite(value);\n\t}", "function measure() {\n\t\t\n\t\t// Call our validate routine and make sure all component properties have been set\n\t\tviz.validate();\n\t\t\n\t\t// Get our size based on height, width, and margin\n\t\tsize = vizuly2.util.size(scope.margin, scope.width, scope.height, scope.parent);\n\t\t\n\t\tscope.size = size;\n\t\t\n\t\t// Tell everyone we are done making our measurements\n\t\tscope.dispatch.apply('measured', viz);\n\t\t\n\t}", "computeCanvasMeasures() {\n const time = this.canvasToPointForNormalizedCanvas(this.createPoint(1, 0)).x\n - this.canvasToPointForNormalizedCanvas(this.createPoint(0, 0)).x;\n const frec = this.canvasToPointForNormalizedCanvas(this.createPoint(0, 1)).y\n - this.canvasToPointForNormalizedCanvas(this.createPoint(0, 0)).y;\n return { canvasTime: time, canvasFrequency: frec };\n }", "newMeasure() {\n return new Measure({}, this.context)\n }", "function OphMeasurementComponent(criterion) { \n\t\n\tthis.compId = 0;\n\tthis.df = new mp_formatter.DateTimeFormatter(MPAGE_LOCALE);\n\tthis.setCriterion(criterion);\n\tthis.setLookBackDropDown(true);\n\tthis.setStyles(new OphMeasurementComponentStyle());\n\tthis.setIncludeLineNumber(false);\n\tthis.m_iViewAdd = false;\n\tthis.m_displayGenerateMeasure = false;\n\tthis.m_displayVisAcuity = false;\n\tthis.m_displayGenerateMeasure = false;\n\tthis.m_displayVisAcuity = false;\n\tthis.m_displayRefract = false;\n\tthis.m_displayAutoRefract = false;\n\tthis.m_displayKerato = false;\n\tthis.m_displayRetino = false;\n\tthis.m_displayRetAcuity = false;\n\tthis.m_displayGlare = false;\n\tthis.m_displayPupEqual = false;\n\tthis.m_displayIOP = false;\n\tthis.m_displayDilation = false;\n\tthis.m_displayMotility = false;\n\tthis.m_displayVisFields = false;\n\tthis.m_displayPachy = false;\n\tthis.m_displayOCT = false;\n\tthis.m_displayLID = false;\n\tthis.m_displayColor = false;\n\tthis.m_displayContrast = false;\n\tthis.m_displayAmsler = false;\n\tthis.m_displayTitmus = false;\n\tthis.m_displayWorth = false;\n\tthis.setResultCount(3);\n\tthis.setIncludeEventSetInfo(true);\n\tthis.setComponentLoadTimerName(\"USR:MPG.OphMeasurement.O1 - load component\");\n\tthis.setComponentRenderTimerName(\"ENG:MPG.OphMeasurement.O1 - render component\");\n\tthis.bandName = \"\";\n\tthis.sectionName = \"\";\n\tthis.itemName = \"\";\n\n\tthis.ophmI18n = i18n.discernabu.oph_measurement_o1;\n\tthis.ophmLen = 0;\n\tthis.paramVisualAcuity = 0;\n\tthis.paramRefraction = 0;\n\t\t\t\n\tthis.paramRetinal = 0;\n\tthis.paramGlare = 0;\n\tthis.paramPupil = 0;\n\tthis.paramAutoRefract = 0;\n\tthis.paramKerato = 0;\n\tthis.paramRetino = 0;\n\tthis.paramIOP = 0;\n\tthis.paramDilation = 0;\n\tthis.paramMotility = 0;\n\tthis.paramVisualFields = 0;\n\tthis.paramPachy = 0;\n\tthis.paramOCT = 0;\n\tthis.paramLid = 0;\n\tthis.paramColor = 0;\n\tthis.paramContrast = 0;\n\tthis.paramAmsler = 0;\n\tthis.paramTitmus = 0;\n\tthis.paramWorth = 0;\n\tthis.paramGraph = 0;\n\t\n\tthis.m_resultCount = 0;\n\tthis.m_isEventSetInfo = false;\n\tthis.m_isComment = false;\n\t\n\t\n\tthis.groupVisualAcuity = {};\n\tthis.groupVisualFields = {};\n\tthis.groupRefract = {};\n\tthis.groupRefract2 = {};\n\tthis.groupAutoRefract = {};\n\tthis.groupKerato = {};\n\tthis.groupRetino = {};\n\tthis.groupRetAcuity = {};\n\tthis.groupGlare = {};\n\tthis.groupPupEqual = {};\n\tthis.groupIOP = {};\n\tthis.groupDilation = {};\n\tthis.groupMotility = {};\n\tthis.groupVisualFieldsTDiag = {};\n\tthis.groupMotilityHDiag = {};\n\tthis.groupPachy = {};\n\tthis.groupOCT = {};\n\tthis.groupLID = {};\n\tthis.groupColor = {};\n\tthis.groupContrast = {};\n\tthis.groupAmsler = {};\n\tthis.groupTitmus = {};\n\tthis.groupWorth = {};\n\tthis.EvtMap = {};\n\tthis.GroupMap = {}; \n}", "function updateExternalMeasurement(cm, line) {\n\t line = visualLine(line);\n\t var lineN = lineNo(line);\n\t var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n\t view.lineN = lineN;\n\t var built = view.built = buildLineContent(cm, view);\n\t view.text = built.pre;\n\t removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n\t return view;\n\t }", "function updateExternalMeasurement(cm, line) {\n\t line = visualLine(line);\n\t var lineN = lineNo(line);\n\t var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n\t view.lineN = lineN;\n\t var built = view.built = buildLineContent(cm, view);\n\t view.text = built.pre;\n\t removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n\t return view;\n\t }", "function updateExternalMeasurement(cm, line) {\n\t line = visualLine(line);\n\t var lineN = lineNo(line);\n\t var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n\t view.lineN = lineN;\n\t var built = view.built = buildLineContent(cm, view);\n\t view.text = built.pre;\n\t removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n\t return view;\n\t }", "function telemetry() {\n\tlet status = document.getElementById('status');\n\tvar newMeasurement = {};\n\tlet sensor = new Accelerometer();\n\tsensor.addEventListener('reading', function(e) {\n\t\tstatus.innerHTML = 'x: ' + e.target.x + '<br> y: ' + e.target.y + '<br> z: ' + e.target.z;\n\t\tnewMeasurement.x = e.target.x;\n\t\tnewMeasurement.y = e.target.y;\n\t\tnewMeasurement.z = e.target.z;\n\t});\n\tsensor.start();\n\treturn newMeasurement;\n}", "function AddonCountsMeasurement1() {\n Metrics.Measurement.call(this);\n}", "function updateExternalMeasurement(cm, line) {\r\n line = visualLine(line);\r\n var lineN = lineNo(line);\r\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\r\n view.lineN = lineN;\r\n var built = view.built = buildLineContent(cm, view);\r\n view.text = built.pre;\r\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\r\n return view\r\n}", "_getMeasurements() {\n const that = this,\n measurements = that._measurements,\n track = that.$.track,\n thumb = that.$.thumb;\n\n if (!that._isVisible() || that._renderingSuspended) {\n that._renderingSuspended = true;\n return;\n }\n\n if (that.orientation === 'horizontal') {\n measurements.trackWidth = track.offsetHeight;\n measurements.thumbSize = thumb.offsetWidth;\n measurements.borderWidth = parseFloat(window.getComputedStyle(that.$.track).borderLeftWidth);\n }\n else {\n measurements.trackWidth = track.offsetWidth;\n measurements.thumbSize = thumb.offsetHeight;\n measurements.borderWidth = parseFloat(window.getComputedStyle(that.$.track).borderTopWidth);\n }\n measurements.halfThumbSize = measurements.thumbSize / 2;\n\n }", "function isMeasurementValue(value) {\n return typeof value === 'number' && isFinite(value);\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line)\n var lineN = lineNo(line)\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN)\n view.lineN = lineN\n var built = view.built = buildLineContent(cm, view)\n view.text = built.pre\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre)\n return view\n}", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line)\n var lineN = lineNo(line)\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN)\n view.lineN = lineN\n var built = view.built = buildLineContent(cm, view)\n view.text = built.pre\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre)\n return view\n}", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n}", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n}", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n}", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n}", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n}", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n}", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n}", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n}", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n}", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n}", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n}", "function updateExternalMeasurement(cm, line) {\r\n line = visualLine(line);\r\n var lineN = lineNo(line);\r\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\r\n view.lineN = lineN;\r\n var built = view.built = buildLineContent(cm, view);\r\n view.text = built.pre;\r\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\r\n return view;\r\n }", "function Vt(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[ka(e,t)];var a=e.display.externalMeasured;return a&&t>=a.lineN&&t<a.lineN+a.size?a:void 0}", "function createMeasureInput() {\n var mStr = '<form name=\"measureForm\"><table class=\"TOOLFRAME\"><tr><td NOWRAP>' + localeList['Total'] + pmMeasureUnits.distance + '</td><td><input type=text size=9 name=\"sumLen\"></td>';\n mStr += '<td id=\"mSegTxt\" value=\"&nbsp;&nbsp;' + localeList['Segment'] + '\" NOWRAP>&nbsp;&nbsp;' + localeList['Segment'] + pmMeasureUnits.distance + '</td><td><input type=text size=9 name=\"segLen\"></td>';\n mStr += '<td width=130 class=\"TDAR\"><input type=\"button\" id=\"cbut_measure\" value=\"' + localeList['Clear'];\n //mStr += '\" class=\"button_off\" onClick=\"javascript:clearMeasure()\" onmouseover=\"changeButtonClr(this, \\'over\\')\" onmouseout=\"changeButtonClr (this, \\'out\\')\" >';\n mStr += '\" class=\"button_off\" name=\"custombutton\" onClick=\"javascript:clearMeasure()\" >';\n mStr += '</td></tr></table></form>';\n \n $('#mapToolArea').html(mStr);\n pmCButton_init('cbut_measure');\n showHelpMessage(localeList['digitize_help']);\n}", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }", "function initMeasure() {\n // Temos que alterar isso depois, quando estivermos usando AWS: \n latitude = process.argv[2];\n longitude = process.argv[3];\n lastMeasure = new Kuaraymeasure(\"Kuaray01\", \n new Date(), null, null, null, latitude,longitude);\n}", "function startMeasure(){\n socket.emit( 'newMeasure' );\n var intId = setTimeout( startMeasure, 5000 );\n if (stop == true) {\n console.log(\"Cleared\");\n clearTimeout( intId );\n }\n }", "function UpdateHotfixMeasurement1() {\n Metrics.Measurement.call(this);\n}", "function main() {\n meter1.update(meter1.val + 0.1);\n}", "assingMeasurements(station,measurements){\n\t\t\tstation[\"x_values\"] = [];\n\t\t\tstation[\"y_values\"] = [];\n\t\t\tfor(var i=0;i<measurements.length; i++){\n\t\t\t\tvar m = measurements[i];\n\t\t\t\tstation[\"x_values\"].push(m[\"ts\"]);\n\t\t\t\tstation[\"y_values\"].push(m[\"value\"]);\n\t\t\t}\n\t\t\tstation[\"state\"]=\"loaded\";\n\t\t}", "function $t(e,t){t=de(t);var n=D(t),r=e.display.externalMeasured=new gt(e.doc,t,n);r.lineN=n;var f=r.built=ct(e,r);return r.text=f.pre,a(e.display.lineMeasure,f.pre),r}", "function kilometerToMeter(measurement)\n{\n if(measurement>0 && typeof(measurement)=='number')\n {\n var convertToMeter=measurement*1000;\n return convertToMeter;\n }\n else{\n console.log(\"you have given wrong input.Please put the valid input in the function\");\n }\n}", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view;\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view;\n }" ]
[ "0.6660645", "0.6466392", "0.62689114", "0.621941", "0.62172973", "0.61269647", "0.6103384", "0.6018999", "0.59913045", "0.59870505", "0.59870505", "0.59870505", "0.59478664", "0.5900226", "0.58413476", "0.58190143", "0.5790613", "0.5784498", "0.577481", "0.57530797", "0.57234967", "0.57002467", "0.56872857", "0.56803465", "0.5633831", "0.5630215", "0.56300265", "0.5629567", "0.5586229", "0.5574842", "0.5569571", "0.5535316", "0.5525379", "0.5520069", "0.5502311", "0.54950947", "0.5494772", "0.54526937", "0.54526186", "0.5451872", "0.5436021", "0.5416675", "0.5415919", "0.53971624", "0.5392144", "0.53911275", "0.538758", "0.53678066", "0.53517747", "0.5345369", "0.53342795", "0.53334886", "0.53334886", "0.53334886", "0.53264827", "0.53213155", "0.5320148", "0.52999395", "0.52777916", "0.52758205", "0.52758205", "0.5263105", "0.5263105", "0.5263105", "0.5263105", "0.5263105", "0.5263105", "0.5263105", "0.5263105", "0.5263105", "0.5263105", "0.5263105", "0.5249345", "0.52365214", "0.52331984", "0.5232037", "0.5232037", "0.5232037", "0.5232037", "0.5232037", "0.5232037", "0.5232037", "0.5232037", "0.5232037", "0.5232037", "0.5232037", "0.5232037", "0.5232037", "0.5232037", "0.5232037", "0.5232037", "0.5232037", "0.52301943", "0.5228413", "0.5210591", "0.52058494", "0.51931936", "0.51879174", "0.5185541", "0.51799756", "0.51799756" ]
0.0
-1
SCRIPT MAIN PROCESS ////////////////////////////////////////////////////////////////////////////// Main Process The beginning of the script starts here Add main logic routine to this function
function main(args){ var selectedItem = args.DOC_REF.selection[0]; var selectionName; if (selectedItem.name) { // Use name selectionName = selectedItem.name; } else { // Use type because name property is empty selectionName = selectedItem.typename; } var myDialog = sfDialogFactory(mainDialog(selectionName)); myDialog.show(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function main() {\r\n\t// Init the myGM functions.\r\n\tmyGM.init();\r\n\r\n\t// If the script was already executed, do nothing.\r\n\tif(myGM.$('#' + myGM.prefix + 'alreadyExecutedScript'))\treturn;\r\n\r\n\t// Add the hint, that the script was already executed.\r\n\tvar alreadyExecuted\t\t= myGM.addElement('input', myGM.$('#container'), 'alreadyExecutedScript');\r\n\talreadyExecuted.type\t= 'hidden';\r\n\r\n\t// Init the language.\r\n\tLanguage.init();\r\n\r\n\t// Init the script.\r\n\tGeneral.init();\r\n\r\n\t// Call the function to check for updates.\r\n\tUpdater.init();\r\n\r\n\t// Call the function to enhance the view.\r\n\tEnhancedView.init();\r\n}", "function MainScript() {\n debug('');\n audit('MainScript', '======START======');\n // processFile( // UNIQUE INSTITUTION\n // './ABAI_RAW/UNIQUE.csv',\n // 'A Spicy Boy', parseUniqueInstitution, UNIQUE_INSTITUTIONS\n // );\n processFile( // INSTITUTION\n './ABAI_RAW/unique.csv',//abaiBatchRecord[ 'custrecord_institue_fileid' ),\n ABAI_TABLES.INSTITUTION, parseInstitution, ABAI_INSTITUTION,\n );\n // debug(JSON.stringify(ABAI_INSTITUTION));\n file.writeFileSync('./RC_RAW/' + 'fuckthisgarbage' + '.json', JSON.stringify(ABAI_INSTITUTION) );\n processFile( // DEPARTMENT ID\n './ABAI_RAW/NetSuiteInstitution-Department.csv',//abaiBatchRecord[ 'custrecord_institue_fileid' ),\n 'depo', parseDepo, ABAI_DEPARTMENT,\n );\n // debug(JSON.stringify(ABAI_INSTITUTION));\n file.writeFileSync('./RC_RAW/' + 'fuckthisgarbageDepartment' + '.json', JSON.stringify(ABAI_DEPARTMENT) );\n // debug('Matched: ' + matchedInstitutions + ' : ' + unMatchedInstitutions)\n processFile( // INSTITUTION ADDRESS\n './ABAI_RAW/institution_address.csv',//abaiBatchRecord['custrecord_institueaddr_fileid'),\n ABAI_TABLES.INSTITUTION_ADDRESS, parseInstitutionAddress, ABAI_INSTITUTION_ADDRESS\n );\n file.writeFileSync('./RC_RAW/' + 'garbageIA' + '.json', JSON.stringify(ABAI_INSTITUTION_ADDRESS) );\n processFile( // COORDINATOR\n './ABAI_RAW/coordinator.csv',//abaiBatchRecord['custrecord_coordinaor_fileid'),\n ABAI_TABLES.COORDINATOR, parseCoordinator, ABAI_COORDINATOR\n );\n file.writeFileSync('./RC_RAW/' + 'garbagecoord' + '.json', JSON.stringify(ABAI_COORDINATOR) );\n processFile( // COURSE SEQUENCE\n './ABAI_RAW/course_sequence.csv',//abaiBatchRecord['custrecord_coursesseq_fileid'),\n ABAI_TABLES.COURSE_SEQUENCE, parseCourseSequence, ABAI_COURSE_SEQUENCE\n );\n file.writeFileSync('./RC_RAW/' + 'garbageCS' + '.json', JSON.stringify(ABAI_COURSE_SEQUENCE) );\n processFile( // COURSE\n './ABAI_RAW/course.csv',//abaiBatchRecord['custrecord_course_fileid'),\n ABAI_TABLES.COURSE, parseCourse, ABAI_COURSE\n );\n file.writeFileSync('./RC_RAW/' + 'garbageCourse' + '.json', JSON.stringify(ABAI_COURSE) );\n processFile( // AP WAIVER\n './ABAI_RAW/ap_waiver.csv', //abaiBatchRecord['custrecord_apwaiver_fileid'),\n ABAI_TABLES.APWAIVER, parseApWaiver, ABAI_AP_WAIVER\n );\n file.writeFileSync('./RC_RAW/' + 'garbageWaiver' + '.json', JSON.stringify(ABAI_AP_WAIVER) );\n processFile( // INSTRUCTOR GROUP\n './ABAI_RAW/instructor_group.csv',//abaiBatchRecord['custrecord_instructorgrp_fileid'),\n ABAI_TABLES.INSTRUCTOR_GROUP, parseInstructor, ABAI_INSTRUCTOR\n );\n processFile( // COURSE SEQUENCE ASSIGNMENT\n './ABAI_RAW/course_sequence_course_assignment.csv',//abaiBatchRecord['custrecord_courseseq_crsass_fileid'),\n ABAI_TABLES.COURSE_ASSIGNEMNT, parseAssignment, ABAI_ASSIGNMENT\n );\n file.writeFileSync('./RC_RAW/' + 'garbageCSA' + '.json', JSON.stringify(ABAI_ASSIGNMENT) );\n file.writeFileSync('./RC_RAW/' + 'garbageCSA2' + '.json', JSON.stringify(ABAI_XREF.CourseToCourseSequence) );\n processFile( // ALT COURSE ID\n './ABAI_RAW/alternative_courseID.csv', //abaiBatchRecord['custrecord_alt_courseid_fileid'),\n ABAI_TABLES.ALT_COURSE_ID, parseAltCourseId, ABAI_ALT_ID\n );\n file.writeFileSync('./RC_RAW/' + 'altCourse' + '.json', JSON.stringify(ABAI_ALT_ID) );\n processFile( // CONTENT HOURS\n './ABAI_RAW/content_hours.csv',//abaiBatchRecord['custrecord_cont_hours_fileid'),\n ABAI_TABLES.CONTENT_HOURS, parseContentHours, ABAI_CONTENT_HOURS\n );\n file.writeFileSync('./RC_RAW/' + 'CHGarbage' + '.json', JSON.stringify(ABAI_CONTENT_HOURS) );\n processFile( // ALLOCATION HOURS\n './ABAI_RAW/content_area_hours_allocation.csv', //abaiBatchRecord['custrecord_cont_hsallocat_fileid'),\n ABAI_TABLES.ALLOCATION, parseAllocation, ABAI_ALLOCATION_HOURS\n );\n file.writeFileSync('./RC_RAW/' + 'garbageAllocation' + '.json', JSON.stringify(ABAI_ALLOCATION_HOURS) );\n audit('MainScript', 'FILE LOAD COMPLETE');\n file.writeFileSync('./RC_RAW/' + 'xref_sequence' + '.json', JSON.stringify(ABAI_XREF.CourseToCourseSequence));\n\n\n audit('MainScript', '=======END=======');\n}", "function _startScript() {\r\n // Prevent the user from pressing the Start button again.\r\n _setButtonState(false);\r\n\r\n _buildWorkQueue();\r\n }", "function startScript(){\n // Update when script starts.\n updateProductInfo();\n updateLocalInfo();\n // Wait for the product analysis to be set.\n setTimeout(setRecyclability, 1000);\n}", "function initializeScript()\r\n{\r\n host.diagnostics.debugLog(\"***> initializeScript called \\n\");\r\n}", "function scriptMain() {\n pageSetup();\n\n}", "function main() {\n landingPageEffects();\n introSlideShow();\n}", "function runScript(){\n\tregisterTab();\t\n\tcurrentQueuePoll();\n\tregisterMsgListener();\n\tinsertAddToQueueOptionOnVideos();\n\tinsertQTubeMastHead();\n\tload(false);\n}", "function MainScript_RC() {\n LOG_TITLE = 'RC_ProcessData';\n debug('');\n debug('======SCH_RC_ProcessData START======');\n\n // With that done, check changes\n processAbaiToRcRecord( RC_TABLES.INSTITUTION, ABAI_INSTITUTION,\n RC_INSTITUTIONS, getRcInstitutionData, translateInstitution\n );\n // processAbaiToRcRecord( RC_TABLES.INSTITUTION_ADDRESS, ABAI_INSTITUTION_ADDRESS,\n // RC_INSTITUTION_ADDRESS, getRcInstitutionAddressData, translateInstitutionAddress\n // );\n processAbaiToRcRecord( RC_TABLES.COORDINATOR, ABAI_COORDINATOR, RC_COORDINATOR, getRcCoordinatorData, skip);\n processAbaiToRcRecord( RC_TABLES.DEPARTMENT, ABAI_COURSE_SEQUENCE,\n RC_DEPARTMENTS, getRcDepartmentData, translateDepartment\n );\n processAbaiToRcRecord( RC_TABLES.COURSE, ABAI_COURSE,\n RC_COURSE, getRcCourseData, translateCourse\n );\n // Do a better course analysis\n processAbaiToRcRecord(RC_TABLES.COURSE_adv, ABAI_ASSIGNMENT,\n RC_COURSE_BY_ASSGN, getBetterRcCourseData, skip\n );\n saveAdvancedFile();\n processAbaiToRcRecord( RC_TABLES.CONTENT_HOURS, ABAI_CONTENT_HOURS,\n RC_CONTENT_HOURS, getRcContentHoursData, translateContentHour\n );\n processAbaiToRcRecord( RC_TABLES.ALLOCATION_HOURS,ABAI_ALLOCATION_HOURS,\n RC_ALLOCATION_HOURS, getRcAllocationHoursData, translateAllocationHour\n );\n file.writeFileSync('./RC_RAW/' + 'mixtape' + '.csv', likeActualGarbageWhyDoIDoTheseThingsItDoesntMakeSense );\n\n // idkcheckitoutorsomething(executeSavedSearch( SavedSearch.INSTITUTION ));\n processFinalRecord();\n audit('fuckups', fuckups)\n debug('=======SCH_RC_ProcessData END========');\n}", "function Start () {\n\t\t\n\t\t\n\t\n\t}", "function runScript() {\n\tconsole.time(\"index\");\n var job = tabs.activeTab.attach({\n \tcontentScriptFile: [self.data.url(\"models_50_wif/benign/CompositeBenignCountsA.js\"),\n \t\t\t\t\t\tself.data.url(\"models_50_wif/benign/CompositeBenignCountsAB.js\"),\n\t\t\t\t\t\tself.data.url(\"models_50_wif/benign/CompositeBenignTotal.js\"),\n\t\t\t\t\t\tself.data.url(\"models_50_wif/malicious/CompositeMaliciousTotal.js\"),\n \t\t\t\t\t\tself.data.url(\"models_50_wif/malicious/CompositeMaliciousCountsA.js\"),\n \t\t\t\t\t\tself.data.url(\"models_50_wif/malicious/CompositeMaliciousCountsAB.js\"),\n self.data.url(\"CompositeWordTransform.js\"),\n \t\t\t\t\t\tself.data.url(\"DetectComposite.js\")]\n \n \n });\n \n job.port.on(\"script-response\", function(response) {\n\t\n\tconsole.log(response);\n });\n}", "function mainFn () {\n logFn( prefixStr + 'Start' );\n xhiObj.npmObj.load( xhiObj.fqPkgFilename, onLoadFn );\n }", "function startScript() {\n if (!assertScriptIsRunnable()) {\n return;\n }\n\n captureStartState();\n\n // Start the work!\n doWork();\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 main() {\r\n\r\n\tFM_log(3,\"main() called\");\r\n\r\n\tsuffixGlobal = server + '_' + getPlayerId();\r\n\r\n\tsuffixLocal = suffixGlobal + '_' + getActiveVillageId();\r\n\r\n\t\r\n\r\n\tFM_log(3,\"suffixGlobal is: \"+suffixGlobal);\r\n\r\n\tFM_log(3,\"suffixLocal is: \"+suffixLocal);\r\n\r\n\t\r\n\r\n\t//define Travian 3.5 Version\r\n\r\n\tgetT35version();\r\n\r\n\t\r\n\r\n\tFM_log(5,document.URL);\r\n\r\n\tvar html = document.body.innerHTML; // In case 'Unable to load site' is showed, try to Refresh the page.\r\n\r\n\tif (html.indexOf(\" <!-- ERROR ITEM CONTAINER\") != -1) {\r\n\r\n\t\twindow.location.replace(rootPath + \"a2b.php\"); \r\n\r\n\t}\r\n\r\n\t\t\r\n\r\n\tif (GM_getValue(\"Active_\" + suffixGlobal, -1) > -1 && GM_getValue(\"ReadRep_\" + suffixGlobal, -1)==1 )\r\n\r\n\t{\r\n\r\n\t\tnewreport = document.getElementsByTagName('html')[0].innerHTML.indexOf('id=\\\"n5\\\" class=\\\"i1\\\"')+document.getElementsByTagName('html')[0].innerHTML.indexOf('id=\\\"n5\\\" class=\\\"i3\\\"');\r\n\r\n\t\tif ( newreport != -2) \r\n\r\n\t\t{\r\n\r\n\t\t\tif(document.URL.indexOf(\"berichte.php\") == -1) {\r\n\r\n\t\t\t\twindow.open(\"/berichte.php\", \"_self\");\r\n\r\n\t\t\t}\r\n\r\n\t\t\tcheckreports();\r\n\r\n\t\t\treturn;\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t\r\n\r\n\t// start countdown and forward to rallypoint if FM is active\r\n\t\r\n\t// this is not working because FM script not runs on all the Travian pages\r\n\t// could be working if @includes get changed, but this probably leads to a slow browser\r\n\t\r\n\r\n\t/*\r\n\r\n\tif (GM_getValue(\"Active_\" + suffixGlobal, -1) > -1)\r\n\r\n\t{\r\n\r\n\t\t//alert(\"waiting\");\r\n\r\n\t\tsetTimeout(function(){window.open(\"/a2b.php\",\"_self\");}, 60000); //wait 1 minute then go back to rally point\r\n\r\n\t}\r\n\r\n\t*/\r\n\r\n\t\t\r\n\r\n\t// get variable for random farming\r\n\r\n\trandom = GM_getValue(\"RandomFarming_\" + suffixGlobal, 0);\r\n\r\n\t\r\n\r\n\tFM_log(3,\"Setting language, images & style\");\r\n\r\n\tsetLanguage();\r\n\r\n\tloadImage();\r\n\r\n\tloadStyle();\r\n\r\n\tvar url = document.URL;\r\n\r\n\turl = url.substring(url.lastIndexOf(\"/\") + 1);\r\n\r\n\tuser_race = GM_getValue('Tribe_' + suffixGlobal, -1);\r\n\r\n\tif (user_race != -1) {\r\n\r\n\t\tuser_race = GM_getValue('Tribe_' + suffixGlobal, 0);\r\n\r\n\t\tuser_race = parseInt(user_race);\r\n\r\n\t} else {\r\n\r\n\t\tif (url.indexOf(\"a2b.php\") != -1) {\r\n\r\n\t\t\tuser_race = 1 + 10 * getPlayerTribe();\r\n\r\n\t\t\tGM_setValue('Tribe_' + suffixGlobal, user_race);\r\n\r\n\t\t\talert(T('SCRIPT_NAME') + \" Installation complete\\n\"\r\n\r\n\t\t\t\t\t+ T('INSTALL_M1') + \"\\n\" + T('INSTALL_M2') + \" \\n-ScratchZ\");\r\n\r\n\t\t\twindow.location.replace(rootPath + \"build.php?id=39\");//ToDo: reload\r\n\r\n\t\t} else {\r\n\r\n\t\t\twindow.location.replace(rootPath + \"a2b.php\");//ToDo: reload\r\n\r\n\t\t}\r\n\r\n\r\n\r\n\t}\r\n\r\n\t\r\n\r\n\t// Set default values if not defined yet\r\n\r\n\tif (GM_getValue(\"Maximize_\" + suffixGlobal, false) === false) {\r\n\r\n\t\tGM_setValue(\"Maximize_\" + suffixGlobal, 1);\r\n\r\n\t}\r\n\r\n\tif (GM_getValue(\"MaximizeSettings_\" + suffixGlobal, false) === false) {\r\n\r\n\t\tGM_setValue(\"MaximizeSettings_\" + suffixGlobal, 0);\r\n\r\n\t}\r\n\r\n\tif (GM_getValue(\"StartIndex_\" + suffixLocal, false) === false) {\r\n\r\n\t\tGM_setValue(\"StartIndex_\" + suffixLocal, 0);\r\n\r\n\t}\r\n\r\n\tif (GM_getValue(\"EndIndex_\" + suffixLocal, false) === false) {\r\n\r\n\t\tGM_setValue(\"EndIndex_\" + suffixLocal, -1);\r\n\r\n\t}\r\n\r\n\tif (GM_getValue(\"Skipcounter_\" + suffixGlobal, false) === false) {\r\n\r\n\t\tGM_setValue(\"Skipcounter_\" + suffixGlobal, 0);\r\n\r\n\t}\r\n\r\n\t\r\n\r\n\t//Settings\r\n\tif (GM_getValue(\"RandomFarming_\" + suffixGlobal, false) == false) {\r\n\t\tGM_setValue(\"RandomFarming_\" + suffixGlobal, 0);\r\n\t}\r\n\r\n\tif (GM_getValue(\"farmMarking_\" + suffixGlobal, false) === false) {\r\n\r\n\t\tGM_setValue(\"farmMarking_\" + suffixGlobal, 0);\r\n\r\n\t}\r\n\r\n\tif (GM_getValue(\"VillageSkipping_\" + suffixGlobal, false) === false) {\r\n\r\n\t\tGM_setValue(\"VillageSkipping_\" + suffixGlobal, 0);\r\n\r\n\t}\r\n\r\n\tif (GM_getValue(\"DelTList_\" + suffixLocal, false) === false) {\r\n\r\n\t\tGM_setValue(\"DelTList_\" + suffixLocal, 1);\r\n\r\n\t}\r\n\r\n\tif (GM_getValue(\"ReadRep_\" + suffixLocal, false) === false) {\r\n\r\n\t\tGM_setValue(\"ReadRep_\" + suffixLocal, 0);\r\n\r\n\t}\t\r\n\r\n\t\r\n\r\n\t// Setting Travian Version\r\n\r\n\tif (GM_getValue(\"TravianVersion_\" + suffixGlobal, false) === false) {\r\n\r\n\t\tGM_setValue(\"TravianVersion_\" + suffixGlobal, 0);\r\n\r\n\t}\r\n\r\n\t\r\n\r\n\t//insert village selector\r\n\r\n\trp_villageSelector();\r\n\r\n\t//alert (url);\r\n\r\n\tif (url.indexOf(\"build.php?\") > -1 && (url.indexOf(\"gid=16\") > -1 || url.indexOf(\"id=39\") > -1)) {\r\n\r\n\t\tif (isReallyRallyPoint()) {\r\n\r\n\t\t\trp_mainPage();\r\n\r\n\t\t}\r\n\r\n\t\tactiveMain();\r\n\r\n\t} else if (url.indexOf(\"a2b.php\") > -1) {\r\n\r\n\t\tactiveMain();\r\n\r\n\t} else if (url.indexOf(\"karte.php?\") > -1 && url.indexOf(\"d=\") > -1\r\n\r\n\t\t\t&& url.indexOf(\"c=\") > -1) { //if user profile page\r\n\r\n\t\tfoundNewFarm();\r\n\r\n\t} else if (url.indexOf(\"berichte.php\") > -1) {\r\n\r\n\t\t// if no messages there, return to rally point\r\n\r\n\t\tnewreport = document.getElementsByTagName('html')[0].innerHTML.indexOf('id=\\\"n5\\\" class=\\\"i1\\\"')+document.getElementsByTagName('html')[0].innerHTML.indexOf('id=\\\"n5\\\" class=\\\"i3\\\"');\r\n\r\n\t\tif ( newreport == -2 && GM_getValue(\"Active_\" + suffixGlobal, -1) > -1) \r\n\r\n\t\t{\r\n\r\n\t\t\twindow.open(\"/build.php?id=39\", \"_self\");\r\n\r\n\t\t\treturn;\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t\r\n\r\n\t// farm marking in the map\r\n\r\n\tif (url.indexOf('karte.php')>-1 && url.indexOf('karte.php?d=')==-1 && GM_getValue(\"farmMarking_\" + suffixGlobal, 0)==1)\r\n\r\n\t{\r\n\r\n\t\t\t\t//get center village\r\n\r\n\t\t\t\tvar mapX = dom.get('x').textContent;\r\n\r\n\t\t\t\tvar mapY = dom.get('y').textContent;\r\n\r\n\t\t\t\t\r\n\r\n\t\t\t\tFM_log(4,\"CenterCoords=\"+mapX+\",\"+mapY);\r\n\r\n\t\t\t\t\r\n\r\n\t\t\t\tGM_setValue(\"MapCenter_\"+suffixGlobal,mapX+\",\"+mapY);\r\n\r\n\t\t\t\t\r\n\r\n\t\t\t\t// look for arrow buttons\r\n\r\n\t\t\t\tvar ex = \"//area[contains(@id,'ma_n')]\";\r\n\r\n\t\t\t\ttag = document.evaluate(ex,document,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);\r\n\r\n\t\t\t\t\r\n\r\n\t\t\t\tFM_log(4,\"adding eventListener\");\r\n\r\n\t\t\t\t\r\n\r\n\t\t\t\tfor(var i=1; i<=tag.snapshotLength;i++)\r\n\r\n\t\t\t\t{\r\n\r\n\t\t\t\t\tvar arrowButton = tag.snapshotItem(i-1);\r\n\r\n\t\t\t\t\t// call function to check again after listener was activated\r\n\r\n\t\t\t\t\tFM_log(4,\"arrowId=\"+arrowButton.id);\r\n\r\n\t\t\t\t\t\r\n\r\n\t\t\t\t\tarrowButton.addEventListener(\"click\", function (e){\r\n\r\n\t\t\t\t\t\tvar evt = e || event;\r\n\r\n\t\t\t\t\t\tvar ele = evt.target || evt.srcElement;\r\n\r\n\t\t\t\t\t\tsetTimeout(function(){getXYtoFarms(ele.id);},500);\r\n\r\n\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t}, true); // so that it will check again when scrolling.\r\n\r\n\t\t\t\t\t\t\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\tgetXYtoFarms(\"\")\r\n\r\n\t}\r\n\r\n}", "function Start () {\r\n\t//Debug.Log(\"Hello World => \" + x);\r\n\tDebug.Log(\"Script Start!!\");\r\n}", "function Main()\n {\n \n }", "function proceed() {\n if (scriptsAsync.length) {\n // Load asynchronous scripts\n head.js.apply(null, scriptsAsync);\n }\n\n start();\n }", "function initScript(){\n getMunTorreviejaData();\n insertImagesInCalendar();\n }", "function mainLoop() {\n if (ATrunning == false) return;\n if(getPageSetting('PauseScript') || game.options.menu.pauseGame.enabled || game.global.viewingUpgrades) return;\n ATrunning = true;\n if(game.options.menu.showFullBreed.enabled != 1) toggleSetting(\"showFullBreed\"); //more detail\n addbreedTimerInsideText.innerHTML = parseFloat(game.global.lastBreedTime/1000).toFixed(1) + 's'; //add hidden next group breed timer;\n addToolTipToArmyCount(); //Add hidden tooltip for army count (SettingsGUI.js @ end)\n //Heirloom:\n if (mainCleanup() // Z1 new world\n || portalWindowOpen // in the portal screen (for manual portallers)\n || (!heirloomsShown && heirloomFlag) // closed heirlooms screen\n || (heirloomCache != game.global.heirloomsExtra.length)) { // inventory size changed (a drop appeared)\n // also pre-portal: portal.js:111\n if (getPageSetting('AutoHeirlooms2')) autoHeirlooms2(); //\"Auto Heirlooms 2\" (heirlooms.js)\n else if (getPageSetting('AutoHeirlooms')) autoHeirlooms();//\"Auto Heirlooms\" (\")\n if (getPageSetting('AutoUpgradeHeirlooms') && !heirloomsShown) autoNull(); //\"Auto Upgrade Heirlooms\" (heirlooms.js)\n\n heirloomCache = game.global.heirloomsExtra.length;\n }\n heirloomFlag = heirloomsShown;\n //Stuff to do Every new Zone\n if (aWholeNewWorld) {\n // Auto-close dialogues.\n switch (document.getElementById('tipTitle').innerHTML) {\n case 'The Improbability': // Breaking the Planet\n case 'Corruption': // Corruption / True Corruption\n case 'Spire': // Spire\n case 'The Magma': // Magma\n cancelTooltip();\n }\n if (getPageSetting('AutoEggs'))\n easterEggClicked();\n setTitle(); // Set the browser title \n }\n setScienceNeeded(); //determine how much science is needed\n\n //EXECUTE CORE LOGIC\n if (getPageSetting('ExitSpireCell') >0) exitSpireCell(); //\"Exit Spire After Cell\" (other.js)\n if (getPageSetting('WorkerRatios')) workerRatios(); //\"Auto Worker Ratios\" (jobs.js)\n if (getPageSetting('BuyUpgrades')) buyUpgrades(); //\"Buy Upgrades\" (upgrades.js)\n autoGoldenUpgradesAT(); //\"Golden Upgrades\" (other.js)\n if (getPageSetting('BuyStorage')) buyStorage(); //\"Buy Storage\" (buildings.js)\n if (getPageSetting('BuyBuildings')) buyBuildings(); //\"Buy Buildings\" (buildings.js)\n if (getPageSetting('BuyJobs')) buyJobs(); //\"Buy Jobs\" (jobs.js)\n if (getPageSetting('ManualGather2')<=2) manualLabor(); //\"Auto Gather/Build\" (gather.js)\n else if (getPageSetting('ManualGather2')==3) manualLabor2(); //\"Auto Gather/Build #2\" (\")\n if (getPageSetting('AutoMaps')) autoMap(); //\"Auto Maps\" (automaps.js)\n else updateAutoMapsStatus();\n if (getPageSetting('GeneticistTimer') >= 0) autoBreedTimer(); //\"Geneticist Timer\" / \"Auto Breed Timer\" (autobreedtimer.js)\n if (autoTrimpSettings.AutoPortal.selected != \"Off\") autoPortal(); //\"Auto Portal\" (hidden until level 40) (portal.js)\n if (getPageSetting('TrapTrimps') && game.global.trapBuildAllowed && game.global.trapBuildToggled == false) toggleAutoTrap(); //\"Trap Trimps\"\n if (aWholeNewWorld && getPageSetting('AutoRoboTrimp')) autoRoboTrimp(); //\"AutoRoboTrimp\" (other.js)\n if (aWholeNewWorld && getPageSetting('FinishC2')>0 && game.global.runningChallengeSquared) finishChallengeSquared(); // \"Finish Challenge2\" (other.js)\n autoLevelEquipment(); //\"Buy Armor\", \"Buy Armor Upgrades\", \"Buy Weapons\", \"Buy Weapons Upgrades\" (equipment.js)\n if (getPageSetting('UseScryerStance')) useScryerStance(); //\"Use Scryer Stance\" (scryer.js)\n else if (getPageSetting('AutoStance')<=1) autoStance(); //\"Auto Stance\" (autostance.js)\n else if (getPageSetting('AutoStance')==2) autoStance2(); //\"Auto Stance #2\" (\")\n if (getPageSetting('UseAutoGen')) autoGenerator(); // \"Auto Generator ON\" (magmite.js)\n ATselectAutoFight(); // pick the right version of Fight/AutoFight/BetterAutoFight/BAF2 (fight.js)\n if (getPageSetting('DynamicPrestige2')>0&&((getPageSetting('ForcePresZ')<0)||(game.global.world<getPageSetting('ForcePresZ')))) prestigeChanging2(); //\"Dynamic Prestige\" (dynprestige.js)\n else autoTrimpSettings.Prestige.selected = document.getElementById('Prestige').value; //just make sure the UI setting and the internal setting are aligned.\n try {\n if (getPageSetting('AutoMagmiteSpender2')==2 && !magmiteSpenderChanged)\n autoMagmiteSpender(); //Auto Magmite Spender (magmite.js)\n } catch (err) {\n debug(\"Error encountered in AutoMagmiteSpender(Always): \" + err.message,\"general\");\n }\n if (getPageSetting('AutoNatureTokens')) autoNatureTokens(); //Nature - (other.js)\n //\n //Runs any user provided scripts - by copying and pasting a function named userscripts() into the Chrome Dev console. (F12)\n if (userscriptOn) userscripts();\n //rinse, repeat\n return;\n}", "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\t\tstage = new createjs.Stage(canvasID);\n\t\tstage.enableMouseOver(10);\n\t\tstage.mouseMoveOutside = true;\n captionManager = new CaptionManager(stage);\n\n createjs.Ticker.setFPS(60);\n\t\tcreatejs.Ticker.addEventListener('tick', stage);\n\n\t\tsetGameMode(GAME_MODES.PREPARING);\n\t}", "function Start () {\r\n\t\t\r\n\t}", "function start() {\n\n}", "function Start() {\n // local variable\n let title = document.title;\n\n ///Displaying to console to confirm that the javascript file works.\n console.log(\n \"%c javascript works, Nice\",\n \"font-weight:bold; font-size: 20px;\"\n );\n console.log(\n \"%c ----------------------------\",\n \"font-weight:bold; font-size: 20px;\"\n );\n console.log(\"Title: \" + title);\n console.log();\n\n ///try catch any possible error!\n //Try various functions and if any of them doesn't exists, \n //it skips to catch block and then displays the content from the catch block.\n try {\n switch (title) {\n case \"COMP125 - Home\":\n content.HomeContent();\n\n break;\n\n case \"COMP125 - About\":\n content.AboutContent();\n break;\n\n case \"COMP125 - Contact\":\n content.ContactContent();\n break;\n\n default:\n throw \"Title not Defined\";\n break;\n }\n } catch (err) {\n console.log(err);\n console.warn(\"Oops\");\n }\n\n //injecting files by calling function\n insertHTML(\"../Scripts/View/content/header.html\", \"header\");\n insertHTML(\"../Scripts/View/content/footer.html\", \"footer\");\n }", "function start(){\n\t\n}", "function processScript()\n\t{\n\t\tif (!runningScript)\n\t\t\treturn;\n\t\t\n\t\t// Step through the script\n\t\twhile ((scriptIndex < runningScript.length) && !isBlocked)\n\t\t\tdoOpcode();\n\t}", "function BeforeStart(){return}", "function BeforeStart(){return}", "function BeforeStart(){return}", "function BeforeStart(){return}", "function BeforeStart(){return}", "function BeforeStart(){return}", "function BeforeStart(){return}", "function BeforeStart(){return}", "function start() {\n\n gw_job_process.UI();\n gw_job_process.procedure();\n //----------\n gw_com_module.startPage();\n //----------\n\n }", "function start(){ alert(\"AstroJS Is Ready! Release 3.022 by Salvatore Ruiu ( www.suchelu.it )\"); }", "function startScript() {\n\tvaccinated = parseInt(document.getElementById(\"txtVaccinated\").value);\n\tif (vaccinated >= 0 && vaccinated < 200) {\n\t\tcityArea.start();\n\t\tpopGraph.start();\n\t\tinitializePopulation();\n\t}\n}", "function main(){\n//CODE//\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 Script() {}", "function Start () {}", "function start()\n{\n clear();\n console.log(\"==============================================\\n\");\n console.log(\" *** Welcome to the Interstellar Pawn Shop *** \\n\");\n console.log(\"==============================================\\n\");\n console.log(\"We carry the following items:\\n\");\n readCatalog();\n}", "function main() {\r\n initFlags();\r\n fixMarkup();\r\n changeLayout();\r\n initConfiguration();\r\n}", "function Start() {\n\n}//fin function Start()", "function theScript() {\r\n///////////////////////////////////////////////////\r\n// BEGIN THE SCRIPT\r\n//=================================================\r\n\r\n\r\n\r\n////////////////////////////////////////////////////////////////////////////////\r\n// INITIAL REQUIREMENTS\r\n////////////////////////////////////////////////////////////////////////////////\r\n\r\n// Require open document\r\ntry {\r\n\tif (app.documents.length > 0 ) {\r\n \r\n // OK to proceed to arguments setup and run main function\r\n \r\n var args = {}; \r\n args.SCRIPT_NAME = \"MEASUREMENT\";\r\n args.DOC_REF = app.activeDocument;\r\n args.SELECTION = args.DOC_REF.selection;\r\n args.ACTIVE_LAYER = args.DOC_REF.activeLayer;\r\n args.ACTIVE_LAYER_NAME = args.ACTIVE_LAYER.name; \r\n \r\n // Call the main function\r\n main(args);\r\n\r\n\t}\r\n\telse {\r\n throw new Error('There are no documents open!');\r\n\t}\r\n}\r\ncatch(e) {\r\n\talert( e.message, \"Script Alert\", true);\r\n}\r\n\r\n////////////////////////////////////////////////////////////////////////////////\r\n// SCRIPT MAIN PROCESS\r\n////////////////////////////////////////////////////////////////////////////////\r\n// Main Process\r\n// The beginning of the script starts here\r\n// Add main logic routine to this function\r\n\r\nfunction main(args){\r\n\r\n var selectedItem = args.DOC_REF.selection[0];\r\n var selectionName;\r\n \r\n if (selectedItem.name) {\r\n // Use name\r\n selectionName = selectedItem.name;\r\n }\r\n else {\r\n // Use type because name property is empty\r\n selectionName = selectedItem.typename; \r\n }\r\n \r\n\r\n\r\n var myDialog = sfDialogFactory(mainDialog(selectionName));\r\n \r\n myDialog.show();\r\n}\r\n\r\n////////////////////////////////////////////////////////////////////////////////\r\n// SCRIPT SUPPORTING FUNCTIONS\r\n////////////////////////////////////////////////////////////////////////////////\r\n// Supporting Functions\r\n// Include functions that offer partial functionality\r\n// These functions are called and acted upon within the mainProcess function\r\n\r\nfunction objReflection(obj, display) {\r\n // Function for easy object reflection\r\n // USAGE EXAMPLE:\r\n // var objectInfo = objReflection(someObject, \"none\");\r\n // or \r\n // objReflection(someObject, \"alert\");\r\n\r\n var KVOs = [];\r\n for(var member in obj){ \r\n KVOs.push(\"\\n\" + member + \":\" + obj[member]);\r\n };\r\n\r\n switch(display)\r\n {\r\n case \"alert\":\r\n alert(\"Object Reflection: \" + KVOs); \r\n break;\r\n case \"none\":\r\n break; \r\n default:\r\n return undefined; \r\n }\r\n return KVOs;\r\n}\r\n\r\nfunction sfDialogFactory(dialog) {\r\n \r\n // A factory method for creating dialog screens\r\n \r\n // Dialog Window\r\n var d = new Window(\"dialog\", dialog.title);\r\n\r\n // alert(\"Number of Inputs\" + dialog.inputs.length);\r\n // alert(\"Number of Options\" + dialog.options.length);\r\n\r\n var i; // counter \r\n var len; // length of array elements\r\n\r\n // Generate Groups\r\n if (dialog.groups.length > 0) {\r\n \r\n len = dialog.groups.length;\r\n for (i = 0; i < len; i++ ) \r\n {\r\n var currentGroup = dialog.groups[i];\r\n var inputGroup = d.add (\"panel\", undefined, currentGroup.title);\r\n inputGroup.alignChildren = [\"fill\",\"fill\"]; \r\n\r\n if (currentGroup.elements.length > 0) {\r\n // Add Elements \r\n var ii;\r\n var elemLen = currentGroup.elements.length;\r\n for (ii = 0; ii < elemLen; ii++ ) \r\n {\r\n var currentElement = currentGroup.elements[ii];\r\n\r\n var el = inputGroup.add(currentElement.type, undefined, currentElement.value);\r\n\r\n // Additional properties added for future reflection\r\n el.elName = currentElement.name;\r\n el.elIndex = ii; \r\n\r\n switch(currentElement.type)\r\n {\r\n case \"statictext\":\r\n el.visible = currentElement.visible;\r\n break;\r\n case \"edittext\":\r\n el.visible = currentElement.visible; \r\n break; \r\n case \"dropdownlist\":\r\n el.visible = currentElement.visible;\r\n el.selection = currentElement.selection;\r\n el.onChange = currentElement.onChange;\r\n break; \r\n default:\r\n throw new Error('Unknown Dialog Element Type'); \r\n }\r\n\r\n } \r\n }\r\n }\r\n }\r\n\r\n function getControlValues(set) {\r\n var elementsData = {};\r\n elementsData.controls = []; \r\n // TO DO Add more types\r\n\r\n var giLen = set.children.length;\r\n for (var gi = 0; gi < giLen; gi++ ) \r\n {\r\n var child = set.children[gi];\r\n // alert(objReflection(child, \"none\", false));\r\n // alert(child.type); \r\n var control = {};\r\n control.name = child.elName;\r\n control.index = child.elIndex; \r\n control.type = child.type;\r\n control.visible = child.visible;\r\n switch(child.type)\r\n {\r\n case \"statictext\":\r\n control.value = child.text; \r\n break;\r\n case \"edittext\":\r\n control.value = child.text; \r\n break; \r\n case \"dropdownlist\": \r\n control.value = child.selection.text; \r\n break; \r\n default:\r\n throw new Error('Unknown Dialog Element Type'); \r\n }\r\n elementsData.controls.push(control);\r\n // alert(objReflection(control, \"none\", false));\r\n } \r\n return elementsData;\r\n }\r\n\r\n\r\n // Buttons Group\r\n var buttonGroup = d.add(\"group\");\r\n var bOK = buttonGroup.add(\"button\", undefined, \"Continue\"); \r\n var bCANCEL = buttonGroup.add(\"button\", undefined, \"Cancel\");\r\n\r\n // Button Click Handlers\r\n bOK.onClick = function(){\r\n d.close();\r\n dialog.callback(\"continue\", getControlValues(inputGroup));\r\n return true;\r\n }; \r\n bCANCEL.onClick = function (){\r\n d.close();\r\n dialog.callback(\"cancel\");\r\n return false; \r\n };\r\n\r\n return d;\r\n}\r\n\r\nfunction mainDialog(selectionName) {\r\n\r\n// Main Dialog\r\n\r\n var dialogObj = {};\r\n\r\n dialogObj.groups = []; // An array of dialog groups\r\n dialogObj.title = \"Measurement\";\r\n\r\n var group1 = {};\r\n group1.title = \"Take Measurement\";\r\n \r\n // Add Elements using JSON shorthand syntax\r\n group1.elements = [\r\n {\r\n \"name\":\"MeasureSelectedItem\",\r\n \"type\":\"statictext\",\r\n \"value\":\"Measure Selected Item?\",\r\n \"visible\":true \r\n },\r\n {\r\n \"name\":\"Selected\", \r\n \"type\":\"statictext\",\r\n \"value\":\"Selected: \" + selectionName,\r\n \"visible\":true\r\n },\r\n {\r\n \"name\":\"UnitOfMeasurement\", \r\n \"type\":\"statictext\",\r\n \"value\":\"Unit of Measurement\",\r\n \"visible\":true\r\n },\r\n {\r\n \"name\":\"UnitType\", \r\n \"type\":\"dropdownlist\",\r\n \"value\":[\"inches\",\"points\",\"millimeters\",\"centimeters\",\"picas\",\"pixels\"], \r\n \"visible\":true, \r\n \"selection\":0, \r\n // \"onChange\":function(){ alert(\"My Drop Downdown change\"); return true;}\r\n },\r\n {\r\n \"name\":\"ScreenDPI\", \r\n \"type\":\"statictext\",\r\n \"value\":\"Screen DPI (if measuring in pixels)\",\r\n \"visible\":true\r\n },\r\n {\r\n \"name\":\"ScreenDPIValue\",\r\n \"type\":\"edittext\",\r\n \"value\":150,\r\n \"visible\":true \r\n },\r\n {\r\n \"name\":\"ColorOfMeasurement\", \r\n \"type\":\"statictext\",\r\n \"value\":\"Color Of Measurement Lines\",\r\n \"visible\":true\r\n },\r\n {\r\n \"name\":\"ColorType\", \r\n \"type\":\"dropdownlist\",\r\n \"value\":[\"MAGENTA\",\"CYAN\",\"RED\",\"WHITE\",\"BLACK\"], \r\n \"visible\":true, \r\n \"selection\":0, \r\n // \"onChange\":function(){ alert(\"My Drop Downdown change\"); return true;}\r\n },\r\n {\r\n \"name\":\"ColorModeOfMeasurement\", \r\n \"type\":\"statictext\",\r\n \"value\":\"Color Mode\",\r\n \"visible\":true\r\n },\r\n {\r\n \"name\":\"ColorMode\", \r\n \"type\":\"dropdownlist\",\r\n \"value\":[\"CMYK\",\"RGB\"], \r\n \"visible\":true, \r\n \"selection\":0, \r\n // \"onChange\":function(){ alert(\"My Drop Downdown change\"); return true;}\r\n },\r\n {\r\n \"name\":\"MarkerOffset\", \r\n \"type\":\"statictext\",\r\n \"value\":\"Amount to offset measurement marks\",\r\n \"visible\":true\r\n },\r\n {\r\n \"name\":\"MarkerOffsetValue\", \r\n \"type\":\"dropdownlist\",\r\n \"value\":[0,5,10,20], \r\n \"visible\":true, \r\n \"selection\":1, \r\n // \"onChange\":function(){ alert(\"My Drop Downdown change\"); return true;}\r\n }\r\n\r\n ];\r\n\r\n\r\n // Add to group list\r\n dialogObj.groups.push(group1); \r\n \r\n dialogObj.callback = function(type, formData) {\r\n if (type === \"continue\"){\r\n var unit;\r\n var screenDPI;\r\n var color;\r\n var colorMode;\r\n var markerOffset;\r\n\r\n // Do something with formData values here \r\n var cLen = formData.controls.length;\r\n var formValues = '';\r\n for (var c = 0; c < cLen; c++ ) \r\n {\r\n if (formData.controls[c].name === \"UnitType\") {\r\n unit = formData.controls[c].value;\r\n }\r\n if (formData.controls[c].name === \"ScreenDPIValue\") {\r\n screenDPI = formData.controls[c].value;\r\n } \r\n if (formData.controls[c].name === \"ColorType\") {\r\n color = formData.controls[c].value;\r\n }\r\n if (formData.controls[c].name === \"ColorMode\") {\r\n colorMode = formData.controls[c].value;\r\n } \r\n if (formData.controls[c].name === \"MarkerOffsetValue\") {\r\n markerOffset = formData.controls[c].value;\r\n } \r\n } \r\n takeMeasurement(args.DOC_REF, unit, screenDPI, color, colorMode, markerOffset);\r\n }\r\n else {\r\n // Cancel\r\n return false;\r\n } \r\n }\r\n \r\n return dialogObj;\r\n}\r\n\r\n\r\nfunction findLayerContext(obj) {\r\n\r\n // alert(\"findLayerContext: \\n\" + obj.name + \"\\n\" + obj.typename); \r\n var theContext = undefined; \r\n\r\n if (obj.layers) {\r\n // alert(\"USING OBJECT FOR LAYER CONTEXT...\"); \r\n theContext = obj;\r\n }\r\n else {\r\n // alert(\"SEARCHING PARENTS FOR LAYER...\"); \r\n theContext = findLayerContext(obj.parent);\r\n }\r\n return theContext;\r\n} \r\n\r\nfunction takeMeasurement(doc_ref, unit, screenDPI, colorName, colorMode, markerOffset) {\r\n\r\n // alert(\"takeMeasurement: \\n\" + \"[markerOffset] \" + markerOffset); \r\n\r\n var selectedItem = doc_ref.selection[0];\r\n \r\n if (selectedItem) {\r\n var referenceContext = findLayerContext(selectedItem); \r\n }\r\n else { \r\n alert(\"You must select an item before taking a measurement.\"); \r\n return false; \r\n }\r\n\r\n var myBounds = selectedItem.geometricBounds;\r\n\r\n // Set up X and Y co-ordinates\r\n var x1 = myBounds[0];\r\n var x2 = myBounds[2];\r\n var y1 = myBounds[1];\r\n var y2 = myBounds[3];\r\n\r\n // Set up data for the Measurements\r\n var ptWidth = myBounds[2] - myBounds[0];\r\n var ptHeight = myBounds[1] - myBounds[3];\r\n\r\n // The default unit is points\r\n // Default values\r\n var tmpWidth = ptWidth;\r\n var tmpHeight = ptHeight;\r\n var unitSuffix = \"pts\";\r\n var unitSuffixSingular = \"pt\";\r\n\r\n // Convert the unit of measure depending on the setting.\r\n // Adobe Illustrator Measures everything in Points. Use the following conversion formulas\r\n //\r\n // Unit Conversion formula\r\n // centimeters 28.346 points = 1 centimeter\r\n // inches\t 72 points = 1 inch\r\n // millimeters 2.834645 points = 1 millimeter\r\n // picas\t 12 points = 1 pica\r\n // Qs\t 1 Q (1 Q equals 0.23 millimeter)\r\n // pixels conversion \r\n // points = (pixels / 150) * 72 assuming 150dpi system\r\n\r\n switch(unit)\r\n {\r\n case \"points\":\r\n tmpWidth = ptWidth;\r\n tmpHeight = ptHeight; \r\n unitSuffix = \"pts\";\r\n unitSuffixSingular = \"pt\";\r\n break;\r\n case \"millimeters\":\r\n tmpWidth = Math.round(ptWidth / 0.02834645);\r\n tmpHeight = Math.round(ptHeight / 0.02834645);\r\n unitSuffix = \"mm\";\r\n unitSuffixSingular = \"mm\"; \r\n break;\r\n case \"centimeters\":\r\n tmpWidth = Math.round(ptWidth / 0.2834645);\r\n tmpHeight = Math.round(ptHeight / 0.2834645);\r\n unitSuffix = \"cm\";\r\n unitSuffixSingular = \"cm\"; \r\n break;\r\n case \"picas\":\r\n tmpWidth = Math.round(ptWidth / 0.12);\r\n tmpHeight = Math.round(ptHeight / 0.12);\r\n unitSuffix = \"picas\";\r\n unitSuffixSingular = \"pica\"; \r\n break;\r\n case \"inches\":\r\n tmpWidth = Math.round(ptWidth / 0.72);\r\n tmpHeight = Math.round(ptHeight / 0.72);\r\n unitSuffix = \"inches\";\r\n unitSuffixSingular = \"inch\"; \r\n break;\r\n\r\n case \"pixels\":\r\n tmpWidth = Math.round(ptWidth / 0.72);\r\n tmpHeight = Math.round(ptHeight / 0.72);\r\n var dpi = parseInt(screenDPI); \r\n tmpWidth = tmpWidth * dpi; \r\n tmpHeight = tmpHeight * dpi; \r\n unitSuffix = \"pixels (\" + dpi + \" dpi)\";\r\n unitSuffixSingular = \"pixel (\" + dpi + \" dpi)\"; \r\n break;\r\n\r\n default:\r\n tmpWidth = ptWidth;\r\n tmpHeight = ptHeight;\r\n unitSuffix = \"pts\";\r\n unitSuffixSingular = \"pt\"; \r\n }\r\n\r\n var finalWidth = tmpWidth / 100;\r\n var finalHeight = tmpHeight / 100;\r\n\r\n // Find Centre of Object\r\n var xCentre = x1 + (ptWidth / 2);\r\n var yCentre = y1 - (ptHeight / 2);\r\n\r\n var colorObj = getColorByName(colorMode, colorName); \r\n \r\n // Make the dimension lines \r\n makeDimensions(doc_ref, myBounds, referenceContext, colorObj, markerOffset);\r\n\r\n function makeDimensions(doc_ref, objBounds, context, measurementColor, lineOffset) {\r\n\r\n // alert(\"makeDimensions: \\n\" + \"[lineOffset] \" + lineOffset); \r\n var x1 = objBounds[0];\r\n var x2 = objBounds[2];\r\n var y1 = objBounds[1];\r\n var y2 = objBounds[3];\r\n\r\n\r\n // Create Measurements Layer\r\n var measurementLayerName = \"MEASUREMENT OF \";\r\n \r\n if (selectedItem.name) {\r\n // Use name\r\n measurementLayerName = measurementLayerName + selectedItem.name;\r\n }\r\n else {\r\n // Use type because name property is empty\r\n measurementLayerName = measurementLayerName + selectedItem.typename; \r\n }\r\n \r\n var theMeasurementLayer = measurementLayerCreate(context, measurementLayerName);\r\n\r\n // Create groups for Measurements\r\n var yMeasure = theMeasurementLayer.groupItems.add();\r\n yMeasure.name = \"Height\";\r\n\r\n var xMeasure = theMeasurementLayer.groupItems.add();\r\n xMeasure.name = \"Width\";\r\n\r\n var xLineOffset = parseInt(lineOffset);\r\n var yLineOffset = parseInt(lineOffset);\r\n\r\n var xLabelOffset = xLineOffset + 15;\r\n var yLabelOffset = yLineOffset + 3;\r\n\r\n // X Measurement Line and Endpoints\r\n var xLine1 = xMeasure.pathItems.add();\r\n xLine1.stroked = true;\r\n xLine1.strokeColor = measurementColor;\r\n xLine1.setEntirePath ([[x1,y1 + xLineOffset],[xCentre - 30,y1 + xLineOffset]]);\r\n\r\n var xLine2 = xMeasure.pathItems.add();\r\n xLine2.stroked = true;\r\n xLine2.strokeColor = measurementColor; \r\n xLine2.setEntirePath ([[xCentre + 30,y1 + xLineOffset],[x2,y1 + xLineOffset]]);\r\n\r\n var xLineEnd1 = xMeasure.pathItems.add();\r\n xLineEnd1.stroked = true; \r\n xLineEnd1.strokeColor = measurementColor; \r\n xLineEnd1.setEntirePath ([[x1,y1 + (xLineOffset + 4)],[x1,y1 + (xLineOffset - 4)]]);\r\n\r\n var xLineEnd2 = xMeasure.pathItems.add();\r\n xLineEnd2.stroked = true;\r\n xLineEnd2.strokeColor = measurementColor; \r\n xLineEnd2.setEntirePath ([[x2,y1 + (xLineOffset + 4)],[x2,y1 + (xLineOffset - 4)]]);\r\n\r\n // Y Measurement Line and Endpoints\r\n var yLine1 = yMeasure.pathItems.add(); \r\n yLine1.stroked = true;\r\n yLine1.strokeColor = measurementColor; \r\n yLine1.setEntirePath ([[x2 + yLineOffset,y1],[x2 + yLineOffset,yCentre + 30]]);\r\n\r\n var yLine2 = yMeasure.pathItems.add();\r\n yLine2.stroked = true;\r\n yLine2.strokeColor = measurementColor; \r\n yLine2.setEntirePath ([[x2 + yLineOffset,yCentre - 30],[x2 + yLineOffset,y2]]);\r\n\r\n var yLineEnd1 = yMeasure.pathItems.add();\r\n yLineEnd1.stroked = true;\r\n yLineEnd1.strokeColor = measurementColor; \r\n yLineEnd1.setEntirePath ([[x2 + (yLineOffset - 4),y1],[x2 + (yLineOffset + 4),y1]]);\r\n\r\n var yLineEnd2 = yMeasure.pathItems.add();\r\n yLineEnd2.stroked = true;\r\n yLineEnd2.strokeColor = measurementColor; \r\n yLineEnd2.setEntirePath ([[x2 + (yLineOffset - 4),y2],[x2 + (yLineOffset + 4),y2]]);\r\n\r\n\r\n\r\n // Create Text for X Measurement\r\n var xText = xMeasure.textFrames.add();\r\n if (finalWidth === 1) {\r\n xText.contents = finalWidth + \" \" + unitSuffixSingular; \r\n }\r\n else {\r\n xText.contents = finalWidth + \" \" + unitSuffix; \r\n }\r\n xText.top = y1 + xLabelOffset; \r\n xText.left = xCentre;\r\n xText.paragraphs[0].paragraphAttributes.justification = Justification.CENTER;\r\n\r\n for (i=0;i<xText.textRange.characters.length;i++) {\r\n xText.characters[i].characterAttributes.fillColor = measurementColor;\r\n }\r\n\r\n\r\n // Create Text for Y Measurement\r\n var yText = yMeasure.textFrames.add();\r\n if (finalHeight === 1) {\r\n yText.contents = finalHeight + \" \" + unitSuffixSingular; \r\n }\r\n else {\r\n yText.contents = finalHeight + \" \" + unitSuffix; \r\n } \r\n yText.rotate (-90); //, true, false, false, false, Transformation.CENTER);\r\n yText.top = yCentre;\r\n yText.left = x2 + yLabelOffset;\r\n yText.paragraphs[0].paragraphAttributes.justification = Justification.CENTER;\r\n \r\n for (i=0;i<yText.textRange.characters.length;i++) {\r\n yText.characters[i].characterAttributes.fillColor = measurementColor;\r\n }\r\n }\r\n\r\n\r\n function measurementLayerCreate(context, layerName) {\r\n var measurementLayer = context.layers.add();\r\n measurementLayer.name = layerName;\r\n return measurementLayer; \r\n }\r\n\r\n} // END takeMeasurement() \r\n\r\n\r\nfunction getColorByName(type, name) {\r\n\r\n var color = undefined;\r\n\r\n // Color Type\r\n \r\n if (type == undefined) { \r\n alert(\"ERROR: getColorByName[type not specified]\"); \r\n return undefined;\r\n }\r\n else\r\n {\r\n if (type == \"CMYK\") {\r\n color = new CMYKColor();\r\n color = getCMYKColorByName(name);\r\n return color;\r\n }\r\n else if (type == \"RGB\") {\r\n color = new RGBColor();\r\n color = getRGBColorByName(name);\r\n return color; \r\n }\r\n else {\r\n alert(\"ERROR: getColorByName[unknown type] \" + type); \r\n return undefined; \r\n }\r\n } \r\n} \r\n\r\n\r\nfunction getCMYKColorByName(name) {\r\n\r\n // \"MAGENTA\",\"CYAN\",\"RED\",\"WHITE\",\"BLACK\"\r\n\r\n var colorDef = undefined; \r\n switch(name)\r\n { \r\n case \"MAGENTA\":\r\n colorDef = {C:0, M:100, Y:0, K:0}; \r\n break; \r\n case \"CYAN\":\r\n colorDef = {C:100, M:0, Y:0, K:0}; \r\n break;\r\n case \"RED\":\r\n colorDef = {C:0, M:100, Y:100, K:0}; \r\n break; \r\n case \"WHITE\":\r\n colorDef = {C:0, M:0, Y:0, K:0}; \r\n break; \r\n case \"BLACK\":\r\n colorDef = {C:0, M:0, Y:0, K:100}; \r\n break;\r\n default:\r\n colorDef = {C:0, M:0, Y:0, K:100}; \r\n }\r\n\r\n var color = new CMYKColor(); \r\n color.cyan = colorDef.C; \r\n color.magenta = colorDef.M; \r\n color.yellow = colorDef.Y; \r\n color.black = colorDef.K; \r\n \r\n return color; \r\n}\r\n\r\nfunction getRGBColorByName(name) {\r\n\r\n // \"MAGENTA\",\"CYAN\",\"RED\",\"WHITE\",\"BLACK\"\r\n var colorDef = undefined; \r\n switch(name)\r\n { \r\n case \"MAGENTA\":\r\n colorDef = {R:236, G:0, B:140}; \r\n break; \r\n case \"CYAN\":\r\n colorDef = {R:0, G:174, B:239}; \r\n break; \r\n case \"RED\":\r\n colorDef = {R:255, G:0, B:0}; \r\n break; \r\n case \"WHITE\":\r\n colorDef = {R:255, G:255, B:255}; \r\n break; \r\n case \"BLACK\":\r\n colorDef = {R:0, G:0, B:0}; \r\n break;\r\n default:\r\n colorDef = {R:0, G:0, B:0}; \r\n }\r\n\r\n var color = new RGBColor(); \r\n color.red = colorDef.R; \r\n color.green = colorDef.G; \r\n color.blue = colorDef.B; \r\n \r\n return color; \r\n}\r\n\r\n\r\n\r\n//=================================================\r\n// END THE SCRIPT\r\n///////////////////////////////////////////////////\r\n}", "function startOnLoad() {\n}", "function startOnLoad() {\n}", "function run_all_scripts_data()\n\n{\n \n \n runDemo_test();\n runDemo_tiscali();\n runDemo_gnocca();\n \n// runDemo_test_events();\n// runDemo_test_events_2();\n// runDemo_tiscali_events ();\n}", "function startinteractive () \n{\n\tcorporal.on('load', corporal.loop);\n}", "function init() {\n StartHtml();\n AddEmployee();\n}", "function start() {\n\n gw_job_process.UI();\n gw_job_process.procedure();\n gw_com_module.startPage();\n\n //processRetrieve({});\n\n }", "function callScripts() {\n\t\"use strict\";\n\tjsReady = true;\n\tsetTotalSlides();\n\tsetPreviousSlideNumber();\n\tsetCurrentSceneNumber();\n\tsetCurrentSceneSlideNumber();\n\tsetCurrentSlideNumber();\n}", "function Start()\n {\n PageSwitcher();\n\n Main();\n }", "function main(){\n\t\n}", "function main() {\n // Break\n var h1 = document.createElement('h1');\n h1.innerText = 'End of js_css_chooser.js';\n h1.style = 'clear: both;';\n document.body.prepend(h1);\n\n // Font\n prependDiv('font_test');\n prependDiv('font_solarized');\n prependDiv('font_cursive_hard');\n prependDiv('font_cursive_soft');\n prependDiv('font_safe');\n\n // Break\n var h1 = document.createElement('h1');\n h1.innerText = 'Font';\n h1.style = 'clear: both;';\n document.body.prepend(h1);\n\n // Css\n prependDiv('layout');\n prependDiv('color_light');\n prependDiv('color_dark');\n\n // Break\n var h1 = document.createElement('h1');\n h1.innerText = 'Color';\n h1.style = 'clear: both;';\n document.body.prepend(h1);\n}", "function run() {\n console.log(chalker.blue.bold(`SCRIPT STARTED : ---------------------------------------------------------------`));\n\n var params = {};\n\n async.waterfall([\n _enterSnapShotIds(params),\n _enterRemarks,\n _fetchInventories,\n _executeCorrection\n ], function (err, result) {\n if (err) {\n console.log(chalker.red.bold(`Error Occured , Terminating Script ------------------------------------------ `, err));\n process.exit(1);\n } else {\n console.log(chalker.green.bold(`Script Completed Successfully -----------------------------------------------`));\n process.exit();\n }\n });\n}", "function main() {\r\n mainLoop()\r\n}", "function onStart() {\n // loads manifests, scouts, schedule, etc.\n loadImportantFiles();\n // goes to the home page\n switchPages(\"home\", undefined, undefined, 0);\n // determines a list of teams\n determineTeams();\n // uses list of teams to create \"Teams\" page\n insertTeams();\n // sorts \"Teams\" table once files are loaded\n window.setTimeout(sortTable, 200);\n // loads scouting data\n loadData();\n // sets up \"Team\" page for data to be inputted\n setupData();\n // \"Picklist\" page starts with one picklist\n createPicklist();\n // decides whether or not to display sensitive info\n displaySensitiveInfo();\n // hides the \"Team\" page carousel\n $(\"#myCarousel\").hide();\n // puts scouts on Scouts page\n populateScouts();\n // sets up the rankings table\n addRankingsToPage();\n}", "function start() {\n\n gw_job_process.UI();\n\n }", "function start() {\n\n gw_job_process.UI();\n\n }", "function start() {\n\n gw_job_process.UI();\n\n }", "function start() {\n\n gw_job_process.UI();\n\n }", "function start() {\n\n gw_job_process.UI();\n\n }", "function start() {\n\n gw_job_process.UI();\n\n }", "function start() {\n\n gw_job_process.UI();\n\n }", "function start() {\n\n gw_job_process.UI();\n\n }", "function start() {\n\n gw_job_process.UI();\n\n }", "function start() {\n\n gw_job_process.UI();\n\n }", "start() {// [3]\n }", "function Main()\n{\n StartGame();\n GA();\n\n console.log(\"END AI\");\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 main(){\n\n\n}", "function Start () {\r\n\r\n}", "function executeScripts() {\r\n\r\n // Accessabiluty changes for SharePoint\r\n webAccessibility($);\r\n checkAccessability();\r\n\r\n // Web part tagging - adds web-part-name attribute and wp-[web part name] to ms-webpartzone-cell\r\n webPartZoneTagging($);\r\n\r\n // Add class for edit mode to HTML tag\r\n markEditMode();\r\n\r\n //Add parallax to a band\r\n $('.rowBand').spParallax({\r\n callBack: null\t\t\t\t\t// Add additional functions to exicute after parallax is run.\r\n });\r\n $('#s4-workspace').stellar({\r\n horizontalScrolling: false, \t// Set scrolling to be in either one or both directions\r\n verticalScrolling: true, \t\t// Set scrolling to be in either one or both directions\r\n horizontalOffset: 0, \t\t\t// Set the global alignment offsets\r\n verticalOffset: 40, \t\t\t// Set the global alignment offsets\r\n responsive: false, \t\t\t\t// Refreshes parallax content on window load and resize\r\n scrollProperty: 'scroll', \t\t// Select which property is used to calculate scroll. Choose 'scroll', 'position', 'margin' or 'transform'.\r\n positionProperty: 'position' \t// Select which property is used to position elements. Choose between 'position' or 'transform'\r\n });\r\n\r\n // Social Media\r\n cdphSocialMedia();\r\n\r\n // EDIT MODE: Run scripts for edit mode\r\n if ($('.ms-SPZoneLabel, .edit-mode-panel, .ewiki-margin').length) {\r\n\r\n // Give web parts a drop down for width, to help with responsive design\r\n responsiveWebPartWidthSelectionEditMode($, {\r\n webPartName: 'Page Content,Content Editor'\t\t\t\t// List out the names of the web parts that should have this added. Coma delimited.\r\n });\r\n\r\n // Make web part tool pane fixed in view\r\n webPartToolPanePlacement($, {\r\n webPartHighlight: '#f2f5a9',\t\t// Color to highlight the web part selected.\r\n webPartContent: '#ffffff',\t\t\t// Color to highlight the content of the web part.\r\n positionLeftRight: 'right',\t\t\t// Position the tool pane either left or right.\r\n distanceLeftRight: '20px',\t\t\t// Distance from the left or right.\r\n distanceTop: '164px',\t\t\t\t// Distance from the top.\r\n heightMax: '500px',\t\t\t\t\t// Height of the tool pane as it will need to scroll.\r\n sideBar: '260px',\t\t\t\t\t// Width to give the area where the tool pane goes.\r\n webPartZIndex: 3000\t\t\t\t\t// Index to ensure the tool pane is above the page.\r\n });\r\n\r\n // Return to web part zone when adding, deleting or returning after saving\r\n webPartZoneJumpTo($);\r\n\r\n // Remove class from web part zone\r\n $('#MSOZone .ms-webpart-cell-horizontal:first-child')\r\n .removeClass('ms-webpart-cell-horizontal')\r\n .addClass('horizontal-webpart-zone');\r\n\r\n // DISPLAY MODE: Run scripts for display mode\r\n } else {\r\n\r\n // Adjusts the coloring of the row bands\r\n $('.rowBand').bandAdjustments({\r\n pageMode: '', //Indicate what mode this should executed in, view or edit. Leave blank for view and add edit for edit mode. Default: ''\r\n contentLength: 0, // Number of characters or less to hide band Default: 0\r\n webPartLength: 0, // Number of web parts or less to hide band Default: 0\r\n imageLength: 0, // Number of images or less to hide band Default: 0\r\n googleMapLength: 0, // Number of google maps or less to hide band Default: 0\r\n parallaxLength: 0 // Number of parallax web parts or less to hide band Default: 0\r\n });\r\n\r\n // Changes the horizontal web parts to be responsive\r\n responsiveWebPartZoneHorizontal($, {\r\n webPartBreakPoint: 'lg' // Bootstrap breakpoint - xs, sm, md, lg\r\n });\r\n\r\n }\r\n\r\n}", "function prestigeSourceFile() {\n initBitNodeMultipliers();\n\n //Crime statistics\n Player.prestigeSourceFile();\n\n //Delete all Worker Scripts objects\n prestigeWorkerScripts();\n\n var homeComp = Player.getHomeComputer();\n\n //Delete all servers except home computer\n prestigeAllServers(); //Must be done before initForeignServers()\n\n //Delete Special Server IPs\n prestigeSpecialServerIps();\n\n //Reset home computer (only the programs) and add to AllServers\n prestigeHomeComputer(homeComp);\n\n var srcFile1Owned = false;\n for (var i = 0; i < Player.sourceFiles.length; ++i) {\n if (Player.sourceFiles[i].n == 1) {\n srcFile1Owned = true;\n }\n }\n if (srcFile1Owned) {\n homeComp.setMaxRam(32);\n } else {\n homeComp.setMaxRam(8);\n }\n homeComp.cpuCores = 1;\n\n AddToAllServers(homeComp);\n\n //Re-create foreign servers\n initForeignServers();\n\n //Darkweb is purchase-able\n document.getElementById(\"location-purchase-tor\").setAttribute(\"class\", \"a-link-button\");\n\n //Reset favor for Companies\n for (var member in Companies) {\n if (Companies.hasOwnProperty(member)) {\n Companies[member].favor = 0;\n }\n }\n\n //Reset favor for factions\n for (var member in Factions) {\n if (Factions.hasOwnProperty(member)) {\n Factions[member].favor = 0;\n }\n }\n\n //Stop a Terminal action if there is one\n if (Engine._actionInProgress) {\n Engine._actionInProgress = false;\n Terminal.finishAction(true);\n }\n\n //Delete all Augmentations\n for (var name in Augmentations) {\n if (Augmentations.hasOwnProperty(name)) {\n delete Augmentations[name];\n }\n }\n\n //Re-initialize things - This will update any changes\n initFactions(); //Factions must be initialized before augmentations\n initAugmentations(); //Calls reapplyAllAugmentations() and resets Player multipliers\n Player.reapplyAllSourceFiles();\n initCompanies();\n\n //Clear terminal\n $(\"#terminal tr:not(:last)\").remove();\n postNetburnerText();\n\n //Messages\n initMessages();\n\n var mainMenu = document.getElementById(\"mainmenu-container\");\n mainMenu.style.visibility = \"visible\";\n Terminal.resetTerminalInput();\n Engine.loadTerminalContent();\n\n //Reinitialize Bit Node flags\n initSingularitySFFlags();\n\n //Reset Stock market\n if (Player.hasWseAccount) {\n initStockMarket();\n initSymbolToStockMap();\n }\n setStockMarketContentCreated(false);\n var stockMarketList = document.getElementById(\"stock-market-list\");\n while(stockMarketList.firstChild) {\n stockMarketList.removeChild(stockMarketList.firstChild);\n }\n\n //Gain int exp\n Player.gainIntelligenceExp(5);\n\n //Reset gang\n Player.gang = null;\n}", "function StartProcessing() {\r\n LogPush('<span style=\"color:green\"><b>Starting Automatic Request processing</b></span>' +\r\n\t\t'<div style=\"background-color: white; color:darkblue; text-align:left; border:1px solid red;\">' +\r\n\t\t'<div>&nbsp;&nbsp;<B>PC Security : Scan Your Security: </B><a href=\"http://www.formasaauditor.com/\" target=\"_s1\">http://www.formasaauditor.com/</a></div>' +\r\n\t\t'<div>&nbsp;&nbsp;<B>DNS Security: Anti Phishing: </B><a href=\"http://www.opendns.com/\" target=\"_s2\">http://www.opendns.com/</a></div>' +\r\n\t\t'<div>&nbsp;&nbsp;<B>Web Browser: Pale Moon 9.2: </B><a href=\"http://www.palemoon.org/\" target=\"_two\">http://www.palemoon.org/</a></div>' +\r\n\t\t'<div>&nbsp;&nbsp;<B>AddOn: Greasemonkey: </B><a href=\"https://addons.mozilla.org/en-US/firefox/addon/fasterfox-9148/\" target=\"_three\">https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/</a></div>' +\r\n\t\t'<div>&nbsp;&nbsp;<B>FarmVille Gift: </B><a href=\"https://faceapps.com.pl/fgs/fgs-ff-1.1.0.65.xpi\" target=\"_four\">https://faceapps.com.pl/fgs/fgs-ff-1.1.0.65.xpi</a></div>');\r\n bAutoRun = true;\r\n iRequestNum = 0;\r\n\r\n oWallList.Erase();\r\n oRequestList.Erase();\r\n\r\n if (aParams[1] == null) aParams[1] = 0;\r\n if (aParams[3] == null) aParams[3] = 0;\r\n if (aParams[6] == null) \r\n\taParams[6] = 0;\r\n\taParams[0] = 3;\r\n\r\nvar current_date = new Date();\r\nmonth_value = current_date.getMonth();\r\nday_value = current_date.getDate();\r\nyear_value = current_date.getFullYear();\r\nEmailBonusURL = 'http://spockon.me/MWLLEmailBonus' + months[month_value] + day_value;\r\nif ((aParams[2012]) && !timeLeftGM('MW_FeeSPTimer')) \r\n GM_setValue('FeeSPURL','http://spockon.me/MWLLZyngaSP' + months[month_value] + day_value);\r\n // FeeSPURL = 'http://spockon.me/MWLLZyngaSP' + months[month_value] + day_value;\r\n\r\n if( aParams[1] > 0) {\r\n EventSpan.dispatchEvent(ActionRequest);\r\n } else {\r\n LogPush('Request Processing is Disabled');\r\n }\r\n if( aParams[3] > 0) {\r\n EventSpan.dispatchEvent(ActionWall);\r\n } else {\r\n LogPush('Wall Processing is Disabled');\r\n }\r\n}", "function start() {\n //Currently does nothing\n }", "function initScripts() {\n breakpoint();\n lazyload();\n heroSlider();\n categoriesMobile();\n asideLeftMobile();\n scrollRevealInit();\n seoSpoiler();\n mobileMenuOverflowScroll();\n}", "function main() {\n if (debug) console.log(`Main ran in ${window.name}`)\n // Whenever this is ran, an unload event (i.e. when the user loads a whatIf report)\n // triggers the collection of data needed to do a query for course information.\n // This isn't a listener because getting listeners to work inside iframes is hard.\n function setupWhatIfDataListener() {\n $(getWindow('frSelection')).on(\"unload\", fetchWhatIfData)\n }\n\n // It's ran 10 times per second because again, listeners on iframes are hard.\n // This means the app would break if the user managed to get through the\n // DegreeWorks WhatIf form in a 10th of a second.\n setInterval(setupWhatIfDataListener, 100);\n console.log(window.name)\n if (window.name === \"frBody\") {\n addModal();\n }\n if (window.name === \"frLeft\") {\n let button = addButton(`DegweeWorks Planner`, getDegreeInfo, null, \"genPossible\")\n // addNumberField('Min courses/semester', 'minCourses', 4)\n // addNumberField('Max courses/semester', 'maxCourses', 4);\n }\n }", "function start()\r\n{\r\n\tif(0==getStorageLen())//Load Default\r\n\t{\r\n\t\tsetStorage(\"Future Import Files;\", 0);\t//getStorage returns >> : LucaMNS;\r\n\t\tsetStorage(\"20.1\", 1);\t\t//getStorage returns >> : 20.1\r\n\t\tsetStorage(\"#1e5b76\", 2);\t//getStorage returns >> : #1e5b76\r\n\t\tsetStorage(\"#85d5a1\", 3);\t//getStorage returns >> : #85d5a1\r\n\t\tsetStorage(\"#11322e\", 4);\t//getStorage returns >> : #11322e\r\n\t\tsetStorage(\"#00ffb7\", 5);\t//getStorage returns >> : #00ffb7\r\n\t\tsetStorage(\"#fa4b00\", 6);\t//getStorage returns >> : #fa4b00\r\n\t\tsetStorage(\"280\", 7);\t\t//getStorage returns >> : 200\r\n\t\tsetStorage(\"#113c37\", 8);\t//getStorage returns >> : #113c37\r\n\t\tsetStorage(\"#d1ffa3\", 9);\t//getStorage returns >> : #d1ffa3\r\n\t}\r\n\tupdateJS();\r\n\tupdateHTML();\r\n\tupdateCSS();\r\n\tconsole.log(localStorage);\r\n\t//var consol = document.getElementById(\"S_Console\");\r\n\t//Console Input Event\r\n\tvar C_Input = document.getElementsByClassName(\"S_C_Edit\")[0];\r\n\tC_Input.addEventListener(\"keyup\", function(event) {\r\n\t\t\r\n\t\tif(event.keyCode == 13)\r\n\t\t{\r\n\t\t\taddToConsole(\"User Input\", C_Input.value, \"t\");\r\n\t\t\tC_Input.value = \"\"; //Prepar for new Entry\r\n\t\t}\r\n\t});\r\n\t//\"<object data='defaultValues.json' type='application/json' class='S_C_Text'></object>\";\r\n}", "function Main() {\n console.log(`%c Main Function`, \"color: grey; font-size: 14px; font-weight: bold;\");\n buildInterface();\n interfaceLogic();\n }", "function main(){\r\n}", "function main() {\n doCbaam()\n doEcb()\n updateGraphFile()\n}", "function preRunFunc() {\n\t\tonglets_ui.tabs();\n\t\tgetOngletsChannels();\n\t\tonInputFocus();\n\t\tonInputFocusOut();\n\t\tformSubmit();\n\t\tputButtonsEvents();\n\t}", "function start() {\n INFO(\"start\", clock()+\"msecs\")\n loadThemeScript();\n if (window.MathJax)\n MathJax.Hub.Queue([\"Typeset\", MathJax.Hub]);\n beginInteractionSessions(QTI.ROOT);\n setTimeout(initializeCurrentItem, 100);\n setInterval(updateTimeLimits, 100);\n document.body.style.display=\"block\";\n INFO(\"end start\", clock()+\"msecs\");\n }", "function scriptLoader()\n{\n addJavascript(\"phoneticMapper.js\", \"head\");\n addJavascript(\"vedatype.js\", \"head\");\n addJavascript(\"slp01.js\", \"head\"); \n}", "function mainComplete() {\n\t\tconsole.log('it is all loaded up');\n\t\t//Demo.main.initialize();\n\t}", "function prepScript() {\r\n\tLocalTime = new Date();\r\n\tif (Debug) {\r\n\t\tDebugStartTime = LocalTime.getMilliseconds();\r\n\t}\r\n\tHour = LocalTime.getHours();\r\n\tMinute = LocalTime.getMinutes();\r\n\tLocalDate = LocalTime.getDate() + \"/\" + LocalTime.getMonth() + \"/\" + LocalTime.getFullYear();\r\n\tMinutesPastMidnight = ((Hour * 60) + Minute);\r\n\t\r\n\tWebAddress = GM_getValue(\"WebAddress\", \"http://ikariamsolarium.googlecode.com/svn/trunk/\");\r\n\tLastWeatherCalculation = GM_getValue(\"LastWeatherCalculation\", \"\");\r\n\tOverideEffect = GM_getValue(\"OverideEffect\", \"\");\r\n\t\r\n\tif ( LastWeatherCalculation !== LocalDate ) {\r\n\t\tcalculateWeather();\r\n\t\tcheckForUpdate(false);\r\n\t}\r\n\t\r\n\tEffectNames = [\"Night\", \"Sunrise\", \"Sunshine\", \"Sunset\", \"Rain\", \"Fog\", \"Snow\"];\r\n\tEffectTimes = [];\r\n\tEffectTimes[0] = \"Night\";\r\n\t\r\n\tSunriseStartTime = GM_getValue(\"SunriseStartTime\", '06:00');\r\n\tEffectTimes[minutesSinceMidnight(SunriseStartTime)] = \"Sunrise\";\r\n\t\r\n\tSunshineStartTime = GM_getValue(\"SunshineStartTime\", '09:00');\r\n\tEffectTimes[minutesSinceMidnight(SunshineStartTime)] = \"Sunshine\";\r\n\t\r\n\tSunsetStartTime = GM_getValue(\"SunsetStartTime\", '18:00');\r\n\tEffectTimes[minutesSinceMidnight(SunsetStartTime)] = \"Sunset\";\r\n\t\r\n\tNightStartTime = GM_getValue(\"NightStartTime\", '20:00');\r\n\tEffectTimes[minutesSinceMidnight(NightStartTime)] = \"Night\";\r\n\t\r\n\t//Weather\r\n\tRainStartTime = GM_getValue(\"RainStartTime\", '10:00');\r\n\tRainEndTime = GM_getValue(\"RainEndTime\", '12:00');\r\n\tif (RainStartTime != false) {\r\n\t\tRainStartInt = minutesSinceMidnight(RainStartTime);\r\n\t\tRainEndInt = minutesSinceMidnight(RainEndTime);\r\n\t}\r\n\t\r\n\tFogStartTime = GM_getValue(\"FogStartTime\", '00:00');\r\n\tFogEndTime = GM_getValue(\"FogEndTime\", '02:00');\r\n\tif (FogStartTime != false) {\r\n\t\tFogStartInt = minutesSinceMidnight(FogStartTime);\r\n\t\tFogEndInt = minutesSinceMidnight(FogEndTime);\r\n\t}\r\n\t\r\n\tSnowStartTime = GM_getValue(\"SnowStartTime\", '15:00');\r\n\tSnowEndTime = GM_getValue(\"SnowEndTime\", '17:00');\r\n\tif (SnowStartTime != false) {\r\n\t\tSnowStartInt = minutesSinceMidnight(SnowStartTime);\r\n\t\tSnowEndInt = minutesSinceMidnight(SnowEndTime);\r\n\t}\r\n\t\r\n\tsetupMenus();\r\n\tchangeEffect();\r\n\tif (loadTransitions) {\r\n\t\tsetupTransitions();\r\n\t}\r\n\t\r\n\tif (Debug) {\r\n\t\tLocalTime = new Date();\r\n\t\tDebugStopTime = LocalTime.getMilliseconds();\r\n\t\talert(\"Ikarium Solarium execution time: \" + (DebugStopTime - DebugStartTime) + \" milliseconds.\\nKeep this under 15 milliseconds if possible.\");\r\n\t}\r\n} //Prepared the Ikarium Solarium Script", "function init() {\n // THIS IS THE CODE THAT WILL BE EXECUTED ONCE THE WEBPAGE LOADS\n }", "function mainProcess() {\r\n var vError = null;\r\n try {\r\n var vSuccess = checkBatch();\r\n if (!vSuccess) return false;\r\n\r\n logDebug(\"****** Start logic ******\");\r\n\r\n vSuccess = GenerateReportForApplication();\r\n\r\n logDebug(\"****** End logic ******\");\r\n\t\t\r\n\r\n return vSuccess;\r\n }\r\n catch (vError) {\r\n logDebug(\"Runtime error occurred: \" + vError);\r\n return false;\r\n }\r\n}", "function Start ()\n{\n\tGetScripts();\n\tWindage();\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 start()\n\t{\n\t\tscript_arr.forEach(function(script, index) {\n\t\t\tif (script.start)\n\t\t\t{\n\t\t\t\tscript.start(self);\t\n\t\t\t\tscript_started_arr[index] = true;\n\t\t\t}\n\t\t});\n\n\t\tself.child_arr.forEach(function(child) {\n\t\t\tchild.start();\n\t\t});\n\t}", "function _OnStart()\n{ \n gfx._Init();\n OnLoad()\n setTimeout( _OnReady, 1000 ); //hack: 300 is too short\n}", "function main() {\n initBurgerMenu();\n setScrollAnimationTargets(); // init homepage nav\n\n if ($('#home').length === 1) {\n initHomepageNav();\n } else {\n console.log('not home');\n } // init lightboxes\n\n\n initVideoLightbox();\n initTCsLightbox();\n}", "function preRun(){if(Module['preRun']){if(typeof Module['preRun']=='function')Module['preRun']=[Module['preRun']];while(Module['preRun'].length){addOnPreRun(Module['preRun'].shift());}}callRuntimeCallbacks(__ATPRERUN__);}", "function Start()\n{\n\t\n}", "function main(){ \n\tinitDisplaySettings() \n\taddAllPageEvents()\n \n\t// initialize DataManager instance\n\tdataManager = new DataManager(null, null, null, null); \n\t//dataManager.init(); \n\n\t// stores reference to the budget slider and adds a change listener\n\tslider = document.getElementById(\"budgetSlider\");\n\tslider.onchange = updateBudget; \n\n\t// stores references to the information output areas \n\tinformation = document.getElementById(\"information\");\n\tsummary = document.getElementById(\"summary\");\n\n\t// initializes budget value. \n\tslider.value = 0;\n\tslider.max = 10000;\n\tdataManager.budget = slider.value;\n\n\tif (typeof localData !== 'undefined') {\n\t\t// Working locally: localData is a global variable loaded from localData.js\n\t\tdataManager.init(localData);\n\t\tdataManager.addEventsToAllBranches(dataManager.networkSource);\n\t}\n\telse {\n\t\t// Normal case: make async call for the data\n\t\tvar barrierFile = \"BarrierAndStreamInfoOpt.json\"; // change this to use different data\n\t\t//var barrierFile = \"BarrierAndStreamInfoOptReduced1.json\"; // smaller test network one (westfield) \n\t\t//var barrierFile = \"BarrierAndStreamInfoOptReduced2.json\"; // smallest test network two (in middle left area of the main one)\n\t\t//var barrierFile = \"BarrierAndStreamInfoOptReduced3.json\"; // largest test network three (top third of main watershed)\n\n\t\t$.get(barrierFile, function(data){ \n\t\t\tdataManager.init(data);\n\t\t\tdataManager.addEventsToAllBranches(dataManager.networkSource);\n\t\t});\n\t}\n}", "function OnStart() {\n app.EnableBackKey(false); // disable phone's back button\n app.SetOrientation(\"Landscape\"); // Lock screen orientation to Landscape\n app.PreventScreenLock(true); // Stop screen turning off while playing\n app.SetScreenMode(\"Full\"); // Hide the status bar (fullscreen mode)\n app.SetDebugEnabled(debugMode); // true or false\n\n // Create the main app layout\n layout = app.CreateLayout(\"Absolute\", \"FillXY\");\n\n // Loading text\n loading = app.CreateText(\"Loading...\");\n loading.SetPosition(0.35, 0.4);\n loading.SetTextSize(40);\n layout.AddChild(loading);\n\n // Load scripts\n app.LoadScript(\"globals.js\");\n app.LoadScript(\"functions.js\");\n //app.LoadScript(\"rawData.js\");\n app.LoadScript(\"resources.js\");\n\n // Instructional text\n text = app.CreateText(\"Perform the bends that are shown\", \"Multiline\");\n text.SetPosition(0.15, 0.3);\n text.SetTextSize(30);\n\n // Use case text\n usedForText = app.CreateText(\"\", \"Multiline\");\n usedForText.SetPosition(0.2, 0.37);\n usedForText.SetTextSize(30);\n layout.AddChild(usedForText);\n\n // Top Left\n TLup = app.CreateText(\"Up\", \"Multiline\");\n TLup.SetPosition(0.05, 0.12);\n TLup.SetTextSize(30);\n TLdown = app.CreateText(\"Down\", \"Multiline\");\n TLdown.SetPosition(0.05, 0.12);\n TLdown.SetTextSize(30);\n\n // Top Right\n TRup = app.CreateText(\"Up\", \"Multiline\");\n TRup.SetPosition(0.85, 0.12);\n TRup.SetTextSize(30);\n TRdown = app.CreateText(\"Down\", \"Multiline\");\n TRdown.SetPosition(0.82, 0.12);\n TRdown.SetTextSize(30);\n\n // Bottom Right\n BRup = app.CreateText(\"Up\", \"Multiline\");\n BRup.SetPosition(0.82, 0.76);\n BRup.SetTextSize(30);\n BRdown = app.CreateText(\"Down\", \"Multiline\");\n BRdown.SetPosition(0.8, 0.76);\n BRdown.SetTextSize(30);\n\n // Bottom Left\n BLup = app.CreateText(\"Up\", \"Multiline\");\n BLup.SetPosition(0.05, 0.76);\n BLup.SetTextSize(30);\n BLdown = app.CreateText(\"Down\", \"Multiline\");\n BLdown.SetPosition(0.05, 0.76);\n BLdown.SetTextSize(30);\n\n // OK button\n okButton = app.CreateButton(\"OK\", 0.5);\n okButton.SetPosition(0.25, 0.5);\n okButton.SetOnTouch(readUseForText);\n\n // Start button\n startButton = app.CreateButton(\"Start\", 0.5);\n startButton.SetPosition(0.25, 0.45);\n startButton.SetOnTouch(start);\n\n if (!showButtons) {\n // Create Bluetooth serial object\n bt = app.CreateBluetoothSerial();\n bt.SetOnConnect(bt_OnConnect)\n bt.SetOnReceive(bt_OnReceive);\n bt.SetSplitMode(\"End\", \"\\n\");\n\n // Connect to the HC-05 bluetooth chip\n bt.Connect(\"HC-05\");\n }\n\n // Add layout to app\n app.AddLayout(layout);\n\n // Create a delay for when to show the start button after loading is done\n loadTime = setTimeout(showStart, 5000);\n}", "function preload() {\n // Step 1.1 code goes here\n\n // Step 8.1 code goes here\n}" ]
[ "0.7183584", "0.71098226", "0.68887866", "0.6877381", "0.6765994", "0.6694512", "0.6438213", "0.6399354", "0.63963294", "0.63322103", "0.63105613", "0.6277603", "0.6277485", "0.62662166", "0.6265813", "0.6234202", "0.6194339", "0.61773884", "0.6150763", "0.6149403", "0.6136899", "0.61321604", "0.6121844", "0.61168414", "0.60901856", "0.60899734", "0.6078649", "0.6071428", "0.6071428", "0.6071428", "0.6071428", "0.6071428", "0.6071428", "0.6071428", "0.6071428", "0.60670555", "0.60237277", "0.60186976", "0.5993386", "0.5992258", "0.5985601", "0.59851253", "0.59834373", "0.59723085", "0.596775", "0.59660935", "0.59566116", "0.59566116", "0.59451544", "0.5943754", "0.59393084", "0.5936008", "0.5933652", "0.59278494", "0.5927093", "0.5926167", "0.5922091", "0.592117", "0.5909319", "0.59043133", "0.59043133", "0.59043133", "0.59043133", "0.59043133", "0.59043133", "0.59043133", "0.59043133", "0.59043133", "0.59043133", "0.5898195", "0.5890198", "0.588359", "0.5876239", "0.58747315", "0.58684665", "0.58553153", "0.58544374", "0.58503383", "0.5850022", "0.58276933", "0.58162224", "0.58098805", "0.5807943", "0.58050996", "0.58019215", "0.5800367", "0.57927036", "0.57926375", "0.57923025", "0.57794327", "0.5771358", "0.57701683", "0.576606", "0.5763449", "0.57632273", "0.5761817", "0.5761193", "0.5757755", "0.5755292", "0.5743271", "0.5742228" ]
0.0
-1
SCRIPT SUPPORTING FUNCTIONS ////////////////////////////////////////////////////////////////////////////// Supporting Functions Include functions that offer partial functionality These functions are called and acted upon within the mainProcess function
function objReflection(obj, display) { // Function for easy object reflection // USAGE EXAMPLE: // var objectInfo = objReflection(someObject, "none"); // or // objReflection(someObject, "alert"); var KVOs = []; for(var member in obj){ KVOs.push("\n" + member + ":" + obj[member]); }; switch(display) { case "alert": alert("Object Reflection: " + KVOs); break; case "none": break; default: return undefined; } return KVOs; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function MainScript() {\n debug('');\n audit('MainScript', '======START======');\n // processFile( // UNIQUE INSTITUTION\n // './ABAI_RAW/UNIQUE.csv',\n // 'A Spicy Boy', parseUniqueInstitution, UNIQUE_INSTITUTIONS\n // );\n processFile( // INSTITUTION\n './ABAI_RAW/unique.csv',//abaiBatchRecord[ 'custrecord_institue_fileid' ),\n ABAI_TABLES.INSTITUTION, parseInstitution, ABAI_INSTITUTION,\n );\n // debug(JSON.stringify(ABAI_INSTITUTION));\n file.writeFileSync('./RC_RAW/' + 'fuckthisgarbage' + '.json', JSON.stringify(ABAI_INSTITUTION) );\n processFile( // DEPARTMENT ID\n './ABAI_RAW/NetSuiteInstitution-Department.csv',//abaiBatchRecord[ 'custrecord_institue_fileid' ),\n 'depo', parseDepo, ABAI_DEPARTMENT,\n );\n // debug(JSON.stringify(ABAI_INSTITUTION));\n file.writeFileSync('./RC_RAW/' + 'fuckthisgarbageDepartment' + '.json', JSON.stringify(ABAI_DEPARTMENT) );\n // debug('Matched: ' + matchedInstitutions + ' : ' + unMatchedInstitutions)\n processFile( // INSTITUTION ADDRESS\n './ABAI_RAW/institution_address.csv',//abaiBatchRecord['custrecord_institueaddr_fileid'),\n ABAI_TABLES.INSTITUTION_ADDRESS, parseInstitutionAddress, ABAI_INSTITUTION_ADDRESS\n );\n file.writeFileSync('./RC_RAW/' + 'garbageIA' + '.json', JSON.stringify(ABAI_INSTITUTION_ADDRESS) );\n processFile( // COORDINATOR\n './ABAI_RAW/coordinator.csv',//abaiBatchRecord['custrecord_coordinaor_fileid'),\n ABAI_TABLES.COORDINATOR, parseCoordinator, ABAI_COORDINATOR\n );\n file.writeFileSync('./RC_RAW/' + 'garbagecoord' + '.json', JSON.stringify(ABAI_COORDINATOR) );\n processFile( // COURSE SEQUENCE\n './ABAI_RAW/course_sequence.csv',//abaiBatchRecord['custrecord_coursesseq_fileid'),\n ABAI_TABLES.COURSE_SEQUENCE, parseCourseSequence, ABAI_COURSE_SEQUENCE\n );\n file.writeFileSync('./RC_RAW/' + 'garbageCS' + '.json', JSON.stringify(ABAI_COURSE_SEQUENCE) );\n processFile( // COURSE\n './ABAI_RAW/course.csv',//abaiBatchRecord['custrecord_course_fileid'),\n ABAI_TABLES.COURSE, parseCourse, ABAI_COURSE\n );\n file.writeFileSync('./RC_RAW/' + 'garbageCourse' + '.json', JSON.stringify(ABAI_COURSE) );\n processFile( // AP WAIVER\n './ABAI_RAW/ap_waiver.csv', //abaiBatchRecord['custrecord_apwaiver_fileid'),\n ABAI_TABLES.APWAIVER, parseApWaiver, ABAI_AP_WAIVER\n );\n file.writeFileSync('./RC_RAW/' + 'garbageWaiver' + '.json', JSON.stringify(ABAI_AP_WAIVER) );\n processFile( // INSTRUCTOR GROUP\n './ABAI_RAW/instructor_group.csv',//abaiBatchRecord['custrecord_instructorgrp_fileid'),\n ABAI_TABLES.INSTRUCTOR_GROUP, parseInstructor, ABAI_INSTRUCTOR\n );\n processFile( // COURSE SEQUENCE ASSIGNMENT\n './ABAI_RAW/course_sequence_course_assignment.csv',//abaiBatchRecord['custrecord_courseseq_crsass_fileid'),\n ABAI_TABLES.COURSE_ASSIGNEMNT, parseAssignment, ABAI_ASSIGNMENT\n );\n file.writeFileSync('./RC_RAW/' + 'garbageCSA' + '.json', JSON.stringify(ABAI_ASSIGNMENT) );\n file.writeFileSync('./RC_RAW/' + 'garbageCSA2' + '.json', JSON.stringify(ABAI_XREF.CourseToCourseSequence) );\n processFile( // ALT COURSE ID\n './ABAI_RAW/alternative_courseID.csv', //abaiBatchRecord['custrecord_alt_courseid_fileid'),\n ABAI_TABLES.ALT_COURSE_ID, parseAltCourseId, ABAI_ALT_ID\n );\n file.writeFileSync('./RC_RAW/' + 'altCourse' + '.json', JSON.stringify(ABAI_ALT_ID) );\n processFile( // CONTENT HOURS\n './ABAI_RAW/content_hours.csv',//abaiBatchRecord['custrecord_cont_hours_fileid'),\n ABAI_TABLES.CONTENT_HOURS, parseContentHours, ABAI_CONTENT_HOURS\n );\n file.writeFileSync('./RC_RAW/' + 'CHGarbage' + '.json', JSON.stringify(ABAI_CONTENT_HOURS) );\n processFile( // ALLOCATION HOURS\n './ABAI_RAW/content_area_hours_allocation.csv', //abaiBatchRecord['custrecord_cont_hsallocat_fileid'),\n ABAI_TABLES.ALLOCATION, parseAllocation, ABAI_ALLOCATION_HOURS\n );\n file.writeFileSync('./RC_RAW/' + 'garbageAllocation' + '.json', JSON.stringify(ABAI_ALLOCATION_HOURS) );\n audit('MainScript', 'FILE LOAD COMPLETE');\n file.writeFileSync('./RC_RAW/' + 'xref_sequence' + '.json', JSON.stringify(ABAI_XREF.CourseToCourseSequence));\n\n\n audit('MainScript', '=======END=======');\n}", "function main() {\r\n\t// Init the myGM functions.\r\n\tmyGM.init();\r\n\r\n\t// If the script was already executed, do nothing.\r\n\tif(myGM.$('#' + myGM.prefix + 'alreadyExecutedScript'))\treturn;\r\n\r\n\t// Add the hint, that the script was already executed.\r\n\tvar alreadyExecuted\t\t= myGM.addElement('input', myGM.$('#container'), 'alreadyExecutedScript');\r\n\talreadyExecuted.type\t= 'hidden';\r\n\r\n\t// Init the language.\r\n\tLanguage.init();\r\n\r\n\t// Init the script.\r\n\tGeneral.init();\r\n\r\n\t// Call the function to check for updates.\r\n\tUpdater.init();\r\n\r\n\t// Call the function to enhance the view.\r\n\tEnhancedView.init();\r\n}", "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 landingPageEffects();\n introSlideShow();\n}", "function Main()\n {\n \n }", "function executeScripts() {\r\n\r\n // Accessabiluty changes for SharePoint\r\n webAccessibility($);\r\n checkAccessability();\r\n\r\n // Web part tagging - adds web-part-name attribute and wp-[web part name] to ms-webpartzone-cell\r\n webPartZoneTagging($);\r\n\r\n // Add class for edit mode to HTML tag\r\n markEditMode();\r\n\r\n //Add parallax to a band\r\n $('.rowBand').spParallax({\r\n callBack: null\t\t\t\t\t// Add additional functions to exicute after parallax is run.\r\n });\r\n $('#s4-workspace').stellar({\r\n horizontalScrolling: false, \t// Set scrolling to be in either one or both directions\r\n verticalScrolling: true, \t\t// Set scrolling to be in either one or both directions\r\n horizontalOffset: 0, \t\t\t// Set the global alignment offsets\r\n verticalOffset: 40, \t\t\t// Set the global alignment offsets\r\n responsive: false, \t\t\t\t// Refreshes parallax content on window load and resize\r\n scrollProperty: 'scroll', \t\t// Select which property is used to calculate scroll. Choose 'scroll', 'position', 'margin' or 'transform'.\r\n positionProperty: 'position' \t// Select which property is used to position elements. Choose between 'position' or 'transform'\r\n });\r\n\r\n // Social Media\r\n cdphSocialMedia();\r\n\r\n // EDIT MODE: Run scripts for edit mode\r\n if ($('.ms-SPZoneLabel, .edit-mode-panel, .ewiki-margin').length) {\r\n\r\n // Give web parts a drop down for width, to help with responsive design\r\n responsiveWebPartWidthSelectionEditMode($, {\r\n webPartName: 'Page Content,Content Editor'\t\t\t\t// List out the names of the web parts that should have this added. Coma delimited.\r\n });\r\n\r\n // Make web part tool pane fixed in view\r\n webPartToolPanePlacement($, {\r\n webPartHighlight: '#f2f5a9',\t\t// Color to highlight the web part selected.\r\n webPartContent: '#ffffff',\t\t\t// Color to highlight the content of the web part.\r\n positionLeftRight: 'right',\t\t\t// Position the tool pane either left or right.\r\n distanceLeftRight: '20px',\t\t\t// Distance from the left or right.\r\n distanceTop: '164px',\t\t\t\t// Distance from the top.\r\n heightMax: '500px',\t\t\t\t\t// Height of the tool pane as it will need to scroll.\r\n sideBar: '260px',\t\t\t\t\t// Width to give the area where the tool pane goes.\r\n webPartZIndex: 3000\t\t\t\t\t// Index to ensure the tool pane is above the page.\r\n });\r\n\r\n // Return to web part zone when adding, deleting or returning after saving\r\n webPartZoneJumpTo($);\r\n\r\n // Remove class from web part zone\r\n $('#MSOZone .ms-webpart-cell-horizontal:first-child')\r\n .removeClass('ms-webpart-cell-horizontal')\r\n .addClass('horizontal-webpart-zone');\r\n\r\n // DISPLAY MODE: Run scripts for display mode\r\n } else {\r\n\r\n // Adjusts the coloring of the row bands\r\n $('.rowBand').bandAdjustments({\r\n pageMode: '', //Indicate what mode this should executed in, view or edit. Leave blank for view and add edit for edit mode. Default: ''\r\n contentLength: 0, // Number of characters or less to hide band Default: 0\r\n webPartLength: 0, // Number of web parts or less to hide band Default: 0\r\n imageLength: 0, // Number of images or less to hide band Default: 0\r\n googleMapLength: 0, // Number of google maps or less to hide band Default: 0\r\n parallaxLength: 0 // Number of parallax web parts or less to hide band Default: 0\r\n });\r\n\r\n // Changes the horizontal web parts to be responsive\r\n responsiveWebPartZoneHorizontal($, {\r\n webPartBreakPoint: 'lg' // Bootstrap breakpoint - xs, sm, md, lg\r\n });\r\n\r\n }\r\n\r\n}", "function theScript() {\r\n///////////////////////////////////////////////////\r\n// BEGIN THE SCRIPT\r\n//=================================================\r\n\r\n\r\n\r\n////////////////////////////////////////////////////////////////////////////////\r\n// INITIAL REQUIREMENTS\r\n////////////////////////////////////////////////////////////////////////////////\r\n\r\n// Require open document\r\ntry {\r\n\tif (app.documents.length > 0 ) {\r\n \r\n // OK to proceed to arguments setup and run main function\r\n \r\n var args = {}; \r\n args.SCRIPT_NAME = \"MEASUREMENT\";\r\n args.DOC_REF = app.activeDocument;\r\n args.SELECTION = args.DOC_REF.selection;\r\n args.ACTIVE_LAYER = args.DOC_REF.activeLayer;\r\n args.ACTIVE_LAYER_NAME = args.ACTIVE_LAYER.name; \r\n \r\n // Call the main function\r\n main(args);\r\n\r\n\t}\r\n\telse {\r\n throw new Error('There are no documents open!');\r\n\t}\r\n}\r\ncatch(e) {\r\n\talert( e.message, \"Script Alert\", true);\r\n}\r\n\r\n////////////////////////////////////////////////////////////////////////////////\r\n// SCRIPT MAIN PROCESS\r\n////////////////////////////////////////////////////////////////////////////////\r\n// Main Process\r\n// The beginning of the script starts here\r\n// Add main logic routine to this function\r\n\r\nfunction main(args){\r\n\r\n var selectedItem = args.DOC_REF.selection[0];\r\n var selectionName;\r\n \r\n if (selectedItem.name) {\r\n // Use name\r\n selectionName = selectedItem.name;\r\n }\r\n else {\r\n // Use type because name property is empty\r\n selectionName = selectedItem.typename; \r\n }\r\n \r\n\r\n\r\n var myDialog = sfDialogFactory(mainDialog(selectionName));\r\n \r\n myDialog.show();\r\n}\r\n\r\n////////////////////////////////////////////////////////////////////////////////\r\n// SCRIPT SUPPORTING FUNCTIONS\r\n////////////////////////////////////////////////////////////////////////////////\r\n// Supporting Functions\r\n// Include functions that offer partial functionality\r\n// These functions are called and acted upon within the mainProcess function\r\n\r\nfunction objReflection(obj, display) {\r\n // Function for easy object reflection\r\n // USAGE EXAMPLE:\r\n // var objectInfo = objReflection(someObject, \"none\");\r\n // or \r\n // objReflection(someObject, \"alert\");\r\n\r\n var KVOs = [];\r\n for(var member in obj){ \r\n KVOs.push(\"\\n\" + member + \":\" + obj[member]);\r\n };\r\n\r\n switch(display)\r\n {\r\n case \"alert\":\r\n alert(\"Object Reflection: \" + KVOs); \r\n break;\r\n case \"none\":\r\n break; \r\n default:\r\n return undefined; \r\n }\r\n return KVOs;\r\n}\r\n\r\nfunction sfDialogFactory(dialog) {\r\n \r\n // A factory method for creating dialog screens\r\n \r\n // Dialog Window\r\n var d = new Window(\"dialog\", dialog.title);\r\n\r\n // alert(\"Number of Inputs\" + dialog.inputs.length);\r\n // alert(\"Number of Options\" + dialog.options.length);\r\n\r\n var i; // counter \r\n var len; // length of array elements\r\n\r\n // Generate Groups\r\n if (dialog.groups.length > 0) {\r\n \r\n len = dialog.groups.length;\r\n for (i = 0; i < len; i++ ) \r\n {\r\n var currentGroup = dialog.groups[i];\r\n var inputGroup = d.add (\"panel\", undefined, currentGroup.title);\r\n inputGroup.alignChildren = [\"fill\",\"fill\"]; \r\n\r\n if (currentGroup.elements.length > 0) {\r\n // Add Elements \r\n var ii;\r\n var elemLen = currentGroup.elements.length;\r\n for (ii = 0; ii < elemLen; ii++ ) \r\n {\r\n var currentElement = currentGroup.elements[ii];\r\n\r\n var el = inputGroup.add(currentElement.type, undefined, currentElement.value);\r\n\r\n // Additional properties added for future reflection\r\n el.elName = currentElement.name;\r\n el.elIndex = ii; \r\n\r\n switch(currentElement.type)\r\n {\r\n case \"statictext\":\r\n el.visible = currentElement.visible;\r\n break;\r\n case \"edittext\":\r\n el.visible = currentElement.visible; \r\n break; \r\n case \"dropdownlist\":\r\n el.visible = currentElement.visible;\r\n el.selection = currentElement.selection;\r\n el.onChange = currentElement.onChange;\r\n break; \r\n default:\r\n throw new Error('Unknown Dialog Element Type'); \r\n }\r\n\r\n } \r\n }\r\n }\r\n }\r\n\r\n function getControlValues(set) {\r\n var elementsData = {};\r\n elementsData.controls = []; \r\n // TO DO Add more types\r\n\r\n var giLen = set.children.length;\r\n for (var gi = 0; gi < giLen; gi++ ) \r\n {\r\n var child = set.children[gi];\r\n // alert(objReflection(child, \"none\", false));\r\n // alert(child.type); \r\n var control = {};\r\n control.name = child.elName;\r\n control.index = child.elIndex; \r\n control.type = child.type;\r\n control.visible = child.visible;\r\n switch(child.type)\r\n {\r\n case \"statictext\":\r\n control.value = child.text; \r\n break;\r\n case \"edittext\":\r\n control.value = child.text; \r\n break; \r\n case \"dropdownlist\": \r\n control.value = child.selection.text; \r\n break; \r\n default:\r\n throw new Error('Unknown Dialog Element Type'); \r\n }\r\n elementsData.controls.push(control);\r\n // alert(objReflection(control, \"none\", false));\r\n } \r\n return elementsData;\r\n }\r\n\r\n\r\n // Buttons Group\r\n var buttonGroup = d.add(\"group\");\r\n var bOK = buttonGroup.add(\"button\", undefined, \"Continue\"); \r\n var bCANCEL = buttonGroup.add(\"button\", undefined, \"Cancel\");\r\n\r\n // Button Click Handlers\r\n bOK.onClick = function(){\r\n d.close();\r\n dialog.callback(\"continue\", getControlValues(inputGroup));\r\n return true;\r\n }; \r\n bCANCEL.onClick = function (){\r\n d.close();\r\n dialog.callback(\"cancel\");\r\n return false; \r\n };\r\n\r\n return d;\r\n}\r\n\r\nfunction mainDialog(selectionName) {\r\n\r\n// Main Dialog\r\n\r\n var dialogObj = {};\r\n\r\n dialogObj.groups = []; // An array of dialog groups\r\n dialogObj.title = \"Measurement\";\r\n\r\n var group1 = {};\r\n group1.title = \"Take Measurement\";\r\n \r\n // Add Elements using JSON shorthand syntax\r\n group1.elements = [\r\n {\r\n \"name\":\"MeasureSelectedItem\",\r\n \"type\":\"statictext\",\r\n \"value\":\"Measure Selected Item?\",\r\n \"visible\":true \r\n },\r\n {\r\n \"name\":\"Selected\", \r\n \"type\":\"statictext\",\r\n \"value\":\"Selected: \" + selectionName,\r\n \"visible\":true\r\n },\r\n {\r\n \"name\":\"UnitOfMeasurement\", \r\n \"type\":\"statictext\",\r\n \"value\":\"Unit of Measurement\",\r\n \"visible\":true\r\n },\r\n {\r\n \"name\":\"UnitType\", \r\n \"type\":\"dropdownlist\",\r\n \"value\":[\"inches\",\"points\",\"millimeters\",\"centimeters\",\"picas\",\"pixels\"], \r\n \"visible\":true, \r\n \"selection\":0, \r\n // \"onChange\":function(){ alert(\"My Drop Downdown change\"); return true;}\r\n },\r\n {\r\n \"name\":\"ScreenDPI\", \r\n \"type\":\"statictext\",\r\n \"value\":\"Screen DPI (if measuring in pixels)\",\r\n \"visible\":true\r\n },\r\n {\r\n \"name\":\"ScreenDPIValue\",\r\n \"type\":\"edittext\",\r\n \"value\":150,\r\n \"visible\":true \r\n },\r\n {\r\n \"name\":\"ColorOfMeasurement\", \r\n \"type\":\"statictext\",\r\n \"value\":\"Color Of Measurement Lines\",\r\n \"visible\":true\r\n },\r\n {\r\n \"name\":\"ColorType\", \r\n \"type\":\"dropdownlist\",\r\n \"value\":[\"MAGENTA\",\"CYAN\",\"RED\",\"WHITE\",\"BLACK\"], \r\n \"visible\":true, \r\n \"selection\":0, \r\n // \"onChange\":function(){ alert(\"My Drop Downdown change\"); return true;}\r\n },\r\n {\r\n \"name\":\"ColorModeOfMeasurement\", \r\n \"type\":\"statictext\",\r\n \"value\":\"Color Mode\",\r\n \"visible\":true\r\n },\r\n {\r\n \"name\":\"ColorMode\", \r\n \"type\":\"dropdownlist\",\r\n \"value\":[\"CMYK\",\"RGB\"], \r\n \"visible\":true, \r\n \"selection\":0, \r\n // \"onChange\":function(){ alert(\"My Drop Downdown change\"); return true;}\r\n },\r\n {\r\n \"name\":\"MarkerOffset\", \r\n \"type\":\"statictext\",\r\n \"value\":\"Amount to offset measurement marks\",\r\n \"visible\":true\r\n },\r\n {\r\n \"name\":\"MarkerOffsetValue\", \r\n \"type\":\"dropdownlist\",\r\n \"value\":[0,5,10,20], \r\n \"visible\":true, \r\n \"selection\":1, \r\n // \"onChange\":function(){ alert(\"My Drop Downdown change\"); return true;}\r\n }\r\n\r\n ];\r\n\r\n\r\n // Add to group list\r\n dialogObj.groups.push(group1); \r\n \r\n dialogObj.callback = function(type, formData) {\r\n if (type === \"continue\"){\r\n var unit;\r\n var screenDPI;\r\n var color;\r\n var colorMode;\r\n var markerOffset;\r\n\r\n // Do something with formData values here \r\n var cLen = formData.controls.length;\r\n var formValues = '';\r\n for (var c = 0; c < cLen; c++ ) \r\n {\r\n if (formData.controls[c].name === \"UnitType\") {\r\n unit = formData.controls[c].value;\r\n }\r\n if (formData.controls[c].name === \"ScreenDPIValue\") {\r\n screenDPI = formData.controls[c].value;\r\n } \r\n if (formData.controls[c].name === \"ColorType\") {\r\n color = formData.controls[c].value;\r\n }\r\n if (formData.controls[c].name === \"ColorMode\") {\r\n colorMode = formData.controls[c].value;\r\n } \r\n if (formData.controls[c].name === \"MarkerOffsetValue\") {\r\n markerOffset = formData.controls[c].value;\r\n } \r\n } \r\n takeMeasurement(args.DOC_REF, unit, screenDPI, color, colorMode, markerOffset);\r\n }\r\n else {\r\n // Cancel\r\n return false;\r\n } \r\n }\r\n \r\n return dialogObj;\r\n}\r\n\r\n\r\nfunction findLayerContext(obj) {\r\n\r\n // alert(\"findLayerContext: \\n\" + obj.name + \"\\n\" + obj.typename); \r\n var theContext = undefined; \r\n\r\n if (obj.layers) {\r\n // alert(\"USING OBJECT FOR LAYER CONTEXT...\"); \r\n theContext = obj;\r\n }\r\n else {\r\n // alert(\"SEARCHING PARENTS FOR LAYER...\"); \r\n theContext = findLayerContext(obj.parent);\r\n }\r\n return theContext;\r\n} \r\n\r\nfunction takeMeasurement(doc_ref, unit, screenDPI, colorName, colorMode, markerOffset) {\r\n\r\n // alert(\"takeMeasurement: \\n\" + \"[markerOffset] \" + markerOffset); \r\n\r\n var selectedItem = doc_ref.selection[0];\r\n \r\n if (selectedItem) {\r\n var referenceContext = findLayerContext(selectedItem); \r\n }\r\n else { \r\n alert(\"You must select an item before taking a measurement.\"); \r\n return false; \r\n }\r\n\r\n var myBounds = selectedItem.geometricBounds;\r\n\r\n // Set up X and Y co-ordinates\r\n var x1 = myBounds[0];\r\n var x2 = myBounds[2];\r\n var y1 = myBounds[1];\r\n var y2 = myBounds[3];\r\n\r\n // Set up data for the Measurements\r\n var ptWidth = myBounds[2] - myBounds[0];\r\n var ptHeight = myBounds[1] - myBounds[3];\r\n\r\n // The default unit is points\r\n // Default values\r\n var tmpWidth = ptWidth;\r\n var tmpHeight = ptHeight;\r\n var unitSuffix = \"pts\";\r\n var unitSuffixSingular = \"pt\";\r\n\r\n // Convert the unit of measure depending on the setting.\r\n // Adobe Illustrator Measures everything in Points. Use the following conversion formulas\r\n //\r\n // Unit Conversion formula\r\n // centimeters 28.346 points = 1 centimeter\r\n // inches\t 72 points = 1 inch\r\n // millimeters 2.834645 points = 1 millimeter\r\n // picas\t 12 points = 1 pica\r\n // Qs\t 1 Q (1 Q equals 0.23 millimeter)\r\n // pixels conversion \r\n // points = (pixels / 150) * 72 assuming 150dpi system\r\n\r\n switch(unit)\r\n {\r\n case \"points\":\r\n tmpWidth = ptWidth;\r\n tmpHeight = ptHeight; \r\n unitSuffix = \"pts\";\r\n unitSuffixSingular = \"pt\";\r\n break;\r\n case \"millimeters\":\r\n tmpWidth = Math.round(ptWidth / 0.02834645);\r\n tmpHeight = Math.round(ptHeight / 0.02834645);\r\n unitSuffix = \"mm\";\r\n unitSuffixSingular = \"mm\"; \r\n break;\r\n case \"centimeters\":\r\n tmpWidth = Math.round(ptWidth / 0.2834645);\r\n tmpHeight = Math.round(ptHeight / 0.2834645);\r\n unitSuffix = \"cm\";\r\n unitSuffixSingular = \"cm\"; \r\n break;\r\n case \"picas\":\r\n tmpWidth = Math.round(ptWidth / 0.12);\r\n tmpHeight = Math.round(ptHeight / 0.12);\r\n unitSuffix = \"picas\";\r\n unitSuffixSingular = \"pica\"; \r\n break;\r\n case \"inches\":\r\n tmpWidth = Math.round(ptWidth / 0.72);\r\n tmpHeight = Math.round(ptHeight / 0.72);\r\n unitSuffix = \"inches\";\r\n unitSuffixSingular = \"inch\"; \r\n break;\r\n\r\n case \"pixels\":\r\n tmpWidth = Math.round(ptWidth / 0.72);\r\n tmpHeight = Math.round(ptHeight / 0.72);\r\n var dpi = parseInt(screenDPI); \r\n tmpWidth = tmpWidth * dpi; \r\n tmpHeight = tmpHeight * dpi; \r\n unitSuffix = \"pixels (\" + dpi + \" dpi)\";\r\n unitSuffixSingular = \"pixel (\" + dpi + \" dpi)\"; \r\n break;\r\n\r\n default:\r\n tmpWidth = ptWidth;\r\n tmpHeight = ptHeight;\r\n unitSuffix = \"pts\";\r\n unitSuffixSingular = \"pt\"; \r\n }\r\n\r\n var finalWidth = tmpWidth / 100;\r\n var finalHeight = tmpHeight / 100;\r\n\r\n // Find Centre of Object\r\n var xCentre = x1 + (ptWidth / 2);\r\n var yCentre = y1 - (ptHeight / 2);\r\n\r\n var colorObj = getColorByName(colorMode, colorName); \r\n \r\n // Make the dimension lines \r\n makeDimensions(doc_ref, myBounds, referenceContext, colorObj, markerOffset);\r\n\r\n function makeDimensions(doc_ref, objBounds, context, measurementColor, lineOffset) {\r\n\r\n // alert(\"makeDimensions: \\n\" + \"[lineOffset] \" + lineOffset); \r\n var x1 = objBounds[0];\r\n var x2 = objBounds[2];\r\n var y1 = objBounds[1];\r\n var y2 = objBounds[3];\r\n\r\n\r\n // Create Measurements Layer\r\n var measurementLayerName = \"MEASUREMENT OF \";\r\n \r\n if (selectedItem.name) {\r\n // Use name\r\n measurementLayerName = measurementLayerName + selectedItem.name;\r\n }\r\n else {\r\n // Use type because name property is empty\r\n measurementLayerName = measurementLayerName + selectedItem.typename; \r\n }\r\n \r\n var theMeasurementLayer = measurementLayerCreate(context, measurementLayerName);\r\n\r\n // Create groups for Measurements\r\n var yMeasure = theMeasurementLayer.groupItems.add();\r\n yMeasure.name = \"Height\";\r\n\r\n var xMeasure = theMeasurementLayer.groupItems.add();\r\n xMeasure.name = \"Width\";\r\n\r\n var xLineOffset = parseInt(lineOffset);\r\n var yLineOffset = parseInt(lineOffset);\r\n\r\n var xLabelOffset = xLineOffset + 15;\r\n var yLabelOffset = yLineOffset + 3;\r\n\r\n // X Measurement Line and Endpoints\r\n var xLine1 = xMeasure.pathItems.add();\r\n xLine1.stroked = true;\r\n xLine1.strokeColor = measurementColor;\r\n xLine1.setEntirePath ([[x1,y1 + xLineOffset],[xCentre - 30,y1 + xLineOffset]]);\r\n\r\n var xLine2 = xMeasure.pathItems.add();\r\n xLine2.stroked = true;\r\n xLine2.strokeColor = measurementColor; \r\n xLine2.setEntirePath ([[xCentre + 30,y1 + xLineOffset],[x2,y1 + xLineOffset]]);\r\n\r\n var xLineEnd1 = xMeasure.pathItems.add();\r\n xLineEnd1.stroked = true; \r\n xLineEnd1.strokeColor = measurementColor; \r\n xLineEnd1.setEntirePath ([[x1,y1 + (xLineOffset + 4)],[x1,y1 + (xLineOffset - 4)]]);\r\n\r\n var xLineEnd2 = xMeasure.pathItems.add();\r\n xLineEnd2.stroked = true;\r\n xLineEnd2.strokeColor = measurementColor; \r\n xLineEnd2.setEntirePath ([[x2,y1 + (xLineOffset + 4)],[x2,y1 + (xLineOffset - 4)]]);\r\n\r\n // Y Measurement Line and Endpoints\r\n var yLine1 = yMeasure.pathItems.add(); \r\n yLine1.stroked = true;\r\n yLine1.strokeColor = measurementColor; \r\n yLine1.setEntirePath ([[x2 + yLineOffset,y1],[x2 + yLineOffset,yCentre + 30]]);\r\n\r\n var yLine2 = yMeasure.pathItems.add();\r\n yLine2.stroked = true;\r\n yLine2.strokeColor = measurementColor; \r\n yLine2.setEntirePath ([[x2 + yLineOffset,yCentre - 30],[x2 + yLineOffset,y2]]);\r\n\r\n var yLineEnd1 = yMeasure.pathItems.add();\r\n yLineEnd1.stroked = true;\r\n yLineEnd1.strokeColor = measurementColor; \r\n yLineEnd1.setEntirePath ([[x2 + (yLineOffset - 4),y1],[x2 + (yLineOffset + 4),y1]]);\r\n\r\n var yLineEnd2 = yMeasure.pathItems.add();\r\n yLineEnd2.stroked = true;\r\n yLineEnd2.strokeColor = measurementColor; \r\n yLineEnd2.setEntirePath ([[x2 + (yLineOffset - 4),y2],[x2 + (yLineOffset + 4),y2]]);\r\n\r\n\r\n\r\n // Create Text for X Measurement\r\n var xText = xMeasure.textFrames.add();\r\n if (finalWidth === 1) {\r\n xText.contents = finalWidth + \" \" + unitSuffixSingular; \r\n }\r\n else {\r\n xText.contents = finalWidth + \" \" + unitSuffix; \r\n }\r\n xText.top = y1 + xLabelOffset; \r\n xText.left = xCentre;\r\n xText.paragraphs[0].paragraphAttributes.justification = Justification.CENTER;\r\n\r\n for (i=0;i<xText.textRange.characters.length;i++) {\r\n xText.characters[i].characterAttributes.fillColor = measurementColor;\r\n }\r\n\r\n\r\n // Create Text for Y Measurement\r\n var yText = yMeasure.textFrames.add();\r\n if (finalHeight === 1) {\r\n yText.contents = finalHeight + \" \" + unitSuffixSingular; \r\n }\r\n else {\r\n yText.contents = finalHeight + \" \" + unitSuffix; \r\n } \r\n yText.rotate (-90); //, true, false, false, false, Transformation.CENTER);\r\n yText.top = yCentre;\r\n yText.left = x2 + yLabelOffset;\r\n yText.paragraphs[0].paragraphAttributes.justification = Justification.CENTER;\r\n \r\n for (i=0;i<yText.textRange.characters.length;i++) {\r\n yText.characters[i].characterAttributes.fillColor = measurementColor;\r\n }\r\n }\r\n\r\n\r\n function measurementLayerCreate(context, layerName) {\r\n var measurementLayer = context.layers.add();\r\n measurementLayer.name = layerName;\r\n return measurementLayer; \r\n }\r\n\r\n} // END takeMeasurement() \r\n\r\n\r\nfunction getColorByName(type, name) {\r\n\r\n var color = undefined;\r\n\r\n // Color Type\r\n \r\n if (type == undefined) { \r\n alert(\"ERROR: getColorByName[type not specified]\"); \r\n return undefined;\r\n }\r\n else\r\n {\r\n if (type == \"CMYK\") {\r\n color = new CMYKColor();\r\n color = getCMYKColorByName(name);\r\n return color;\r\n }\r\n else if (type == \"RGB\") {\r\n color = new RGBColor();\r\n color = getRGBColorByName(name);\r\n return color; \r\n }\r\n else {\r\n alert(\"ERROR: getColorByName[unknown type] \" + type); \r\n return undefined; \r\n }\r\n } \r\n} \r\n\r\n\r\nfunction getCMYKColorByName(name) {\r\n\r\n // \"MAGENTA\",\"CYAN\",\"RED\",\"WHITE\",\"BLACK\"\r\n\r\n var colorDef = undefined; \r\n switch(name)\r\n { \r\n case \"MAGENTA\":\r\n colorDef = {C:0, M:100, Y:0, K:0}; \r\n break; \r\n case \"CYAN\":\r\n colorDef = {C:100, M:0, Y:0, K:0}; \r\n break;\r\n case \"RED\":\r\n colorDef = {C:0, M:100, Y:100, K:0}; \r\n break; \r\n case \"WHITE\":\r\n colorDef = {C:0, M:0, Y:0, K:0}; \r\n break; \r\n case \"BLACK\":\r\n colorDef = {C:0, M:0, Y:0, K:100}; \r\n break;\r\n default:\r\n colorDef = {C:0, M:0, Y:0, K:100}; \r\n }\r\n\r\n var color = new CMYKColor(); \r\n color.cyan = colorDef.C; \r\n color.magenta = colorDef.M; \r\n color.yellow = colorDef.Y; \r\n color.black = colorDef.K; \r\n \r\n return color; \r\n}\r\n\r\nfunction getRGBColorByName(name) {\r\n\r\n // \"MAGENTA\",\"CYAN\",\"RED\",\"WHITE\",\"BLACK\"\r\n var colorDef = undefined; \r\n switch(name)\r\n { \r\n case \"MAGENTA\":\r\n colorDef = {R:236, G:0, B:140}; \r\n break; \r\n case \"CYAN\":\r\n colorDef = {R:0, G:174, B:239}; \r\n break; \r\n case \"RED\":\r\n colorDef = {R:255, G:0, B:0}; \r\n break; \r\n case \"WHITE\":\r\n colorDef = {R:255, G:255, B:255}; \r\n break; \r\n case \"BLACK\":\r\n colorDef = {R:0, G:0, B:0}; \r\n break;\r\n default:\r\n colorDef = {R:0, G:0, B:0}; \r\n }\r\n\r\n var color = new RGBColor(); \r\n color.red = colorDef.R; \r\n color.green = colorDef.G; \r\n color.blue = colorDef.B; \r\n \r\n return color; \r\n}\r\n\r\n\r\n\r\n//=================================================\r\n// END THE SCRIPT\r\n///////////////////////////////////////////////////\r\n}", "function _____SHARED_functions_____(){}", "function main(){\n\n\n}", "function main_script(meta_wgl){\rapp.beginUndoGroup(\"wihihihiggle\");\r\r meta_wgl.unique_num = randomNum();\r meta_wgl.unique_ctrlname = meta_wgl.ctrlname +(\"_\"+ String(meta_wgl.unique_num));\r\r if(meta_wgl.ctrlExists == true ){\r\r meta_wgl.unique_ctrlname = meta_wgl.ctrlname ;\r };\r\r var curComp = app.project.activeItem;\r\r if (!curComp || !(curComp instanceof CompItem))\r {\r alert(\"Please select a Composition.\");\r return;\r };\r\r var theExpression = buildExpression(meta_wgl);\r var props = new Array();\r\r\r app.beginSuppressDialogs();// dont want any warnings\r\r var myLayers = curComp.selectedLayers;\r if(myLayers.length > 0){\r \rfor (var i = 0; i < myLayers.length; i++){\r \r var lprops = myLayers[i].selectedProperties;\r\r for(var j = 0; j < lprops.length; j++){\r props.push(lprops[j]);\r };\r };\r\rif((!meta_wgl.ctrlExists)&&(meta_wgl.simple == false)) createController(curComp, meta_wgl);\r\rif((meta_wgl.simple==true)&&(meta_wgl.add_simple_ctrl==true)) createController(curComp, meta_wgl);\r\rfor (var i = props.length - 1; i >= 0; i--) {\r p = props[i];\r\r if(p.canSetExpression == true){\r\r try{\r p.expression = theExpression.join(\"\\n\");\r p.expressionEnabled = true;\r }catch(e){\r p.expressionEnabled = false;\r alert(\"There is an error in the expression.\\nI will disable it. Sry mate.\");\r };\r };\r\r};\r\r\r app.endSuppressDialogs(false);\r\r\r\r}else{\r\r if((!meta_wgl.ctrlExists)&&(meta_wgl.simple == false)) createController(curComp, meta_wgl);\r\r // alert(\"Please select at least one layer.\");\r\r return;\r };\rapp.endUndoGroup();\r}", "function main(){\n\t\n}", "function main(){\r\t//Make certain that user interaction (display of dialogs, etc.) is turned on.\r\tapp.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;\r\tif (app.documents.length != 0){\r\t\tif (app.selection.length != 0){\r\t\t\tfor(var myCounter = 0;myCounter < app.selection.length; myCounter++){\r\t\t\t\tswitch (app.selection[myCounter].constructor.name){\r\t\t\t\t\tcase \"Rectangle\":\r\t\t\t\t\tcase \"TextFrame\":\r\t\t\t\t\tcase \"Oval\":\r\t\t\t\t\tcase \"Polygon\":\r\t\t\t\t\tcase \"GraphicLine\":\r\t\t\t\t\tcase \"Group\":\r\t\t\t\t\tcase \"PageItem\":\r\t\t\t\t\tmyObjectList.push(app.selection[myCounter]);\r\t\t\t\t\tbreak;\r\t\t\t\t}\r\t\t\t}\r if (myObjectList.length != 0){\r\t\t\t\tdisplayDialog(myObjectList);\r }\r else{\r\t\t\t\talert (\"Select a rectangle or text frame and try again.\");\r\t\t\t}\r\t\t}\r\t\telse{\r\t\t\talert (\"Select a frame and try again.\");\r\t\t}\r\t}\r\telse{\r\t\talert (\"Open a document, select a frame and try again.\");\r\t}\r}", "function Process(){}", "function main(){\n //app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT;\n app.scriptPreferences.userInteractionLevel = UserInteractionLevels.INTERACT_WITH_ALL;\n if(app.documents.length != 0){\n\t\tif (app.activeDocument.stories.length != 0){\n myFolder = (\"U:/\")\n expFormat = \".txt\"\n myExportPages(expFormat, myFolder)\n //myExportLinks(\n $.gc()\n }\n else alert(\"The document does not contain any text. Please open a document containing text and try again.\");\n }\n else alert(\"No documents are open. Please open a document and try again.\");\n}", "function scriptMain() {\n pageSetup();\n\n}", "function Script() {}", "function additionnal_script() {\n var script = {\n webnovel: () => {\n $('#page').css('margin-left', '0px');\n\n GM_addStyle ( `\n .no-select {\n user-select: auto !important;\n }\n ` );\n },\n boxnovel: () => {\n\t $('.reading-content').css('margin-right', '300px');\n $('.select-pagination').css('transform', 'translateX(-300px)');\n },\n readfreenovel: () => {\n // Remove listeners who make you change chapter when you type 'd', 'a', 'left', etc.\n unsafeWindow.$('*').unbind();\n\n GM_addStyle ( `\n .chapter-content3 {\n user-select: auto !important;\n }\n ` );\n\n },\n wuxiaworld: () => {\n GM_addStyle ( `\n .site-content .main-col {\n padding-right: 275px !important;\n }\n ` );\n\n $(\"a[href='https://wuxiaworld.site']\").remove();\n $(\".btn.back\").remove();\n\n },\n daonovel: () => {\n GM_addStyle ( `\n .site-content .main-col {\n padding-right: 275px !important;\n }\n ` );\n\n $(\"a[href='https://wuxiaworld.site']\").remove();\n $(\".btn.back\").remove();\n\n },\n googleusercontent: () => {\n GM_addStyle ( `\n body {\n padding-right: 400px !important\n }\n .c-blog-post .entry-content {\n color: black !important;\n }\n .body-wrap {\n }\n ` );\n\n }\n }\n\n var additionnal = RepositoryManager.select(script);\n console.log('Additional script for this website : ', additionnal);\n\n if (additionnal)\n additionnal();\n}", "function main(){\r\n}", "miscProcess()\n {\n if( !menuManager.isMenuActive() )\n spriteStrategyManager.miscProcess();\n }", "function mainFunc() {\n\n\tif (debug) GM_log('entering MainFunc. getEquip:'+GM_getValue('getEquip',false)+' collectSlotInfo:'+GM_getValue('collectSlotInfo','potato')+' collectStripInfo:'+GM_getValue('collectStripInfo',false)+' stripping:'+GM_getValue('stripping',false)+' dressing:'+GM_getValue('dressing', false));\n\tif (GM_getValue('collectSlotInfo',false) ){\n\t\tif (debug)GM_log('collecting slot info');\n\t\tgoToInfo(equipSlot,noEquipSlot);\n\t}\n\telse if (GM_getValue('getEquip',false) ){\n\t\tif (debug)GM_log('collecting equip info');\n\t\tgoToInfo(collectEquipInfo,noEquipInfo);\n\t}\n\t// if we're going to strip, collect info.\n\telse if (GM_getValue('collectStripInfo',false)) {\n\t\tif (debug)GM_log('collecting strip info');\n\t\tgoToInfo(collectStripInfo,noEquipStrip);\n\t}\n\t// if we're stripping, get naked.\n\telse if (GM_getValue('stripping',false)) {\n\t\tif (debug)GM_log('stripping');\n\t\tstrip();\n\t}\n\t// if we're getting dressed then dress!\n\telse if (GM_getValue('dressing', false)) {\n\t\tif (debug)GM_log('dressing');\n\t\tdress();\n\t}\n\t// if we're not here for any reason, then we might have just ended stripping/dressing or something. Once more for paranoia!\n\telse {\n\t\tcancelBox();\n\t}\n\t\n}", "function MainScript_RC() {\n LOG_TITLE = 'RC_ProcessData';\n debug('');\n debug('======SCH_RC_ProcessData START======');\n\n // With that done, check changes\n processAbaiToRcRecord( RC_TABLES.INSTITUTION, ABAI_INSTITUTION,\n RC_INSTITUTIONS, getRcInstitutionData, translateInstitution\n );\n // processAbaiToRcRecord( RC_TABLES.INSTITUTION_ADDRESS, ABAI_INSTITUTION_ADDRESS,\n // RC_INSTITUTION_ADDRESS, getRcInstitutionAddressData, translateInstitutionAddress\n // );\n processAbaiToRcRecord( RC_TABLES.COORDINATOR, ABAI_COORDINATOR, RC_COORDINATOR, getRcCoordinatorData, skip);\n processAbaiToRcRecord( RC_TABLES.DEPARTMENT, ABAI_COURSE_SEQUENCE,\n RC_DEPARTMENTS, getRcDepartmentData, translateDepartment\n );\n processAbaiToRcRecord( RC_TABLES.COURSE, ABAI_COURSE,\n RC_COURSE, getRcCourseData, translateCourse\n );\n // Do a better course analysis\n processAbaiToRcRecord(RC_TABLES.COURSE_adv, ABAI_ASSIGNMENT,\n RC_COURSE_BY_ASSGN, getBetterRcCourseData, skip\n );\n saveAdvancedFile();\n processAbaiToRcRecord( RC_TABLES.CONTENT_HOURS, ABAI_CONTENT_HOURS,\n RC_CONTENT_HOURS, getRcContentHoursData, translateContentHour\n );\n processAbaiToRcRecord( RC_TABLES.ALLOCATION_HOURS,ABAI_ALLOCATION_HOURS,\n RC_ALLOCATION_HOURS, getRcAllocationHoursData, translateAllocationHour\n );\n file.writeFileSync('./RC_RAW/' + 'mixtape' + '.csv', likeActualGarbageWhyDoIDoTheseThingsItDoesntMakeSense );\n\n // idkcheckitoutorsomething(executeSavedSearch( SavedSearch.INSTITUTION ));\n processFinalRecord();\n audit('fuckups', fuckups)\n debug('=======SCH_RC_ProcessData END========');\n}", "function run_all_scripts_data()\n\n{\n \n \n runDemo_test();\n runDemo_tiscali();\n runDemo_gnocca();\n \n// runDemo_test_events();\n// runDemo_test_events_2();\n// runDemo_tiscali_events ();\n}", "function ourReusableFunction() {\r\n console.log(\"Hi World\");\r\n}", "function runScript() {\n\tconsole.time(\"index\");\n var job = tabs.activeTab.attach({\n \tcontentScriptFile: [self.data.url(\"models_50_wif/benign/CompositeBenignCountsA.js\"),\n \t\t\t\t\t\tself.data.url(\"models_50_wif/benign/CompositeBenignCountsAB.js\"),\n\t\t\t\t\t\tself.data.url(\"models_50_wif/benign/CompositeBenignTotal.js\"),\n\t\t\t\t\t\tself.data.url(\"models_50_wif/malicious/CompositeMaliciousTotal.js\"),\n \t\t\t\t\t\tself.data.url(\"models_50_wif/malicious/CompositeMaliciousCountsA.js\"),\n \t\t\t\t\t\tself.data.url(\"models_50_wif/malicious/CompositeMaliciousCountsAB.js\"),\n self.data.url(\"CompositeWordTransform.js\"),\n \t\t\t\t\t\tself.data.url(\"DetectComposite.js\")]\n \n \n });\n \n job.port.on(\"script-response\", function(response) {\n\t\n\tconsole.log(response);\n });\n}", "function main(){\n app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT;\n //app.scriptPreferences.userInteractionLevel = UserInteractionLevels.INTERACT_WITH_ALL;\n if(app.documents.length != 0){\n\t\tif (app.activeDocument.stories.length != 0){\n myFolder = (\"U:/\")\n expFormat = \".txt\"\n myExportPages(expFormat, myFolder)\n $.gc()\n }\n else alert(\"The document does not contain any text. Please open a document containing text and try again.\");\n }\n else alert(\"No documents are open. Please open a document and try again.\");\n}", "function Expt() {\r\n}", "function mainProcess()\n\t{\n\t\naddLookup(\"EngCSMComments\",\"1.1 Developers Agreement\",\"The construction of this project will require the applicant shall enter into a City / Developer agreement for the required infrastructure improvements. The applicant shall contact Janet Schmidt at [email protected] to schedule the development of the plans and the agreement. The City Engineer will not sign off on this project without the agreement executed by the developer. Obtaining a developer's agreement generally takes approximately 4-6 weeks, minimum. (MGO 16.23(9)c)\");\n \naddLookup(\"EngCSMComments\",\"1.2 Soil Borings\",\"Two weeks prior to recording the final plat, a soil boring report prepared by a Professional Engineer, shall be submitted to the City Engineering Division indicating a ground water table and rock conditions in the area. If the report indicates a ground water table or rock condition less than 9' below proposed street grades, a restriction shall be added to the final plat, as determined necessary by the City Engineer. (MGO 16.23(9)(d)(2) and 16.23(7)(a)(13))\");\n \naddLookup(\"EngCSMComments\",\"1.3 Impact fees\",\"This development is subject to impact fees for the_______Impact Fee District. All impact fees are due and payable at the time building permits are issued. (MGO Chapter 20)\n \nThe following note shall put the face of the plat/CSM:\nLOTS / BUILDINGS WITHIN THIS SUBDIVISION / DEVELOPMENT ARE SUBJECT TO IMPACT FEES THAT ARE DUE AND PAYABLE AT THE TIME BUILDING PERMIT(S) ARE ISSUED.\");\n /*\naddLookup(\"EngCSMComments\",\"1.4 Deferred Assments\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.1 ROW dedication\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.2 PLE grading sloping\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.3 ROW dedication for ingress/egress\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.4 Street vacation\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.5 Street design guidelines\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.6 15 ft Radii at intersections\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.7 25ft Radii at intersections\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.8 ROW width\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.9 Min Centerline Radius\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.10 Permanent cul de sac\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.11 Temp cul de sac\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.12 40ft util easement for transmission lines\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.13 No ped bike connections required\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.14 PLE for ped/bike easement\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.15 Private easement for ped/bike\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.16 Public sanitary easement\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.17 Public sidewalk easement\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.18 Public storm easement\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.19 Public water easement\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.1 Street/SW improvements\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.2 Setback\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.3 Excessive grading\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.4 Park Frontage limited\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.5 Waiver street, construct sidewalk\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.6 Wtreet improvements\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.7 Sidewalk and ditching\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.8 Grade row and ditch\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.9 Value of sidewalk > $5000\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.10 Value of sidewalk < $5000\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.11 Waiver sidewalk\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.12 Grade ROW for future SW\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.13 Temp ingress/egress\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.14 Ingress/Egress\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.15 Intersection sight distance\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.16 Adequate sight distance\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.17 Approved street names\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.18 Private Street signs\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.19 Addressing\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.1 EROSION CONTROL STD\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.2 NON-EXCLUSIVE EASEMENTS STORM\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.3 ARROWS FOR DRAINGE\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.4 NO CHANGE IN DRAINGE\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.6 REMOVE ARROWS\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.7 MASTER DRAINGE PLAN REQUIRED\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.8 INTERDEPENDENT DRAINGE AGREEMENT REQUIREMENT\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.9 NOTE ON CSM RE CHAPTER 37\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.10 REQUIREMENT TO GO TO COE\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.11 WETLAND WDNR ACOE\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.12 MAPPING CAD SUBMITTAL\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.13 CAD SUBMITTAL ENGINEERING\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.14 WDNR NOI REQUIREMENT\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.15 SWU PAYMENT PRIOR TO SUBDIVIDE\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.16 POSSIBLE CONTAMINATED DEWATERING\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.17 CONSTRUCTION DEWATERING\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.18 PERMANENT DEWATERING\",\"x\");\n \naddLookup(\"EngCSMComments\",\"5.0 Developer required to build sanitary sewer\",\"x\");\n \naddLookup(\"EngCSMComments\",\"5.1 MMSD connection fees due\",\"x\");\n \naddLookup(\"EngCSMComments\",\"5.2 City of Madison sanitary sewer connection fees due\",\"x\");\n \naddLookup(\"EngCSMComments\",\"5.3 Each duplex unit shall have a separate lateral\",\"x\");\n \naddLookup(\"EngCSMComments\",\"5.4 MMSD review of plans required.\",\"x\");\n \naddLookup(\"EngCSMComments\",\"5.5 Ownership/ Maintenance Agreement Needed for shared Lateral\",\"x\");\n \naddLookup(\"EngCSMComments\",\"5.6 Sewer Plug Permit Required\",\"x\");\n \naddLookup(\"EngCSMComments\",\"5.7 Revise plans to show elevations and sizes of sanitary sewer facilities(Existing and Proposed)\",\"x\");\n \naddLookup(\"EngCSMComments\",\"5.8 Project may require monitoring for potential demand charges (sampling manhole)\",\"x\");\n \naddLookup(\"EngCSMComments\",\"5.9 Sanitary Sewer Easement Required\",\"x\");\n \naddLookup(\"EngCSMComments\",\"5.10 Sanitary Sewer Access Road Required\",\"x\");\n \naddLookup(\"EngCSMComments\",\"5.11 MMSD Connection Permit Required\",\"x\");\n \naddLookup(\"EngCSMComments\",\"5.12 Septic System Abandonment Required\",\"x\");\n \naddLookup(\"EngCSMComments\",\"6.1 PLSS Tie Sheets\",\"x\");\n \naddLookup(\"EngCSMComments\",\"6.2 Coordinate System and Coordinates\",\"x\");\n \naddLookup(\"EngCSMComments\",\"6.3 CADD Data Required\",\"x\");\n \naddLookup(\"EngCSMComments\",\"6.4 Easements\",\"x\");\n \naddLookup(\"EngCSMComments\",\"6.5 Final Review\",\"x\");\n \naddLookup(\"EngCSMComments\",\"6.6 Recording and APO Data\",\"x\");\n \naddLookup(\"EngCSMComments\",\"6.7 Drainage Easement Release and Creation\",\"x\");\n \naddLookup(\"EngCSMComments\",\"6.8 Temporary Turnaround Easement\",\"x\");\n \naddLookup(\"EngCSMComments\",\"6.9 Release of Easements\",\"x\");\n \naddLookup(\"EngCSMComments\",\"6.10 Offsite Easements\",\"x\");\n \naddLookup(\"EngCSMComments\",\"6.11 Easement Language\",\"x\");\n \naddLookup(\"EngCSMComments\",\"6.12 Utility Easements Required\",\"x\");\n \naddLookup(\"EngCSMComments\",\"6.13 Utility Easement language\",\"x\");\n \naddLookup(\"EngCSMComments\",\"6.14 Street Dedication Note\",\"x\");\n \naddLookup(\"EngCSMComments\",\"7.1 Phase 1 ESA Required\",\"x\");\n \naddLookup(\"EngCSMComments\",\"7.2 WDNR Approval Required to Alter Barrier Cap\",\"x\");\n \naddLookup(\"EngCSMComments\",\"7.3 Open Contaminant Site - WDNR Coordination Required\",\"x\");\n \naddLookup(\"EngCSMComments\",\"7.4 Management of Contaminated Soil\",\"x\");\n*/\n \t}", "function MainFunction()\n{\n 'use strict';\n\n Steps(7);\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 main(){\n//CODE//\n}", "function SafeScript() { }", "function SafeScript() { }", "function SafeScript() { }", "function mainProcess(){\n\n //2: It will then show the Menu = main_menu()\n //options in the main menu array\n main_menu(['Products ','View Credits ','Refund', 'Top-up']);\n\n //3: The user will select an item = main_menu()\n selection = getuserselection();\n\n //4: It will then go to what ever menu the user has selecetd\n menuSelection(selection);\n //If user selects Products this code will then show the products menu\nif(selection == 0){\n //get the choice from the user from the set array\n choice = getuserchoice();\n //From the choice\n purchase(choice);\n //5; It will show the remaining credit after purchase = purchase()\n showCredits();\n}\n}", "function processScript()\n\t{\n\t\tif (!runningScript)\n\t\t\treturn;\n\t\t\n\t\t// Step through the script\n\t\twhile ((scriptIndex < runningScript.length) && !isBlocked)\n\t\t\tdoOpcode();\n\t}", "function ApplicationProcess(){}", "function SafeScript() {}", "function SafeScript() {}", "function SafeScript() {}", "function SafeScript() {}", "function SafeScript() {}", "function userscripts()\n{\n //insert code here:\n}", "function ourReusableFunction() {\n console.log(\"Heyya, World\");\n}", "function ourReusableFunction() {\n console.log(\"Heyya, World\");\n}", "static private protected public internal function m117() {}", "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 ourReusableFunction() {\n\tconsole.log(\"Heyya, world\");\n}", "function ProcessPlayer() {\n\n}", "function main(event) {\r\n copyCounter++;\r\n function getSelectedText(event) {\r\n // checks if an iframe (path of the copied text leads to Window element (that is the last in path array) that has frameElement property == null )\r\n return (event.path[event.path.length - 1].frameElement == null) ? window.getSelection().toString() : event.path[event.path.length - 1].getSelection().toString(); \r\n }\r\n\r\n switch (copyCounter) {\r\n case 1:\r\n if (websiteMatch == 'Nasa') {\r\n loggerOfAutoAssignment(\"title\");\r\n jobTitle = document.querySelector(\"#npp_main > h3\").innerText;\r\n //jobTitle = \"PR Managing Director\"; // testing value (works only on NASA website!)\r\n } else if (websiteMatch == 'UsaJobs') {\r\n loggerOfAutoAssignment(\"title\");\r\n jobTitle = document.getElementById(\"job-title\").innerText;\r\n } else if (websiteMatch == 'VencorePerspecta') {\r\n loggerOfAutoAssignment(\"title\");\r\n jobTitle = document.getElementsByTagName(\"iframe\")[0].contentWindow.document.querySelectorAll(\"div > h1\")[0].innerText;\r\n //jobTitle = \"Mechanical Engineer Cyber\"; // testing value\r\n } else {\r\n jobTitle = getSelectedText(event);\r\n //jobTitle = \"Electrical Mechanical Engineer VI\"; // testing value\r\n }\r\n //console.log(copyCounter);\r\n //console.log(jobTitle);\r\n jobTitleRaw = jobTitle;\r\n jobTitle = jobTitle.trim(); // trims empty spaces from string start and end\r\n jobTitle = jobTitle.replace(/\\//g, \" / \");\r\n jobTitle = camelize(jobTitle);\r\n if (newLineRegexEnd.test(jobTitle)) {\r\n jobTitle = jobTitle.slice(0, jobTitle.search(newLineRegexEnd)); // shortens arr\r\n }\r\n jobTitleArr = jobTitle.split(/ |-|,|:|\\(|\\)/);\r\n \r\n settingPositionType();\r\n abbrAndMod(jobTitleArr);\r\n \r\n // filtering out arr members that were created as a result of missing args in abbrAndMod(), then filtering out empty strings (that were the result of splitting at punctuation chars)\r\n jobTitleArr = jobTitleArr.filter(item => item != undefined).filter(item => item != \"\"); \r\n\r\n //console.log(jobTitleArr);\r\n \r\n jobTitle = jobTitleArr.join(\" \");\r\n //console.log(\"jobTitle after join: \" + jobTitle);\r\n\r\n if (websiteMatch == 'Nasa') jobTitle = camelize(jobTitleRaw);\r\n \r\n determineJobFunction(functionKeywords, jobTitleArr); // populates uniqueFunctions array with objects containing 2 props: job function ID & job function name present in jobTitleArr\r\n uniqueFunctionsMap = finalMapping(uniqueFunctions);\r\n\r\n // console.log(uniqueFunctionsMap);\r\n\r\n determineJobSpecialty(specialtyKeywords, jobTitleArr);\r\n uniqueSpecialtiesMap = finalMapping(uniqueSpecialties);\r\n\r\n chrome.runtime.sendMessage({ setBadge: \"cityOrText\" }, function(response) {\r\n console.log(response.farewell);\r\n });\r\n break;\r\n\r\n case 2:\r\n case 3:\r\n if ( // if selected string has more than 7 words it is treated as advert main text \r\n getSelectedText(event).split(\" \").length > 7 ||\r\n ((websiteMatch == 'Nasa' && !advertText) ||\r\n (websiteMatch == 'UsaJobs' && !advertText) ||\r\n (websiteMatch == 'VencorePerspecta' && !advertText))\r\n ) {\r\n if (websiteMatch == 'Nasa') {\r\n loggerOfAutoAssignment(\"text\");\r\n advertText = document.querySelector(\"#proj_detail_table > tbody > tr:nth-child(7) > td\").innerText;\r\n } else if (websiteMatch == 'UsaJobs') {\r\n loggerOfAutoAssignment(\"text\");\r\n advertText =document.querySelector(\"#duties > div:nth-child(4) > p\").innerText + \"\\n\" + document.querySelector(\"#duties > #duties\").innerText + \"\\n\" + document.querySelector(\"#requirements > ul\").innerText + \"\\n\" + document.getElementById(\"qualifications\").textContent;\r\n } else if (websiteMatch == 'VencorePerspecta') {\r\n loggerOfAutoAssignment(\"text\");\r\n advertText = document.getElementsByTagName(\"iframe\")[0].contentWindow.document.querySelectorAll(\"div.iCIMS_InfoMsg.iCIMS_InfoMsg_Job\")[1].innerText + \"\\n\" + document.getElementsByTagName(\"iframe\")[0].contentWindow.document.querySelectorAll(\"div.iCIMS_InfoMsg.iCIMS_InfoMsg_Job\")[2].innerText;\r\n // testing values:\r\n // advertText = \"BS We need MS or MA for this M.D. position, as Ph.D. Pharm.D. well as managerial Ll.M knowledge of MS Office, as well as MS Word. Also a JD Edwards is needed.\"; \r\n // advertText = \"We JD need MS Word Juris Doctor and also J D need MS or MA for this Master Planning position, as Scrum Master well as JD Edwards knowledge of MS Office suite.\";\r\n // advertText = \"conditions: BS with 3-7 years of experience\";\r\n } else {\r\n advertText = getSelectedText(event);\r\n }\r\n //console.log(advertText);\r\n\r\n let focusedEduLookupAdvertText = advertText; // copies advertText for the purpose of additional ('focused') search for education at the end\r\n\r\n\r\n // *********** TEMORARILY DISABLED DUE TO STRICKTER COMPANY RULEZ INTRODUCED ON NOV 23 2020 ***************\r\n // reduces multiple consecutive new lines to only one \\n\r\n // advertText = advertText.replace(/\\n/g, function(match, offset) {\r\n // if (advertText[offset + 1] == \"\\u00a0\" || advertText[offset + 1] == \"\\n\") { // at this point method has already ecountered \"\\n\" so it checks what's at next index\r\n // return \"\"; // and if there is &nbsp; or another \\n they are replaced by an empty string (/\\u00a0/ is regex(unicode) value for &nbsp;)\r\n // }\r\n // return \"\\n\"; // if neither of previous 2 conditions were met, which means it found any other character it inserts \"\\n\"\r\n // });\r\n // *********** END OF TEMORARILY DISABLED DUE TO STRICKTER COMPANY RULEZ INTRODUCED ON NOV 23 2020 ***************\r\n\r\n\r\n //console.log(advertText);\r\n\r\n // testing values:\r\n //advertText = \"We need MS or MA for this position, as well as knowledge of MS Office suite. Also a JD Edwards is needed.\";\r\n //advertText = \" 4-5 years of financial reporting experience with a SEC registrant 6-12 years of overall financial accounting and reporting experience\";\r\n //advertText = \"Bachelor, degree in communications, business or public administration, journalism, marketing, information technology or equivalent experience. What we desire: Master of Business Administration. with a focus on Marketing Management. Previous experience developing or enhancing websites, mobile apps and social media strategies for a Master'S Degree, Master'S In Finance. consumer-facing brand. Masters Degree In Information Technology\";\r\n //advertText = \"we need 5-7 Years Experience 5-12 Years Experience 5 - 12 Years Experience 3 Years Experience 4+ Years Experience 3 + Years Experience 12-14 Years Experience 1-4 Years Experience 5 Year Experience 12 Years Experience 15+ Years Experience 13 + Years Experience One Year Ten Years Five Years Four Years Three+ Years Seven + Years Five To Seven Years A minimum of Ten + Years Five+ Years of professional Five (5) Years of experience Eight Or More Years Five Or More Years Twelve (12) Years of experience Or More Years\";\r\n advertTextEducation = camelize(advertText);\r\n if (advertTextEducation.includes(\"Juris Doctorate\")) advertTextEducation = advertTextEducation.replace(\"Doctorate\", \"\"); // to avoid Juris Doctorate being recognized by both Juris and Doctorate\r\n //console.log(advertTextEducation);\r\n\r\n advertTextExperience = advertTextEducation;\r\n\r\n // to pay attention to this since education is determined after removing these chars from text\r\n advertTextEducationArr = advertTextEducation.split(/ |\\/|-|•|,|\\.|\\n|;|:|\\(|\\)/).filter(item => item != \"\"); // filters out empty string array members that were created as a result of punctuation filtering \r\n advertTextEducation = advertTextEducationArr.join(\" \");\r\n\r\n // console.log(advertTextEducation);\r\n // console.log(advertTextEducationArr);\r\n\r\n // 1st indexes of these array members are stored and then those words are filtered out:\r\n spliceAdvertTextEducationArr(getAllIndexes(advertTextEducationArr, [\"Ms\", \"Word\", \"Access\", \"Project\", \"PowerPoint\", \"Office\", \"Windows\", \"Excel\", \"Technologies\", \"SharePoint\", \"Sql\", \"Share\"])); \r\n spliceAdvertTextEducationArr(getAllIndexes(advertTextEducationArr, [\"Jd\", \"Edwards\"]));\r\n spliceAdvertTextEducationArr(getAllIndexes(advertTextEducationArr, [\"Master\", \"Planning\"]));\r\n spliceAdvertTextEducationArr(getAllIndexes(advertTextEducationArr, [\"Master\", \"Scrum\"]));\r\n \r\n // console.log(advertTextEducationArr);\r\n \r\n determineEducation(educationKeywords, advertTextEducationArr)\r\n // console.log(uniqueEducationArr);\r\n\r\n// ************* *********** ******** ***** *** ** ** *\r\n// Focused education lookup\r\n// ************* *********** ******** ***** *** ** ** *\r\n\r\nfocusedEduLookupAdvertText = camelize(focusedEduLookupAdvertText);\r\nfocusedEduLookupAdvertText = focusedEduLookupAdvertText\r\n .replace(/,/gm, \" ,\")\r\n .replace(/\\./gm, \" .\")\r\n .replace(/\\n/gm, \" ---LINEBREAK--- \");\r\n\r\nlet focusedEduLookupAdvertTextSentences = focusedEduLookupAdvertText.split(/---LINEBREAK---|\\./gm);\r\n// console.log(focusedEduLookupAdvertTextSentences);\r\n\r\nfor (let i = 0; i < focusedEduLookupAdvertTextSentences.length; i++) {\r\n focusedEduLookupAdvertTextSentences[i] = focusedEduLookupAdvertTextSentences[i].split(\" \");\r\n recognizeSentencesWithEducation(educationKeywords, focusedEduLookupAdvertTextSentences[i]);\r\n}\r\n\r\n// console.log(\"Sentences With Education: \" + sentencesWithEducationArr);\r\n\r\nfocusedEducationLookup();\r\n\r\n// ************* *********** ******** ***** *** ** ** *\r\n// End of Focused education lookup\r\n// ************* *********** ******** ***** *** ** ** *\r\n\r\n uniqueEducationMap = finalMapping(uniqueEducationArr);\r\n //console.log(uniqueEducationMap.length);\r\n\r\n // ************************\r\n // ***** Experience ********\r\n // ************************\r\n\r\n settingFlags();\r\n experienceLookup();\r\n // console.log(experienceArr);\r\n extractingExperience();\r\n correctingExperience();\r\n // console.log(\"experienceMin final value: \" + experienceMin);\r\n // console.log(\"experience final value: \" + experience);\r\n // console.log(\"experienceMax final value: \" + experienceMax);\r\n\r\n if (experience > 0) {\r\n populateExperienceObjectArr (experience, \">= and <\");\r\n }\r\n\r\n if (experienceMax > 0 && experienceMax > experience) {\r\n populateExperienceObjectArr (experienceMax, \"> and <=\");\r\n }\r\n\r\n if (experienceMin < 99 && experienceMin < experience) {\r\n populateExperienceObjectArr (experienceMin, \">= and <\");\r\n }\r\n \r\n // experienceObjArr.forEach(item => {\r\n // // just logging\r\n // console.log(item);\r\n // console.log(item.nameString);\r\n // console.log(item.idIvy);\r\n // });\r\n \r\n experienceObjArrMap = finalMapping(experienceObjArr); // new array from adding only object with unique idIvy property: \r\n\r\n filterEducationExperience();\r\n \r\n //console.log(experienceObjArrMap);\r\n\r\n // *******************************\r\n // ***** Experience - End ********\r\n // *******************************\r\n\r\n if (cityName == undefined) {\r\n chrome.runtime.sendMessage({ setBadge: \"city\" }, function(response) {\r\n console.log(response.farewell);\r\n });\r\n } else {\r\n chrome.runtime.sendMessage({ setBadge: \"title\" }, function(response) {\r\n console.log(response.farewell);\r\n });\r\n storageSet();\r\n break;\r\n }\r\n break;\r\n } else {\r\n // if selected text is a string with <7 words which is treated as city name entry \r\n if (websiteMatch == 'Nasa') {\r\n loggerOfAutoAssignment(\"location\");\r\n cityName = document.querySelector(\"#proj_detail_table > tbody > tr:nth-child(3) > td\").firstChild.nextSibling.nextSibling.textContent.substring(3).split(\",\")[0];\r\n } else if (websiteMatch == 'UsaJobs') {\r\n loggerOfAutoAssignment(\"location\");\r\n cityName = document.querySelector(\"#locations > ul > li > a > div.usajobs-joa-locations__body > span.usajobs-joa-locations__city\").innerText.split(\",\")[0];\r\n } else if (websiteMatch == 'VencorePerspecta') {\r\n loggerOfAutoAssignment(\"location\");\r\n function contains(selector, text) { // lookup (within an iframe) for a selector containing text (selector & text are passed as funct args)\r\n let elements = document.getElementsByTagName(\"iframe\")[0].contentWindow.document.querySelectorAll(selector);\r\n return Array.prototype.filter.call(elements, function(element) {\r\n return RegExp(text).test(element.textContent);\r\n });\r\n }\r\n cityName = contains(\"dt\", \"Job Location\")[0].nextElementSibling.textContent.trim().split(\"-\")[1];\r\n } else if (websiteMatch == 'Argonne') {\r\n loggerOfAutoAssignment(\"location\");\r\n cityName = \"Lemont\"; // all jobs in this company are at the same location therefore it is hardcoded\r\n } else if (websiteMatch == 'Brookhaven') {\r\n loggerOfAutoAssignment(\"location\");\r\n cityName = \"Long Island\"; // all jobs in this company are at the same location therefore it is hardcoded\r\n } else {\r\n cityName = getSelectedText(event);\r\n // cityName = \"Boston\"; // testing value\r\n }\r\n\r\n cityName = cityName.trim();\r\n // console.log(cityName);\r\n // console.log(copyCounter);\r\n if (newLineRegexEnd.test(cityName)) {\r\n cityName = cityName.slice(0, cityName.search(newLineRegexEnd));\r\n }\r\n cityName = camelize(cityName);\r\n locationObj = locationData.find(c => c.city == cityName);\r\n if (locationObj) {\r\n if (!locationObj.country) {\r\n countryID = \"1\";\r\n country = \"USA\";\r\n usaStateID = locationObj.usaStateID;\r\n usaState = locationObj.usaState;\r\n }\r\n if (!locationObj.usaState) {\r\n usaStateID = \"53\";\r\n usaState = \"N/A\";\r\n countryID = locationObj.countryID;\r\n country = locationObj.country;\r\n }\r\n } else {\r\n // console.log(\"Location has not been found\");\r\n chrome.runtime.sendMessage({ setBadge: \"text\" }, function(response) {\r\n console.log(response.farewell);\r\n });\r\n usaState = \"\";\r\n country = \"\";\r\n }\r\n\r\n // console.log(locationObj);\r\n\r\n if (advertText == undefined) {\r\n chrome.runtime.sendMessage({ setBadge: \"text\" }, function(response) {\r\n console.log(response.farewell);\r\n });\r\n break;\r\n } else {\r\n chrome.runtime.sendMessage({ setBadge: \"title\" }, function(response) {\r\n console.log(response.farewell);\r\n });\r\n storageSet();\r\n break;\r\n }\r\n }\r\n }\r\n}", "function SafeScript(){}", "function main() {\n\n}", "function charJawSide(){ //start script\n app.beginUndoGroup(\"Create Character Jaw Rig Side\");\n\n //if(parseFloat(app.version) >= 10.5){\n var theComp = app.project.activeItem; //only selected\n\n // check if comp is selected\n if (theComp == null || !(theComp instanceof CompItem)){\n // if no comp selected, display an alert\n alert(\"Please establish a comp as the active item and run the script again.\");\n } else {\n var theLayers = theComp.selectedLayers;\n if(theLayers.length==0){\n alert(\"Please select a precomp and run the script again.\");\n }else{\n // otherwise, loop through each selected layer in the selected comp\n for (var i = 0; i < theLayers.length; i++){\n // define the layer in the loop we're currently looking at\n var curLayer = theLayers[i];\n // Select layer to add expression to\n if (curLayer.matchName == \"ADBE AV Layer\"){\n //first check if this is a footage layer\n //next check if this is a comp.\n var myLayer = theComp.selectedLayers[0];\n if(myLayer.source.numLayers==null){\n //not a comp; send alert.\n alert(\"This only works on precomp layers.\");\n }else{\n //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n //myLayer is indeed a precomp. OK to do stuff.\n var slider = myLayer.property(\"Effects\").addProperty(\"Slider Control\");\n slider.name = \"jaw side control\"\n var headNull = myLayer.source.layers.addNull();\n var upperJawNull = myLayer.source.layers.addNull();\n var lowerJawNull = myLayer.source.layers.addNull();\n headNull.name = \"head placeholder\";\n upperJawNull.name = \"upper jaw placeholder\";\n lowerJawNull.name = \"lower jaw placeholder\";\n //when asset replaces null, anchor point will be centered.\n headNull.transform.anchorPoint.setValue([50,50]);\n upperJawNull.transform.anchorPoint.setValue([50,50]);\n lowerJawNull.transform.anchorPoint.setValue([50,50]);\n headNull.property(\"Opacity\").setValue(100);\n upperJawNull.property(\"Opacity\").setValue(100);\n lowerJawNull.property(\"Opacity\").setValue(100);\n //parenting jaws to head\n upperJawNull.parent = headNull;\n lowerJawNull.parent = headNull;\n //expressions\n //headNullExprPos;\n //headNullExprRot;\n headNullExprScale = \"var x = transform.scale[0];\" + \"\\r\" +\n \"var y = transform.scale[1];\" + \"\\r\" +\n \"var s = comp(\\\"\" + theComp.name + \"\\\").layer(\\\"\" + myLayer.name + \"\\\").effect(\\\"\" + slider.name + \"\\\")(\\\"Slider\\\");\" + \"\\r\" +\n \"[x,y+(s/-4)];\";\n //headNull.property(\"Position\").expression = headNullExprPos;\n //headNull.property(\"Rotation\").expression = headNullExprRot;\n headNull.property(\"Scale\").expression = headNullExprScale;\n //--\n upperJawNullExprPos = \"var x = transform.position[0];\" + \"\\r\" +\n \"var y = transform.position[1];\" + \"\\r\" +\n \"var s = comp(\\\"\" + theComp.name + \"\\\").layer(\\\"\" + myLayer.name + \"\\\").effect(\\\"\" + slider.name + \"\\\")(\\\"Slider\\\");\" + \"\\r\" +\n \"var scaler = -0.2;\" + \"\\r\" +\n \"[x, y+(s*scaler)];\";\n upperJawNullExprRot = \"var r = transform.rotation;\" + \"\\r\" +\n \"var s = comp(\\\"\" + theComp.name + \"\\\").layer(\\\"\" + myLayer.name + \"\\\").effect(\\\"\" + slider.name + \"\\\")(\\\"Slider\\\");\" + \"\\r\" +\n \"var scaler = 0.2;\" + \"\\r\" +\n \"r+(s*scaler);\";\n //upperJawNullExprScale;\n upperJawNull.property(\"Position\").expression = upperJawNullExprPos;\n upperJawNull.property(\"Rotation\").expression = upperJawNullExprRot;\n //upperJawNull.property(\"Scale\").expression = upperJawNullExprScale;\n //--\n lowerJawNullExprPos = \"var x = transform.position[0];\" + \"\\r\" +\n \"var y = transform.position[1];\" + \"\\r\" +\n \"var s = comp(\\\"\" + theComp.name + \"\\\").layer(\\\"\" + myLayer.name + \"\\\").effect(\\\"\" + slider.name + \"\\\")(\\\"Slider\\\");\" + \"\\r\" +\n \"var scaler = 2;\" + \"\\r\" +\n \"[x, y+(s*scaler)];\";\n lowerJawNullExprRot = \"var r = transform.rotation;\" + \"\\r\" +\n \"var s = comp(\\\"\" + theComp.name + \"\\\").layer(\\\"\" + myLayer.name + \"\\\").effect(\\\"\" + slider.name + \"\\\")(\\\"Slider\\\");\" + \"\\r\" +\n \"var scaler = -1.0;\" + \"\\r\" +\n \"r+(s*scaler);\";\n //lowerJawNullExprScale; \n lowerJawNull.property(\"Position\").expression = lowerJawNullExprPos;\n lowerJawNull.property(\"Rotation\").expression = lowerJawNullExprRot;\n //lowerJawNull.property(\"Scale\").expression = lowerJawNullExprScale;\n //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n }\n }else{\n //not a footage layer; send alert.\n alert(\"This only works on precomp layers.\");\n }\n }\n }\n }\n \n app.endUndoGroup();\n} //end script", "function Void_Setup(){\r\n}", "function main() {\n if (debug) console.log(`Main ran in ${window.name}`)\n // Whenever this is ran, an unload event (i.e. when the user loads a whatIf report)\n // triggers the collection of data needed to do a query for course information.\n // This isn't a listener because getting listeners to work inside iframes is hard.\n function setupWhatIfDataListener() {\n $(getWindow('frSelection')).on(\"unload\", fetchWhatIfData)\n }\n\n // It's ran 10 times per second because again, listeners on iframes are hard.\n // This means the app would break if the user managed to get through the\n // DegreeWorks WhatIf form in a 10th of a second.\n setInterval(setupWhatIfDataListener, 100);\n console.log(window.name)\n if (window.name === \"frBody\") {\n addModal();\n }\n if (window.name === \"frLeft\") {\n let button = addButton(`DegweeWorks Planner`, getDegreeInfo, null, \"genPossible\")\n // addNumberField('Min courses/semester', 'minCourses', 4)\n // addNumberField('Max courses/semester', 'maxCourses', 4);\n }\n }", "function main()\r{\r\tif(isNeedToValidateReqDocument(capIDModel,processCode, stepNum, processID, taskStatus))\r\t{\t\r\t\tisRequiredDocument();\r\t}\r}", "function callScripts() {\n\t\"use strict\";\n\tjsReady = true;\n\tsetTotalSlides();\n\tsetPreviousSlideNumber();\n\tsetCurrentSceneNumber();\n\tsetCurrentSceneSlideNumber();\n\tsetCurrentSlideNumber();\n}", "function twpro_injectScript() {\r\n\t\tvar style = document.createElement('style'),\r\n\t\t\tcss = '.twpro_search_hide{display:none}';\r\n\t\tstyle.setAttribute('type', 'text/css');\r\n\t\tif(style.styleSheet){ // IE\r\n\t\t\tstyle.styleSheet.cssText = css;\r\n\t\t}\r\n\t\telse{\r\n\t\t\tstyle.appendChild(document.createTextNode(css));\r\n\t\t}\r\n\t\tdocument.getElementsByTagName('head')[0].appendChild(style);\r\n\t\tTWPro.enablebbcodes = true;\r\n\t\tTWPro.twpro_calculated = false;\r\n\t\tTWPro.twpro_failure = false;\r\n\t\tTWPro.twpro_failureInject = false;\r\n\t\tTWPro.twpro_failureRollback = [];\r\n\t\tTWPro.twpro_active = true;\r\n\t\tTWPro.twpro_sorts = ['name', 'erfahrung', 'lohn', 'glueck', 'comb', 'gefahr', 'laborp'];\r\n\t\tfunction getPCookie(n){var c='; '+document.cookie+';',s='; twpro_'+encodeURIComponent(n)+'=',b=c.indexOf(s),e;if(b==-1)return'';b=b+s.length;e=c.indexOf(';',b);return decodeURIComponent(c.substring(b,e))}\r\n\t\tTWPro.prefs = {\r\n\t\t\t'Hide_unjobs': 1,\r\n\t\t\t'dispJobClothingOnly': 2,\r\n\t\t\t'multipliers': getPCookie('multipliers'),\r\n\t\t\t'reportaccess': getPCookie('reportaccess')\r\n\t\t};\r\n\t\tTWPro.prefNumber = parseInt(getPCookie('prefs'), 10) || 0;\r\n\t\tTWPro.multipliers = {xp:1, wages:1, luck:1, danger:1};\r\n\t\tvar multiplier,\r\n\t\t\tsavedMultipliers = TWPro.twpro_preference('multipliers').split(':'),\r\n\t\t\tj=0;\r\n\t\tfor(var i in TWPro.multipliers){\r\n\t\t\tmultiplier = parseInt(savedMultipliers[j++], 10);\r\n\t\t\tif(!isNaN(multiplier)){\r\n\t\t\t\tTWPro.multipliers[i] = multiplier;\r\n\t\t\t}\r\n\t\t}\r\n\t\tTWPro.searchInventory = {timer:null};\r\n\t\tTWPro.twpro_jobs = [];\r\n\t\t// Jobs\r\n\t\t{\r\n\t\t\tTWPro.twpro_jobValues = {};\r\n\t\t\tTWPro.twpro_jobValues.swine = {};\r\n\t\t\tTWPro.twpro_jobValues.swine.erfahrung = 1;\r\n\t\t\tTWPro.twpro_jobValues.swine.lohn = 3;\r\n\t\t\tTWPro.twpro_jobValues.swine.glueck = 0;\r\n\t\t\tTWPro.twpro_jobValues.swine.gefahr = 1;\r\n\t\t\tTWPro.twpro_jobValues.scarecrow = {};\r\n\t\t\tTWPro.twpro_jobValues.scarecrow.erfahrung = 3;\r\n\t\t\tTWPro.twpro_jobValues.scarecrow.lohn = 1;\r\n\t\t\tTWPro.twpro_jobValues.scarecrow.glueck = 2;\r\n\t\t\tTWPro.twpro_jobValues.scarecrow.gefahr = 20;\r\n\t\t\tTWPro.twpro_jobValues.wanted = {};\r\n\t\t\tTWPro.twpro_jobValues.wanted.erfahrung = 3;\r\n\t\t\tTWPro.twpro_jobValues.wanted.lohn = 2;\r\n\t\t\tTWPro.twpro_jobValues.wanted.glueck = 0;\r\n\t\t\tTWPro.twpro_jobValues.wanted.gefahr = 10;\r\n\t\t\tTWPro.twpro_jobValues.tabacco = {};\r\n\t\t\tTWPro.twpro_jobValues.tabacco.erfahrung = 1;\r\n\t\t\tTWPro.twpro_jobValues.tabacco.lohn = 6;\r\n\t\t\tTWPro.twpro_jobValues.tabacco.glueck = 2;\r\n\t\t\tTWPro.twpro_jobValues.tabacco.gefahr = 2;\r\n\t\t\tTWPro.twpro_jobValues.cotton = {};\r\n\t\t\tTWPro.twpro_jobValues.cotton.erfahrung = 4;\r\n\t\t\tTWPro.twpro_jobValues.cotton.lohn = 1;\r\n\t\t\tTWPro.twpro_jobValues.cotton.glueck = 0;\r\n\t\t\tTWPro.twpro_jobValues.cotton.gefahr = 3;\r\n\t\t\tTWPro.twpro_jobValues.sugar = {};\r\n\t\t\tTWPro.twpro_jobValues.sugar.erfahrung = 2;\r\n\t\t\tTWPro.twpro_jobValues.sugar.lohn = 5;\r\n\t\t\tTWPro.twpro_jobValues.sugar.glueck = 4;\r\n\t\t\tTWPro.twpro_jobValues.sugar.gefahr = 1;\r\n\t\t\tTWPro.twpro_jobValues.angle = {};\r\n\t\t\tTWPro.twpro_jobValues.angle.erfahrung = 0;\r\n\t\t\tTWPro.twpro_jobValues.angle.lohn = 1;\r\n\t\t\tTWPro.twpro_jobValues.angle.glueck = 6;\r\n\t\t\tTWPro.twpro_jobValues.angle.gefahr = 2;\r\n\t\t\tTWPro.twpro_jobValues.cereal = {};\r\n\t\t\tTWPro.twpro_jobValues.cereal.erfahrung = 6;\r\n\t\t\tTWPro.twpro_jobValues.cereal.lohn = 2;\r\n\t\t\tTWPro.twpro_jobValues.cereal.glueck = 2;\r\n\t\t\tTWPro.twpro_jobValues.cereal.gefahr = 4;\r\n\t\t\tTWPro.twpro_jobValues.berry = {};\r\n\t\t\tTWPro.twpro_jobValues.berry.erfahrung = 6;\r\n\t\t\tTWPro.twpro_jobValues.berry.lohn = 2;\r\n\t\t\tTWPro.twpro_jobValues.berry.glueck = 5;\r\n\t\t\tTWPro.twpro_jobValues.berry.gefahr = 6;\r\n\t\t\tTWPro.twpro_jobValues.sheeps = {};\r\n\t\t\tTWPro.twpro_jobValues.sheeps.erfahrung = 5;\r\n\t\t\tTWPro.twpro_jobValues.sheeps.lohn = 3;\r\n\t\t\tTWPro.twpro_jobValues.sheeps.glueck = 0;\r\n\t\t\tTWPro.twpro_jobValues.sheeps.gefahr = 2;\r\n\t\t\tTWPro.twpro_jobValues.newspaper = {};\r\n\t\t\tTWPro.twpro_jobValues.newspaper.erfahrung = 1;\r\n\t\t\tTWPro.twpro_jobValues.newspaper.lohn = 6;\r\n\t\t\tTWPro.twpro_jobValues.newspaper.glueck = 2;\r\n\t\t\tTWPro.twpro_jobValues.newspaper.gefahr = 1;\r\n\t\t\tTWPro.twpro_jobValues.cut = {};\r\n\t\t\tTWPro.twpro_jobValues.cut.erfahrung = 7;\r\n\t\t\tTWPro.twpro_jobValues.cut.lohn = 5;\r\n\t\t\tTWPro.twpro_jobValues.cut.glueck = 3;\r\n\t\t\tTWPro.twpro_jobValues.cut.gefahr = 3;\r\n\t\t\tTWPro.twpro_jobValues.grinding = {};\r\n\t\t\tTWPro.twpro_jobValues.grinding.erfahrung = 7;\r\n\t\t\tTWPro.twpro_jobValues.grinding.lohn = 11;\r\n\t\t\tTWPro.twpro_jobValues.grinding.glueck = 0;\r\n\t\t\tTWPro.twpro_jobValues.grinding.gefahr = 5;\r\n\t\t\tTWPro.twpro_jobValues.corn = {};\r\n\t\t\tTWPro.twpro_jobValues.corn.erfahrung = 7;\r\n\t\t\tTWPro.twpro_jobValues.corn.lohn = 4;\r\n\t\t\tTWPro.twpro_jobValues.corn.glueck = 8;\r\n\t\t\tTWPro.twpro_jobValues.corn.gefahr = 5;\r\n\t\t\tTWPro.twpro_jobValues.beans = {};\r\n\t\t\tTWPro.twpro_jobValues.beans.erfahrung = 7;\r\n\t\t\tTWPro.twpro_jobValues.beans.lohn = 9;\r\n\t\t\tTWPro.twpro_jobValues.beans.glueck = 4;\r\n\t\t\tTWPro.twpro_jobValues.beans.gefahr = 5;\r\n\t\t\tTWPro.twpro_jobValues.fort_guard = {};\r\n\t\t\tTWPro.twpro_jobValues.fort_guard.erfahrung = 9;\r\n\t\t\tTWPro.twpro_jobValues.fort_guard.lohn = 3;\r\n\t\t\tTWPro.twpro_jobValues.fort_guard.glueck = 2;\r\n\t\t\tTWPro.twpro_jobValues.fort_guard.gefahr = 7;\r\n\t\t\tTWPro.twpro_jobValues.tanning = {};\r\n\t\t\tTWPro.twpro_jobValues.tanning.erfahrung = 15;\r\n\t\t\tTWPro.twpro_jobValues.tanning.lohn = 12;\r\n\t\t\tTWPro.twpro_jobValues.tanning.glueck = 5;\r\n\t\t\tTWPro.twpro_jobValues.tanning.gefahr = 18;\r\n\t\t\tTWPro.twpro_jobValues.digging = {};\r\n\t\t\tTWPro.twpro_jobValues.digging.erfahrung = 3;\r\n\t\t\tTWPro.twpro_jobValues.digging.lohn = 11;\r\n\t\t\tTWPro.twpro_jobValues.digging.glueck = 5;\r\n\t\t\tTWPro.twpro_jobValues.digging.gefahr = 7;\r\n\t\t\tTWPro.twpro_jobValues.grave = {};\r\n\t\t\tTWPro.twpro_jobValues.grave.erfahrung = 12;\r\n\t\t\tTWPro.twpro_jobValues.grave.lohn = 16;\r\n\t\t\tTWPro.twpro_jobValues.grave.glueck = 22;\r\n\t\t\tTWPro.twpro_jobValues.grave.gefahr = 9;\r\n\t\t\tTWPro.twpro_jobValues.turkey = {};\r\n\t\t\tTWPro.twpro_jobValues.turkey.erfahrung = 14;\r\n\t\t\tTWPro.twpro_jobValues.turkey.lohn = 3;\r\n\t\t\tTWPro.twpro_jobValues.turkey.glueck = 7;\r\n\t\t\tTWPro.twpro_jobValues.turkey.gefahr = 21;\r\n\t\t\tTWPro.twpro_jobValues.rail = {};\r\n\t\t\tTWPro.twpro_jobValues.rail.erfahrung = 18;\r\n\t\t\tTWPro.twpro_jobValues.rail.lohn = 10;\r\n\t\t\tTWPro.twpro_jobValues.rail.glueck = 5;\r\n\t\t\tTWPro.twpro_jobValues.rail.gefahr = 10;\r\n\t\t\tTWPro.twpro_jobValues.cow = {};\r\n\t\t\tTWPro.twpro_jobValues.cow.erfahrung = 17;\r\n\t\t\tTWPro.twpro_jobValues.cow.lohn = 5;\r\n\t\t\tTWPro.twpro_jobValues.cow.glueck = 0;\r\n\t\t\tTWPro.twpro_jobValues.cow.gefahr = 11;\r\n\t\t\tTWPro.twpro_jobValues.fence = {};\r\n\t\t\tTWPro.twpro_jobValues.fence.erfahrung = 11;\r\n\t\t\tTWPro.twpro_jobValues.fence.lohn = 7;\r\n\t\t\tTWPro.twpro_jobValues.fence.glueck = 5;\r\n\t\t\tTWPro.twpro_jobValues.fence.gefahr = 6;\r\n\t\t\tTWPro.twpro_jobValues.saw = {};\r\n\t\t\tTWPro.twpro_jobValues.saw.erfahrung = 12;\r\n\t\t\tTWPro.twpro_jobValues.saw.lohn = 23;\r\n\t\t\tTWPro.twpro_jobValues.saw.glueck = 6;\r\n\t\t\tTWPro.twpro_jobValues.saw.gefahr = 32;\r\n\t\t\tTWPro.twpro_jobValues.stone = {};\r\n\t\t\tTWPro.twpro_jobValues.stone.erfahrung = 8;\r\n\t\t\tTWPro.twpro_jobValues.stone.lohn = 17;\r\n\t\t\tTWPro.twpro_jobValues.stone.glueck = 9;\r\n\t\t\tTWPro.twpro_jobValues.stone.gefahr = 33;\r\n\t\t\tTWPro.twpro_jobValues.straighten = {};\r\n\t\t\tTWPro.twpro_jobValues.straighten.erfahrung = 22;\r\n\t\t\tTWPro.twpro_jobValues.straighten.lohn = 8;\r\n\t\t\tTWPro.twpro_jobValues.straighten.glueck = 15;\r\n\t\t\tTWPro.twpro_jobValues.straighten.gefahr = 12;\r\n\t\t\tTWPro.twpro_jobValues.wood = {};\r\n\t\t\tTWPro.twpro_jobValues.wood.erfahrung = 5;\r\n\t\t\tTWPro.twpro_jobValues.wood.lohn = 18;\r\n\t\t\tTWPro.twpro_jobValues.wood.glueck = 2;\r\n\t\t\tTWPro.twpro_jobValues.wood.gefahr = 21;\r\n\t\t\tTWPro.twpro_jobValues.irrigation = {};\r\n\t\t\tTWPro.twpro_jobValues.irrigation.erfahrung = 13;\r\n\t\t\tTWPro.twpro_jobValues.irrigation.lohn = 7;\r\n\t\t\tTWPro.twpro_jobValues.irrigation.glueck = 15;\r\n\t\t\tTWPro.twpro_jobValues.irrigation.gefahr = 6;\r\n\t\t\tTWPro.twpro_jobValues.brand = {};\r\n\t\t\tTWPro.twpro_jobValues.brand.erfahrung = 25;\r\n\t\t\tTWPro.twpro_jobValues.brand.lohn = 8;\r\n\t\t\tTWPro.twpro_jobValues.brand.glueck = 0;\r\n\t\t\tTWPro.twpro_jobValues.brand.gefahr = 35;\r\n\t\t\tTWPro.twpro_jobValues.wire = {};\r\n\t\t\tTWPro.twpro_jobValues.wire.erfahrung = 13;\r\n\t\t\tTWPro.twpro_jobValues.wire.lohn = 17;\r\n\t\t\tTWPro.twpro_jobValues.wire.glueck = 6;\r\n\t\t\tTWPro.twpro_jobValues.wire.gefahr = 0;\r\n\t\t\tTWPro.twpro_jobValues.dam = {};\r\n\t\t\tTWPro.twpro_jobValues.dam.erfahrung = 18;\r\n\t\t\tTWPro.twpro_jobValues.dam.lohn = 4;\r\n\t\t\tTWPro.twpro_jobValues.dam.glueck = 9;\r\n\t\t\tTWPro.twpro_jobValues.dam.gefahr = 41;\r\n\t\t\tTWPro.twpro_jobValues.gems = {};\r\n\t\t\tTWPro.twpro_jobValues.gems.erfahrung = 7;\r\n\t\t\tTWPro.twpro_jobValues.gems.lohn = 25;\r\n\t\t\tTWPro.twpro_jobValues.gems.glueck = 8;\r\n\t\t\tTWPro.twpro_jobValues.gems.gefahr = 4;\r\n\t\t\tTWPro.twpro_jobValues.claim = {};\r\n\t\t\tTWPro.twpro_jobValues.claim.erfahrung = 4;\r\n\t\t\tTWPro.twpro_jobValues.claim.lohn = 31;\r\n\t\t\tTWPro.twpro_jobValues.claim.glueck = 4;\r\n\t\t\tTWPro.twpro_jobValues.claim.gefahr = 29;\r\n\t\t\tTWPro.twpro_jobValues.chuck_wagon = {};\r\n\t\t\tTWPro.twpro_jobValues.chuck_wagon.erfahrung = 23;\r\n\t\t\tTWPro.twpro_jobValues.chuck_wagon.lohn = 5;\r\n\t\t\tTWPro.twpro_jobValues.chuck_wagon.glueck = 42;\r\n\t\t\tTWPro.twpro_jobValues.chuck_wagon.gefahr = 11;\r\n\t\t\tTWPro.twpro_jobValues.break_in = {};\r\n\t\t\tTWPro.twpro_jobValues.break_in.erfahrung = 32;\r\n\t\t\tTWPro.twpro_jobValues.break_in.lohn = 13;\r\n\t\t\tTWPro.twpro_jobValues.break_in.glueck = 10;\r\n\t\t\tTWPro.twpro_jobValues.break_in.gefahr = 52;\r\n\t\t\tTWPro.twpro_jobValues.trade = {};\r\n\t\t\tTWPro.twpro_jobValues.trade.erfahrung = 3;\r\n\t\t\tTWPro.twpro_jobValues.trade.lohn = 15;\r\n\t\t\tTWPro.twpro_jobValues.trade.glueck = 25;\r\n\t\t\tTWPro.twpro_jobValues.trade.gefahr = 12;\r\n\t\t\tTWPro.twpro_jobValues.mast = {};\r\n\t\t\tTWPro.twpro_jobValues.mast.erfahrung = 25;\r\n\t\t\tTWPro.twpro_jobValues.mast.lohn = 21;\r\n\t\t\tTWPro.twpro_jobValues.mast.glueck = 3;\r\n\t\t\tTWPro.twpro_jobValues.mast.gefahr = 14;\r\n\t\t\tTWPro.twpro_jobValues.spring = {};\r\n\t\t\tTWPro.twpro_jobValues.spring.erfahrung = 33;\r\n\t\t\tTWPro.twpro_jobValues.spring.lohn = 9;\r\n\t\t\tTWPro.twpro_jobValues.spring.glueck = 23;\r\n\t\t\tTWPro.twpro_jobValues.spring.gefahr = 19;\r\n\t\t\tTWPro.twpro_jobValues.beaver = {};\r\n\t\t\tTWPro.twpro_jobValues.beaver.erfahrung = 17;\r\n\t\t\tTWPro.twpro_jobValues.beaver.lohn = 32;\r\n\t\t\tTWPro.twpro_jobValues.beaver.glueck = 6;\r\n\t\t\tTWPro.twpro_jobValues.beaver.gefahr = 21;\r\n\t\t\tTWPro.twpro_jobValues.coal = {};\r\n\t\t\tTWPro.twpro_jobValues.coal.erfahrung = 14;\r\n\t\t\tTWPro.twpro_jobValues.coal.lohn = 30;\r\n\t\t\tTWPro.twpro_jobValues.coal.glueck = 0;\r\n\t\t\tTWPro.twpro_jobValues.coal.gefahr = 13;\r\n\t\t\tTWPro.twpro_jobValues.print = {};\r\n\t\t\tTWPro.twpro_jobValues.print.erfahrung = 20;\r\n\t\t\tTWPro.twpro_jobValues.print.lohn = 30;\r\n\t\t\tTWPro.twpro_jobValues.print.glueck = 5;\r\n\t\t\tTWPro.twpro_jobValues.print.gefahr = 7;\r\n\t\t\tTWPro.twpro_jobValues.fishing = {};\r\n\t\t\tTWPro.twpro_jobValues.fishing.erfahrung = 23;\r\n\t\t\tTWPro.twpro_jobValues.fishing.lohn = 6;\r\n\t\t\tTWPro.twpro_jobValues.fishing.glueck = 23;\r\n\t\t\tTWPro.twpro_jobValues.fishing.gefahr = 38;\r\n\t\t\tTWPro.twpro_jobValues.trainstation = {};\r\n\t\t\tTWPro.twpro_jobValues.trainstation.erfahrung = 47;\r\n\t\t\tTWPro.twpro_jobValues.trainstation.lohn = 12;\r\n\t\t\tTWPro.twpro_jobValues.trainstation.glueck = 7;\r\n\t\t\tTWPro.twpro_jobValues.trainstation.gefahr = 15;\r\n\t\t\tTWPro.twpro_jobValues.windmeel = {};\r\n\t\t\tTWPro.twpro_jobValues.windmeel.erfahrung = 43;\r\n\t\t\tTWPro.twpro_jobValues.windmeel.lohn = 42;\r\n\t\t\tTWPro.twpro_jobValues.windmeel.glueck = 6;\r\n\t\t\tTWPro.twpro_jobValues.windmeel.gefahr = 18;\r\n\t\t\tTWPro.twpro_jobValues.explore = {};\r\n\t\t\tTWPro.twpro_jobValues.explore.erfahrung = 45;\r\n\t\t\tTWPro.twpro_jobValues.explore.lohn = 1;\r\n\t\t\tTWPro.twpro_jobValues.explore.glueck = 22;\r\n\t\t\tTWPro.twpro_jobValues.explore.gefahr = 37;\r\n\t\t\tTWPro.twpro_jobValues.float = {};\r\n\t\t\tTWPro.twpro_jobValues.float.erfahrung = 45;\r\n\t\t\tTWPro.twpro_jobValues.float.lohn = 23;\r\n\t\t\tTWPro.twpro_jobValues.float.glueck = 0;\r\n\t\t\tTWPro.twpro_jobValues.float.gefahr = 52;\r\n\t\t\tTWPro.twpro_jobValues.bridge = {};\r\n\t\t\tTWPro.twpro_jobValues.bridge.erfahrung = 33;\r\n\t\t\tTWPro.twpro_jobValues.bridge.lohn = 17;\r\n\t\t\tTWPro.twpro_jobValues.bridge.glueck = 18;\r\n\t\t\tTWPro.twpro_jobValues.bridge.gefahr = 53;\r\n\t\t\tTWPro.twpro_jobValues.springe = {};\r\n\t\t\tTWPro.twpro_jobValues.springe.erfahrung = 45;\r\n\t\t\tTWPro.twpro_jobValues.springe.lohn = 29;\r\n\t\t\tTWPro.twpro_jobValues.springe.glueck = 0;\r\n\t\t\tTWPro.twpro_jobValues.springe.gefahr = 42;\r\n\t\t\tTWPro.twpro_jobValues.coffin = {};\r\n\t\t\tTWPro.twpro_jobValues.coffin.erfahrung = 8;\r\n\t\t\tTWPro.twpro_jobValues.coffin.lohn = 42;\r\n\t\t\tTWPro.twpro_jobValues.coffin.glueck = 15;\r\n\t\t\tTWPro.twpro_jobValues.coffin.gefahr = 20;\r\n\t\t\tTWPro.twpro_jobValues.dynamite = {};\r\n\t\t\tTWPro.twpro_jobValues.dynamite.erfahrung = 12;\r\n\t\t\tTWPro.twpro_jobValues.dynamite.lohn = 23;\r\n\t\t\tTWPro.twpro_jobValues.dynamite.glueck = 64;\r\n\t\t\tTWPro.twpro_jobValues.dynamite.gefahr = 93;\r\n\t\t\tTWPro.twpro_jobValues.coyote = {};\r\n\t\t\tTWPro.twpro_jobValues.coyote.erfahrung = 43;\r\n\t\t\tTWPro.twpro_jobValues.coyote.lohn = 15;\r\n\t\t\tTWPro.twpro_jobValues.coyote.glueck = 26;\r\n\t\t\tTWPro.twpro_jobValues.coyote.gefahr = 45;\r\n\t\t\tTWPro.twpro_jobValues.buffalo = {};\r\n\t\t\tTWPro.twpro_jobValues.buffalo.erfahrung = 62;\r\n\t\t\tTWPro.twpro_jobValues.buffalo.lohn = 24;\r\n\t\t\tTWPro.twpro_jobValues.buffalo.glueck = 0;\r\n\t\t\tTWPro.twpro_jobValues.buffalo.gefahr = 72;\r\n\t\t\tTWPro.twpro_jobValues.fort = {};\r\n\t\t\tTWPro.twpro_jobValues.fort.erfahrung = 71;\r\n\t\t\tTWPro.twpro_jobValues.fort.lohn = 33;\r\n\t\t\tTWPro.twpro_jobValues.fort.glueck = 17;\r\n\t\t\tTWPro.twpro_jobValues.fort.gefahr = 35;\r\n\t\t\tTWPro.twpro_jobValues.indians = {};\r\n\t\t\tTWPro.twpro_jobValues.indians.erfahrung = 14;\r\n\t\t\tTWPro.twpro_jobValues.indians.lohn = 11;\r\n\t\t\tTWPro.twpro_jobValues.indians.glueck = 63;\r\n\t\t\tTWPro.twpro_jobValues.indians.gefahr = 34;\r\n\t\t\tTWPro.twpro_jobValues.clearing = {};\r\n\t\t\tTWPro.twpro_jobValues.clearing.erfahrung = 8;\r\n\t\t\tTWPro.twpro_jobValues.clearing.lohn = 62;\r\n\t\t\tTWPro.twpro_jobValues.clearing.glueck = 9;\r\n\t\t\tTWPro.twpro_jobValues.clearing.gefahr = 16;\r\n\t\t\tTWPro.twpro_jobValues.silver = {};\r\n\t\t\tTWPro.twpro_jobValues.silver.erfahrung = 8;\r\n\t\t\tTWPro.twpro_jobValues.silver.lohn = 76;\r\n\t\t\tTWPro.twpro_jobValues.silver.glueck = 0;\r\n\t\t\tTWPro.twpro_jobValues.silver.gefahr = 32;\r\n\t\t\tTWPro.twpro_jobValues.diligence_guard = {};\r\n\t\t\tTWPro.twpro_jobValues.diligence_guard.erfahrung = 77;\r\n\t\t\tTWPro.twpro_jobValues.diligence_guard.lohn = 34;\r\n\t\t\tTWPro.twpro_jobValues.diligence_guard.glueck = 45;\r\n\t\t\tTWPro.twpro_jobValues.diligence_guard.gefahr = 43;\r\n\t\t\tTWPro.twpro_jobValues.wolf = {};\r\n\t\t\tTWPro.twpro_jobValues.wolf.erfahrung = 63;\r\n\t\t\tTWPro.twpro_jobValues.wolf.lohn = 21;\r\n\t\t\tTWPro.twpro_jobValues.wolf.glueck = 15;\r\n\t\t\tTWPro.twpro_jobValues.wolf.gefahr = 67;\r\n\t\t\tTWPro.twpro_jobValues.track = {};\r\n\t\t\tTWPro.twpro_jobValues.track.erfahrung = 60;\r\n\t\t\tTWPro.twpro_jobValues.track.lohn = 10;\r\n\t\t\tTWPro.twpro_jobValues.track.glueck = 30;\r\n\t\t\tTWPro.twpro_jobValues.track.gefahr = 33;\r\n\t\t\tTWPro.twpro_jobValues.ox = {};\r\n\t\t\tTWPro.twpro_jobValues.ox.erfahrung = 34;\r\n\t\t\tTWPro.twpro_jobValues.ox.lohn = 64;\r\n\t\t\tTWPro.twpro_jobValues.ox.glueck = 18;\r\n\t\t\tTWPro.twpro_jobValues.ox.gefahr = 43;\r\n\t\t\tTWPro.twpro_jobValues.guard = {};\r\n\t\t\tTWPro.twpro_jobValues.guard.erfahrung = 35;\r\n\t\t\tTWPro.twpro_jobValues.guard.lohn = 25;\r\n\t\t\tTWPro.twpro_jobValues.guard.glueck = 38;\r\n\t\t\tTWPro.twpro_jobValues.guard.gefahr = 4;\r\n\t\t\tTWPro.twpro_jobValues.bible = {};\r\n\t\t\tTWPro.twpro_jobValues.bible.erfahrung = 61;\r\n\t\t\tTWPro.twpro_jobValues.bible.lohn = 5;\r\n\t\t\tTWPro.twpro_jobValues.bible.glueck = 52;\r\n\t\t\tTWPro.twpro_jobValues.bible.gefahr = 77;\r\n\t\t\tTWPro.twpro_jobValues.ponyexpress = {};\r\n\t\t\tTWPro.twpro_jobValues.ponyexpress.erfahrung = 48;\r\n\t\t\tTWPro.twpro_jobValues.ponyexpress.lohn = 15;\r\n\t\t\tTWPro.twpro_jobValues.ponyexpress.glueck = 51;\r\n\t\t\tTWPro.twpro_jobValues.ponyexpress.gefahr = 44;\r\n\t\t\tTWPro.twpro_jobValues.weapons = {};\r\n\t\t\tTWPro.twpro_jobValues.weapons.erfahrung = 35;\r\n\t\t\tTWPro.twpro_jobValues.weapons.lohn = 15;\r\n\t\t\tTWPro.twpro_jobValues.weapons.glueck = 72;\r\n\t\t\tTWPro.twpro_jobValues.weapons.gefahr = 82;\r\n\t\t\tTWPro.twpro_jobValues.dead = {};\r\n\t\t\tTWPro.twpro_jobValues.dead.erfahrung = 14;\r\n\t\t\tTWPro.twpro_jobValues.dead.lohn = 14;\r\n\t\t\tTWPro.twpro_jobValues.dead.glueck = 90;\r\n\t\t\tTWPro.twpro_jobValues.dead.gefahr = 34;\r\n\t\t\tTWPro.twpro_jobValues.grizzly = {};\r\n\t\t\tTWPro.twpro_jobValues.grizzly.erfahrung = 78;\r\n\t\t\tTWPro.twpro_jobValues.grizzly.lohn = 25;\r\n\t\t\tTWPro.twpro_jobValues.grizzly.glueck = 35;\r\n\t\t\tTWPro.twpro_jobValues.grizzly.gefahr = 71;\r\n\t\t\tTWPro.twpro_jobValues.oil = {};\r\n\t\t\tTWPro.twpro_jobValues.oil.erfahrung = 25;\r\n\t\t\tTWPro.twpro_jobValues.oil.lohn = 83;\r\n\t\t\tTWPro.twpro_jobValues.oil.glueck = 20;\r\n\t\t\tTWPro.twpro_jobValues.oil.gefahr = 7;\r\n\t\t\tTWPro.twpro_jobValues.treasure_hunting = {};\r\n\t\t\tTWPro.twpro_jobValues.treasure_hunting.erfahrung = 20;\r\n\t\t\tTWPro.twpro_jobValues.treasure_hunting.lohn = 20;\r\n\t\t\tTWPro.twpro_jobValues.treasure_hunting.glueck = 83;\r\n\t\t\tTWPro.twpro_jobValues.treasure_hunting.gefahr = 24;\r\n\t\t\tTWPro.twpro_jobValues.army = {};\r\n\t\t\tTWPro.twpro_jobValues.army.erfahrung = 76;\r\n\t\t\tTWPro.twpro_jobValues.army.lohn = 55;\r\n\t\t\tTWPro.twpro_jobValues.army.glueck = 17;\r\n\t\t\tTWPro.twpro_jobValues.army.gefahr = 35;\r\n\t\t\tTWPro.twpro_jobValues.steal = {};\r\n\t\t\tTWPro.twpro_jobValues.steal.erfahrung = 50;\r\n\t\t\tTWPro.twpro_jobValues.steal.lohn = 48;\r\n\t\t\tTWPro.twpro_jobValues.steal.glueck = 74;\r\n\t\t\tTWPro.twpro_jobValues.steal.gefahr = 66;\r\n\t\t\tTWPro.twpro_jobValues.mercenary = {};\r\n\t\t\tTWPro.twpro_jobValues.mercenary.erfahrung = 52;\r\n\t\t\tTWPro.twpro_jobValues.mercenary.lohn = 92;\r\n\t\t\tTWPro.twpro_jobValues.mercenary.glueck = 23;\r\n\t\t\tTWPro.twpro_jobValues.mercenary.gefahr = 65;\r\n\t\t\tTWPro.twpro_jobValues.bandits = {};\r\n\t\t\tTWPro.twpro_jobValues.bandits.erfahrung = 75;\r\n\t\t\tTWPro.twpro_jobValues.bandits.lohn = 28;\r\n\t\t\tTWPro.twpro_jobValues.bandits.glueck = 85;\r\n\t\t\tTWPro.twpro_jobValues.bandits.gefahr = 83;\r\n\t\t\tTWPro.twpro_jobValues.aggression = {};\r\n\t\t\tTWPro.twpro_jobValues.aggression.erfahrung = 27;\r\n\t\t\tTWPro.twpro_jobValues.aggression.lohn = 78;\r\n\t\t\tTWPro.twpro_jobValues.aggression.glueck = 78;\r\n\t\t\tTWPro.twpro_jobValues.aggression.gefahr = 86;\r\n\t\t\tTWPro.twpro_jobValues.diligence_aggression = {};\r\n\t\t\tTWPro.twpro_jobValues.diligence_aggression.erfahrung = 73;\r\n\t\t\tTWPro.twpro_jobValues.diligence_aggression.lohn = 43;\r\n\t\t\tTWPro.twpro_jobValues.diligence_aggression.glueck = 95;\r\n\t\t\tTWPro.twpro_jobValues.diligence_aggression.gefahr = 67;\r\n\t\t\tTWPro.twpro_jobValues.bounty = {};\r\n\t\t\tTWPro.twpro_jobValues.bounty.erfahrung = 32;\r\n\t\t\tTWPro.twpro_jobValues.bounty.lohn = 92;\r\n\t\t\tTWPro.twpro_jobValues.bounty.glueck = 79;\r\n\t\t\tTWPro.twpro_jobValues.bounty.gefahr = 72;\r\n\t\t\tTWPro.twpro_jobValues.captured = {};\r\n\t\t\tTWPro.twpro_jobValues.captured.erfahrung = 69;\r\n\t\t\tTWPro.twpro_jobValues.captured.lohn = 23;\r\n\t\t\tTWPro.twpro_jobValues.captured.glueck = 85;\r\n\t\t\tTWPro.twpro_jobValues.captured.gefahr = 44;\r\n\t\t\tTWPro.twpro_jobValues.train = {};\r\n\t\t\tTWPro.twpro_jobValues.train.erfahrung = 87;\r\n\t\t\tTWPro.twpro_jobValues.train.lohn = 67;\r\n\t\t\tTWPro.twpro_jobValues.train.glueck = 92;\r\n\t\t\tTWPro.twpro_jobValues.train.gefahr = 96;\r\n\t\t\tTWPro.twpro_jobValues.burglary = {};\r\n\t\t\tTWPro.twpro_jobValues.burglary.erfahrung = 34;\r\n\t\t\tTWPro.twpro_jobValues.burglary.lohn = 80;\r\n\t\t\tTWPro.twpro_jobValues.burglary.glueck = 81;\r\n\t\t\tTWPro.twpro_jobValues.burglary.gefahr = 26;\r\n\t\t\tTWPro.twpro_jobValues.quackery = {};\r\n\t\t\tTWPro.twpro_jobValues.quackery.erfahrung = 50;\r\n\t\t\tTWPro.twpro_jobValues.quackery.lohn = 65;\r\n\t\t\tTWPro.twpro_jobValues.quackery.glueck = 52;\r\n\t\t\tTWPro.twpro_jobValues.quackery.gefahr = 67;\r\n\t\t\tTWPro.twpro_jobValues.peace = {};\r\n\t\t\tTWPro.twpro_jobValues.peace.erfahrung = 68;\r\n\t\t\tTWPro.twpro_jobValues.peace.lohn = 33;\r\n\t\t\tTWPro.twpro_jobValues.peace.glueck = 76;\r\n\t\t\tTWPro.twpro_jobValues.peace.gefahr = 44;\r\n\t\t\tTWPro.twpro_jobValues.ship = {};\r\n\t\t\tTWPro.twpro_jobValues.ship.erfahrung = 35;\r\n\t\t\tTWPro.twpro_jobValues.ship.lohn = 82;\r\n\t\t\tTWPro.twpro_jobValues.ship.glueck = 15;\r\n\t\t\tTWPro.twpro_jobValues.ship.gefahr = 14;\r\n\t\t\tTWPro.twpro_jobValues.smuggle = {};\r\n\t\t\tTWPro.twpro_jobValues.smuggle.erfahrung = 45;\r\n\t\t\tTWPro.twpro_jobValues.smuggle.lohn = 62;\r\n\t\t\tTWPro.twpro_jobValues.smuggle.glueck = 83;\r\n\t\t\tTWPro.twpro_jobValues.smuggle.gefahr = 56;\r\n\t\t\tTWPro.twpro_jobValues.ranch = {};\r\n\t\t\tTWPro.twpro_jobValues.ranch.erfahrung = 61;\r\n\t\t\tTWPro.twpro_jobValues.ranch.lohn = 28;\r\n\t\t\tTWPro.twpro_jobValues.ranch.glueck = 17;\r\n\t\t\tTWPro.twpro_jobValues.ranch.gefahr = 24;\r\n\t\t\tTWPro.twpro_jobValues.iron = {};\r\n\t\t\tTWPro.twpro_jobValues.iron.erfahrung = 32;\r\n\t\t\tTWPro.twpro_jobValues.iron.lohn = 52;\r\n\t\t\tTWPro.twpro_jobValues.iron.glueck = 15;\r\n\t\t\tTWPro.twpro_jobValues.iron.gefahr = 29;\r\n\t\t\tTWPro.twpro_jobValues.agave = {};\r\n\t\t\tTWPro.twpro_jobValues.agave.erfahrung = 42;\r\n\t\t\tTWPro.twpro_jobValues.agave.lohn = 25;\r\n\t\t\tTWPro.twpro_jobValues.agave.glueck = 12;\r\n\t\t\tTWPro.twpro_jobValues.agave.gefahr = 27;\r\n\t\t\tTWPro.twpro_jobValues.tomato = {};\r\n\t\t\tTWPro.twpro_jobValues.tomato.erfahrung = 12;\r\n\t\t\tTWPro.twpro_jobValues.tomato.lohn = 13;\r\n\t\t\tTWPro.twpro_jobValues.tomato.glueck = 7;\r\n\t\t\tTWPro.twpro_jobValues.tomato.gefahr = 11;\r\n\t\t\tTWPro.twpro_jobValues.horseshoe = {};\r\n\t\t\tTWPro.twpro_jobValues.horseshoe.erfahrung = 28;\r\n\t\t\tTWPro.twpro_jobValues.horseshoe.lohn = 14;\r\n\t\t\tTWPro.twpro_jobValues.horseshoe.glueck = 9;\r\n\t\t\tTWPro.twpro_jobValues.horseshoe.gefahr = 23;\r\n\t\t\tTWPro.twpro_jobValues.fire = {};\r\n\t\t\tTWPro.twpro_jobValues.fire.erfahrung = 41;\r\n\t\t\tTWPro.twpro_jobValues.fire.lohn = 15;\r\n\t\t\tTWPro.twpro_jobValues.fire.glueck = 65;\r\n\t\t\tTWPro.twpro_jobValues.fire.gefahr = 45;\r\n\t\t\tTWPro.twpro_jobValues.orange = {};\r\n\t\t\tTWPro.twpro_jobValues.orange.erfahrung = 25;\r\n\t\t\tTWPro.twpro_jobValues.orange.lohn = 14;\r\n\t\t\tTWPro.twpro_jobValues.orange.glueck = 10;\r\n\t\t\tTWPro.twpro_jobValues.orange.gefahr = 21;\r\n\t\t\tTWPro.twpro_jobValues.muck_out = {};\r\n\t\t\tTWPro.twpro_jobValues.muck_out.erfahrung = 5;\r\n\t\t\tTWPro.twpro_jobValues.muck_out.lohn = 4;\r\n\t\t\tTWPro.twpro_jobValues.muck_out.glueck = 2;\r\n\t\t\tTWPro.twpro_jobValues.muck_out.gefahr = 6;\r\n\t\t\tTWPro.twpro_jobValues.shoes = {};\r\n\t\t\tTWPro.twpro_jobValues.shoes.erfahrung = 2;\r\n\t\t\tTWPro.twpro_jobValues.shoes.lohn = 3;\r\n\t\t\tTWPro.twpro_jobValues.shoes.glueck = 3;\r\n\t\t\tTWPro.twpro_jobValues.shoes.gefahr = 2;\r\n\t\t\tTWPro.twpro_jobValues.socks_darn = {};\r\n\t\t\tTWPro.twpro_jobValues.socks_darn.erfahrung = 4;\r\n\t\t\tTWPro.twpro_jobValues.socks_darn.lohn = 1;\r\n\t\t\tTWPro.twpro_jobValues.socks_darn.glueck = 0;\r\n\t\t\tTWPro.twpro_jobValues.socks_darn.gefahr = 0;\r\n\t\t\tTWPro.twpro_jobValues.potatoe = {};\r\n\t\t\tTWPro.twpro_jobValues.potatoe.erfahrung = 53;\r\n\t\t\tTWPro.twpro_jobValues.potatoe.lohn = 8;\r\n\t\t\tTWPro.twpro_jobValues.potatoe.glueck = 5;\r\n\t\t\tTWPro.twpro_jobValues.potatoe.gefahr = 5;\r\n\t\t\tTWPro.twpro_jobValues.feed_animal = {};\r\n\t\t\tTWPro.twpro_jobValues.feed_animal.erfahrung = 60;\r\n\t\t\tTWPro.twpro_jobValues.feed_animal.lohn = 17;\r\n\t\t\tTWPro.twpro_jobValues.feed_animal.glueck = 10;\r\n\t\t\tTWPro.twpro_jobValues.feed_animal.gefahr = 20;\r\n\t\t\tTWPro.twpro_jobValues.pumpkin = {};\r\n\t\t\tTWPro.twpro_jobValues.pumpkin.erfahrung = 45;\r\n\t\t\tTWPro.twpro_jobValues.pumpkin.lohn = 45;\r\n\t\t\tTWPro.twpro_jobValues.pumpkin.glueck = 10;\r\n\t\t\tTWPro.twpro_jobValues.pumpkin.gefahr = 10;\r\n\t\t\tTWPro.twpro_jobValues.blueberries = {};\r\n\t\t\tTWPro.twpro_jobValues.blueberries.erfahrung = 35;\r\n\t\t\tTWPro.twpro_jobValues.blueberries.lohn = 52;\r\n\t\t\tTWPro.twpro_jobValues.blueberries.glueck = 35;\r\n\t\t\tTWPro.twpro_jobValues.blueberries.gefahr = 15;\r\n\t\t\tTWPro.twpro_jobValues.plant_trees = {};\r\n\t\t\tTWPro.twpro_jobValues.plant_trees.erfahrung = 25;\r\n\t\t\tTWPro.twpro_jobValues.plant_trees.lohn = 34;\r\n\t\t\tTWPro.twpro_jobValues.plant_trees.glueck = 54;\r\n\t\t\tTWPro.twpro_jobValues.plant_trees.gefahr = 25;\r\n\t\t\tTWPro.twpro_jobValues.gather_feathers = {};\r\n\t\t\tTWPro.twpro_jobValues.gather_feathers.erfahrung = 23;\r\n\t\t\tTWPro.twpro_jobValues.gather_feathers.lohn = 47;\r\n\t\t\tTWPro.twpro_jobValues.gather_feathers.glueck = 60;\r\n\t\t\tTWPro.twpro_jobValues.gather_feathers.gefahr = 15;\r\n\t\t\tTWPro.twpro_jobValues.lotus_gathering = {};\r\n\t\t\tTWPro.twpro_jobValues.lotus_gathering.erfahrung = 45;\r\n\t\t\tTWPro.twpro_jobValues.lotus_gathering.lohn = 54;\r\n\t\t\tTWPro.twpro_jobValues.lotus_gathering.glueck = 35;\r\n\t\t\tTWPro.twpro_jobValues.lotus_gathering.gefahr = 20;\r\n\t\t\tTWPro.twpro_jobValues.crab_hunting = {};\r\n\t\t\tTWPro.twpro_jobValues.crab_hunting.erfahrung = 56;\r\n\t\t\tTWPro.twpro_jobValues.crab_hunting.lohn = 67;\r\n\t\t\tTWPro.twpro_jobValues.crab_hunting.glueck = 35;\r\n\t\t\tTWPro.twpro_jobValues.crab_hunting.gefahr = 12;\r\n\t\t\tTWPro.twpro_jobValues.teaching = {};\r\n\t\t\tTWPro.twpro_jobValues.teaching.erfahrung = 79;\r\n\t\t\tTWPro.twpro_jobValues.teaching.lohn = 54;\r\n\t\t\tTWPro.twpro_jobValues.teaching.glueck = 5;\r\n\t\t\tTWPro.twpro_jobValues.teaching.gefahr = 23;\r\n\t\t\tTWPro.twpro_jobValues.sheriff_work = {};\r\n\t\t\tTWPro.twpro_jobValues.sheriff_work.erfahrung = 76;\r\n\t\t\tTWPro.twpro_jobValues.sheriff_work.lohn = 67;\r\n\t\t\tTWPro.twpro_jobValues.sheriff_work.glueck = 56;\r\n\t\t\tTWPro.twpro_jobValues.sheriff_work.gefahr = 45;\r\n\t\t\tTWPro.twpro_jobValues.sulfur_gathering = {};\r\n\t\t\tTWPro.twpro_jobValues.sulfur_gathering.erfahrung = 34;\r\n\t\t\tTWPro.twpro_jobValues.sulfur_gathering.lohn = 76;\r\n\t\t\tTWPro.twpro_jobValues.sulfur_gathering.glueck = 78;\r\n\t\t\tTWPro.twpro_jobValues.sulfur_gathering.gefahr = 32;\r\n\t\t\tTWPro.twpro_jobValues.wildwater = {};\r\n\t\t\tTWPro.twpro_jobValues.wildwater.erfahrung = 74;\r\n\t\t\tTWPro.twpro_jobValues.wildwater.lohn = 84;\r\n\t\t\tTWPro.twpro_jobValues.wildwater.glueck = 30;\r\n\t\t\tTWPro.twpro_jobValues.wildwater.gefahr = 57;\r\n\t\t\tTWPro.twpro_jobValues.gambler = {};\r\n\t\t\tTWPro.twpro_jobValues.gambler.erfahrung = 57;\r\n\t\t\tTWPro.twpro_jobValues.gambler.lohn = 67;\r\n\t\t\tTWPro.twpro_jobValues.gambler.glueck = 69;\r\n\t\t\tTWPro.twpro_jobValues.gambler.gefahr = 63;\r\n\t\t\tTWPro.twpro_jobValues.rattlesnake = {};\r\n\t\t\tTWPro.twpro_jobValues.rattlesnake.erfahrung = 46;\r\n\t\t\tTWPro.twpro_jobValues.rattlesnake.lohn = 72;\r\n\t\t\tTWPro.twpro_jobValues.rattlesnake.glueck = 71;\r\n\t\t\tTWPro.twpro_jobValues.rattlesnake.gefahr = 73;\r\n\t\t\tTWPro.twpro_jobValues.salpeter_gathering = {};\r\n\t\t\tTWPro.twpro_jobValues.salpeter_gathering.erfahrung = 53;\r\n\t\t\tTWPro.twpro_jobValues.salpeter_gathering.lohn = 62;\r\n\t\t\tTWPro.twpro_jobValues.salpeter_gathering.glueck = 58;\r\n\t\t\tTWPro.twpro_jobValues.salpeter_gathering.gefahr = 27;\r\n\t\t\tTWPro.twpro_jobValues.horse_transport = {};\r\n\t\t\tTWPro.twpro_jobValues.horse_transport.erfahrung = 82;\r\n\t\t\tTWPro.twpro_jobValues.horse_transport.lohn = 66;\r\n\t\t\tTWPro.twpro_jobValues.horse_transport.glueck = 69;\r\n\t\t\tTWPro.twpro_jobValues.horse_transport.gefahr = 48;\r\n\t\t\tTWPro.twpro_jobValues.rodeo = {};\r\n\t\t\tTWPro.twpro_jobValues.rodeo.erfahrung = 56;\r\n\t\t\tTWPro.twpro_jobValues.rodeo.lohn = 76;\r\n\t\t\tTWPro.twpro_jobValues.rodeo.glueck = 69;\r\n\t\t\tTWPro.twpro_jobValues.rodeo.gefahr = 78;\r\n\t\t\tTWPro.twpro_jobValues.travelling_salesman = {};\r\n\t\t\tTWPro.twpro_jobValues.travelling_salesman.erfahrung = 46;\r\n\t\t\tTWPro.twpro_jobValues.travelling_salesman.lohn = 59;\r\n\t\t\tTWPro.twpro_jobValues.travelling_salesman.glueck = 97;\r\n\t\t\tTWPro.twpro_jobValues.travelling_salesman.gefahr = 67;\r\n\t\t\tTWPro.twpro_jobValues.con_artist = {};\r\n\t\t\tTWPro.twpro_jobValues.con_artist.erfahrung = 89;\r\n\t\t\tTWPro.twpro_jobValues.con_artist.lohn = 78;\r\n\t\t\tTWPro.twpro_jobValues.con_artist.glueck = 35;\r\n\t\t\tTWPro.twpro_jobValues.con_artist.gefahr = 83;\r\n\t\t\tTWPro.twpro_jobValues.cougar = {};\r\n\t\t\tTWPro.twpro_jobValues.cougar.erfahrung = 89;\r\n\t\t\tTWPro.twpro_jobValues.cougar.lohn = 46;\r\n\t\t\tTWPro.twpro_jobValues.cougar.glueck = 39;\r\n\t\t\tTWPro.twpro_jobValues.cougar.gefahr = 93;\r\n\t\t\tTWPro.twpro_jobValues.alcohol = {};\r\n\t\t\tTWPro.twpro_jobValues.alcohol.erfahrung = 91;\r\n\t\t\tTWPro.twpro_jobValues.alcohol.lohn = 74;\r\n\t\t\tTWPro.twpro_jobValues.alcohol.glueck = 34;\r\n\t\t\tTWPro.twpro_jobValues.alcohol.gefahr = 56;\r\n\t\t\tTWPro.twpro_jobValues.lead_gathering = {};\r\n\t\t\tTWPro.twpro_jobValues.lead_gathering.erfahrung = 72;\r\n\t\t\tTWPro.twpro_jobValues.lead_gathering.lohn = 89;\r\n\t\t\tTWPro.twpro_jobValues.lead_gathering.glueck = 22;\r\n\t\t\tTWPro.twpro_jobValues.lead_gathering.gefahr = 72;\r\n\t\t\tTWPro.twpro_jobValues.gem_gathering = {};\r\n\t\t\tTWPro.twpro_jobValues.gem_gathering.erfahrung = 78;\r\n\t\t\tTWPro.twpro_jobValues.gem_gathering.lohn = 91;\r\n\t\t\tTWPro.twpro_jobValues.gem_gathering.glueck = 23;\r\n\t\t\tTWPro.twpro_jobValues.gem_gathering.gefahr = 77;\r\n\t\t\tTWPro.twpro_jobValues.mission = {};\r\n\t\t\tTWPro.twpro_jobValues.mission.erfahrung = 82;\r\n\t\t\tTWPro.twpro_jobValues.mission.lohn = 92;\r\n\t\t\tTWPro.twpro_jobValues.mission.glueck = 54;\r\n\t\t\tTWPro.twpro_jobValues.mission.gefahr = 38;\r\n\t\t\tTWPro.twpro_jobValues.casino = {};\r\n\t\t\tTWPro.twpro_jobValues.casino.erfahrung = 92;\r\n\t\t\tTWPro.twpro_jobValues.casino.lohn = 78;\r\n\t\t\tTWPro.twpro_jobValues.casino.glueck = 23;\r\n\t\t\tTWPro.twpro_jobValues.casino.gefahr = 47;\r\n\t\t\tTWPro.twpro_jobValues.marshall = {};\r\n\t\t\tTWPro.twpro_jobValues.marshall.erfahrung = 90;\r\n\t\t\tTWPro.twpro_jobValues.marshall.lohn = 87;\r\n\t\t\tTWPro.twpro_jobValues.marshall.glueck = 60;\r\n\t\t\tTWPro.twpro_jobValues.marshall.gefahr = 94;\r\n\t\t\tTWPro.twpro_jobValues.shatter_gang = {};\r\n\t\t\tTWPro.twpro_jobValues.shatter_gang.erfahrung = 70;\r\n\t\t\tTWPro.twpro_jobValues.shatter_gang.lohn = 84;\r\n\t\t\tTWPro.twpro_jobValues.shatter_gang.glueck = 89;\r\n\t\t\tTWPro.twpro_jobValues.shatter_gang.gefahr = 99;\r\n\t\t\tTWPro.twpro_jobValues.bankrobbery = {};\r\n\t\t\tTWPro.twpro_jobValues.bankrobbery.erfahrung = 84;\r\n\t\t\tTWPro.twpro_jobValues.bankrobbery.lohn = 93;\r\n\t\t\tTWPro.twpro_jobValues.bankrobbery.glueck = 30;\r\n\t\t\tTWPro.twpro_jobValues.bankrobbery.gefahr = 89;\r\n\t\t\tTWPro.twpro_jobValues.free_slaves = {};\r\n\t\t\tTWPro.twpro_jobValues.free_slaves.erfahrung = 93;\r\n\t\t\tTWPro.twpro_jobValues.free_slaves.lohn = 84;\r\n\t\t\tTWPro.twpro_jobValues.free_slaves.glueck = 28;\r\n\t\t\tTWPro.twpro_jobValues.free_slaves.gefahr = 92;\r\n\t\t\tTWPro.twpro_jobValues.buffelo_bill = {};\r\n\t\t\tTWPro.twpro_jobValues.buffelo_bill.erfahrung = 94;\r\n\t\t\tTWPro.twpro_jobValues.buffelo_bill.lohn = 92;\r\n\t\t\tTWPro.twpro_jobValues.buffelo_bill.glueck = 65;\r\n\t\t\tTWPro.twpro_jobValues.buffelo_bill.gefahr = 70;\r\n\t\t\t\r\n\t\t\tvar extra_jobs = ['construct', 'lifepoints', 'ride', 'duelshootingatt', 'duelshootingdef', 'duelvigor', 'fortatt', 'fortdef'];\r\n\t\t\tfor(var i=0; i<extra_jobs.length; i++){\r\n\t\t\t\tTWPro.twpro_jobValues[extra_jobs[i]] = {'erfahrung':0, 'lohn':0, 'glueck':0, 'gefahr':0};\r\n\t\t\t}\r\n\t\t}\r\n\t\tTWPro.twpro_setBonusParsed = false;\r\n\t\t// Setitems\r\n\t\t{\r\n\t\t\tTWPro.twpro_setBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_sleeper = [];\r\n\t\t\tTWPro.twpro_setBonus.set_sleeper[1] = {image:\"images/items/head/mini/sleep_cap.png\",gender:\"mixed\",bonus:{attributes:{},skills:{}},jobBonus:{all:0},speedBonus:0,parsedBonus:{}};\r\n\t\t\tTWPro.twpro_setBonus.set_sleeper[2] = {bonus:{attributes:{},skills:{}},jobBonus:{all:0},speedBonus:0,parsedBonus:{}};\r\n\t\t\tTWPro.twpro_setBonus.set_sleeper[3] = {bonus:{attributes:{},skills:{}},jobBonus:{all:0},speedBonus:0,parsedBonus:{}};\r\n\t\t\tTWPro.twpro_setBonus.set_sleeper[4] = {bonus:{attributes:{},skills:{}},jobBonus:{all:0},speedBonus:0,parsedBonus:{}};\r\n\t\t\tTWPro.twpro_setBonus.set_sleeper[5] = {bonus:{attributes:{},skills:{}},jobBonus:{all:0},speedBonus:0,parsedBonus:{}};\r\n\t\t\tTWPro.twpro_setBonus.set_sleeper[6] = {bonus:{attributes:{},skills:{}},jobBonus:{all:0},speedBonus:0,parsedBonus:{}};\r\n\t\t\tTWPro.twpro_setBonus.season_set = [];\r\n\t\t\tTWPro.twpro_setBonus.season_set[1] = {image:\"images/items/yield/mini/dfgrocket1a.png\",gender:\"mixed\",bonus:{attributes:{},skills:{}},jobBonus:{all:0},speedBonus:0,parsedBonus:{}};\r\n\t\t\tTWPro.twpro_setBonus.season_set[2] = {bonus:{attributes:{},skills:{}},jobBonus:{all:0},speedBonus:0,parsedBonus:{}};\r\n\t\t\tTWPro.twpro_setBonus.season_set[3] = {bonus:{attributes:{},skills:{}},jobBonus:{all:0},speedBonus:0,parsedBonus:{}};\r\n\t\t\tTWPro.twpro_setBonus.season_set[4] = {bonus:{attributes:{},skills:{}},jobBonus:{all:0},speedBonus:0,parsedBonus:{}};\r\n\t\t\tTWPro.twpro_setBonus.season_set[5] = {bonus:{attributes:{},skills:{}},jobBonus:{all:0},speedBonus:0,parsedBonus:{}};\r\n\t\t\tTWPro.twpro_setBonus.season_set[6] = {bonus:{attributes:{},skills:{}},jobBonus:{all:0},speedBonus:0,parsedBonus:{}};\r\n\t\t\tTWPro.twpro_setBonus.season_set[7] = {bonus:{attributes:{},skills:{}},jobBonus:{all:0},speedBonus:0,parsedBonus:{}};\r\n\t\t\tTWPro.twpro_setBonus.set_indian = [];\r\n\t\t\tTWPro.twpro_setBonus.set_indian[1] = {image:\"images/items/head/mini/indian_hat.png\",gender:\"mixed\",bonus:{attributes:{},skills:{}},jobBonus:{all:0},speedBonus:0,parsedBonus:{}};\r\n\t\t\tTWPro.twpro_setBonus.set_indian[2] = {};\r\n\t\t\tTWPro.twpro_setBonus.set_indian[2].bonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_indian[2].bonus.attributes = {};\r\n\t\t\tTWPro.twpro_setBonus.set_indian[2].bonus.attributes.flexibility = 2;\r\n\t\t\tTWPro.twpro_setBonus.set_indian[2].bonus.skills = {};\r\n\t\t\tTWPro.twpro_setBonus.set_indian[2].bonus.skills.hide = 8;\r\n\t\t\tTWPro.twpro_setBonus.set_indian[2].jobBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_indian[2].jobBonus.all = 0;\r\n\t\t\tTWPro.twpro_setBonus.set_indian[2].jobBonus.coyote = 30;\r\n\t\t\tTWPro.twpro_setBonus.set_indian[2].speedBonus = 15;\r\n\t\t\tTWPro.twpro_setBonus.set_indian[2].parsedBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_indian[3] = {};\r\n\t\t\tTWPro.twpro_setBonus.set_indian[3].bonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_indian[3].bonus.attributes = {};\r\n\t\t\tTWPro.twpro_setBonus.set_indian[3].bonus.attributes.flexibility = 5;\r\n\t\t\tTWPro.twpro_setBonus.set_indian[3].bonus.skills = {};\r\n\t\t\tTWPro.twpro_setBonus.set_indian[3].bonus.skills.hide = 8;\r\n\t\t\tTWPro.twpro_setBonus.set_indian[3].bonus.skills.swim = 8;\r\n\t\t\tTWPro.twpro_setBonus.set_indian[3].jobBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_indian[3].jobBonus.all = 0;\r\n\t\t\tTWPro.twpro_setBonus.set_indian[3].jobBonus.coyote = 30;\r\n\t\t\tTWPro.twpro_setBonus.set_indian[3].jobBonus.buffalo = 40;\r\n\t\t\tTWPro.twpro_setBonus.set_indian[3].speedBonus = 30;\r\n\t\t\tTWPro.twpro_setBonus.set_indian[3].parsedBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_indian[4] = {};\r\n\t\t\tTWPro.twpro_setBonus.set_indian[4].bonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_indian[4].bonus.attributes = {};\r\n\t\t\tTWPro.twpro_setBonus.set_indian[4].bonus.attributes.flexibility = 8;\r\n\t\t\tTWPro.twpro_setBonus.set_indian[4].bonus.skills = {};\r\n\t\t\tTWPro.twpro_setBonus.set_indian[4].bonus.skills.hide = 8;\r\n\t\t\tTWPro.twpro_setBonus.set_indian[4].bonus.skills.swim = 8;\r\n\t\t\tTWPro.twpro_setBonus.set_indian[4].bonus.skills.pitfall = 8;\r\n\t\t\tTWPro.twpro_setBonus.set_indian[4].jobBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_indian[4].jobBonus.all = 0;\r\n\t\t\tTWPro.twpro_setBonus.set_indian[4].jobBonus.coyote = 30;\r\n\t\t\tTWPro.twpro_setBonus.set_indian[4].jobBonus.buffalo = 40;\r\n\t\t\tTWPro.twpro_setBonus.set_indian[4].jobBonus.wolf = 50;\r\n\t\t\tTWPro.twpro_setBonus.set_indian[4].speedBonus = 44;\r\n\t\t\tTWPro.twpro_setBonus.set_indian[4].parsedBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_indian[5] = {};\r\n\t\t\tTWPro.twpro_setBonus.set_indian[5].bonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_indian[5].bonus.attributes = {};\r\n\t\t\tTWPro.twpro_setBonus.set_indian[5].bonus.attributes.flexibility = 12;\r\n\t\t\tTWPro.twpro_setBonus.set_indian[5].bonus.skills = {};\r\n\t\t\tTWPro.twpro_setBonus.set_indian[5].bonus.skills.hide = 8;\r\n\t\t\tTWPro.twpro_setBonus.set_indian[5].bonus.skills.swim = 8;\r\n\t\t\tTWPro.twpro_setBonus.set_indian[5].bonus.skills.pitfall = 8;\r\n\t\t\tTWPro.twpro_setBonus.set_indian[5].bonus.skills.animal = 8;\r\n\t\t\tTWPro.twpro_setBonus.set_indian[5].jobBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_indian[5].jobBonus.all = 0;\r\n\t\t\tTWPro.twpro_setBonus.set_indian[5].jobBonus.coyote = 30;\r\n\t\t\tTWPro.twpro_setBonus.set_indian[5].jobBonus.buffalo = 40;\r\n\t\t\tTWPro.twpro_setBonus.set_indian[5].jobBonus.wolf = 50;\r\n\t\t\tTWPro.twpro_setBonus.set_indian[5].jobBonus.grizzly = 60;\r\n\t\t\tTWPro.twpro_setBonus.set_indian[5].speedBonus = 60;\r\n\t\t\tTWPro.twpro_setBonus.set_indian[5].parsedBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_gentleman = [];\r\n\t\t\tTWPro.twpro_setBonus.set_gentleman[1] = {image:\"images/items/yield/mini/cane.png\",gender:\"male\",bonus:{attributes:{},skills:{}},jobBonus:{all:0},speedBonus:0,parsedBonus:{}};\r\n\t\t\tTWPro.twpro_setBonus.set_gentleman[2] = {};\r\n\t\t\tTWPro.twpro_setBonus.set_gentleman[2].bonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_gentleman[2].bonus.attributes = {};\r\n\t\t\tTWPro.twpro_setBonus.set_gentleman[2].bonus.attributes.charisma = 1;\r\n\t\t\tTWPro.twpro_setBonus.set_gentleman[2].bonus.skills = {};\r\n\t\t\tTWPro.twpro_setBonus.set_gentleman[2].bonus.skills.appearance = 8;\r\n\t\t\tTWPro.twpro_setBonus.set_gentleman[2].jobBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_gentleman[2].jobBonus.all = 5;\r\n\t\t\tTWPro.twpro_setBonus.set_gentleman[2].speedBonus = 0;\r\n\t\t\tTWPro.twpro_setBonus.set_gentleman[2].parsedBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_gentleman[3] = {};\r\n\t\t\tTWPro.twpro_setBonus.set_gentleman[3].bonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_gentleman[3].bonus.attributes = {};\r\n\t\t\tTWPro.twpro_setBonus.set_gentleman[3].bonus.attributes.charisma = 3;\r\n\t\t\tTWPro.twpro_setBonus.set_gentleman[3].bonus.skills = {};\r\n\t\t\tTWPro.twpro_setBonus.set_gentleman[3].bonus.skills.leadership = 8;\r\n\t\t\tTWPro.twpro_setBonus.set_gentleman[3].bonus.skills.appearance = 8;\r\n\t\t\tTWPro.twpro_setBonus.set_gentleman[3].jobBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_gentleman[3].jobBonus.all = 15;\r\n\t\t\tTWPro.twpro_setBonus.set_gentleman[3].speedBonus = 0;\r\n\t\t\tTWPro.twpro_setBonus.set_gentleman[3].parsedBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_gentleman[4] = {};\r\n\t\t\tTWPro.twpro_setBonus.set_gentleman[4].bonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_gentleman[4].bonus.attributes = {};\r\n\t\t\tTWPro.twpro_setBonus.set_gentleman[4].bonus.attributes.charisma = 6;\r\n\t\t\tTWPro.twpro_setBonus.set_gentleman[4].bonus.skills = {};\r\n\t\t\tTWPro.twpro_setBonus.set_gentleman[4].bonus.skills.leadership = 8;\r\n\t\t\tTWPro.twpro_setBonus.set_gentleman[4].bonus.skills.trade = 8;\r\n\t\t\tTWPro.twpro_setBonus.set_gentleman[4].bonus.skills.appearance = 8;\r\n\t\t\tTWPro.twpro_setBonus.set_gentleman[4].jobBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_gentleman[4].jobBonus.all = 30;\r\n\t\t\tTWPro.twpro_setBonus.set_gentleman[4].speedBonus = 0;\r\n\t\t\tTWPro.twpro_setBonus.set_gentleman[4].parsedBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_gentleman[5] = {};\r\n\t\t\tTWPro.twpro_setBonus.set_gentleman[5].bonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_gentleman[5].bonus.attributes = {};\r\n\t\t\tTWPro.twpro_setBonus.set_gentleman[5].bonus.attributes.charisma = 10;\r\n\t\t\tTWPro.twpro_setBonus.set_gentleman[5].bonus.skills = {};\r\n\t\t\tTWPro.twpro_setBonus.set_gentleman[5].bonus.skills.leadership = 8;\r\n\t\t\tTWPro.twpro_setBonus.set_gentleman[5].bonus.skills.trade = 8;\r\n\t\t\tTWPro.twpro_setBonus.set_gentleman[5].bonus.skills.appearance = 16;\r\n\t\t\tTWPro.twpro_setBonus.set_gentleman[5].jobBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_gentleman[5].jobBonus.all = 50;\r\n\t\t\tTWPro.twpro_setBonus.set_gentleman[5].speedBonus = 0;\r\n\t\t\tTWPro.twpro_setBonus.set_gentleman[5].parsedBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_dancer = [];\r\n\t\t\tTWPro.twpro_setBonus.set_dancer[1] = {image:\"images/items/yield/mini/umbrella.png\",gender:\"female\",bonus:{attributes:{},skills:{}},jobBonus:{all:0},speedBonus:0,parsedBonus:{}};\r\n\t\t\tTWPro.twpro_setBonus.set_dancer[2] = {};\r\n\t\t\tTWPro.twpro_setBonus.set_dancer[2].bonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_dancer[2].bonus.attributes = {};\r\n\t\t\tTWPro.twpro_setBonus.set_dancer[2].bonus.attributes.charisma = 2;\r\n\t\t\tTWPro.twpro_setBonus.set_dancer[2].bonus.skills = {};\r\n\t\t\tTWPro.twpro_setBonus.set_dancer[2].bonus.skills.appearance = 10;\r\n\t\t\tTWPro.twpro_setBonus.set_dancer[2].jobBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_dancer[2].jobBonus.all = 5;\r\n\t\t\tTWPro.twpro_setBonus.set_dancer[2].speedBonus = 0;\r\n\t\t\tTWPro.twpro_setBonus.set_dancer[2].parsedBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_dancer[3] = {};\r\n\t\t\tTWPro.twpro_setBonus.set_dancer[3].bonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_dancer[3].bonus.attributes = {};\r\n\t\t\tTWPro.twpro_setBonus.set_dancer[3].bonus.attributes.charisma = 5;\r\n\t\t\tTWPro.twpro_setBonus.set_dancer[3].bonus.skills = {};\r\n\t\t\tTWPro.twpro_setBonus.set_dancer[3].bonus.skills.animal = 10;\r\n\t\t\tTWPro.twpro_setBonus.set_dancer[3].bonus.skills.appearance = 10;\r\n\t\t\tTWPro.twpro_setBonus.set_dancer[3].jobBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_dancer[3].jobBonus.all = 15;\r\n\t\t\tTWPro.twpro_setBonus.set_dancer[3].speedBonus = 0;\r\n\t\t\tTWPro.twpro_setBonus.set_dancer[3].parsedBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_dancer[4] = {};\r\n\t\t\tTWPro.twpro_setBonus.set_dancer[4].bonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_dancer[4].bonus.attributes = {};\r\n\t\t\tTWPro.twpro_setBonus.set_dancer[4].bonus.attributes.charisma = 9;\r\n\t\t\tTWPro.twpro_setBonus.set_dancer[4].bonus.skills = {};\r\n\t\t\tTWPro.twpro_setBonus.set_dancer[4].bonus.skills.finger_dexterity = 12;\r\n\t\t\tTWPro.twpro_setBonus.set_dancer[4].bonus.skills.animal = 10;\r\n\t\t\tTWPro.twpro_setBonus.set_dancer[4].bonus.skills.appearance = 10;\r\n\t\t\tTWPro.twpro_setBonus.set_dancer[4].jobBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_dancer[4].jobBonus.all = 30;\r\n\t\t\tTWPro.twpro_setBonus.set_dancer[4].speedBonus = 0;\r\n\t\t\tTWPro.twpro_setBonus.set_dancer[4].parsedBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_dancer[5] = {};\r\n\t\t\tTWPro.twpro_setBonus.set_dancer[5].bonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_dancer[5].bonus.attributes = {};\r\n\t\t\tTWPro.twpro_setBonus.set_dancer[5].bonus.attributes.charisma = 11;\r\n\t\t\tTWPro.twpro_setBonus.set_dancer[5].bonus.skills = {};\r\n\t\t\tTWPro.twpro_setBonus.set_dancer[5].bonus.skills.finger_dexterity = 12;\r\n\t\t\tTWPro.twpro_setBonus.set_dancer[5].bonus.skills.endurance = 6;\r\n\t\t\tTWPro.twpro_setBonus.set_dancer[5].bonus.skills.animal = 10;\r\n\t\t\tTWPro.twpro_setBonus.set_dancer[5].bonus.skills.appearance = 16;\r\n\t\t\tTWPro.twpro_setBonus.set_dancer[5].jobBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_dancer[5].jobBonus.all = 50;\r\n\t\t\tTWPro.twpro_setBonus.set_dancer[5].speedBonus = 0;\r\n\t\t\tTWPro.twpro_setBonus.set_dancer[5].parsedBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_quackery = [];\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[1] = {image:\"images/items/yield/mini/potion.png\",gender:\"mixed\",bonus:{attributes:{},skills:{}},jobBonus:{all:0},speedBonus:0,parsedBonus:{}};\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[2] = {};\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[2].bonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[2].bonus.attributes = {};\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[2].bonus.attributes.dexterity = 1;\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[2].bonus.skills = {};\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[2].bonus.skills.endurance = 5;\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[2].bonus.skills.trade = 5;\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[2].jobBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[2].jobBonus.all = 0;\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[2].jobBonus.quackery = 30;\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[2].speedBonus = 0;\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[2].parsedBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[3] = {};\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[3].bonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[3].bonus.attributes = {};\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[3].bonus.attributes.dexterity = 2;\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[3].bonus.skills = {};\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[3].bonus.skills.endurance = 10;\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[3].bonus.skills.trade = 10;\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[3].jobBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[3].jobBonus.all = 0;\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[3].jobBonus.quackery = 60;\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[3].speedBonus = 0;\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[3].parsedBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[4] = {};\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[4].bonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[4].bonus.attributes = {};\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[4].bonus.attributes.dexterity = 4;\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[4].bonus.skills = {};\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[4].bonus.skills.endurance = 15;\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[4].bonus.skills.trade = 15;\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[4].jobBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[4].jobBonus.all = 0;\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[4].jobBonus.quackery = 90;\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[4].speedBonus = 0;\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[4].parsedBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[5] = {};\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[5].bonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[5].bonus.attributes = {};\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[5].bonus.attributes.dexterity = 6;\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[5].bonus.skills = {};\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[5].bonus.skills.endurance = 20;\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[5].bonus.skills.trade = 20;\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[5].jobBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[5].jobBonus.all = 0;\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[5].jobBonus.quackery = 120;\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[5].speedBonus = 0;\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[5].parsedBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[6] = {};\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[6].bonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[6].bonus.attributes = {};\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[6].bonus.attributes.dexterity = 9;\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[6].bonus.skills = {};\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[6].bonus.skills.tough = 18;\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[6].bonus.skills.endurance = 20;\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[6].bonus.skills.reflex = 18;\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[6].bonus.skills.aim = 18;\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[6].bonus.skills.shot = 18;\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[6].bonus.skills.trade = 20;\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[6].jobBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[6].jobBonus.all = 0;\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[6].jobBonus.quackery = 120;\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[6].speedBonus = 0;\r\n\t\t\tTWPro.twpro_setBonus.set_quackery[6].parsedBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_mexican = [];\r\n\t\t\tTWPro.twpro_setBonus.set_mexican[1] = {image:\"images/items/head/mini/mexican_sombrero.png\",gender:\"mixed\",bonus:{attributes:{},skills:{}},jobBonus:{all:0},speedBonus:0,parsedBonus:{}};\r\n\t\t\tTWPro.twpro_setBonus.set_mexican[2] = {};\r\n\t\t\tTWPro.twpro_setBonus.set_mexican[2].bonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_mexican[2].bonus.attributes = {};\r\n\t\t\tTWPro.twpro_setBonus.set_mexican[2].bonus.attributes.strength = 1;\r\n\t\t\tTWPro.twpro_setBonus.set_mexican[2].bonus.skills = {};\r\n\t\t\tTWPro.twpro_setBonus.set_mexican[2].jobBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_mexican[2].jobBonus.all = 0;\r\n\t\t\tTWPro.twpro_setBonus.set_mexican[2].speedBonus = 12;\r\n\t\t\tTWPro.twpro_setBonus.set_mexican[2].parsedBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_mexican[3] = {};\r\n\t\t\tTWPro.twpro_setBonus.set_mexican[3].bonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_mexican[3].bonus.attributes = {};\r\n\t\t\tTWPro.twpro_setBonus.set_mexican[3].bonus.attributes.strength = 2;\r\n\t\t\tTWPro.twpro_setBonus.set_mexican[3].bonus.skills = {};\r\n\t\t\tTWPro.twpro_setBonus.set_mexican[3].jobBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_mexican[3].jobBonus.all = 0;\r\n\t\t\tTWPro.twpro_setBonus.set_mexican[3].jobBonus.agave = 60;\r\n\t\t\tTWPro.twpro_setBonus.set_mexican[3].speedBonus = 24;\r\n\t\t\tTWPro.twpro_setBonus.set_mexican[3].parsedBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_mexican[4] = {};\r\n\t\t\tTWPro.twpro_setBonus.set_mexican[4].bonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_mexican[4].bonus.attributes = {};\r\n\t\t\tTWPro.twpro_setBonus.set_mexican[4].bonus.attributes.strength = 4;\r\n\t\t\tTWPro.twpro_setBonus.set_mexican[4].bonus.skills = {};\r\n\t\t\tTWPro.twpro_setBonus.set_mexican[4].jobBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_mexican[4].jobBonus.all = 0;\r\n\t\t\tTWPro.twpro_setBonus.set_mexican[4].jobBonus.oil = 70;\r\n\t\t\tTWPro.twpro_setBonus.set_mexican[4].jobBonus.agave = 60;\r\n\t\t\tTWPro.twpro_setBonus.set_mexican[4].speedBonus = 36;\r\n\t\t\tTWPro.twpro_setBonus.set_mexican[4].parsedBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_mexican[5] = {};\r\n\t\t\tTWPro.twpro_setBonus.set_mexican[5].bonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_mexican[5].bonus.attributes = {};\r\n\t\t\tTWPro.twpro_setBonus.set_mexican[5].bonus.attributes.strength = 6;\r\n\t\t\tTWPro.twpro_setBonus.set_mexican[5].bonus.skills = {};\r\n\t\t\tTWPro.twpro_setBonus.set_mexican[5].jobBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_mexican[5].jobBonus.all = 0;\r\n\t\t\tTWPro.twpro_setBonus.set_mexican[5].jobBonus.oil = 70;\r\n\t\t\tTWPro.twpro_setBonus.set_mexican[5].jobBonus.smuggle = 80;\r\n\t\t\tTWPro.twpro_setBonus.set_mexican[5].jobBonus.agave = 60;\r\n\t\t\tTWPro.twpro_setBonus.set_mexican[5].speedBonus = 48;\r\n\t\t\tTWPro.twpro_setBonus.set_mexican[5].parsedBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_mexican[6] = {};\r\n\t\t\tTWPro.twpro_setBonus.set_mexican[6].bonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_mexican[6].bonus.attributes = {};\r\n\t\t\tTWPro.twpro_setBonus.set_mexican[6].bonus.attributes.strength = 9;\r\n\t\t\tTWPro.twpro_setBonus.set_mexican[6].bonus.skills = {};\r\n\t\t\tTWPro.twpro_setBonus.set_mexican[6].jobBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_mexican[6].jobBonus.all = 0;\r\n\t\t\tTWPro.twpro_setBonus.set_mexican[6].jobBonus.dynamite = 90;\r\n\t\t\tTWPro.twpro_setBonus.set_mexican[6].jobBonus.oil = 70;\r\n\t\t\tTWPro.twpro_setBonus.set_mexican[6].jobBonus.smuggle = 80;\r\n\t\t\tTWPro.twpro_setBonus.set_mexican[6].jobBonus.agave = 60;\r\n\t\t\tTWPro.twpro_setBonus.set_mexican[6].speedBonus = 60;\r\n\t\t\tTWPro.twpro_setBonus.set_mexican[6].parsedBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_male = [];\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_male[1] = {image:\"images/items/head/mini/pilger_hat.png\",gender:\"male\",bonus:{attributes:{},skills:{}},jobBonus:{all:0},speedBonus:0,parsedBonus:{}};\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_male[2] = {};\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_male[2].bonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_male[2].bonus.attributes = {};\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_male[2].bonus.skills = {};\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_male[2].jobBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_male[2].jobBonus.all = 0;\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_male[2].jobBonus.construct = 5;\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_male[2].speedBonus = 0;\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_male[2].parsedBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_male[3] = {};\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_male[3].bonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_male[3].bonus.attributes = {};\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_male[3].bonus.skills = {};\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_male[3].jobBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_male[3].jobBonus.all = 0;\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_male[3].jobBonus.construct = 15;\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_male[3].speedBonus = 0;\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_male[3].parsedBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_male[4] = {};\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_male[4].bonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_male[4].bonus.attributes = {};\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_male[4].bonus.skills = {};\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_male[4].jobBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_male[4].jobBonus.all = 0;\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_male[4].jobBonus.construct = 30;\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_male[4].speedBonus = 0;\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_male[4].parsedBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_male[5] = {};\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_male[5].bonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_male[5].bonus.attributes = {};\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_male[5].bonus.skills = {};\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_male[5].jobBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_male[5].jobBonus.all = 0;\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_male[5].jobBonus.bible = 150;\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_male[5].jobBonus.construct = 50;\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_male[5].speedBonus = 0;\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_male[5].parsedBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_female = [];\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_female[1] = {image:\"images/items/head/mini/pilger_cap.png\",gender:\"female\",bonus:{attributes:{},skills:{}},jobBonus:{all:0},speedBonus:0,parsedBonus:{}};\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_female[2] = {};\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_female[2].bonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_female[2].bonus.attributes = {};\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_female[2].bonus.skills = {};\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_female[2].jobBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_female[2].jobBonus.all = 0;\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_female[2].jobBonus.construct = 5;\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_female[2].speedBonus = 0;\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_female[2].parsedBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_female[3] = {};\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_female[3].bonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_female[3].bonus.attributes = {};\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_female[3].bonus.skills = {};\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_female[3].jobBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_female[3].jobBonus.all = 0;\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_female[3].jobBonus.construct = 15;\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_female[3].speedBonus = 0;\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_female[3].parsedBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_female[4] = {};\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_female[4].bonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_female[4].bonus.attributes = {};\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_female[4].bonus.skills = {};\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_female[4].jobBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_female[4].jobBonus.all = 0;\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_female[4].jobBonus.construct = 30;\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_female[4].speedBonus = 0;\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_female[4].parsedBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_female[5] = {};\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_female[5].bonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_female[5].bonus.attributes = {};\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_female[5].bonus.skills = {};\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_female[5].jobBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_female[5].jobBonus.all = 0;\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_female[5].jobBonus.bible = 150;\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_female[5].jobBonus.construct = 50;\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_female[5].speedBonus = 0;\r\n\t\t\tTWPro.twpro_setBonus.set_pilgrim_female[5].parsedBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set = [];\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[1] = {image:\"images/items/neck/mini/greenhorn_neck.png\",gender:\"mixed\",bonus:{attributes:{},skills:{}},jobBonus:{all:0},speedBonus:0,parsedBonus:{}};\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[2] = {};\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[2].bonus = {};\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[2].bonus.attributes = {};\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[2].bonus.skills = {};\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[2].jobBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[2].jobBonus.all = 0;\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[2].jobBonus.sugar = 10;\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[2].speedBonus = 0;\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[2].parsedBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[3] = {};\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[3].bonus = {};\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[3].bonus.attributes = {};\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[3].bonus.skills = {};\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[3].jobBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[3].jobBonus.all = 0;\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[3].jobBonus.wood = 20;\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[3].jobBonus.sugar = 10;\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[3].speedBonus = 0;\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[3].parsedBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[4] = {};\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[4].bonus = {};\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[4].bonus.attributes = {};\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[4].bonus.skills = {};\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[4].jobBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[4].jobBonus.all = 0;\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[4].jobBonus.tanning = 20;\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[4].jobBonus.wood = 20;\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[4].jobBonus.sugar = 10;\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[4].speedBonus = 0;\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[4].parsedBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[5] = {};\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[5].bonus = {};\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[5].bonus.attributes = {};\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[5].bonus.skills = {};\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[5].jobBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[5].jobBonus.all = 0;\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[5].jobBonus.turkey = 20;\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[5].jobBonus.tanning = 20;\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[5].jobBonus.wood = 20;\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[5].jobBonus.sugar = 10;\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[5].speedBonus = 0;\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[5].parsedBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[6] = {};\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[6].bonus = {};\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[6].bonus.attributes = {};\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[6].bonus.skills = {};\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[6].jobBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[6].jobBonus.all = 0;\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[6].jobBonus.cow = 20;\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[6].jobBonus.turkey = 20;\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[6].jobBonus.tanning = 20;\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[6].jobBonus.wood = 20;\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[6].jobBonus.sugar = 10;\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[6].speedBonus = 0;\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[6].parsedBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[7] = {};\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[7].bonus = {};\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[7].bonus.attributes = {};\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[7].bonus.skills = {};\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[7].jobBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[7].jobBonus.all = 5;\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[7].jobBonus.cow = 20;\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[7].jobBonus.turkey = 20;\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[7].jobBonus.tanning = 20;\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[7].jobBonus.wood = 20;\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[7].jobBonus.sugar = 10;\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[7].speedBonus = 0;\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[7].parsedBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[8] = {};\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[8].bonus = {};\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[8].bonus.attributes = {};\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[8].bonus.attributes.strength = 1;\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[8].bonus.attributes.charisma = 1;\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[8].bonus.skills = {};\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[8].jobBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[8].jobBonus.all = 15;\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[8].jobBonus.cow = 20;\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[8].jobBonus.turkey = 20;\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[8].jobBonus.tanning = 20;\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[8].jobBonus.wood = 20;\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[8].jobBonus.sugar = 10;\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[8].speedBonus = 20;\r\n\t\t\tTWPro.twpro_setBonus.greenhorn_set[8].parsedBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_farmer = [];\r\n\t\t\tTWPro.twpro_setBonus.set_farmer[1] = {image:\"images/items/yield/mini/pitchfork.png\",gender:\"mixed\",bonus:{attributes:{},skills:{}},jobBonus:{all:0},speedBonus:0,parsedBonus:{}};\r\n\t\t\tTWPro.twpro_setBonus.set_farmer[2] = {};\r\n\t\t\tTWPro.twpro_setBonus.set_farmer[2].bonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_farmer[2].bonus.attributes = {};\r\n\t\t\tTWPro.twpro_setBonus.set_farmer[2].bonus.attributes.strength = 1;\r\n\t\t\tTWPro.twpro_setBonus.set_farmer[2].bonus.attributes.flexibility = 1;\r\n\t\t\tTWPro.twpro_setBonus.set_farmer[2].bonus.skills = {};\r\n\t\t\tTWPro.twpro_setBonus.set_farmer[2].jobBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_farmer[2].jobBonus.all = 0;\r\n\t\t\tTWPro.twpro_setBonus.set_farmer[2].jobBonus.cereal = 10;\r\n\t\t\tTWPro.twpro_setBonus.set_farmer[2].jobBonus.cut = 10;\r\n\t\t\tTWPro.twpro_setBonus.set_farmer[2].jobBonus.grinding = 10;\r\n\t\t\tTWPro.twpro_setBonus.set_farmer[2].speedBonus = 0;\r\n\t\t\tTWPro.twpro_setBonus.set_farmer[2].parsedBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_farmer[3] = {};\r\n\t\t\tTWPro.twpro_setBonus.set_farmer[3].bonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_farmer[3].bonus.attributes = {};\r\n\t\t\tTWPro.twpro_setBonus.set_farmer[3].bonus.attributes.strength = 1;\r\n\t\t\tTWPro.twpro_setBonus.set_farmer[3].bonus.attributes.flexibility = 1;\r\n\t\t\tTWPro.twpro_setBonus.set_farmer[3].bonus.attributes.dexterity = 1;\r\n\t\t\tTWPro.twpro_setBonus.set_farmer[3].bonus.attributes.charisma = 1;\r\n\t\t\tTWPro.twpro_setBonus.set_farmer[3].bonus.skills = {};\r\n\t\t\tTWPro.twpro_setBonus.set_farmer[3].jobBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_farmer[3].jobBonus.all = 0;\r\n\t\t\tTWPro.twpro_setBonus.set_farmer[3].jobBonus.cereal = 10;\r\n\t\t\tTWPro.twpro_setBonus.set_farmer[3].jobBonus.cut = 10;\r\n\t\t\tTWPro.twpro_setBonus.set_farmer[3].jobBonus.grinding = 10;\r\n\t\t\tTWPro.twpro_setBonus.set_farmer[3].jobBonus.cow = 20;\r\n\t\t\tTWPro.twpro_setBonus.set_farmer[3].jobBonus.wire = 20;\r\n\t\t\tTWPro.twpro_setBonus.set_farmer[3].jobBonus.horseshoe = 20;\r\n\t\t\tTWPro.twpro_setBonus.set_farmer[3].speedBonus = 0;\r\n\t\t\tTWPro.twpro_setBonus.set_farmer[3].parsedBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_farmer[4] = {};\r\n\t\t\tTWPro.twpro_setBonus.set_farmer[4].bonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_farmer[4].bonus.attributes = {};\r\n\t\t\tTWPro.twpro_setBonus.set_farmer[4].bonus.attributes.strength = 2;\r\n\t\t\tTWPro.twpro_setBonus.set_farmer[4].bonus.attributes.flexibility = 2;\r\n\t\t\tTWPro.twpro_setBonus.set_farmer[4].bonus.attributes.dexterity = 2;\r\n\t\t\tTWPro.twpro_setBonus.set_farmer[4].bonus.attributes.charisma = 2;\r\n\t\t\tTWPro.twpro_setBonus.set_farmer[4].bonus.skills = {};\r\n\t\t\tTWPro.twpro_setBonus.set_farmer[4].jobBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.set_farmer[4].jobBonus.all = 0;\r\n\t\t\tTWPro.twpro_setBonus.set_farmer[4].jobBonus.cereal = 10;\r\n\t\t\tTWPro.twpro_setBonus.set_farmer[4].jobBonus.cut = 10;\r\n\t\t\tTWPro.twpro_setBonus.set_farmer[4].jobBonus.grinding = 10;\r\n\t\t\tTWPro.twpro_setBonus.set_farmer[4].jobBonus.cow = 20;\r\n\t\t\tTWPro.twpro_setBonus.set_farmer[4].jobBonus.wire = 20;\r\n\t\t\tTWPro.twpro_setBonus.set_farmer[4].jobBonus.windmeel = 40;\r\n\t\t\tTWPro.twpro_setBonus.set_farmer[4].jobBonus.springe = 40;\r\n\t\t\tTWPro.twpro_setBonus.set_farmer[4].jobBonus.ranch = 40;\r\n\t\t\tTWPro.twpro_setBonus.set_farmer[4].jobBonus.horseshoe = 20;\r\n\t\t\tTWPro.twpro_setBonus.set_farmer[4].speedBonus = 0;\r\n\t\t\tTWPro.twpro_setBonus.set_farmer[4].parsedBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.gold_set = [];\r\n\t\t\tTWPro.twpro_setBonus.gold_set[1] = {image:\"images/items/left_arm/mini/golden_rifle.png\",gender:\"mixed\",bonus:{attributes:{},skills:{}},jobBonus:{all:0},speedBonus:0,parsedBonus:{}};\r\n\t\t\tTWPro.twpro_setBonus.gold_set[2] = {};\r\n\t\t\tTWPro.twpro_setBonus.gold_set[2].bonus = {};\r\n\t\t\tTWPro.twpro_setBonus.gold_set[2].bonus.attributes = {};\r\n\t\t\tTWPro.twpro_setBonus.gold_set[2].bonus.skills = {};\r\n\t\t\tTWPro.twpro_setBonus.gold_set[2].bonus.skills.health = 10;\r\n\t\t\tTWPro.twpro_setBonus.gold_set[2].jobBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.gold_set[2].jobBonus.all = 25;\r\n\t\t\tTWPro.twpro_setBonus.gold_set[2].speedBonus = 20;\r\n\t\t\tTWPro.twpro_setBonus.gold_set[2].parsedBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.fireworker_set = [];\r\n\t\t\tTWPro.twpro_setBonus.fireworker_set[1] = {};\r\n\t\t\tTWPro.twpro_setBonus.fireworker_set[1].image = \"images/items/yield/mini/bucket_fire.png\";\r\n\t\t\tTWPro.twpro_setBonus.fireworker_set[1].gender = \"mixed\";\r\n\t\t\tTWPro.twpro_setBonus.fireworker_set[1].bonus = {};\r\n\t\t\tTWPro.twpro_setBonus.fireworker_set[1].bonus.attributes = {};\r\n\t\t\tTWPro.twpro_setBonus.fireworker_set[1].bonus.skills = {};\r\n\t\t\tTWPro.twpro_setBonus.fireworker_set[1].jobBonus = {};\r\n\t\t\tTWPro.twpro_setBonus.fireworker_set[1].jobBonus.all = 0;\r\n\t\t\tTWPro.twpro_setBonus.fireworker_set[1].jobBonus.fire = 15;\r\n\t\t\tTWPro.twpro_setBonus.fireworker_set[1].speedBonus = 0;\r\n\t\t\tTWPro.twpro_setBonus.fireworker_set[1].parsedBonus = {};\r\n\r\n\t\t}\r\n\t\tTWPro.twpro_invHash = '';\r\n\t\tTWPro.twpro_itemStorage = {};\r\n\t\twhile (TWPro.twpro_active) {\r\n\t\t\t//alert('// Original AjaxWindow.show:\\n'+AjaxWindow.show.toString());\r\n\t\t\t//alert('// Original Bag.getInstance().add:\\n'+Bag.getInstance().add.toString());\r\n\t\t\t//for(var twpro_i = 0; twpro_i < ItemPopup.prototype.getXHTML.toString().length; twpro_i += 2000)\r\n\t\t\t//{\r\n\t\t\t// alert(((twpro_i == 0)?('// Original ItemPopup.prototype.getXHTML:\\n'):(''))+ItemPopup.prototype.getXHTML.toString().substr(twpro_i,2000));\r\n\t\t\t//}\r\n\t\t\tvar twpro_matchtest;\r\n\t\t\tif (AjaxWindow.show.toString().search(/evalJS/) == -1) {\r\n\t\t\t\tif ((AjaxWindow.show.toString().search(/if *\\(data\\.page *!= *undefined\\) *{/) == -1) || (AjaxWindow.show.toString().search(/eval\\(data\\.js\\);/) == -1)) {\r\n\t\t\t\t\tTWPro.twpro_failureInject = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tTWPro.twpro_failureRollback.unshift('AjaxWindow.show = ' + AjaxWindow.show.toString());\r\n\t\t\t\teval('AjaxWindow.show = ' + AjaxWindow.show.toString().replace(/if *\\(data\\.page *!= *undefined\\) *{/, 'if(data.page!=undefined){TWPro.twpro_injectionSwitch(extendeName,\\'page\\',data,null);').replace(/eval\\(data\\.js\\);/, 'TWPro.twpro_injectionSwitch(extendeName,\\'js\\',data,\\'js\\');eval(data.js);TWPro.twpro_injectionSwitch(extendeName,\\'after\\',data,null);'));\r\n\t\t\t\t//alert('// TW Pro AjaxWindow.show:\\n'+AjaxWindow.show.toString());\r\n\t\t\t}\r\n\t\t\telse { if ((AjaxWindow.show.toString().search(/if *\\(data\\.page *!= *undefined\\) *{/) == -1) || (AjaxWindow.show.toString().search(/this\\.evalJS\\(\\);/) == -1)) {\r\n\t\t\t\t\tTWPro.twpro_failureInject = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tTWPro.twpro_failureRollback.unshift('AjaxWindow.show = ' + AjaxWindow.show.toString());\r\n\t\t\t\teval('AjaxWindow.show = ' + AjaxWindow.show.toString().replace(/if *\\(data\\.page *!= *undefined\\) *{/, 'if(data.page!=undefined){TWPro.twpro_injectionSwitch(extendeName,\\'page\\',data,null);').replace(/this\\.evalJS\\(\\);/, 'this.twpro_extendeName=extendeName;this.evalJS();'));\r\n\t\t\t\t//alert('// TW Pro AjaxWindow.show:\\n'+AjaxWindow.show.toString());\r\n\t\t\t\t//alert('// Original Ajax.prototype.evalJS:\\n'+Ajax.prototype.evalJS.toString());\r\n\t\t\t\tif (Ajax.prototype.evalJS.toString().search(/eval\\(this\\.jsContent\\);/) == -1) {\r\n\t\t\t\t\tTWPro.twpro_failureInject = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tTWPro.twpro_failureRollback.unshift('Ajax.prototype.evalJS = ' + Ajax.prototype.evalJS.toString());\r\n\t\t\t\teval('Ajax.prototype.evalJS = ' + Ajax.prototype.evalJS.toString().replace(/eval\\(this\\.jsContent\\);/, 'TWPro.twpro_injectionSwitch(this.twpro_extendeName,\\'js\\',this,\\'jsContent\\');eval(this.jsContent);TWPro.twpro_injectionSwitch(this.twpro_extendeName,\\'after\\',this,null);'));\r\n\t\t\t\t//alert('// TW Pro Ajax.prototype.evalJS:\\n'+Ajax.prototype.evalJS.toString());\r\n\t\t\t}\r\n\t\t\tWEvent.register('inventory_add', {\r\n\t\t\t\texec: function(data){data=typeof data=='string'?Json.evaluate(data[0]):data[0];setTimeout(TWPro.twpro_changeItem, 0, {inv_id:data.inv_id})}\r\n\t\t\t});\r\n\t\t\tWEvent.register('inventory_remove', {\r\n\t\t\t\texec: function(inv_id){setTimeout(TWPro.twpro_changeItem, 0, {inv_id:inv_id,deleted:1})}\r\n\t\t\t});\r\n\t\t\t// Wear.add() removed, Wear.uncarry() -> WEvent handles it now\r\n\t\t\t// Wear.uncarry() removed, WEvent handles it now\r\n\t\t\tif (Bag.getInstance().add.toString().search(/}, *('*)over/) == -1) {\r\n\t\t\t\tTWPro.twpro_failureInject = true;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\ttwpro_matchtest = Bag.getInstance().add.toString().match(/([\"'])wear_[\"'] *\\+ *item\\.get_type\\(\\) *\\+ *[\"']_highlight[\"']/g);\r\n\t\t\tif (twpro_matchtest == null || twpro_matchtest.length != 3) {\r\n\t\t\t\tTWPro.twpro_failureInject = true;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tTWPro.twpro_failureRollback.unshift('Bag.getInstance().add = ' + Bag.getInstance().add.toString());\r\n\t\t\t// removed TWPro.changeItem() from Bag.getInstance().add() because WEvent handles it now\r\n\t\t\teval('Bag.getInstance().add = ' + Bag.getInstance().add.toString().replace(/([\"'])wear_[\"'] *\\+ *item\\.get_type\\(\\) *\\+ *[\"']_highlight[\"']/g, '(TWPro.twpro_activeJob())?($1$1):($1wear_$1+item.get_type()+$1_highlight$1)'));\r\n\t\t\t// Bag.getInstance().carry removed, WEvent handles it now\r\n\t\t\tif (ItemPopup.prototype.getXHTML.toString().replace(/xhtml *\\+= *(['\"])<span class=(\\\\*)\"item_popup_trader_price/) == -1) {\r\n\t\t\t\tTWPro.twpro_failureInject = true;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tTWPro.twpro_failureRollback.unshift('ItemPopup.prototype.getXHTML = ' + ItemPopup.prototype.getXHTML.toString());\r\n\t\t\teval('ItemPopup.prototype.getXHTML = ' + ItemPopup.prototype.getXHTML.toString().replace(/xhtml *\\+= *(['\"])<span class=(\\\\*)\"item_popup_trader_price/, 'xhtml+=TWPro.twpro_popup(item);xhtml+=$1<span class=$2\"item_popup_trader_price'));\r\n\t\t\t//for(var twpro_i = 0; twpro_i < ItemPopup.prototype.getXHTML.toString().length; twpro_i += 2000)\r\n\t\t\t//{\r\n\t\t\t// alert(((twpro_i == 0)?('// TW Pro ItemPopup.prototype.getXHTML:\\n'):(''))+ItemPopup.prototype.getXHTML.toString().substr(twpro_i,2000));\r\n\t\t\t//}\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tTWPro.twpro_world = location.hostname.match(/^[^.]+/)[0];\r\n\t\tvar twpro_support = document.createElement('div');\r\n\t\ttwpro_support.id = 'twpro_support';\r\n\t\ttwpro_support.style.cssText = 'position:absolute; color:#656565; font-size:10px; margin-left:2px; z-index:2';\r\n\t\tvar twpro_supportLink = document.createElement('a');\r\n\t\ttwpro_supportLink.id = 'twpro_supportLink';\r\n\t\ttwpro_supportLink.href = 'http://userscripts.org/scripts/show/92414';\r\n\t\ttwpro_supportLink.target = '_blank';\r\n\t\ttwpro_supportLink.appendChild(document.createTextNode('v'+twpro_version));\r\n\t\tvar twpro_supportAuthor = document.createElement('a');\r\n\t\ttwpro_supportAuthor.id = 'twpro_supportAuthor';\r\n\t\ttwpro_supportAuthor.style.cursor = 'help';\r\n\t\ttwpro_supportAuthor.appendChild(document.createTextNode(\"[+++]\"));\r\n\t\ttwpro_support.appendChild(document.createTextNode(\"TW Pro+: \"));\r\n\t\ttwpro_support.appendChild(twpro_supportLink);\r\n\t\ttwpro_support.appendChild(document.createTextNode(' '+TWPro.lang.AUTHOR+': '));\r\n\t\ttwpro_support.appendChild(twpro_supportAuthor);\r\n\t\tvar translator = TWPro.lang.info;\r\n\t\tif(translator && translator.length){\r\n\t\t\tvar twpro_translatorLink = document.createElement('a');\r\n\t\t\ttwpro_translatorLink.appendChild(document.createTextNode(translator[0]));\r\n\t\t\tif(translator.length > 1){\r\n\t\t\t\tif(translator.length > 3 && translator[3].indexOf('.'+location.host.match(/\\d+\\./)) != -1){\r\n\t\t\t\t\ttwpro_translatorLink.href = 'javascript:AjaxWindow.show(\"profile\",{char_id:'+translator[2]+'},\"'+translator[2]+'\");';\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\ttwpro_translatorLink.href = translator[1];\r\n\t\t\t\t\ttwpro_translatorLink.target = '_blank';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\ttwpro_support.appendChild(document.createTextNode(\" \"+TWPro.lang.TRANSLATOR+\": \"));\r\n\t\t\ttwpro_support.appendChild(twpro_translatorLink);\r\n\t\t}\r\n\t\tif (!TWPro.twpro_active) {\r\n\t\t\ttwpro_support.appendChild(document.createTextNode(\" (\"+TWPro.lang.TWPRO_DISABLED+\")\"));\r\n\t\t}\r\n\t\tvar flags = 'data:image/gif;base64,R0lGODlhPgAKAMQaAAAAAK4cKMYLHv7LAO0pOeJnD5MAAOSzt//EAP3DAtaVDN0AAP///+KxD6NODrWKWc2KLYhAIKl5cehFALXB2M6sLLl8Fb5rG//OACFGi////wAAAAAAAAAAAAAAAAAAACH5BAHoAxoALAAAAAA+AAoAAAWXICCOZCkGaKquQuu+cDnMM2HbZk6uvAr/LxltcMPpdL1kYclsOoW0IsFArVqv1IN2y+0ivgmFIvEtl6G14mLNbrvXjLh8Ti83HI+G2Ywmqt+AbHSDc2UQERIQe2ckQ343E5GSk5SRFJeYmZplFRYXFYtffVIYpaanqKUZq6ytrk6wTaNFqbWnrritQLuzN7a/ucG7QL02IQA7'\r\n\t\tvar ib = document.getElementById('main_footnotes');\r\n\t\tib.insertBefore(twpro_support, ib.firstChild);\r\n\t\t$(twpro_supportAuthor.id).addMousePopup(new MousePopup('<table cellspacing=\"0\" cellpadding=\"0\"><tr><td>Author:</td><td>Nexton<div style=\"float:right;margin-left:3px;margin-top:3px;background:url('+flags+')0px;width:17px;height: 10px;\"></div></td></tr><tr><td>Contributor:</td><td>Lekensteyn<div style=\"float:right;margin-left:3px;margin-top:3px;background:url('+flags+')-17px;width:15px;height: 10px;\"></div></td></tr><tr><td>Contributor:</td><td>Sandevil<div style=\"float:right;margin-left:3px;margin-top:3px;background:url('+flags+')-32px;width:15px;height: 10px;\"></div></td></tr><tr><td>Contributor:</td><td>Pedro Ramirez<div style=\"float:right;margin-left:3px;margin-top:3px;background:url('+flags+')0px;width:17px;height: 10px;\"></div></td></tr><tr><td>This release:&nbsp;</td><td>Zyphir Randrott<div style=\"float:right;margin-left:3px;margin-top:3px;background:url('+flags+')-47px;width:15px;height: 10px;\"></div></td></tr></table>'));\r\n\t\tif (TWPro.twpro_failureInject) {\r\n\t\t\tTWPro.twpro_throwFailure();\r\n\t\t}\r\n\t}", "function FC_GoMain()\n{\n\tlocation.href = \"../../maincontents.htm\";\n\n\t//window.external.ContentsUserFunction('GoMain,0');\n}", "function doStuff(){\n\n}", "function compCode_20160614_154125() {\r\rapp.beginUndoGroup(\"massiveBusiness\");\r\rtry {\r\r// Create Folder hierarchy\r\tvar zcompcodescripts_folder = getItem(\"Z_Compcode_Scripts\", FolderItem, app.project.rootFolder);\r\tif (zcompcodescripts_folder === null) {\r\t\tzcompcodescripts_folder = app.project.items.addFolder(\"Z_Compcode_Scripts\");\r\t}\r\tvar buildings_folder = getItem(\"Buildings\", FolderItem, zcompcodescripts_folder);\r\tif (buildings_folder === null) {\r\t\tbuildings_folder = app.project.items.addFolder(\"Buildings\");\r\t\tbuildings_folder.parentFolder = zcompcodescripts_folder;\r\t}\r\tvar out_folder = getItem(\"OUT\", FolderItem, buildings_folder);\r\tif (out_folder === null) {\r\t\tout_folder = app.project.items.addFolder(\"OUT\");\r\t\tout_folder.parentFolder = buildings_folder;\r\t}\r\tvar precomps_folder = getItem(\"PreComps\", FolderItem, buildings_folder);\r\tif (precomps_folder === null) {\r\t\tprecomps_folder = app.project.items.addFolder(\"PreComps\");\r\t\tprecomps_folder.parentFolder = buildings_folder;\r\t}\r\r// Create Compositions\r\tvar massivebusiness_comp = app.project.items.addComp(\"massiveBusiness\", 412, 412, 1, 2.8, 25);\r\t\tmassivebusiness_comp.time = 2.76;\r\t\tmassivebusiness_comp.bgColor = [0,0,0];\r\t\tmassivebusiness_comp.parentFolder = out_folder;\r\tvar massivebusinessanimation_comp = getItem(\"massiveBusiness_animation\", CompItem, precomps_folder);\r\tvar massivebusinessanimation_comp_populate = false;\r\tif (massivebusinessanimation_comp === null) {\r\t\tmassivebusinessanimation_comp = app.project.items.addComp(\"massiveBusiness_animation\", 412, 412, 1, 2.8, 25);\r\t\tmassivebusinessanimation_comp.time = 0.04;\r\t\tmassivebusinessanimation_comp.bgColor = [0,0,0];\r\t\tmassivebusinessanimation_comp.workAreaDuration = 1.08010005950928;\r\t\tmassivebusinessanimation_comp.motionBlur = true;\r\t\tmassivebusinessanimation_comp.parentFolder = precomps_folder;\r\t\tmassivebusinessanimation_comp_populate = true;\r\t}\r\r// Working with comp \"massiveBusiness\", varName \"massivebusiness_comp\";\r\tmassivebusiness_comp.openInViewer();\r\t// Add existing composition \"massiveBusiness_animation\", varName \"massivebusinessanimation_comp\";\r\tvar massivebusinessanimation = massivebusiness_comp.layers.add(massivebusinessanimation_comp);\r\t\tmassivebusinessanimation.collapseTransformation = true;\r\t\tmassivebusinessanimation.motionBlur = true;\r\t\tmassivebusinessanimation.moveToEnd();\r\t\tmassivebusinessanimation.timeRemapEnabled = true;\r\t\tvar massivebusinessanimationTimeRemap = massivebusinessanimation.property(\"ADBE Time Remapping\");\r\t\t\tmassivebusinessanimationTimeRemap.setValueAtTime(99999, massivebusinessanimationTimeRemap.keyValue(1));\r\t\t\tmassivebusinessanimationTimeRemap.removeKey(2);\r\t\t\tmassivebusinessanimationTimeRemap.removeKey(1);\r\t\t\tvar massivebusinessanimationTimeRemap_keyTimesArray = [0,1.2,1.6,2.8];\r\t\t\tvar massivebusinessanimationTimeRemap_valuesArray = [0,1.2,1.2,0];\r\t\t\tmassivebusinessanimationTimeRemap.setValuesAtTimes(massivebusinessanimationTimeRemap_keyTimesArray, massivebusinessanimationTimeRemap_valuesArray);\r\t\t\tmassivebusinessanimationTimeRemap.removeKey(massivebusinessanimationTimeRemap.nearestKeyIndex(99999));\r\t\tmassivebusinessanimation.selected = false;\r\t// Add Shape Layer \"Icon_bg_mask\", varName \"iconbgmask\";\r\tvar iconbgmask = massivebusiness_comp.layers.addShape();\r\t\ticonbgmask.name = \"Icon_bg_mask\";\r\t\ticonbgmask.enabled = false;\r\t\ticonbgmask.motionBlur = true;\r\t\ticonbgmask.moveToEnd();\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").addProperty(\"ADBE Vector Group\");\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(1).name = \"chemicals Outlines - Group 22\";\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(1).property(2).addProperty(\"ADBE Vector Group\");\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).name = \"Group 22\";\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(2).addProperty(\"ADBE Vector Shape - Group\");\r\t\tvar iconbgmaskPath = iconbgmask.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(2).property(1).property(\"ADBE Vector Shape\");\r\t\tvar iconbgmaskPath_newShape = new Shape();\r\t\t\ticonbgmaskPath_newShape.vertices = [[144, 0], [0, 144], [-144, 0], [0, -144]];\r\t\t\ticonbgmaskPath_newShape.inTangents = [[0, -79.5289916992188], [79.5289916992188, 0], [0, 79.5289916992188], [-79.5290069580078, 0]];\r\t\t\ticonbgmaskPath_newShape.outTangents = [[0, 79.5289916992188], [-79.5290069580078, 0], [0, -79.5289916992188], [79.5289916992188, 0]];\r\t\t\ticonbgmaskPath_newShape.closed = true;\r\t\ticonbgmaskPath.setValue(iconbgmaskPath_newShape);\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(2).addProperty(\"ADBE Vector Graphic - Stroke\");\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(2).property(2).property(\"ADBE Vector Stroke Color\").setValue([0,0,0,1]);\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(2).property(2).property(\"ADBE Vector Stroke Width\").setValue(12);\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(2).property(2).property(\"ADBE Vector Stroke Line Cap\").setValue(2);\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(2).property(2).property(\"ADBE Vector Stroke Line Join\").setValue(2);\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(3).property(\"ADBE Vector Position\").setValue([206,206]);\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(1).property(3).property(\"ADBE Vector Anchor\").setValue([206,206]);\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(1).property(3).property(\"ADBE Vector Position\").setValue([206,206]);\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").addProperty(\"ADBE Vector Group\");\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(2).name = \"chemicals Outlines - Group 23\";\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(2).property(2).addProperty(\"ADBE Vector Group\");\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(2).property(2).property(1).name = \"Group 23\";\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(2).property(2).property(1).property(2).addProperty(\"ADBE Vector Shape - Group\");\r\t\tvar iconbgmaskPath = iconbgmask.property(\"ADBE Root Vectors Group\").property(2).property(2).property(1).property(2).property(1).property(\"ADBE Vector Shape\");\r\t\tvar iconbgmaskPath_newShape = new Shape();\r\t\t\ticonbgmaskPath_newShape.vertices = [[144, 0], [0, 144], [-144, 0], [0, -144]];\r\t\t\ticonbgmaskPath_newShape.inTangents = [[0, -79.5289916992188], [79.5289916992188, 0], [0, 79.5289916992188], [-79.5290069580078, 0]];\r\t\t\ticonbgmaskPath_newShape.outTangents = [[0, 79.5289916992188], [-79.5290069580078, 0], [0, -79.5289916992188], [79.5289916992188, 0]];\r\t\t\ticonbgmaskPath_newShape.closed = true;\r\t\ticonbgmaskPath.setValue(iconbgmaskPath_newShape);\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(2).property(2).property(1).property(2).addProperty(\"ADBE Vector Graphic - Fill\");\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(2).property(2).property(1).property(2).property(2).property(\"ADBE Vector Fill Color\").setValue([0.14100000718061,0.67099998324525,0.88999998803232,1]);\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(2).property(2).property(1).property(3).property(\"ADBE Vector Position\").setValue([206,206]);\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(2).property(3).property(\"ADBE Vector Anchor\").setValue([206,206]);\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(2).property(3).property(\"ADBE Vector Position\").setValue([206,206]);\r\t\ticonbgmask.property(\"ADBE Transform Group\").property(\"ADBE Anchor Point\").setValue([206,206,0]);\r\t\tvar iconbgmaskScale = iconbgmask.property(\"ADBE Transform Group\").property(\"ADBE Scale\");\r\t\t\tvar iconbgmaskScale_keyTimesArray = [0,0.4,2.4,2.76];\r\t\t\tvar iconbgmaskScale_valuesArray = [[0,0,100],[100,100,100],[100,100,100],[0,0,100]];\r\t\t\ticonbgmaskScale.setValuesAtTimes(iconbgmaskScale_keyTimesArray, iconbgmaskScale_valuesArray);\r\t\t\tvar iconbgmaskScale_easeInSpeedArray = [[0,0,0],[0,0,0],[0,0,0],[0,0,0]];\r\t\t\tvar iconbgmaskScale_easeInInfluArray = [[50,50,50],[50,50,50],[50,50,50],[50,50,50]];\r\t\t\tvar iconbgmaskScale_easeOutSpeedArray = [[0,0,0],[0,0,0],[0,0,0],[0,0,0]];\r\t\t\tvar iconbgmaskScale_easeOutInfluArray = [[50,50,50],[50,50,50],[50,50,50],[50,50,50]];\r\t\t\tvar iconbgmaskScale_keyInInterpolationType = [KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER];\r\t\t\tvar iconbgmaskScale_keyOutInterpolationType = [KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER];\r\t\t\tapplyEasing(iconbgmaskScale, iconbgmaskScale_keyTimesArray, [iconbgmaskScale_easeInSpeedArray, iconbgmaskScale_easeInInfluArray], [iconbgmaskScale_easeOutSpeedArray, iconbgmaskScale_easeOutInfluArray], [iconbgmaskScale_keyInInterpolationType, iconbgmaskScale_keyOutInterpolationType]);\r\r\t\ticonbgmask.selected = false;\r\t// Add existing composition \"massiveBusiness_animation\", varName \"massivebusinessanimation_comp\";\r\tvar shadow = massivebusiness_comp.layers.add(massivebusinessanimation_comp);\r\t\tshadow.name = \"shadow\";\r\t\tshadow.collapseTransformation = true;\r\t\tshadow.motionBlur = true;\r\t\tshadow.moveToEnd();\r\t\tshadow.trackMatteType = TrackMatteType.ALPHA;\r\t\tshadow.timeRemapEnabled = true;\r\t\tvar shadowTimeRemap = shadow.property(\"ADBE Time Remapping\");\r\t\t\tshadowTimeRemap.setValueAtTime(99999, shadowTimeRemap.keyValue(1));\r\t\t\tshadowTimeRemap.removeKey(2);\r\t\t\tshadowTimeRemap.removeKey(1);\r\t\t\tvar shadowTimeRemap_keyTimesArray = [0,1.2,1.6,2.8];\r\t\t\tvar shadowTimeRemap_valuesArray = [0,1.2,1.2,0];\r\t\t\tshadowTimeRemap.setValuesAtTimes(shadowTimeRemap_keyTimesArray, shadowTimeRemap_valuesArray);\r\t\t\tshadowTimeRemap.removeKey(shadowTimeRemap.nearestKeyIndex(99999));\r\t\tshadow.property(\"ADBE Effect Parade\").addProperty(\"ADBE Fill\");\r\t\tshadow.property(\"ADBE Effect Parade\").property(1).property(\"ADBE Fill-0002\").setValue([0,0,0,1]);\r\t\tvar shadowPosition = shadow.property(\"ADBE Transform Group\").property(\"ADBE Position\");\r\t\t\tvar shadowPosition_keyTimesArray = [0.28,0.6,2.2,2.48];\r\t\t\tvar shadowPosition_valuesArray = [[206,206,0],[227.5,218.5,0],[227.5,218.5,0],[206,206,0]];\r\t\t\tshadowPosition.setValuesAtTimes(shadowPosition_keyTimesArray, shadowPosition_valuesArray);\r\t\t\tvar shadowPosition_inSpatialTangents = [[-3.58333325386047,-2.08333325386047,0],[-3.58333325386047,-2.08333325386047,0],[0,0,0],[3.58333325386047,2.08333325386047,0]];\r\t\t\tvar shadowPosition_outSpatialTangents = [[3.58333325386047,2.08333325386047,0],[0,0,0],[-3.58333325386047,-2.08333325386047,0],[-3.58333325386047,-2.08333325386047,0]];\r\t\t\tapplySpatialTangents(shadowPosition, shadowPosition_keyTimesArray, shadowPosition_inSpatialTangents, shadowPosition_outSpatialTangents);\r\t\t\tvar shadowPosition_easeInSpeedArray = [0,0,0,0];\r\t\t\tvar shadowPosition_easeInInfluArray = [16.666666667,50,50,16.666666667];\r\t\t\tvar shadowPosition_easeOutSpeedArray = [0,0,0,0];\r\t\t\tvar shadowPosition_easeOutInfluArray = [50,16.666666667,16.666666667,50];\r\t\t\tvar shadowPosition_keyInInterpolationType = [KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER];\r\t\t\tvar shadowPosition_keyOutInterpolationType = [KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER];\r\t\t\tapplyEasing(shadowPosition, shadowPosition_keyTimesArray, [shadowPosition_easeInSpeedArray, shadowPosition_easeInInfluArray], [shadowPosition_easeOutSpeedArray, shadowPosition_easeOutInfluArray], [shadowPosition_keyInInterpolationType, shadowPosition_keyOutInterpolationType]);\r\r\t\tshadow.property(\"ADBE Transform Group\").property(\"ADBE Opacity\").setValue(20);\r\t\tshadow.selected = false;\r\t// Add Shape Layer \"Icon_bg\", varName \"iconbg\";\r\tvar iconbg = massivebusiness_comp.layers.addShape();\r\t\ticonbg.name = \"Icon_bg\";\r\t\ticonbg.motionBlur = true;\r\t\ticonbg.moveToEnd();\r\t\ticonbg.property(\"ADBE Root Vectors Group\").addProperty(\"ADBE Vector Group\");\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(1).name = \"chemicals Outlines - Group 22\";\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(1).property(2).addProperty(\"ADBE Vector Group\");\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).name = \"Group 22\";\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(2).addProperty(\"ADBE Vector Shape - Group\");\r\t\tvar iconbgPath = iconbg.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(2).property(1).property(\"ADBE Vector Shape\");\r\t\tvar iconbgPath_newShape = new Shape();\r\t\t\ticonbgPath_newShape.vertices = [[144, 0], [0, 144], [-144, 0], [0, -144]];\r\t\t\ticonbgPath_newShape.inTangents = [[0, -79.5289916992188], [79.5289916992188, 0], [0, 79.5289916992188], [-79.5290069580078, 0]];\r\t\t\ticonbgPath_newShape.outTangents = [[0, 79.5289916992188], [-79.5290069580078, 0], [0, -79.5289916992188], [79.5289916992188, 0]];\r\t\t\ticonbgPath_newShape.closed = true;\r\t\ticonbgPath.setValue(iconbgPath_newShape);\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(2).addProperty(\"ADBE Vector Graphic - Stroke\");\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(2).property(2).property(\"ADBE Vector Stroke Color\").setValue([0,0,0,1]);\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(2).property(2).property(\"ADBE Vector Stroke Width\").setValue(12);\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(2).property(2).property(\"ADBE Vector Stroke Line Cap\").setValue(2);\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(2).property(2).property(\"ADBE Vector Stroke Line Join\").setValue(2);\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(3).property(\"ADBE Vector Position\").setValue([206,206]);\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(1).property(3).property(\"ADBE Vector Anchor\").setValue([206,206]);\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(1).property(3).property(\"ADBE Vector Position\").setValue([206,206]);\r\t\ticonbg.property(\"ADBE Root Vectors Group\").addProperty(\"ADBE Vector Group\");\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(2).name = \"chemicals Outlines - Group 23\";\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(2).property(2).addProperty(\"ADBE Vector Group\");\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(2).property(2).property(1).name = \"Group 23\";\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(2).property(2).property(1).property(2).addProperty(\"ADBE Vector Shape - Group\");\r\t\tvar iconbgPath = iconbg.property(\"ADBE Root Vectors Group\").property(2).property(2).property(1).property(2).property(1).property(\"ADBE Vector Shape\");\r\t\tvar iconbgPath_newShape = new Shape();\r\t\t\ticonbgPath_newShape.vertices = [[144, 0], [0, 144], [-144, 0], [0, -144]];\r\t\t\ticonbgPath_newShape.inTangents = [[0, -79.5289916992188], [79.5289916992188, 0], [0, 79.5289916992188], [-79.5290069580078, 0]];\r\t\t\ticonbgPath_newShape.outTangents = [[0, 79.5289916992188], [-79.5290069580078, 0], [0, -79.5289916992188], [79.5289916992188, 0]];\r\t\t\ticonbgPath_newShape.closed = true;\r\t\ticonbgPath.setValue(iconbgPath_newShape);\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(2).property(2).property(1).property(2).addProperty(\"ADBE Vector Graphic - Fill\");\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(2).property(2).property(1).property(2).property(2).property(\"ADBE Vector Fill Color\").setValue([0.1410000026226,0.6710000038147,0.88999998569489,1]);\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(2).property(2).property(1).property(2).property(2).property(\"ADBE Vector Fill Opacity\").setValue(60);\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(2).property(2).property(1).property(3).property(\"ADBE Vector Position\").setValue([206,206]);\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(2).property(3).property(\"ADBE Vector Anchor\").setValue([206,206]);\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(2).property(3).property(\"ADBE Vector Position\").setValue([206,206]);\r\t\ticonbg.property(\"ADBE Transform Group\").property(\"ADBE Anchor Point\").setValue([206,206,0]);\r\t\tvar iconbgScale = iconbg.property(\"ADBE Transform Group\").property(\"ADBE Scale\");\r\t\t\tvar iconbgScale_keyTimesArray = [0,0.4,2.4,2.76];\r\t\t\tvar iconbgScale_valuesArray = [[0,0,100],[100,100,100],[100,100,100],[0,0,100]];\r\t\t\ticonbgScale.setValuesAtTimes(iconbgScale_keyTimesArray, iconbgScale_valuesArray);\r\t\t\tvar iconbgScale_easeInSpeedArray = [[0,0,0],[0,0,0],[0,0,0],[0,0,0]];\r\t\t\tvar iconbgScale_easeInInfluArray = [[50,50,50],[50,50,50],[50,50,50],[50,50,50]];\r\t\t\tvar iconbgScale_easeOutSpeedArray = [[0,0,0],[0,0,0],[0,0,0],[0,0,0]];\r\t\t\tvar iconbgScale_easeOutInfluArray = [[50,50,50],[50,50,50],[50,50,50],[50,50,50]];\r\t\t\tvar iconbgScale_keyInInterpolationType = [KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER];\r\t\t\tvar iconbgScale_keyOutInterpolationType = [KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER];\r\t\t\tapplyEasing(iconbgScale, iconbgScale_keyTimesArray, [iconbgScale_easeInSpeedArray, iconbgScale_easeInInfluArray], [iconbgScale_easeOutSpeedArray, iconbgScale_easeOutInfluArray], [iconbgScale_keyInInterpolationType, iconbgScale_keyOutInterpolationType]);\r\r\t\ticonbg.selected = false;\r// Working with comp \"massiveBusiness_animation\", varName \"massivebusinessanimation_comp\";\rif (massivebusinessanimation_comp_populate === true) {\r\t// Add Shape Layer \"massiveBusiness Outlines - Group 1\", varName \"massivebusinessOutlinesGroup1\";\r\tvar massivebusinessOutlinesGroup1 = massivebusinessanimation_comp.layers.addShape();\r\t\tmassivebusinessOutlinesGroup1.name = \"massiveBusiness Outlines - Group 1\";\r\t\tmassivebusinessOutlinesGroup1.startTime = 0.24;\r\t\tmassivebusinessOutlinesGroup1.inPoint = 0.36;\r\t\tmassivebusinessOutlinesGroup1.outPoint = 3.04;\r\t\tmassivebusinessOutlinesGroup1.motionBlur = true;\r\t\tmassivebusinessOutlinesGroup1.moveToEnd();\r\t\tmassivebusinessOutlinesGroup1.property(\"ADBE Root Vectors Group\").addProperty(\"ADBE Vector Group\");\r\t\tmassivebusinessOutlinesGroup1.property(\"ADBE Root Vectors Group\").property(1).property(2).addProperty(\"ADBE Vector Shape - Group\");\r\t\tvar massivebusinessOutlinesGroup1Path = massivebusinessOutlinesGroup1.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(\"ADBE Vector Shape\");\r\t\t\tvar massivebusinessOutlinesGroup1Path_keyTimesArray = [0.36, 0.48, 0.68, 1.08];\r\t\t\tvar massivebusinessOutlinesGroup1Path_object = {};\r\t\t\t\tmassivebusinessOutlinesGroup1Path_object.closed = true;\r\t\t\t\tmassivebusinessOutlinesGroup1Path_object.vertices = [[[-9.59049987792969, 70.5160064697266], [14.5905151367188, 70.5160064697266], [13.9830322265625, 70.4839935302734], [10.3190307617188, 70.4839935302734], [10.2295227050781, 70.5890045166016], [3.76750183105469, 70.5890045166016], [3.85700988769531, 70.4839935302734], [1.54403686523438, 70.1714935302734], [1.45449829101562, 70.2454986572266], [-2.00997924804688, 70.2884979248047], [-2.04048156738281, 70.2454986572266], [-5.70198059082031, 70.2884979248047], [-5.73248291015625, 70.2454986572266], [-9.39398193359375, 70.2884979248047]], [[-84.5904998779297, 70.5160064697266], [84.5905151367188, 70.5160064697266], [83.9830322265625, 70.4839935302734], [57.8190307617188, 70.4839935302734], [57.7295227050781, 70.5890045166016], [46.2675170898438, 70.5890045166016], [46.3570251464844, 70.4839935302734], [24.0440216064453, 70.1714935302734], [23.9545135498047, 70.2454986572266], [-12.0099792480469, 70.2884979248047], [-12.0404815673828, 70.2454986572266], [-48.2019805908203, 70.2884979248047], [-48.2324829101562, 70.2454986572266], [-84.3939819335938, 70.2884979248047]], [[-84.5904998779297, 70.5160064697266], [84.5905151367188, 70.5160064697266], [79.6790161132812, 6.48399353027344], [57.8900146484375, 6.48399353027344], [57.8005065917969, 6.58900451660156], [46.3385009765625, 6.58900451660156], [46.4280090332031, 6.48399353027344], [24.1150054931641, 6.17149353027344], [24.0254974365234, 5.68299865722656], [-11.9389953613281, 5.72599792480469], [-11.9694976806641, 5.68299865722656], [-48.1309967041016, 5.72599792480469], [-48.1614990234375, 5.68299865722656], [-84.322998046875, 5.72599792480469]], [[-84.5904998779297, 70.5160064697266], [84.5905151367188, 70.5160064697266], [79.5895080566406, -70.5160064697266], [57.8005065917969, -70.5160064697266], [57.8005065917969, 6.58900451660156], [46.3385009765625, 6.58900451660156], [46.3385009765625, -70.5160064697266], [24.0254974365234, -70.5160064697266], [24.0254974365234, 5.68299865722656], [-11.9694976806641, -16.0240020751953], [-11.9694976806641, 5.68299865722656], [-48.1614990234375, -16.0240020751953], [-48.1614990234375, 5.68299865722656], [-84.3535003662109, -16.0240020751953]]];\r\t\t\taddShapeKeyframes(massivebusinessOutlinesGroup1Path, massivebusinessOutlinesGroup1Path_keyTimesArray, massivebusinessOutlinesGroup1Path_object);\r\t\t\tvar massivebusinessOutlinesGroup1Path_easeInSpeedArray = [0,0,2.83349473266731,0];\r\t\t\tvar massivebusinessOutlinesGroup1Path_easeInInfluArray = [65,65,65,65];\r\t\t\tvar massivebusinessOutlinesGroup1Path_easeOutSpeedArray = [0,0,2.83347893605559,0];\r\t\t\tvar massivebusinessOutlinesGroup1Path_easeOutInfluArray = [65,65,65,16.666666667];\r\t\t\tvar massivebusinessOutlinesGroup1Path_keyInInterpolationType = [KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER];\r\t\t\tvar massivebusinessOutlinesGroup1Path_keyOutInterpolationType = [KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER];\r\t\t\tapplyEasing(massivebusinessOutlinesGroup1Path, massivebusinessOutlinesGroup1Path_keyTimesArray, [massivebusinessOutlinesGroup1Path_easeInSpeedArray, massivebusinessOutlinesGroup1Path_easeInInfluArray], [massivebusinessOutlinesGroup1Path_easeOutSpeedArray, massivebusinessOutlinesGroup1Path_easeOutInfluArray], [massivebusinessOutlinesGroup1Path_keyInInterpolationType, massivebusinessOutlinesGroup1Path_keyOutInterpolationType]);\r\r\t\tmassivebusinessOutlinesGroup1.property(\"ADBE Root Vectors Group\").property(1).property(2).addProperty(\"ADBE Vector Graphic - Stroke\");\r\t\tmassivebusinessOutlinesGroup1.property(\"ADBE Root Vectors Group\").property(1).property(2).property(2).property(\"ADBE Vector Stroke Color\").setValue([0,0,0,1]);\r\t\tmassivebusinessOutlinesGroup1.property(\"ADBE Root Vectors Group\").property(1).property(2).property(2).property(\"ADBE Vector Stroke Width\").setValue(8.55399990081787);\r\t\tmassivebusinessOutlinesGroup1.property(\"ADBE Root Vectors Group\").property(1).property(2).property(2).property(\"ADBE Vector Stroke Line Join\").setValue(2);\r\t\tmassivebusinessOutlinesGroup1.property(\"ADBE Root Vectors Group\").property(1).property(2).addProperty(\"ADBE Vector Graphic - Fill\");\r\t\tmassivebusinessOutlinesGroup1.property(\"ADBE Root Vectors Group\").property(1).property(2).property(3).property(\"ADBE Vector Fill Color\").setValue([1,1,1,1]);\r\t\tmassivebusinessOutlinesGroup1.property(\"ADBE Root Vectors Group\").property(1).property(3).property(\"ADBE Vector Position\").setValue([203.999893188477,194.181503295898]);\r\t\tmassivebusinessOutlinesGroup1.property(\"ADBE Transform Group\").property(\"ADBE Anchor Point\").setValue([203.999893188477,194.181503295898,0]);\r\t\tmassivebusinessOutlinesGroup1.property(\"ADBE Transform Group\").property(\"ADBE Position\").setValue([203.999893188477,194.181503295898,0]);\r\t\tmassivebusinessOutlinesGroup1.selected = false;\r}\rmassivebusiness_comp.openInViewer();\r\r} catch(e) {\r\talert(e.toString() + \"\\nError on line: \" + e.line.toString());\r}\rapp.endUndoGroup();\r\r\rfunction getItem(itemName, itemInstanceName, locationObject) {\r\tif (locationObject.numItems > 0) {\r\t\tfor (var i = 1; i <= locationObject.numItems; i ++) {\r\t\t\tvar curItem = locationObject.item(i);\r\t\t\tif (curItem.name === itemName) {\r\t\t\t\tif (curItem instanceof itemInstanceName || (curItem.mainSource !== \"undefined\" && curItem.mainSource instanceof itemInstanceName)) {\r\t\t\t\t\treturn curItem;\r\t\t\t\t}\r\t\t\t}\r\t\t}\r\t}\r\treturn null;\r}\r\rfunction applyEasing(property, keyTimesArray, easeInArray, easeOutArray, keyInterpolationArray) {\r\tfor (var i = 0; i < keyTimesArray.length; i ++) {\r\t\tif (property.propertyValueType === PropertyValueType.TwoD) {\r\t\t\tvar easeIn0 = new KeyframeEase(easeInArray[0][i][0], easeInArray[1][i][0]);\r\t\t\tvar easeOut0 = new KeyframeEase(easeOutArray[0][i][0], easeOutArray[1][i][0]);\r\t\t\tvar easeIn1 = new KeyframeEase(easeInArray[0][i][1], easeInArray[1][i][1]);\r\t\t\tvar easeOut1 = new KeyframeEase(easeOutArray[0][i][1], easeOutArray[1][i][1]);\r\t\t\tproperty.setTemporalEaseAtKey(i+1, [easeIn0, easeIn1], [easeOut0, easeOut1]);\r\t\t} else if (property.propertyValueType === PropertyValueType.ThreeD) {\r\t\t\tvar easeIn0 = new KeyframeEase(easeInArray[0][i][0], easeInArray[1][i][0]);\r\t\t\tvar easeOut0 = new KeyframeEase(easeOutArray[0][i][0], easeOutArray[1][i][0]);\r\t\t\tvar easeIn1 = new KeyframeEase(easeInArray[0][i][1], easeInArray[1][i][1]);\r\t\t\tvar easeOut1 = new KeyframeEase(easeOutArray[0][i][1], easeOutArray[1][i][1]);\r\t\t\tvar easeIn2 = new KeyframeEase(easeInArray[0][i][2], easeInArray[1][i][2]);\r\t\t\tvar easeOut2 = new KeyframeEase(easeOutArray[0][i][2], easeOutArray[1][i][2]);\r\t\t\tproperty.setTemporalEaseAtKey(i+1, [easeIn0, easeIn1, easeIn2], [easeOut0, easeOut1, easeOut2]);\r\t\t} else {\r\t\t\tvar easeIn = new KeyframeEase(easeInArray[0][i], easeInArray[1][i]);\r\t\t\tvar easeOut = new KeyframeEase(easeOutArray[0][i], easeOutArray[1][i]);\r\t\t\tif (keyInterpolationArray[1][i] !== KeyframeInterpolationType.HOLD) {\r\t\t\t\tproperty.setTemporalEaseAtKey(i+1, [easeIn], [easeOut]);\r\t\t\t} else {\r\t\t\t\tproperty.setTemporalEaseAtKey(i+1, [easeIn]);\r\t\t\t}\r\t\t}\r\t\tproperty.setInterpolationTypeAtKey(i+1, keyInterpolationArray[0][i], keyInterpolationArray[1][i]);\r\t}\r}\r\rfunction applySpatialTangents(property, keyTimesArray, inSpatialTangentsArray, outSpatialTangentsArray) {\r\tfor (var sp = 0; sp < keyTimesArray.length; sp ++) {\r\t\tproperty.setSpatialTangentsAtKey(sp+1, inSpatialTangentsArray[sp], outSpatialTangentsArray[sp]);\r\t}\r}\rfunction addShapeKeyframes(myPath, keyTimesArray, myShapeObject) {\r\tvar valuesArray = [];\r\tfor (var i = 0, il = keyTimesArray.length; i < il; i ++) {\r\t\tvar newShape = new Shape();\r\t\tfor (var prop in myShapeObject) {\r\t\t\tif (myShapeObject[prop] instanceof Array) { newShape[prop] = myShapeObject[prop][i]; }\r\t\t\telse { newShape[prop] = myShapeObject[prop]; }\r\t\t}\r\t\tvaluesArray.push(newShape);\r\t}\r\tmyPath.setValuesAtTimes(keyTimesArray, valuesArray);\r}\r\r}", "function Macex() {\r\n}", "function poiWorkerFunction() \n{\n//console.log('poiWorkerFunction called');\n// source of worker-poi3d.js \n// FIXME! Migrate to inline webworker when Security Error Of IE11 is fixed!\n// self.onmessage = function(event) {\n// if( event.data['command'] === 'compile' ) {\n// eval(event.data['script']);\n// return;\n// }\n// };\n//\n// Implementation Of Epipolar POI Webgl Engine\n// override worker-poi3d.js.onmessage!\n//\nself.onmessage = function(event) {\n if( !self.engine_ ) {\n //console.log('Worker.onmessage.this=' + this);\n self.engine_ = new self.Poi3dEngine(/**@type{Worker}*/(this));\n }\n if(self.engine_) {\n self.engine_.onmessage(event.data);\n }\n};\n\n/**\n * POI Feature class\n * @constructor\n */\nself.Poi3dFeature = function() {\n /**\n * @type {boolean}\n */\n this.visible = false;\n /**\n * @type {string}\n */\n this.id = '';\n /**\n * @type {string}\n */\n this.text = '';\n /**\n * @type {number}\n */\n this.rank = 0;\n /**\n * @type {number}\n */\n this.level = 0;\n /**\n * @type {string}\n */\n this.layer = '';\n /**\n * @type {number}\n */\n this.icon = 0;\n /**\n * @type {number}\n */\n this.mapX = 0;\n /**\n * @type {number}\n */\n this.mapY = 0;\n /**\n * @type {number}\n */\n this.mapZ = 0;\n /**\n * @type {number}\n */\n this.ndcX = 0;\n /**\n * @type {number}\n */\n this.ndcY = 0;\n /**\n * @type {number}\n */\n this.ndcZ = 0;\n /**\n * @type {number}\n */\n this.atlasX = -1; //-1 means non-atlas state\n /**\n * @type {number}\n */\n this.atlasY = 0;\n /**\n * @type {number}\n */\n this.atlasW = 0;\n /**\n * @type {number}\n */\n this.atlasH = 0;\n};\n\n/**\n * AtlasNode class\n * @constructor\n * @param {number} xTL Top Left Corner.\n * @param {number} yTL Top Left Corner.\n * @param {number} xBR Bottom Right Corner.\n * @param {number} yBR Bottom Right Corner.\n * @param {self.AtlasNode=} childNode1 Child.\n * @param {self.AtlasNode=} childNode2 Child.\n * @param {number=} textID POI ID.\n */\nself.AtlasNode = function(xTL, yTL, xBR, yBR, childNode1, childNode2, textID) {\n this.left = xTL; this.top = yTL;\n this.right = xBR; this.bottom = yBR;\n this.child1 = childNode1 || null; // leaf when child1 != null && child2 != null\n this.child2 = childNode2 || null;\n this.imageID = textID || -1; \n};\n/**\n * PoiAtlas class\n * @constructor\n * @param {number=} canvasWidth Canvas Width(default 1024).\n * @param {number=} canvasHeight Canvas Height(default 1024).\n */\nself.PoiAtlas = function( canvasWidth, canvasHeight ) {\n this.canvasWidth = canvasWidth || 1024; // px units\n this.canvasHeight = canvasHeight || 1024; // px\n this.rootNode = new self.AtlasNode(0,0,this.canvasWidth,this.canvasHeight);\n};\n/**\n * Add POI Item\n * @param {self.Poi3dFeature} poi Renderable POI item.\n # @return {boolean} Success Adding\n */\nself.PoiAtlas.prototype.addPoi = function (poi) {\n // iconAlign {0:none,1:left, 2:right, 3:top,4:bottom}\n // Measure Text Width To Find Fitting Region\n if( (poi.text === undefined || poi.text === null || poi.text.length === 0) ) {\n if( (poi.icon === undefined || poi.icon === null || poi.icon === -1) ) {\n return false; // Do Nothing!\n }\n // Only Icon\n // ToDo! Implement Icon\n }\n // Finding Fitted Node\n var nodeFit = this.findNode( this.rootNode, poi );\n // Fitting Node Found!\n if( nodeFit !== undefined && nodeFit !== null ) {\n nodeFit.imageID = poi.id;\n poi.atlasX = nodeFit.left;\n poi.atlasY = nodeFit.top ; // Note! poi.atlasW&Height is Same as node.Width*Height\n return true;\n }\n // Not Found Fitting Node, Resize Altas and Retry Adding\n else {\n this.resize(poi);\n return this.addPoi(poi);\n }\n};\n/**\n * Find Fitting Node By recursively traveling quad tree nodes\n * @param {self.AtlasNode} nodeCurr Curent Root AtlasNode.\n * @param {self.Poi3dFeature} poi Renderable POI item.\n * @private\n */\nself.PoiAtlas.prototype.findNode = function (nodeCurr, poi) {\n if( nodeCurr === undefined || nodeCurr === null ) {\n return undefined;\n }\n // if nodeCurr is Leaf\n if( (nodeCurr.child1 === undefined || nodeCurr.child1 === null) \n && (nodeCurr.child2 === undefined || nodeCurr.child2 === null) ) {\n // If nodeCurr Already Has been Assigned with image, Then Go else Below or Right Nodes\n if( nodeCurr.imageID !== -1 ) {\n return undefined;\n }\n // Determine Horz or Vert Split\n var nodeWidth = nodeCurr.right - nodeCurr.left;\n var nodeHeight = nodeCurr.bottom - nodeCurr.top;\n var diffWidth = nodeWidth - poi.atlasW;\n var diffHeight = nodeHeight - poi.atlasH;\n // If Node Is Smaller than the Image\n if( diffWidth < 0 || diffHeight < 0 ) {\n return undefined;\n }\n // If Node Is same size as Image, then Using this Node\n if( diffWidth === 0 && diffHeight === 0 ) {\n return nodeCurr;\n }\n // Vertical Split (child1=left, child2=right)\n if( diffWidth > diffHeight ) {\n nodeCurr.child1 = new self.AtlasNode(nodeCurr.left, nodeCurr.top, nodeCurr.left+poi.atlasW, nodeCurr.bottom);\n // Only make a second child if enough space available\n if( nodeCurr.left+poi.atlasW+1 < nodeCurr.right ) {\n nodeCurr.child2 = new self.AtlasNode(nodeCurr.left+poi.atlasW+1, nodeCurr.top, nodeCurr.right , nodeCurr.bottom);\n }\n }\n // Horizontal Split (child1=top, child2=bottom)\n else {\n nodeCurr.child1 = new self.AtlasNode(nodeCurr.left, nodeCurr.top , nodeCurr.right, nodeCurr.top+poi.atlasH);\n // Only make a second child if enough space available\n if( nodeCurr.top+poi.atlasH+1 < nodeCurr.bottom ) {\n nodeCurr.child2 = new self.AtlasNode(nodeCurr.left, nodeCurr.top+poi.atlasH+1, nodeCurr.right, nodeCurr.bottom);\n }\n }\n // assign image into child1 which was fitted by same size of image\n return this.findNode(nodeCurr.child1,poi);\n }\n // If Nor a Leaf node, Walk down Childs Recursively\n return this.findNode(nodeCurr.child1,poi) || this.findNode(nodeCurr.child2,poi);\n};\n/**\n * Resize Atlas Canvas\n * @param {self.Poi3dFeature} poi Renderable POI item.\n */\nself.PoiAtlas.prototype.resize = function (poi) {\n var oldWidth = this.canvasWidth ;\n var oldHeight = this.canvasHeight;\n var newWidth = oldWidth + poi.atlasW + Math.floor(oldWidth /2); // Increment By Half of Old size\n var newHeight = oldHeight + poi.atlasH + Math.floor(oldHeight/2);\n //\n // Realine Quad (CoordSys : Left To right, Top To Bottom )\n // \n // New Main Root\n // Top Vertical Half \n // Old Root(Left) | TopRight\n // Bottom Vertical Half\n //\n var nodeTopRigh = new self.AtlasNode(oldWidth+1,0 , newWidth,oldHeight);\n var nodeTopHalf = new self.AtlasNode(0 ,0 , newWidth,oldHeight, this.rootNode,nodeTopRigh);\n var nodeBotHalf = new self.AtlasNode(0 ,oldHeight+1, newWidth,newHeight);\n var nodeNewRoot = new self.AtlasNode(0 ,0 , newWidth,newHeight,nodeTopHalf ,nodeBotHalf);\n this.rootNode = nodeNewRoot;\n // Resize Convas\n this.canvasWidth = newWidth;\n this.canvasHeight = newHeight;\n};\n\n/**\n * Poi3dEngine class\n * @constructor\n * @param {Worker} worker Worker.\n */\nself.Poi3dEngine = function(worker) {\n /**\n * @private\n * @type {Worker}\n */\n this.worker_ = worker;\n /**\n * @type {boolean} \n * @private\n */\n this.DEBUG = false;\n /**\n * @type {number} \n * @private\n */\n this.fontHeight_ = 32;\n /**\n * @type {Array.<string>} \n * @private\n */\n this.names_ = ['id','text','level'];\n //\n // FIXME! options\n // OverlapBufferSize\n // FontHeight\n // LimitCount\n //\n /**\n * @type {Array.<self.Poi3dFeature>} \n * @private\n */\n this.features_ = [];\n /**\n * Engine State\n * 0:initialized, 1:building, 2:done\n * @type {number} \n * @private\n */\n this.state_ = 0;\n};\n/**\n * Override Worker.onmessage\n * @param {Object} eventData Event.Data.\n */\nself.Poi3dEngine.prototype.onmessage = function(eventData) {\n // Note! sorted by calling frequency\n var command = eventData['command'];\n //console.log('poiWorker.onmessage.command='+command);\n \n //\n // Build POIs on ending of interactions\n //\n if( command === 'build' ) {\n this.build(eventData);\n return;\n }\n //\n // On ViewChanged ?\n // viewState\n // \n if( command === 'viewChanged' ) {\n this.onViewChanged(eventData);\n return;\n }\n //\n // Intialization POI Worker Engine\n //\n if( command === 'start' ) {\n this.initalize(eventData);\n return;\n }\n};\n/**\n * Intialize POI Worker Engine\n * @param {Object} eventData Event Data\n */\nself.Poi3dEngine.prototype.initalize = function(eventData) {\n var options = eventData['options'];\n //\n this.DEBUG = options['debug'];\n this.names_ = options['names'];\n //\n // if( this.DEBUG ) {\n // console.log('POIWorker.initalize fontHeight=' + this.fontHeight_);\n // //\n // this.worker_.postMessage({response:'initalized', echo:eventData});\n // }\n}\n/**\n * Post Done Message To App Main Thread\n * @private\n */\nself.Poi3dEngine.prototype.done = function() {\n //\n // var startTime = new Date().getTime(); // get the current time\n // while (new Date().getTime() < startTime + 5*1000)\n // {\n // //\n // }\n this.worker_.postMessage({response:'done'});\n // change state to DONE\n self.state_ = 2;\n}\n/**\n * Handle View Changed\n * @param {Object} eventData Event Data\n * @private\n */\nself.Poi3dEngine.prototype.onViewChanged = function(eventData) {\n if( this.DEBUG ) {\n console.log('POIWorker.onViewChanged=' + eventData);\n }\n //\n // 1. queryViewingFeatures(transform NDC & cull |1|>0)\n // 2. sortFeaturesByRank\n // 3. cullOverlaps\n //\n //this.sortFeaturesByRank();\n // \n //this.cullOverlaps();\n //\n //this.done();\n}\n/**\n * Build POI Fatures\n * @param {Object} eventData Event Data\n * @private\n */\nself.Poi3dEngine.prototype.build = function(eventData) {\n // change state to BUILDING\n self.state_ = 1;\n // if( this.DEBUG ) {\n // console.log('POIWorker.build=' + eventData);\n // }\n // 0. read command parameters\n var featuresSet = eventData['featuresSet'];\n var projViewMatrix = eventData['projViewMatrix'];\n var viewSize = eventData['viewSize'];\n var viewTilt = eventData['viewTilt'];\n //\n this.fontHeight_ = eventData['fontHeight'];\n //console.log('this.fontHeight_='+this.fontHeight_);\n //\n // 1. constructFeatures\n this.constructFeatures(featuresSet, projViewMatrix);\n // 2. sortFeaturesByRank\n this.sortFeaturesByRank();\n // 3. cullOverlaps\n this.cullOverlaps(viewSize, viewTilt);\n // 4. Send Done with building Atlas\n this.doneWithBuildingAtlas();\n}\n/**\n * Construct PoiFeatures From GeometryCollection\n * @param {Object} featuresSet FeaturesSet string source\n * @param {Array<number>} mat ProjViewMatrix\n * @private\n */\nself.Poi3dEngine.prototype.constructFeatures = function(featuresSet, mat) {\n // FIXME! Only GeoJSON! Allow XML or other format!\n var i,ii, featureSource, featureCollection, features;\n var feature, geoemtry, properties, coordinates;\n var mapX,mapY,mapZ, ndcX,ndcY,ndcZ, ndcW;\n var poi, k,kk, cntTotal=0;\n //\n // 1. queryViewingFeatures \n // Construct Internal Features with transforming\n //\n this.features_.length = 0;\n //\n for(i=0,ii=featuresSet.length; i < ii; ++i) {\n featureSource = featuresSet[i];\n featureCollection = JSON.parse(featureSource);\n features = featureCollection['features'];\n //console.log('featureCollection.type='+featureCollection.type);\n //\n for(k = 0, kk=features.length; k<kk; k++,cntTotal++) {\n feature = features[k];\n geoemtry = feature['geometry'];\n properties = feature['properties'];\n coordinates = geoemtry['coordinates'];\n if ( coordinates[0] instanceof Array ) {\n coordinates = coordinates[0];\n }\n mapX = coordinates[0]; \n mapY = coordinates[1];\n mapZ = coordinates[2];\n //console.log('poi.x='+mapX+', '+mapY+', '+mapZ);\n // transform to NDC\n ndcW =1/(mapX * mat[3] + mapY * mat[7] + mapZ * mat[11] + mat[15]);\n ndcX = (mapX * mat[0] + mapY * mat[4] + mapZ * mat[8] + mat[12])*ndcW;\n ndcY = (mapX * mat[1] + mapY * mat[5] + mapZ * mat[9] + mat[13])*ndcW;\n ndcZ = (mapX * mat[2] + mapY * mat[6] + mapZ * mat[10] + mat[14])*ndcW;\n // Culling Outside Frustum\n // FIXME! Need Culling Far Z\n if( (-1.0 < ndcX && ndcX < 1.0) && (-1.0 < ndcY && ndcY < 1.0) && (-1.0 < ndcZ && ndcZ < 1.0) ) {\n poi = new self.Poi3dFeature();\n poi.id = properties[this.names_[0]]; //'id'\n poi.text = properties[this.names_[1]]; // 'text' FIXME! MultiLanguageSupport\n poi.level = properties[this.names_[2]]; // 'level'\n poi.mapX = mapX;\n poi.mapY = mapY;\n poi.mapZ = mapZ;\n poi.ndcX = ndcX;\n poi.ndcY = ndcY;\n poi.ndcZ = ndcZ;\n poi.atlasW = this.fontHeight_*poi.text.length;\n poi.atlasH = this.fontHeight_+6;//6\n //\n this.features_.push(poi);\n //\n // if( this.DEBUG ) {\n // console.log('Atlas=' + poi.atlasW+'/'+poi.atlasH + ' NDC[' + this.features_.length + ']=' \n // + ndcX.toFixed(1)+'/' + ndcY.toFixed(1)+'/' + ndcZ.toFixed(5)+'/' + ndcW.toFixed(1));\n // }\n }\n }\n }\n // Dispose to GC\n featuresSet.length = 0;\n featuresSet = null;\n //console.log('total poi count='+this.features_.length+'/'+cntTotal);\n}\n\n/**\n * Sort Features By Rank or TextLength\n * @private\n */\nself.Poi3dEngine.prototype.sortFeaturesByRank = function() {\n this.features_.sort( function(a,b){\n if(a.level === b.level)\n return a.text.length - b.text.length;\n else\n return a.level - b.level;\n });\n // this.features_.sort( function(a,b){\n // return a.ndcZ - b.ndcZ;\n // });\n // if( this.DEBUG ) {\n // var i,ii, feature;\n // for(i=0, ii=this.features_.length; i < ii; i++) {\n // feature = this.features_[i];\n // console.log('poi['+i+']=' + feature.rank+'/'+feature.text+'/'+feature.layer);\n // }\n // }\n}\n/**\n * Cull Overlapped POI Features\n * @private\n * @param {Array.<number>} viewSize Viewport Size\n * @param {number} viewTilt Camera Viewing Tilt angle \n */\nself.Poi3dEngine.prototype.cullOverlaps = function(viewSize, viewTilt) {\n // 1. construct SpatialIndex Of subGrids\n // FIXME! Use rbush\n var rBush = [];\n var i,ii, feature;\n // 2. dispatch features into subGrids\n // conflict buffer to allow peasable dispatch\n // FIXME! make public option\n //var hk = (1.0-0.5*Math.abs(Math.sin(viewTilt))); // ah is 0.7 at 35 degree\n var hk = 0.5*Math.exp( Math.cos(viewTilt) );\n var aw=0.7, ah=hk;\n var k, kk, rectA=[0,0,0,0], rectB, wx,wy; // ix, iy, grid, poi\n for(i=0, ii=this.features_.length; i < ii; i++) {\n feature = this.features_[i];\n wx = 0.5*viewSize[0]*(feature.ndcX+1);\n wy = 0.5*viewSize[1]*(feature.ndcY+1);\n rectA[0] = wx - aw*feature.atlasW;\n rectA[1] = wy - ah*feature.atlasH;\n rectA[2] = wx + aw*feature.atlasW;\n rectA[3] = wy + ah*feature.atlasH;\n // Check Overlaps\n feature.visible = true;\n for(k=0, kk=rBush.length; k < kk; k++) {\n rectB = rBush[k];\n // Check overlap\n if( rectA[0] < rectB[2] && rectB[0] < rectA[2] \n && rectA[1] < rectB[3] && rectB[1] < rectA[3]) {\n feature.visible = false;\n break;\n }\n }\n if( feature.visible===true ) {\n //console.log('rect='+feature.text+'/'+rectA[0].toFixed(0)+'/'+rectA[1].toFixed(0)\n // +'/'+rectA[2].toFixed(0)+'/'+rectA[3].toFixed(0));\n rBush.push([rectA[0],rectA[1],rectA[2],rectA[3]]);\n }\n }\n // Dispose To GC\n rBush.length = 0;\n rBush = null;\n // if( this.DEBUG ) {\n // var i,ii, feature;\n // for(i=0, ii=this.features_.length; i < ii; i++) {\n // feature = this.features_[i];\n // console.log('poi-cull['+i+']=' + feature.rank+'/'+feature.text+'/'+feature.visible);\n // }\n // }\n}\n\n/**\n * Send Done reponse to App for building command\n * @private\n */\nself.Poi3dEngine.prototype.doneWithBuildingAtlas = function() {\n // build atlas\n var countLimits = 250;\n var atlas = new self.PoiAtlas(2048,2048);\n var i,ii, item;\n for(i=0, ii=this.features_.length; i < ii; i++) {\n item = this.features_[i];\n item.atlasX = -1;\n if(item.visible===true && countLimits-- > 0) {\n atlas.addPoi(item);\n // if( this.DEBUG ) {\n // console.log('poi-atlas-1['+i+']=' + item.atlasX+'/'+item.atlasY);\n // }\n }\n }\n // build vertex array\n var arrayVertex=[], arrayMesh=[]; // arrayVertex is interleaved layout! (vertex,text,tc)\n var pois = [], poi;\n var tc = [0,0,0,0], index=-1;\n for(i=0, ii=this.features_.length; i < ii; i++) {\n item = this.features_[i];\n if( !(item.visible===true && item.atlasX !== -1) ) {\n continue;\n }\n ++index;\n //\n // Four Corner of Quad ( All Same, But Shader Dot It! )\n // Note! TextureCoord is Screen CoordSys\n //\n // LT(-+) RT(++)\n // 3 -----2 \n // | |\n // 0 ---- 1\n // LB(--) RB(+-)\n //\n tc[0] = item.atlasX / atlas.canvasWidth; // left \n tc[2] = (item.atlasX+item.atlasW) / atlas.canvasWidth; // right\n tc[1] = item.atlasY / atlas.canvasHeight; // top\n tc[3] = (item.atlasY+item.atlasH) / atlas.canvasHeight;// bottom\n //\n // Layout of arrayVertex\n // 0:mapX, 1:mapY, 2:mapZ, 3:textCoord.x, 4:textCoord.y, 5:texture.U, 6:texture.V\n //\n // POI Vertex Shader\n //\n // vec4 pos = uMatrix * vec4(aPosition, 1.0);\n // pos /= pos.w;\n // pos.x += (aFontCoord.x / uViewport.x); // NOTE! 0.5 means NDC 2*((Tw/2)/Vw) = Tw/Vw\n // pos.y += (aFontCoord.y / uViewport.y);\n //\n // 0-corner\n arrayVertex.push(item.mapX); arrayVertex.push(item.mapY); arrayVertex.push(item.mapZ);\n arrayVertex.push(-item.atlasW); arrayVertex.push(-item.atlasH);\n arrayVertex.push(tc[0]) ; arrayVertex.push(tc[3]);\n // 1-corner\n arrayVertex.push(item.mapX); arrayVertex.push(item.mapY); arrayVertex.push(item.mapZ);\n arrayVertex.push(+item.atlasW); arrayVertex.push(-item.atlasH);\n arrayVertex.push(tc[2]) ; arrayVertex.push(tc[3]); // 1 corner\n // 2-corner\n arrayVertex.push(item.mapX); arrayVertex.push(item.mapY); arrayVertex.push(item.mapZ);\n arrayVertex.push(+item.atlasW); arrayVertex.push(+item.atlasH);\n arrayVertex.push(tc[2]) ; arrayVertex.push(tc[1]); // 2 corner\n // 3-corner\n arrayVertex.push(item.mapX); arrayVertex.push(item.mapY); arrayVertex.push(item.mapZ);\n arrayVertex.push(-item.atlasW); arrayVertex.push(+item.atlasH);\n arrayVertex.push(tc[0]) ; arrayVertex.push(tc[1]); // 3 corner\n // Triangle Index (4 is Quad)\n arrayMesh.push(index*4+0); arrayMesh.push(index*4+1); arrayMesh.push(index*4+2);\n arrayMesh.push(index*4+2); arrayMesh.push(index*4+3); arrayMesh.push(index*4+0);\n //\n poi = new Object();\n poi['text' ] = item.text;\n poi['atlasX'] = item.atlasX;\n poi['atlasY'] = item.atlasY;\n poi['atlasW'] = item.atlasW;\n poi['atlasH'] = item.atlasH;\n pois.push(poi);\n // if( this.DEBUG ) {\n // console.log('poi-atlas-1['+i+']=' + item.atlasX+'/'+item.atlasY +'/' + item.atlasW+'/'+item.atlasH);\n // }\n }\n //\n var response = new Object();\n response['response' ] = 'done';\n response['vertexArray' ] = arrayVertex;\n response['indexArray' ] = arrayMesh;\n response['atlasSize' ] = [atlas.canvasWidth, atlas.canvasHeight];\n response['pois' ] = pois;\n // change state to DONE\n self.state_ = 2;\n //\n //setTimeout(function(){\n this.worker_.postMessage(response);\n //}.bind(this),500);\n}\n} // end of PoiEngineFunction", "function showSCMain()\r\n{\r\n // Tracker#:12621 ISSUES ON BLANK RECORD OF TECH SPEC\r\n // Check for valid record to execute process.\r\n if(!isValidRecord(true))\r\n {\r\n return;\r\n }\r\n \r\n\tvar htmlAreaObj = _getWorkAreaDefaultObj();\r\n\tvar objAjax = htmlAreaObj.getHTMLAjax(); \t\r\n var objHTMLData = htmlAreaObj.getHTMLDataObj();\r\n\t//alert(objHTMLData);\r\n\tif(objHTMLData && objHTMLData.hasUserModifiedData() && objHTMLData.isDataModified())\r\n {\r\n var htmlErrors = objAjax.error();\r\n htmlErrors.addError(\"confirmInfo\", szMsg_Changes, false);\t\r\n messagingDiv(htmlErrors, \"saveTechSpec()\", \"continueShowSCMain()\");\r\n }\r\n else\r\n {\t \t\r\n \tcontinueShowSCMain();\r\n } \r\n}", "function Start() {\n console.log(\n \"%cChecking the functions...\",\n \"background: green; color: white; font-size: 14px;\"\n );\n\n let success = addTextToIntro();\n if (success) {\n console.log(\n \"%cSuccessfully added paragraphs to Intro\",\n \"color:blue; font-size: 12px;\"\n );\n } else {\n console.warn(\n \"%cContent not added to Intro does not exist\",\n \"color:red; font-size: 12px;\"\n );\n }\n\n let success1 = addTextToFolegandros();\n if (success1) {\n console.log(\n \"%cSuccessfully added paragraphs to Folegandros\",\n \"color:blue; font-size: 12px;\"\n );\n } else {\n console.warn(\n \"%cContent not added to Folegandros does not exist\",\n \"color:red; font-size: 12px;\"\n );\n }\n\n let success2 = addTextToAlonissos();\n if (success2) {\n console.log(\n \"%cSuccessfully added paragraphs to Alonissos\",\n \"color:blue; font-size: 12px;\"\n );\n } else {\n console.warn(\n \"%cContent not added to Alonissos does not exist\",\n \"color:red; font-size: 12px;\"\n );\n }\n\n let success3 = addTextToSpetses();\n if (success3) {\n console.log(\n \"%cSuccessfully added paragraphs to Spetses\",\n \"color:blue; font-size: 12px;\"\n );\n } else {\n console.warn(\n \"%cContent not added to Spetses does not exist\",\n \"color:red; font-size: 12px;\"\n );\n }\n\n let success4 = addTextToAmorgos();\n if (success4) {\n console.log(\n \"%cSuccessfully added paragraphs to Amorgos\",\n \"color:blue; font-size: 12px;\"\n );\n } else {\n console.warn(\n \"%cContent not added to Amorgos does not exist\",\n \"color:red; font-size: 12px;\"\n );\n }\n\n let success5 = addTextToSyros();\n if (success5) {\n console.log(\n \"%cSuccessfully added paragraphs to Syros\",\n \"color:blue; font-size: 12px;\"\n );\n } else {\n console.warn(\n \"%cContent not added to Syros does not exist\",\n \"color:red; font-size: 12px;\"\n );\n }\n\n let success6 = addTextToMilos();\n if (success6) {\n console.log(\n \"%cSuccessfully added paragraphs to Milos\",\n \"color:blue; font-size: 12px;\"\n );\n } else {\n console.warn(\n \"%cContent not added to Milos does not exist\",\n \"color:red; font-size: 12px;\"\n );\n }\n\n let success7 = addTextToHydra();\n if (success7) {\n console.log(\n \"%cSuccessfully added paragraphs to Hydra\",\n \"color:blue; font-size: 12px;\"\n );\n } else {\n console.warn(\n \"%cContent not added to Hydra does not exist\",\n \"color:red; font-size: 12px;\"\n );\n }\n\n let success8 = addTextToIthaca();\n if (success8) {\n console.log(\n \"%cSuccessfully added paragraphs to Ithaca\",\n \"color:blue; font-size: 12px;\"\n );\n } else {\n console.warn(\n \"%cContent not added to Ithaca does not exist\",\n \"color:red; font-size: 12px;\"\n );\n }\n\n let success9 = addTextToGavdos();\n if (success9) {\n console.log(\n \"%cSuccessfully added paragraphs to Gavdos\",\n \"color:blue; font-size: 12px;\"\n );\n } else {\n console.warn(\n \"%cContent not added to Gavdos does not exist\",\n \"color:red; font-size: 12px;\"\n );\n }\n }", "function exampleFunctionToRun(){\n\n }", "function runScript(){\n\tregisterTab();\t\n\tcurrentQueuePoll();\n\tregisterMsgListener();\n\tinsertAddToQueueOptionOnVideos();\n\tinsertQTubeMastHead();\n\tload(false);\n}", "function Start()\n {\n PageSwitcher();\n\n Main();\n }", "function myReusableFunction(){\n console.log(\"Heyya World\");\n}", "static private internal function m121() {}", "function runPracticeMode (ex, ignoreData) {\n ex.textbox112 = function(message, options, width, left, top, cx, cy, height) {\n // Default Arguments!\n if(typeof(width) == 'undefined') {width = ex.width()/3;}\n if(typeof(cx) == 'undefined') {cx = ex.width() / 2;}\n if(typeof(cy) == 'undefined') {cy = ex.height() / 2;}\n if(typeof(height) == 'undefined') {height = width;}\n\n var element = ex.alert(message, {\n fontSize: (width/height * 25),\n stay: true,\n removeXButton: true,\n opacity: 0.8\n });\n element.style(options);\n if (typeof(left) == 'undefined') {left = cx - width / 2}\n if (typeof(top) == 'undefined') {top = cy - height / 2}\n element.position(left, top);\n\n return element;\n };\n \n ex.insertTextAreaTextbox112 = function(TextboxElement, textarea) {\n var identifier = \"$TEXTAREA$\";\n ex.insertDropdown(TextboxElement, identifier, textarea);\n }\n\n ex.insertButtonTextbox112 = function(TextboxElement, button, identifier) {\n ex.insertDropdown(TextboxElement, identifier, button);\n };\n \n /***************************************************************************\n * Initialize instruction data\n **************************************************************************/\n \n var currentInstruction = \"createStartInstruction\";\n var instrI,bucket,numForInstr, indexForInstr, instrElem, currentI;\n var instrValList = [instrI,bucket,numForInstr,indexForInstr,instrElem,currentI];\n \n /***************************************************************************\n * Initialize List & Buckets\n **************************************************************************/\n\n //vertical distant on top of list\n var margin = 30;\n\n //Length of list\n var listLength = 7;\n \n //Prevent users from moving list objects while a textbox is open\n\n\n //Width/Heigh of list elements\n var elementH = (3*ex.height()/4 - 2*margin)/listLength;\n var elementW = (5*ex.width()/6)/(listLength+2);\n\n //Top Left corner of the list\n var x0 = margin; \n var y0 = ex.height()/2 - elementH*listLength/2;\n\n //Digit Index - 0 is the one's digit, 1 is the 10's digit, etc.\n var digitIndex = 0;\n\n //Set color scheme of list element (optional)\n var enabledColor = \"LightSalmon\";\n var disabledColor = \"LightGray\";\n\n //Create the actual list\n var maxNumberOfDigits = 3;\n var startList = createStartList(listLength, maxNumberOfDigits);\n var maxNum = getMaxOfArray(startList);\n var numOfDigits = Math.floor(Math.log10(getMaxOfArray(startList)))+1;\n\n //Set font size (optional) -- this ensures the text stays within the bounds of the element rect\n var scaleFactor = 1.25; //The height of a char is ~1.25 times the width\n var fontSize = Math.min(elementH*3/4, elementW*scaleFactor/maxNumberOfDigits);\n\n //Import the strings\n var strings = getStrings();\n\n //Functions to be called when a list element clicks into a bucket\n var successFn = function (i, bucket) {\n if (workingIndex == 0 && digitIndex == 0) { // If it is the first element\n createCorrectAnsMessage(i, bucket);\n } \n elementPlacedInCorrectBucket(i, bucket);\n saveData();\n };\n\n var failureFn = function (i, bucket) {\n attempts++;\n if (attempts == 1) {\n createHint1Message(i, bucket);\n } else if (attempts == 2) {\n createIncorrectAnsMessage(i, bucket);\n attempts = 0;\n }\n saveData();\n }\n\n //for integers only\n var bucketNum = 10;\n\n var bucketX = ex.width()/6;\n var bucketY = 0;\n var bucketW = ex.width();\n var bucketH = ex.height()-bucketY;\n\n var bucketOrdering = [\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\"];\n\n //Empty Spots for Buckets\n var bucketSpots = getBucketSpots(bucketNum, bucketX, bucketY, bucketW, bucketH, elementW, elementH);\n var emptySpots = getEmptySpots(bucketSpots, bucketOrdering);\n\n var draggableList = createDraggableList(ex, startList, elementW, elementH, x0, y0, successFn, failureFn, drawAll, digitIndex, maxNumberOfDigits, emptySpots, enabledColor, disabledColor, fontSize);\n\n //index being move/click\n var workingIndex = 0;\n //highest index that has been moved so far\n var maxIndex = 0;\n var numberOfIterations = numOfDigits;\n var currentIteration = 0;\n var attempts = 0;\n\n //Set the standard position of isntructions\n var instrW = ex.width()*2/5;\n var instrX = ex.width()/2;\n\n //Set textbox112 color scheme\n var instrColor = \"yellow\";\n var questionsColor = \"blue\";\n var correctAnsColor = \"green\";\n var incorrectAnsColor = \"red\";\n\n //Indicates whether to ignore the stored data or not\n // var ignoreData = false;\n\n /***************************************************************************\n * Draw Functions\n **************************************************************************/\n function drawBuckets(){\n //Draw dashed lines\n console.log(\"yeah\");\n console.log(emptySpots);\n for (var spot in emptySpots) {\n var x = emptySpots[spot][0];\n var y = emptySpots[spot][1];\n var w = emptySpots[spot][2];\n var h = emptySpots[spot][3];\n ex.graphics.ctx.setLineDash([6]);\n ex.graphics.ctx.strokeRect(x,y,w,h);\n }\n var bucketColor = \"#CEE8F0\";\n //Draw buckets\n for (var spot in bucketSpots) {\n ex.graphics.ctx.strokeStyle = \"black\";\n ex.graphics.ctx.fillStyle = bucketColor;\n var x = bucketSpots[spot][0];\n var y = bucketSpots[spot][1];\n var w = bucketSpots[spot][2];\n var h = bucketSpots[spot][3];\n ex.graphics.ctx.fillRect(x, y, w, h);\n ex.graphics.ctx.setLineDash([]);\n ex.graphics.ctx.strokeRect(x, y, w, h);\n ex.graphics.ctx.fillStyle = \"black\";\n ex.graphics.ctx.font = fontSize + \"px Arial\";\n ex.graphics.ctx.textAlign = \"center\";\n ex.graphics.ctx.textBaseline=\"middle\";\n ex.graphics.ctx.fillText(spot,x+w/2,y+h/2); \n }\n }\n\n function drawList(){\n draggableList.draw();\n }\n\n function drawAll() {\n ex.graphics.ctx.clearRect(0,0,ex.width(),ex.height());\n drawBuckets();\n drawList();\n }\n\n /***************************************************************************\n * Misc callback functions\n **************************************************************************/\n\n var elementPlacedInCorrectBucket = function(i, bucket) {\n console.log(i);\n console.log(bucket);\n console.log(\"workingIndex:\",workingIndex);\n draggableList.disable(workingIndex);\n maxIndex = workingIndex;\n workingIndex++;\n bucketSpots[bucket][4].push(i);\n // updateList();\n if(workingIndex < listLength) {\n draggableList.enable(workingIndex);\n } else {\n endOfOneIteration();\n }\n emptySpots = getEmptySpots(bucketSpots, bucketOrdering);\n draggableList.setEmptySpots(emptySpots);\n drawAll();\n attempts = 0;\n saveData();\n }\n\n var endOfOneIteration = function () {\n currentIteration++;\n\n //Find a bucket with more than one element, if it exists\n var elementI = undefined;\n for (var spot in bucketSpots) {\n if (bucketSpots[spot][4].length > 1) {\n elementI = bucketSpots[spot][4][getRandomInt(0, bucketSpots[spot][4].length-1)];\n }\n }\n if (elementI == undefined) {\n elementI = getRandomInt(0, listLength-1);\n }\n var element = draggableList.elementList[elementI];\n var correctI = 0;\n for (var i = 0; i < bucketOrdering.length; i++) {\n var bucketLabel = bucketOrdering[i];\n var didBreak = false;\n for (var j = 0; j < bucketSpots[bucketLabel][4].length; j++) {\n if (elementI == bucketSpots[bucketLabel][4][j]) {\n didBreak = true;\n break;\n }\n correctI++;\n }\n if (didBreak) { break; }\n }\n\n createAfterOneIterationQ(element, correctI);\n }\n\n /***************************************************************************\n * Functions to create Instruction boxes\n **************************************************************************/ \n\n function createStartInstruction () {\n currentInstruction = \"createStartInstruction\";\n saveData();\n beforeShowInstruction();\n var text = strings.practiceIntro(); // (1)\n var button = ex.createButton(0, 0, strings.okButtonText());\n introBox = ex.textbox112(text,\n {\n stay: true,\n color: instrColor\n }, instrW, instrX);\n button.on(\"click\", function () {\n saveData();\n introBox.remove();\n currentInstruction = \"\";\n afterCloseInstruction();\n createIterationQ();\n saveData();\n });\n ex.insertButtonTextbox112(introBox, button, \"BTNA\");\n saveData();\n }\n\n function createIterationQ () {\n currentInstruction = \"createIterationQ\";\n saveData();\n beforeShowInstruction();\n var button = ex.createButton(0, 0, strings.submitButtonText());\n var input = ex.createInputText(0,0,\"?\", {inputSize: 1});\n var text = strings.practiceNumIteractionQ(); // (2)\n iterationQ = ex.textbox112(text,\n {\n stay: true,\n color: questionsColor\n }, instrW, instrX);\n button.on(\"click\", function() {\n saveData();\n iterationQ.remove();\n currentInstruction = \"\";\n console.log(input.text());\n console.log(numOfDigits);\n if (parseInt(input.text()) == numOfDigits){\n createIterationQCorrect();\n } else {\n createIterationQIncorrect();\n }\n saveData();\n }); \n ex.insertButtonTextbox112(iterationQ, button, \"BTNA\");\n ex.insertTextAreaTextbox112(iterationQ, input); \n saveData();\n }\n\n function createIterationQCorrect(){\n currentInstruction = \"createIterationQCorrect\";\n saveData();\n var correctText = strings.practiceNumIterationCorrect(); //(2) Correct\n var correctButton = ex.createButton(0, 0, strings.nextButtonText());\n correctBox = ex.textbox112(correctText,\n {\n stay: true,\n color: correctAnsColor\n }, instrW, instrX);\n correctButton.on(\"click\", function () {\n saveData();\n correctBox.remove();\n currentInstruction = \"\";\n createStartSortInstruction();\n saveData();\n });\n ex.insertButtonTextbox112(correctBox, correctButton, \"BTNA\");\n saveData();\n }\n\n function createIterationQIncorrect(){\n currentInstruction = \"createIterationQIncorrect\";\n saveData();\n var incorrectText = strings.practiceNumIterationIncorrect(getMaxOfArray(startList));//(2) Incorrect\n var incorrectButton = ex.createButton(0, 0, strings.nextButtonText());\n incorrectBox = ex.textbox112(incorrectText,\n {\n stay: true,\n color: incorrectAnsColor\n }, instrW, instrX);\n incorrectButton.on(\"click\", function () {\n saveData();\n incorrectBox.remove();\n currentInstruction = \"\";\n createStartSortInstruction();\n saveData();\n });\n ex.insertButtonTextbox112(incorrectBox, incorrectButton, \"BTNA\");\n saveData();\n }\n\n function createStartSortInstruction () {\n currentInstruction = \"createStartSortInstruction\";\n saveData();\n beforeShowInstruction();\n var text = strings.practiceStartSort(); // (3)\n var button = ex.createButton(0, 0, strings.okButtonText());\n startBox = ex.textbox112(text,\n {\n stay: true,\n color: instrColor\n }, instrW, instrX);\n button.on(\"click\", function () {\n saveData();\n startBox.remove();\n currentInstruction = \"\";\n afterCloseInstruction();\n saveData();\n });\n ex.insertButtonTextbox112(startBox, button, \"BTNA\");\n saveData();\n }\n\n function createHint1Message (i, bucket) {\n currentInstruction = \"createHint1Message\";\n instrValList[0] = i;\n instrValList[1] = bucket;\n saveData();\n beforeShowInstruction();\n var elem = draggableList.elementList[i];\n var text = strings.practiceHint1(digitIndex, elem); //hint1\n console.log(\"text\"+ strings.okButtonText());\n console.log(ex);\n console.log(\"i\" + i);\n console.log(\"bucket\" + bucket);\n\n var button = ex.createButton(0, 0, strings.okButtonText());\n hintBox = ex.textbox112(text,\n {\n stay: true,\n color: incorrectAnsColor\n }, instrW, instrX);\n button.on(\"click\", function () {\n saveData();\n hintBox.remove();\n currentInstruction = \"\";\n afterCloseInstruction();\n saveData();\n });\n ex.insertButtonTextbox112(hintBox, button, \"BTNA\");\n saveData();\n }\n\n function createCorrectAnsMessage (i, bucket) {\n currentInstruction = \"createCorrectAnsMessage\";\n instrValList[0] = i;\n instrValList[1] = bucket;\n saveData();\n beforeShowInstruction();\n var text = strings.practiceCorrectAns(digitIndex); //correct sorting\n var button = ex.createButton(0, 0, strings.okButtonText());\n correctAnsBox = ex.textbox112(text,\n {\n stay: true,\n color: correctAnsColor\n }, instrW, instrX);\n button.on(\"click\", function () {\n saveData();\n correctAnsBox.remove();\n currentInstruction = \"\";\n //elementPlacedInCorrectBucket(i, bucket);\n afterCloseInstruction();\n saveData();\n });\n ex.insertButtonTextbox112(correctAnsBox, button, \"BTNA\");\n saveData();\n }\n\n function createIncorrectAnsMessage (i, bucket) {\n currentInstruction = \"createIncorrectAnsMessage\";\n instrValList[0] = i;\n instrValList[1] = bucket;\n saveData();\n beforeShowInstruction();\n var submitButton = ex.createButton(0, 0, strings.submitButtonText());\n var elem = draggableList.elementList[i];\n var numOfDigitsInElem = Math.floor(Math.log10(elem))+1;\n // Generate a number with the same number of digits as the elem that is currently being placed\n //var num = getRandomInt(Math.pow(10, numOfDigitsInElem-1), Math.pow(10, numOfDigitsInElem)-1);\n var num = elem;\n submitButton.on(\"click\", function() {\n saveData();\n console.log(input.text());\n console.log((Math.floor(num/Math.pow(10, digitIndex)))%10);\n if (parseInt(input.text()) == Math.floor(num/Math.pow(10, digitIndex))%10){\n currentInstruction = \"\";\n createIncorrectAnsCorrect(num,i);\n wrongAnsBox.remove();\n afterCloseInstruction();\n } else {\n currentInstruction = \"\";\n createIncorrectAnsIncorrect(num,i);\n wrongAnsBox.remove();\n }\n saveData();\n });\n var input = ex.createInputText(0,0,\"?\", {inputSize: 1});\n var text = strings.practiceIncorrectAns(num, digitIndex, draggableList.elementList[i]);//IncorrectAnsAfterHint\n wrongAnsBox = ex.textbox112(text,\n {\n stay: true,\n color: incorrectAnsColor\n }, instrW, instrX); \n ex.insertButtonTextbox112(wrongAnsBox, submitButton, \"BTNA\");\n ex.insertTextAreaTextbox112(wrongAnsBox, input);\n saveData();\n }\n\n function createIncorrectAnsCorrect(num,i){\n currentInstruction = \"createIncorrectAnsCorrect\";\n instrValList[2] = num;\n instrValList[3] = i;\n saveData();\n var button = ex.createButton(0, 0, strings.okButtonText());\n correctAnsBox = ex.textbox112(strings.practiceIncorrectAnsCorrect(num, digitIndex, draggableList.elementList[i]),{\n stay: true,\n color: correctAnsColor\n }, instrW, instrX);\n button.on(\"click\", function () { \n saveData();\n correctAnsBox.remove();\n currentInstruction = \"\";\n afterCloseInstruction();\n saveData();\n });\n ex.insertButtonTextbox112(correctAnsBox, button, \"BTNA\");\n saveData();\n }\n\n function createIncorrectAnsIncorrect(num,i){\n currentInstruction = \"createIncorrectAnsIncorrect\";\n instrValList[2] = num;\n instrValList[3] = i;\n saveData();\n var button = ex.createButton(0, 0, strings.okButtonText());\n wrongAnsBox2 = ex.textbox112(strings.practiceIncorrectAnsIncorrect(num, digitIndex, draggableList.elementList[i]),{\n stay: true,\n color: incorrectAnsColor\n }, instrW, instrX);\n button.on(\"click\", function () { \n saveData();\n wrongAnsBox2.remove();\n currentInstruction = \"\";\n afterCloseInstruction();\n saveData();\n });\n ex.insertButtonTextbox112(wrongAnsBox2, button, \"BTNA\");\n saveData();\n }\n\n function createAfterOneIterationQ (element, correctI) {\n currentInstruction = \"createAfterOneIterationQ\";\n instrValList[4] = element;\n instrValList[5] = correctI;\n saveData();\n beforeShowInstruction();\n var button = ex.createButton(0, 0, strings.submitButtonText());\n var input = ex.createInputText(0,0,\"?\", {inputSize: 1});\n var text = strings.practiceAfterOneIteration(element, currentIteration+1);\n iterationQ = ex.textbox112(text,\n {\n stay: true,\n color: questionsColor\n }, instrW, instrX);\n button.on(\"click\", function() {\n saveData();\n console.log(input.text());\n console.log(numOfDigits);\n if (input.text() != \"\") {\n if (parseInt(input.text()) == correctI){\n currentInstruction = \"\";\n createAfterOneIterationCorrect(element,correctI);\n iterationQ.remove();\n } else {\n iterationQ.remove();\n currentInstruction = \"\";\n createAfterOneIterationIncorrect(element,correctI);\n }\n }\n saveData();\n }); \n ex.insertButtonTextbox112(iterationQ, button, \"BTNA\");\n ex.insertTextAreaTextbox112(iterationQ, input); \n saveData();\n }\n\n function createAfterOneIterationCorrect(element,correctI){\n currentInstruction = \"createAfterOneIterationCorrect\";\n instrValList[4] = element;\n instrValList[5] = correctI;\n saveData();\n var correctText = strings.practiceAfterOneIterationCorrect(element, correctI);\n var correctButton = ex.createButton(0, 0, strings.nextButtonText());\n correctBox = ex.textbox112(correctText,\n {\n stay: true,\n color: correctAnsColor\n }, instrW, instrX);\n correctButton.on(\"click\", function () {\n saveData();\n correctBox.remove();\n currentInstruction = \"\";\n //move elements back\n var postAnimationCallback = undefined;\n if (currentIteration > numberOfIterations) postAnimationCallback = createEndOfSortMessage;\n if (draggableList.list[0].currentBucket !== undefined) moveBack(draggableList, bucketSpots, bucketOrdering, postAnimationCallback);\n emptySpots = getEmptySpots(bucketSpots, bucketOrdering);\n draggableList.setEmptySpots(emptySpots);\n workingIndex = 0;\n draggableList.enable(workingIndex);\n digitIndex++;\n draggableList.setDigitIndex(digitIndex);\n currentIteration++;\n console.log(currentIteration);\n if (currentIteration <= numberOfIterations+1) {\n createNextIterationInstruction();\n } /*else { //End of sort\n createEndOfSortMessage();\n }*/\n drawAll();\n saveData();\n });\n ex.insertButtonTextbox112(correctBox, correctButton, \"BTNA\");\n saveData();\n }\n\n function createAfterOneIterationIncorrect(element,correctI){\n currentInstruction = \"createAfterOneIterationIncorrect\";\n instrValList[4] = element;\n instrValList[5] = correctI;\n saveData();\n var incorrectText = strings.practiceAfterOneIterationIncorrect(element, correctI);\n var incorrectButton = ex.createButton(0, 0, strings.nextButtonText());\n incorrectBox = ex.textbox112(incorrectText,\n {\n stay: true,\n color: incorrectAnsColor\n }, instrW, instrX);\n incorrectButton.on(\"click\", function () {\n saveData();\n incorrectBox.remove(); \n currentInstruction = \"\";\n console.log(currentIteration);\n //move elements back\n var postAnimationCallback = undefined;\n if (currentIteration > numberOfIterations) postAnimationCallback = createEndOfSortMessage;\n if (draggableList.list[0].currentBucket !== undefined) moveBack(draggableList, bucketSpots, bucketOrdering, postAnimationCallback);\n emptySpots = getEmptySpots(bucketSpots, bucketOrdering);\n draggableList.setEmptySpots(emptySpots);\n workingIndex = 0;\n draggableList.enable(workingIndex);\n digitIndex++;\n draggableList.setDigitIndex(digitIndex);\n currentIteration++;\n console.log(currentIteration);\n if (currentIteration <= numberOfIterations+1) {\n createNextIterationInstruction();\n } /*else { //End of sort\n createEndOfSortMessage();\n }*/\n drawAll();\n saveData();\n });\n ex.insertButtonTextbox112(incorrectBox, incorrectButton, \"BTNA\");\n saveData();\n }\n\n function createNextIterationInstruction () {\n currentInstruction = \"createNextIterationInstruction\";\n saveData();\n beforeShowInstruction();\n var text = strings.practiceNextIteration(digitIndex);\n var button = ex.createButton(0, 0, strings.okButtonText());\n nextIterationBox = ex.textbox112(text,\n {\n stay: true,\n color: instrColor\n }, instrW, instrX);\n button.on(\"click\", function () {\n saveData();\n nextIterationBox.remove();\n currentInstruction = \"\";\n afterCloseInstruction();\n drawAll();\n saveData();\n });\n ex.insertButtonTextbox112(nextIterationBox, button, \"BTNA\");\n saveData();\n }\n\n function createEndOfSortMessage () {\n //Move elements back\n currentInstruction = \"createEndOfSortMessage\";\n saveData();\n\n //Show the instruction\n beforeShowInstruction();\n var text = strings.practiceEndOfSort();\n // var buttonTakeQuiz = ex.createButton(0, 0, strings.practiceTakeTheQuizButtonText());\n var buttonPracticeMore = ex.createButton(0, 0, strings.practiceMoreButtonText());\n if (endOfSortBox != undefined){endOfSortBox.remove();}\n endOfSortBox = ex.textbox112(text,\n {\n stay: true,\n color: instrColor\n }, instrW, instrX);\n // if (endOfSortBox != undefined){endOfSortBox.remove();}\n // buttonTakeQuiz.on(\"click\", function () {\n // saveData();\n // endOfSortBox.remove();\n // currentInstruction = \"\";\n // afterCloseInstruction();\n // ignoreData = true;\n // console.log(\"end of sort message click take quiz\");\n // ex.data.meta.mode = \"quiz-immediate\";\n // console.log(ex.data.meta.mode);\n // saveData(\"quiz-immediate\");\n // main(ex, \"quiz-immediate\");\n // });\n buttonPracticeMore.on(\"click\", function () {\n saveData();\n endOfSortBox.remove();\n currentInstruction = \"\";\n afterCloseInstruction();\n ex.data.meta.mode = \"practice\";\n console.log(ex.data.meta.mode);\n saveData(\"practice\");\n main(ex, \"practice\");\n });\n // ex.insertButtonTextbox112(endOfSortBox, buttonTakeQuiz, \"BTNA1\");\n ex.insertButtonTextbox112(endOfSortBox, buttonPracticeMore, \"BTNA\");\n saveData();\n }\n\n /***************************************************************************\n * Main Game Code\n **************************************************************************/\n\n function reset () {\n checkAndRemoveAlerts();\n draggableList.disable(workingIndex);\n workingIndex = 0;\n draggableList.enable(workingIndex);\n //highest index that has been moved so far\n maxIndex = 0;\n numberOfIterations = numOfDigits;\n currentIteration = 0;\n attempts = 0;\n newOrder = [];\n\n for (var i = 0; i < startList.length; i++) {\n newOrder[i] = startList.indexOf(draggableList.elementList[i]);\n }\n\n if (draggableList.list[0].currentBucket !== undefined) moveBack(draggableList, bucketSpots, bucketOrdering, undefined, newOrder, false);\n bucketSpots = getBucketSpots(bucketNum, bucketX, bucketY, bucketW, bucketH, elementW, elementH);\n emptySpots = getEmptySpots(bucketSpots, bucketOrdering);\n delete ex.data.run;\n currentInstruction = \"createStartInstruction\";\n drawAll();\n runInstruction();\n }\n\n function bindButtons(){\n ex.graphics.off(\"mousedown\");\n ex.graphics.on(\"mousedown\", draggableList.mousedown);\n ex.off(\"keydown\");\n ex.on(\"keydown\", draggableList.keydown);\n }\n function setUp(){\n ex.chromeElements.submitButton.disable();\n ex.chromeElements.displayCAButton.disable();\n ex.chromeElements.undoButton.disable();\n ex.chromeElements.redoButton.disable();\n ex.chromeElements.resetButton.enable();\n ex.chromeElements.resetButton.off(\"click\");\n ex.chromeElements.resetButton.on(\"click\", reset);\n ex.chromeElements.newButton.enable();\n ex.chromeElements.newButton.off(\"click\");\n ex.chromeElements.newButton.on(\"click\", function () {\n ex.graphics.ctx.clearRect(0,0, ex.width, ex.height);\n ex._element_references = {};\n // console.log(_elementReferences);\n console.log(ex.elementReferences);\n checkAndRemoveAlerts();\n ex.data.meta.mode = \"practice\";\n saveData(\"practice\");\n main(ex, \"practice\");\n });\n ex.unload(saveData);\n }\n \n function saveData(mode){\n if (mode === undefined) mode = \"practice\";\n var data = {};\n data.startList = startList;\n data.bucketSpots = bucketSpots;\n data.emptySpots = emptySpots;\n //draggablelist data\n data.elementList = draggableList.elementList.slice();\n // If list elements are aniamting, snap them into end positions\n if (draggableList.isAnimating()) {\n data.list = [];\n for (var i = 0; i < draggableList.list.length; i++) {\n data.list[i] = jQuery.extend(true, {}, draggableList.list[i]);\n if (draggableList.list[i].isAnimating) {\n data.list[i].x = draggableList.list[i].animationTargetX;\n data.list[i].y = draggableList.list[i].animationTargetY;\n }\n }\n } else {\n data.list = draggableList.list;\n }\n data.digitIndex = digitIndex;\n data.workingIndex = workingIndex;\n data.maxIndex = maxIndex;\n data.currentIteration = currentIteration;\n data.attempts = attempts;\n data.currentInstruction = currentInstruction;\n data.instrValList = instrValList;\n // data.ignoreData = false;//ignoreData;\n // console.log(data.ignoreData);\n data.mode = mode;\n console.log(\"saveState Mode\".concat(ex.data.meta.mode));\n // data.mode = ex.data.meta.mode;\n // console.log(ex.data.meta.mode);\n // console.log(data.mode);\n ex.saveState(data);\n console.log(ex.data.instance.state.ignoreData);\n console.log(ex.data.instance.state);\n // console.log(data.ignoreData);\n console.log(data.list);\n }\n\n function loadData(){\n console.log(\"loadData\");\n console.log(typeof(ex.data.instance.state));\n if(!ignoreData && ex.data.instance.state != null && ex.data.instance.state != undefined && typeof(ex.data.instance.state) == \"object\" && Object.keys(ex.data.instance.state).length > 0){ \n startList = ex.data.instance.state.startList;\n bucketSpots = getBucketSpots(bucketNum, bucketX, bucketY, bucketW, bucketH, elementW, elementH);\n list = ex.data.instance.state.list;\n for (spot in ex.data.instance.state.bucketSpots) {\n bucketSpots[spot][4] = ex.data.instance.state.bucketSpots[spot][4];\n for (var i = 0; i < bucketSpots[spot][4].length; i++) {\n var elemI = bucketSpots[spot][4][i];\n //Adjust position if the screen is a different size than when state was saved\n list[elemI].x = bucketSpots[spot][0] + bucketSpots[spot][2]*(i+1);\n list[elemI].y = bucketSpots[spot][1];\n }\n } \n emptySpots = getEmptySpots(bucketSpots, bucketOrdering);\n workingIndex = ex.data.instance.state.workingIndex;\n console.log(workingIndex);\n maxIndex = ex.data.instance.state.maxIndex;\n currentIteration = ex.data.instance.state.currentIteration;\n digitIndex = ex.data.instance.state.digitIndex;\n attempts = ex.data.instance.state.attempts;\n //draggabeList data\n console.log(ex.data.instance.state)\n elementList = ex.data.instance.state.elementList.slice();\n console.log(elementList);\n console.log(list);\n console.log(\"before create draggable list.\");\n draggableList = createDraggableList(ex, elementList, elementW, elementH, x0, y0, successFn, failureFn, drawAll, digitIndex,\n maxNumberOfDigits, emptySpots, enabledColor, disabledColor, fontSize);\n console.log(\"after create draggable list.\");\n for (var i = 0; i < list.length; i++) {\n var elem = list[i];\n if (elem.x == x0) {\n draggableList.list[i].move(x0, y0+i*elementH, false);\n } else {\n draggableList.list[i].move(elem.x, elem.y, false);\n }\n \n draggableList.list[i].text = elem.text;\n draggableList.list[i].currentBucket = elem.currentBucket;\n if (i != workingIndex) {\n draggableList.list[i].disable();\n } else {\n draggableList.list[i].enable();\n }\n console.log(draggableList.list[i]);\n }\n console.log(draggableList);\n console.log(\"after create individual draggable list.\");\n currentInstruction = ex.data.instance.state.currentInstruction;\n instrValList = ex.data.instance.state.instrValList;\n console.log(\"end load data mode \".concat(ex.data.meta.mode));\n // ignoreData = ex.data.instance.state.ignoreData;\n }\n }\n\n function afterCloseInstruction () {\n ex.graphics.off(\"mousedown\");\n ex.off(\"keydown\");\n ex.graphics.on(\"mousedown\", draggableList.mousedown);\n ex.on(\"keydown\", draggableList.keydown);\n }\n\n function beforeShowInstruction () {\n ex.graphics.off(\"mousedown\");\n ex.off(\"keydown\");\n }\n \n function runInstruction(){\n switch(currentInstruction){\n case \"createStartInstruction\":\n createStartInstruction();\n break;\n case \"createIterationQ\":\n createIterationQ();\n break;\n case \"createIterationQCorrect\":\n createIterationQCorrect();\n break;\n case \"createIterationQIncorrect\":\n createIterationQIncorrect();\n break;\n case \"createStartSortInstruction\":\n createStartSortInstruction();\n break;\n case \"createHint1Message\":\n createHint1Message(instrValList[0],instrValList[1]);\n break;\n case \"createCorrectAnsMessage\":\n createCorrectAnsMessage(instrValList[0],instrValList[1]);\n break;\n case \"createIncorrectAnsMessage\":\n createIncorrectAnsMessage(instrValList[0],instrValList[1]);\n break;\n case \"createIncorrectAnsCorrect\":\n createIncorrectAnsCorrect(instrValList[2],instrValList[3]);\n break;\n case \"createIncorrectAnsIncorrect\":\n createIncorrectAnsIncorrect(instrValList[2],instrValList[3]);\n break;\n case \"createAfterOneIterationQ\":\n createAfterOneIterationQ(instrValList[4],instrValList[5]);\n break;\n case \"createAfterOneIterationCorrect\":\n createAfterOneIterationCorrect(instrValList[4],instrValList[5]);\n break;\n case \"createAfterOneIterationIncorrect\":\n createAfterOneIterationIncorrect(instrValList[4],instrValList[5]);\n break;\n case \"createNextIterationInstruction\":\n createNextIterationInstruction();\n break;\n case \"createEndOfSortMessage\":\n createEndOfSortMessage();\n break; \n } \n }\n \n function run(){\n loadData();\n bindButtons();\n setUp();\n drawAll();\n runInstruction();\n }\n\n run();\n}", "function BOT_reqApplicationPostProcessing () {\r\n\treturn;\r\n}", "function Captivate_DoExternalInterface() {\n\n trace(\"\\nRecd EI call:\" + Array.prototype.slice.call(arguments).join(\":\"));\n\n //Interaction data related vars\n var interactionID_str, \n\t\tcorrectResponse_str, \n\t\tweight_int, \n\t\tstudentResponse_str, \n\t\tresult_str, \n\t\tlatency_int, \n\t\tobjectiveID_str, \n\t\tdescriptionTexts,\n\t\tquestion_text = \"\";\n \n \n\n\n if (arguments.length < 1) {\n trace(\"Insufficient arguments to EI call\");\n return;\n }\n\n\n var CmdToExecute = new String(arguments[0]),\n \tSetVal = arguments[1],\n \tstrErr = \"true\",\n \tretValForSWF = \"\",\n \tlastArg = arguments[arguments.length - 1];\n \t\n\n if (lastArg && lastArg != \"\") retValForSWF = lastArg;\n\n \n \t// do nothing, if SCORM API is not available\n if (!makeCallsToDriver) {\n trace(\"Running instance of API not detected in EI handler. Ignoring call.\");\n return;\n }\n\n\n //check if this is an interaction related function - if so, get the individual data strings - this\n //is a temp. soln. till arity in Queue.as is officially increased\n if (CmdToExecute.indexOf(\"Interaction\") > -1 && CmdToExecute.indexOf(\"Record\") > -1) {\n\n trace(\"Found a record interaction call:\" + CmdToExecute);\n\n var interaction_arr = SetVal;\n if (interaction_arr.length != 8) \n\t\t\ttrace(\"ERROR! Wrong number of interaction elements received!\");\n\n interactionID_str = interaction_arr[0];\n correctResponse_str = interaction_arr[1];\n weight_int = parseInt(interaction_arr[2]);\n studentResponse_str = interaction_arr[3];\n result_str = ConvertToInteractionResultConstant(interaction_arr[4]);\n latency_int = parseInt(interaction_arr[5]);\n objectiveID_str = interaction_arr[6];\n descriptionTexts = interaction_arr[7];\n\t\tquestion_text = descriptionTexts.questionText;\n\t\t\n trace(\"Interaction Elements:\");\n trace(interactionID_str);\n trace(correctResponse_str);\n trace(weight_int);\n trace(studentResponse_str);\n trace(result_str);\n trace(latency_int);\n trace(objectiveID_str);\n trace(descriptionTexts);\n\t\t\n }\n\n\n\n //the API has already been initialized - so shouldn't be initialized again\n //check whether its initialized and revert back\n if (CmdToExecute == \"Start\") {\n\n trace(\"Fwd:\" + \"Do nothing!\");\n\n strErr = makeCallsToDriver;\n if (retValForSWF != \"\") CaptivateObj.SetScormVariable(retValForSWF, strErr);\n trace(\"Setting var in SWF:\" + retValForSWF + \" = \" + strErr);\n\n\n } else if (CmdToExecute == \"SetExitSuspendAfterCompleted\") {\n\n trace(\"Fwd:\" + \"SetExitSuspendAfterCompleted!\");\n var lExitSuspendIfCompleted = (SetVal == \"true\" ? true : false);\n EXIT_SUSPEND_IF_COMPLETED = lExitSuspendIfCompleted;\n if (retValForSWF != \"\") CaptivateObj.SetScormVariable(retValForSWF, strErr);\n trace(\"Setting var in SWF:\" + retValForSWF + \" = \" + strErr);\n\n\n } else if (CmdToExecute == \"SetExitNormalIfPassed\") {\n\n trace(\"Fwd:\" + \"SetExitNormalIfPassed!\");\n var lExitNormalIfPassed = (SetVal == \"true\" ? true : false);\n EXIT_NORMAL_IF_PASSED = lExitNormalIfPassed;\n if (retValForSWF != \"\") CaptivateObj.SetScormVariable(retValForSWF, strErr);\n trace(\"Setting var in SWF:\" + retValForSWF + \" = \" + strErr);\n\n\n } else if (CmdToExecute == \"CommitData\") {\n trace(\"Fwd:\" + \"CommitData\");\n\n strErr = CommitData();\n\n if (retValForSWF != \"\") CaptivateObj.SetScormVariable(retValForSWF, strErr);\n trace(\"Setting var in SWF:\" + retValForSWF + \" = \" + strErr);\n\n } else if (CmdToExecute == \"SetReachedEnd\") {\n trace(\"Fwd:\" + \"SetReachedEnd:\" + SetVal);\n\n strErr = SetReachedEnd();\n\n if (retValForSWF != \"\") CaptivateObj.SetScormVariable(retValForSWF, strErr);\n trace(\"Setting var in SWF:\" + retValForSWF + \" = \" + strErr);\n } else if (CmdToExecute == \"SetDataChunk\") {\n trace(\"Fwd:\" + \"SetDataChunk:\" + SetVal);\n\n strErr = SetDataChunk(SetVal);\n\n if (retValForSWF != \"\") CaptivateObj.SetScormVariable(retValForSWF, strErr);\n trace(\"Setting var in SWF:\" + retValForSWF + \" = \" + strErr);\n } else if (CmdToExecute == \"SetPassed\") {\n trace(\"Fwd:\" + \"SetPassed\");\n\n strErr = SetPassed();\n\n if (retValForSWF != \"\") CaptivateObj.SetScormVariable(retValForSWF, strErr);\n trace(\"Setting var in SWF:\" + retValForSWF + \" = \" + strErr);\n } else if (CmdToExecute == \"SetProgressMeasure\") {\n trace(\"Fwd:\" + \"SetProgressMeasure\" + SetVal);\n\n strErr = SetProgressMeasure(SetVal);\n\n if (retValForSWF != \"\") CaptivateObj.SetScormVariable(retValForSWF, strErr);\n trace(\"Setting var in SWF:\" + retValForSWF + \" = \" + strErr);\n } else if (CmdToExecute == \"SetFailed\") {\n trace(\"Fwd:\" + \"SetFailed\");\n\n strErr = SetFailed();\n\n if (retValForSWF != \"\") CaptivateObj.SetScormVariable(retValForSWF, strErr);\n trace(\"Setting var in SWF:\" + retValForSWF + \" = \" + strErr);\n } else if (CmdToExecute == \"GetEntryMode\") {\n trace(\"Fwd:\" + \"GetEntryMode:\");\n\n strErr = GetEntryMode(SetVal);\n\n if (retValForSWF != \"\") CaptivateObj.SetScormVariable(retValForSWF, strErr);\n trace(\"Setting var in SWF:\" + retValForSWF + \" = \" + strErr);\n } else if (CmdToExecute == \"SetBookmark\") {\n trace(\"Fwd:\" + \"SetBookmark:\" + SetVal);\n\n strErr = SetBookmark(SetVal);\n\n if (retValForSWF != \"\") CaptivateObj.SetScormVariable(retValForSWF, strErr);\n trace(\"Setting var in SWF:\" + retValForSWF + \" = \" + strErr);\n } else if (CmdToExecute == \"SetSessionTime\") {\n trace(\"Fwd:\" + \"SetSessionTime():\" + SetVal);\n\n strErr = SetSessionTime(SetVal);\n\n if (retValForSWF != \"\") CaptivateObj.SetScormVariable(retValForSWF, strErr);\n trace(\"Setting var in SWF:\" + retValForSWF + \" = \" + strErr);\n } else if (CmdToExecute == \"GetLastError\") {\n trace(\"Fwd:\" + \"GetLastLMSErrorCode:\");\n\n strErr = GetLastLMSErrorCode();\n\n if (retValForSWF != \"\") CaptivateObj.SetScormVariable(retValForSWF, strErr);\n trace(\"Setting var in SWF:\" + retValForSWF + \" = \" + strErr);\n } else if (CmdToExecute == \"GetLastErrorDesc\") {\n trace(\"Fwd:\" + \"GetLastErrorDesc:\");\n\n strErr = GetLastErrorDesc();\n\n if (retValForSWF != \"\") CaptivateObj.SetScormVariable(retValForSWF, strErr);\n trace(\"Setting var in SWF:\" + retValForSWF + \" = \" + strErr);\n } else if (CmdToExecute == \"SetScore\") {\n trace(\"Fwd:\" + \"SetScore:\" + SetVal);\n\n\n //var scores = String(SetVal).split(\"|\");\n var scores = SetVal;\n trace(String(scores));\n strErr = SetScore(scores[0], scores[1], scores[2]);\n\n if (retValForSWF != \"\") CaptivateObj.SetScormVariable(retValForSWF, strErr);\n trace(\"Setting var in SWF:\" + retValForSWF + \" = \" + strErr);\n } else if (CmdToExecute == \"SetPointBasedScore\") {\n trace(\"Fwd:\" + \"SetPointBasedScore:\" + SetVal);\n\n\n //var scores = String(SetVal).split(\"|\");\n var scores = SetVal;\n trace(String(scores));\n strErr = SetPointBasedScore(scores[0], scores[1], scores[2]);\n\n if (retValForSWF != \"\") CaptivateObj.SetScormVariable(retValForSWF, strErr);\n trace(\"Setting var in SWF:\" + retValForSWF + \" = \" + strErr);\n } else if (CmdToExecute == \"Suspend\") {\n trace(\"Fwd:\" + \"Suspend:\");\n\n strErr = Suspend();\n\n if (retValForSWF != \"\") CaptivateObj.SetScormVariable(retValForSWF, strErr);\n trace(\"Setting var in SWF:\" + retValForSWF + \" = \" + strErr);\n } else if (CmdToExecute == \"GetDataChunk\") {\n trace(\"Fwd:\" + \"GetDataChunk:\");\n\n strErr = GetDataChunk();\n\n if (retValForSWF != \"\") CaptivateObj.SetScormVariable(retValForSWF, strErr);\n trace(\"Setting var in SWF:\" + retValForSWF + \" = \" + strErr);\n } else if (CmdToExecute == \"ConcedeControl\") {\n trace(\"Fwd:\" + \"ConcedeControl\");\n\n strErr = ConcedeControl();\n\n if (retValForSWF != \"\") CaptivateObj.SetScormVariable(retValForSWF, strErr);\n trace(\"Setting var in SWF:\" + retValForSWF + \" = \" + strErr);\n\n } else if (CmdToExecute == \"GetBookMark\") {\n trace(\"Fwd:\" + \"GetBookMark():\");\n\n strErr = GetBookmark();\n\n if (retValForSWF != \"\") CaptivateObj.SetScormVariable(retValForSWF, strErr);\n trace(\"Setting var in SWF:\" + retValForSWF + \" = \" + strErr);\n } else if (CmdToExecute == \"GetLaunchData\") {\n trace(\"Fwd:\" + \"GetLaunchData():\");\n\n strErr = GetLaunchData();\n\n if (retValForSWF != \"\") CaptivateObj.SetScormVariable(retValForSWF, strErr);\n trace(\"Setting var in SWF:\" + retValForSWF + \" = \" + strErr);\n } else\n\n\n\n\n\n //Interaction set value handlers\n if (CmdToExecute == \"RecordMultipleChoiceInteraction\") {\n trace(\"Fwd:\" + \"RecordMultipleChoiceInteraction():\");\n\n\n\n var correctResponse_arr = []\n var studentResponse_arr = []\n\n //get the answer text arrays\n var MCQ_answer_texts = descriptionTexts.answerTexts;\n\n var split_char_correctResponse = \"\";\n var split_char_studentResponse = \"\";\n\n if (correctResponse_str.indexOf(\".\") > -1) split_char_correctResponse = \".\";\n if (correctResponse_str.indexOf(\",\") > -1) split_char_correctResponse = \",\";\n\n if (studentResponse_str.indexOf(\".\") > -1) split_char_studentResponse = \".\";\n if (studentResponse_str.indexOf(\",\") > -1) split_char_studentResponse = \",\";\n\n\n trace(\"Split char correct:\" + split_char_correctResponse);\n trace(\"Split char student:\" + split_char_studentResponse);\n\n\n if (correctResponse_str != \"\") {\n if (split_char_correctResponse != \"\") {\n correctResponse_arr = correctResponse_str.split(split_char_correctResponse);\n } else {\n correctResponse_arr.push(correctResponse_str);\n }\n } else {\n correctResponse_arr.push(\"1\"); // send in a dummy value here\n }\n\n if (studentResponse_str != \"\") {\n if (split_char_studentResponse != \"\") {\n studentResponse_arr = studentResponse_str.split(split_char_studentResponse);\n } else {\n studentResponse_arr.push(studentResponse_str);\n }\n } else {\n studentResponse_arr.push(\"1\"); // send in a dummy value here\n }\n\n\n //create corresponding response identifier objects\n correctResponse_ResponIdent_arr = [];\n studentResponse_ResponIdent_arr = [];\n\n var idx = 0;\n\n if (MCQ_answer_texts)\n \t{\n\t\t\tfor (idx = 0; idx < correctResponse_arr.length; idx++) \n\t\t\t{\n\t\t\t\tvar lLongText = MCQ_answer_texts[correctResponse_arr[idx]];\n\t\t\t\tif((undefined == lLongText) || (\"\" == lLongText))\n\t\t\t\t\tlLongText = correctResponse_arr[idx];\t\t\n\t\t\t\tcorrectResponse_ResponIdent_arr.push(CreateResponseIdentifier(correctResponse_arr[idx], lLongText));\n\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\tfor (idx = 0; idx < studentResponse_arr.length; idx++) \n\t\t\t{\n\t\t\t\tvar lLongText = MCQ_answer_texts[studentResponse_arr[idx]];\n\t\t\t\tif ((undefined == lLongText) || (\"\" == lLongText))\n\t\t\t\t\tlLongText = studentResponse_arr[idx];\t\n\t\t\t\tstudentResponse_ResponIdent_arr.push(CreateResponseIdentifier(studentResponse_arr[idx], lLongText));\n\t\t\t}\t\n } \n\t\telse \n\t\t{\n for (idx = 0; idx < correctResponse_arr.length; idx++) \n\t\t\t\tcorrectResponse_ResponIdent_arr.push(\n\t\t\t\t\t\t\t\t\t\t\t\tCreateResponseIdentifier(correctResponse_arr[idx], \n\t\t\t\t\t\t\t\t\t\t\t\t\tcorrectResponse_arr[idx])\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\n for (idx = 0; idx < studentResponse_arr.length; idx++) \n\t\t\t\tstudentResponse_ResponIdent_arr.push(\n\t\t\t\t\t\t\t\t\t\t\t\tCreateResponseIdentifier(studentResponse_arr[idx], \n\t\t\t\t\t\t\t\t\t\t\t\t\tstudentResponse_arr[idx])\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\n }\n\n\n strErr = RecordMultipleChoiceInteraction(interactionID_str, \n\t\t\t\t\t\t\t\t\t\t\t\tstudentResponse_ResponIdent_arr, \n\t\t\t\t\t\t\t\t\t\t\t\tresult_str, \n\t\t\t\t\t\t\t\t\t\t\t\tcorrectResponse_ResponIdent_arr, \n\t\t\t\t\t\t\t\t\t\t\t\tquestion_text, \n\t\t\t\t\t\t\t\t\t\t\t\tweight_int, \n\t\t\t\t\t\t\t\t\t\t\t\tlatency_int, \n\t\t\t\t\t\t\t\t\t\t\t\tobjectiveID_str);\n\n if (retValForSWF != \"\") CaptivateObj.SetScormVariable(retValForSWF, strErr);\n trace(\"Setting var in SWF:\" + retValForSWF + \" = \" + strErr);\n } else if (CmdToExecute == \"RecordTrueFalseInteraction\") {\n trace(\"Fwd:\" + \"RecordTrueFalseInteraction():\");\n\t\tvar TF_answer_texts = descriptionTexts.answerTexts;\n var bStudent_response = TF_answer_texts[studentResponse_str];\n\t\tvar bCorrect_response = TF_answer_texts[correctResponse_str];\n\n strErr = RecordTrueFalseInteraction(interactionID_str, \n\t\t\t\t\t\t\t\t\t\t\tbStudent_response, \n\t\t\t\t\t\t\t\t\t\t\tresult_str, \n\t\t\t\t\t\t\t\t\t\t\tbCorrect_response, \n\t\t\t\t\t\t\t\t\t\t\tquestion_text, \n\t\t\t\t\t\t\t\t\t\t\tweight_int, \n\t\t\t\t\t\t\t\t\t\t\tlatency_int, \n\t\t\t\t\t\t\t\t\t\t\tobjectiveID_str);\n\n if (retValForSWF != \"\") CaptivateObj.SetScormVariable(retValForSWF, strErr);\n trace(\"Setting var in SWF:\" + retValForSWF + \" = \" + strErr);\n } else if (CmdToExecute == \"RecordFillInInteraction\") {\n trace(\"Fwd:\" + \"RecordFillInInteraction():\");\n\n\n strErr = RecordFillInInteraction(interactionID_str, \n\t\t\t\t\t\t\t\t\t\tstudentResponse_str, \n\t\t\t\t\t\t\t\t\t\tresult_str, \n\t\t\t\t\t\t\t\t\t\tcorrectResponse_str, \n\t\t\t\t\t\t\t\t\t\tquestion_text, \n\t\t\t\t\t\t\t\t\t\tweight_int, \n\t\t\t\t\t\t\t\t\t\tlatency_int, \n\t\t\t\t\t\t\t\t\t\tobjectiveID_str);\n\n if (retValForSWF != \"\") CaptivateObj.SetScormVariable(retValForSWF, strErr);\n trace(\"Setting var in SWF:\" + retValForSWF + \" = \" + strErr);\n } else if (CmdToExecute == \"RecordMatchingInteraction\") {\n trace(\"Fwd:\" + \"RecordMatchingInteraction():\");\n\n\n var leftColumnTexts = descriptionTexts.answerTexts.left;\n var rightColumnTexts = descriptionTexts.answerTexts.right;\n\n var correctResponse_MatchingResponses_arr = [];\n var studentResponse_MatchingResponses_arr = [];\n\n var temp_responses_arr = correctResponse_str.split(\",\");\n var resp_idx = 0;\n var curr_resp, src_target;\n\n for (resp_idx = 0; resp_idx < temp_responses_arr.length; ++resp_idx) {\n curr_resp = temp_responses_arr[resp_idx];\n src_target = curr_resp.split(\".\");\n\n var match_temp1 = src_target[0];\n var match_temp2 = src_target[1];\n\t\n\t\t\tvar lLongLeftColText = leftColumnTexts[match_temp1];\n\t\t\tvar lLongRightColText = rightColumnTexts[match_temp2];\n\t\t\tif ((undefined == lLongLeftColText) || (\"\" == lLongLeftColText))\n\t\t\t lLongLeftColText = match_temp1;\n\t\t\tif ((undefined == lLongRightColText) || (\"\" == lLongRightColText))\n\t\t\t lLongRightColText = match_temp2;\n\t\t\n var resp_src = CreateResponseIdentifier(match_temp1, lLongLeftColText);\n var resp_target = CreateResponseIdentifier(match_temp2, lLongRightColText);\n\n \n correctResponse_MatchingResponses_arr.push(new MatchingResponse(resp_src, resp_target));\n }\n\n temp_responses_arr = studentResponse_str.split(\",\");\n for (resp_idx = 0; resp_idx < temp_responses_arr.length; ++resp_idx) {\n curr_resp = temp_responses_arr[resp_idx];\n src_target = curr_resp.split(\".\");\n\n var match_temp1 = src_target[0];\n var match_temp2 = src_target[1];\n\n \tvar lLongLeftColText = leftColumnTexts[match_temp1];\n\t\t\tvar lLongRightColText = rightColumnTexts[match_temp2];\n\t\t\tif((undefined == lLongLeftColText ) || (\"\" == lLongLeftColText ))\n\t\t\t\tlLongLeftColText = match_temp1;\n\t\t\tif((undefined == lLongRightColText) || (\"\" == lLongRightColText))\n\t\t\t\tlLongRightColText = match_temp2;\n\t\t\n var resp_src = CreateResponseIdentifier(match_temp1, lLongLeftColText);\n var resp_target = CreateResponseIdentifier(match_temp2, lLongRightColText);\n \n studentResponse_MatchingResponses_arr.push(new MatchingResponse(resp_src, resp_target));\n }\n\n\n strErr = RecordMatchingInteraction(interactionID_str, \n\t\t\t\t\t\t\t\t\t\tstudentResponse_MatchingResponses_arr, \n\t\t\t\t\t\t\t\t\t\tresult_str, \n\t\t\t\t\t\t\t\t\t\tcorrectResponse_MatchingResponses_arr, \n\t\t\t\t\t\t\t\t\t\tquestion_text, \n\t\t\t\t\t\t\t\t\t\tweight_int, \n\t\t\t\t\t\t\t\t\t\tlatency_int, \n\t\t\t\t\t\t\t\t\t\tobjectiveID_str);\n\n if (retValForSWF != \"\") CaptivateObj.SetScormVariable(retValForSWF, strErr);\n trace(\"Setting var in SWF:\" + retValForSWF + \" = \" + strErr);\n } else if (CmdToExecute == \"RecordSequencingInteraction\") {\n trace(\"Fwd:\" + \"RecordSequencingInteraction():\");\n\t\n\t\tvar lLongLearnerResponse = descriptionTexts.answerTexts.learner_response;\n\t\tvar lLongCorrectResponse = descriptionTexts.answerTexts.correct_response;\n\t\tif((undefined == lLongLearnerResponse) || (\"\" == lLongLearnerResponse))\n\t\t\tlLongLearnerResponse = studentResponse_str.substring(0, 1);\n\t\tif((undefined == lLongCorrectResponse) || (\"\" == lLongCorrectResponse))\n\t\t\tlLongCorrectResponse = correctResponse_str.substring(0, 1);\n\t\t\n strErr = RecordSequencingInteraction(interactionID_str, \n\t\t\t\t\t\tCreateResponseIdentifier(studentResponse_str.substring(0, 1),\n\t\t\t\t\t\t\tlLongLearnerResponse), \n\t\t\t\t\t\tresult_str, \n\t\t\t\t\t\tCreateResponseIdentifier(correctResponse_str.substring(0, 1),\n\t\t\t\t\t\t\tlLongCorrectResponse), \n\t\t\t\t\t\tquestion_text, \n\t\t\t\t\t\tweight_int, \n\t\t\t\t\t\tlatency_int, \n\t\t\t\t\t\tobjectiveID_str);\n\n if (retValForSWF != \"\") CaptivateObj.SetScormVariable(retValForSWF, strErr);\n trace(\"Setting var in SWF:\" + retValForSWF + \" = \" + strErr);\n } else if (CmdToExecute == \"RecordLikertInteraction\") {\n trace(\"Fwd:\" + \"RecordLikertInteraction():\");\n\n strErr = RecordLikertInteraction(interactionID_str, \n\t\t\t\t\t\t\t\t\t\tCreateResponseIdentifier(studentResponse_str.substring(0, 1), \n\t\t\t\t\t\t\t\t\t\t\tstudentResponse_str), \n\t\t\t\t\t\t\t\t\t\ttrue, \n\t\t\t\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\t\t\tquestion_text, \n\t\t\t\t\t\t\t\t\t\tweight_int, \n\t\t\t\t\t\t\t\t\t\tlatency_int, \n\t\t\t\t\t\t\t\t\t\tobjectiveID_str);\n\n if (retValForSWF != \"\") CaptivateObj.SetScormVariable(retValForSWF, strErr);\n trace(\"Setting var in SWF:\" + retValForSWF + \" = \" + strErr);\n } else trace(\"This call has not been ported or is not handled yet.\");\n return strErr;\n}", "function charJawFront(){ //start script\n app.beginUndoGroup(\"Create Character Jaw Rig Front\");\n\n //if(parseFloat(app.version) >= 10.5){\n var theComp = app.project.activeItem; //only selected\n\n // check if comp is selected\n if (theComp == null || !(theComp instanceof CompItem)){\n // if no comp selected, display an alert\n alert(\"Please establish a comp as the active item and run the script again.\");\n } else {\n var theLayers = theComp.selectedLayers;\n if(theLayers.length==0){\n alert(\"Please select a precomp and run the script again.\");\n }else{\n // otherwise, loop through each selected layer in the selected comp\n for (var i = 0; i < theLayers.length; i++){\n // define the layer in the loop we're currently looking at\n var curLayer = theLayers[i];\n // Select layer to add expression to\n if (curLayer.matchName == \"ADBE AV Layer\"){\n //first check if this is a footage layer\n //next check if this is a comp.\n var myLayer = theComp.selectedLayers[0];\n if(myLayer.source.numLayers==null){\n //not a comp; send alert.\n alert(\"This only works on precomp layers.\");\n }else{\n //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n //myLayer is indeed a precomp. OK to do stuff.\n var slider = myLayer.property(\"Effects\").addProperty(\"Slider Control\");\n slider.name = \"jaw front control\"\n var headNull = myLayer.source.layers.addNull();\n //var upperJawNull = myLayer.source.layers.addNull();\n var lowerJawNull = myLayer.source.layers.addNull();\n headNull.name = \"head placeholder\";\n //upperJawNull.name = \"upper jaw placeholder\";\n lowerJawNull.name = \"lower jaw placeholder\";\n //when asset replaces null, anchor point will be centered.\n headNull.transform.anchorPoint.setValue([50,50]);\n //upperJawNull.transform.anchorPoint.setValue([50,50]);\n lowerJawNull.transform.anchorPoint.setValue([50,50]);\n headNull.property(\"Opacity\").setValue(100);\n //upperJawNull.property(\"Opacity\").setValue(100);\n lowerJawNull.property(\"Opacity\").setValue(100);\n //parenting jaws to head\n //upperJawNull.parent = headNull;\n lowerJawNull.parent = headNull;\n //expressions\n //headNullExprPos;\n //headNullExprRot;\n //headNullExprScale;\n //headNull.property(\"Position\").expression = headNullExprPos;\n //headNull.property(\"Rotation\").expression = headNullExprRot;\n //headNull.property(\"Scale\").expression = headNullExprScale;\n //--\n //upperJawNullExprPos;\n //upperJawNullExprRot;\n //upperJawNullExprScale;\n //upperJawNull.property(\"Position\").expression = upperJawNullExprPos;\n //upperJawNull.property(\"Rotation\").expression = upperJawNullExprRot;\n //upperJawNull.property(\"Scale\").expression = upperJawNullExprScale;\n //--\n lowerJawNullExprPos = \"var scaler = 1.0;\" + \"\\r\" +\n \"var x = transform.position[0];\" + \"\\r\" +\n \"var y = transform.position[1];\" + \"\\r\" +\n \"var s = comp(\\\"\" + theComp.name + \"\\\").layer(\\\"\" + myLayer.name + \"\\\").effect(\\\"\" + slider.name + \"\\\")(\\\"Slider\\\");\" + \"\\r\" +\n \"[x, y+(s*scaler)];\";\n //lowerJawNullExprRot;\n lowerJawNullExprScale = \"var scaler = 1.0;\" + \"\\r\" +\n \"var s = comp(\\\"\" + theComp.name + \"\\\").layer(\\\"\" + myLayer.name + \"\\\").effect(\\\"\" + slider.name + \"\\\")(\\\"Slider\\\");\" + \"\\r\" +\n \"var x = transform.scale[0];\" + \"\\r\" +\n \"var y = transform.scale[1];\" + \"\\r\" +\n \"[x,y+(s*scaler)];\"; \n lowerJawNull.property(\"Position\").expression = lowerJawNullExprPos;\n //lowerJawNull.property(\"Rotation\").expression = lowerJawNullExprRot;\n lowerJawNull.property(\"Scale\").expression = lowerJawNullExprScale;\n //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n }\n }else{\n //not a footage layer; send alert.\n alert(\"This only works on precomp layers.\");\n }\n }\n }\n }\n \n app.endUndoGroup();\n} //end script", "private internal function m248() {}", "function main()\n{\n initCommand();\n global.mode = global.mode_NORMAL;\n global.firstRun = true;\n global.baseX = NaN;\n global.baseY = NaN;\n global.destX = NaN;\n global.destY = NaN;\n global.factor = NaN;\n\n global.baseRX = NaN;\n global.baseRY = NaN;\n global.destRX = NaN;\n global.destRY = NaN;\n global.factorRef = NaN;\n global.factorNew = NaN;\n\n if(numSelected() <= 0)\n {\n //TODO: Prompt to select objects if nothing is preselected\n setPromptPrefix(qsTr(\"Preselect objects before invoking the scale command.\"));\n appendPromptHistory();\n endCommand();\n messageBox(\"information\", qsTr(\"Scale Preselect\"), qsTr(\"Preselect objects before invoking the scale command.\"));\n }\n else\n {\n setPromptPrefix(qsTr(\"Specify base point: \"));\n }\n}", "function subSmartClient(script_retorno) {\n\n var scripts = \"\";\n\n var tipo_retorno = typeof (script_retorno);\n\n if (tipo_retorno == \"string\") {\n try {\n var retorno_json = JSON.parse(script_retorno);\n script_retorno = retorno_json;\n tipo_retorno = \"object\";\n } catch (e) {\n tipo_retorno = \"string\";\n }\n }\n\n if (tipo_retorno == \"object\") {\n if (script_retorno) {\n if (script_retorno.script) {\n if (script_retorno.script != \"\") {\n scripts = script_retorno.script;\n script_retorno.script = \"\";\n } else { return script_retorno; }\n } else if (script_retorno.all) {\n if (script_retorno.all.frontend.script) {\n if (script_retorno.all.frontend.script != \"\") {\n scripts = script_retorno.all.frontend.script;\n script_retorno.all.frontend.script = \"\";\n } else { return script_retorno; }\n }\n }\n } else {\n return script_retorno;\n }\n } else if (typeof (script_retorno) != \"string\") {\n return script_retorno;\n } else {\n scripts = script_retorno;\n }\n\n if (scripts == \"\") {\n return scripts;\n }\n\n var inicio_script = scripts.indexOf(\"<script>\");\n\n if (inicio_script == -1) {\n return scripts;\n }\n\n scripts = scripts.substring(inicio_script);\n scripts = scripts.replaceAll(\"<script>\", \"\");\n scripts = scripts.split(\"</script>\");\n\n //scripts = scripts.replace(/\\s/g, \"\");\n\n //var script = scripts.match(/_iniciodoscriptjs_(.\\n?)*_finaldoscriptjs_/g);\n\n if (scripts.length == 0) {\n return script_retorno;\n }\n\n for (var i = 0; i < scripts.length; i++) {\n //if (script[i].indexOf(\"<script>\") != -1) {\n var fun = scripts[i]; //.replace(/\\<script\\>/g, \"\");\n if (fun != \"\") {\n\n eval(fun);\n\n if (tipo_retorno == \"string\") {\n script_retorno = script_retorno.replace(`<script>${fun}<\\script>`, \"\");\n }\n }\n //}\n }\n\n return (script_retorno);\n}", "function main() {\n\n\t//If Character is dead, respawn\n\t//is_moving(character) and smart.moving is TRUE even for DEAD characters\n\t//So the respawn code MUST be on top!\n\tif (character.rip) {\n\t\tsetTimeout(respawn, 15000);\n\t\treturn;\n\t}\n\n\t//Replenish Health and Mana\n\tusePotions();\n\n\t//If character is moving, do nothing\n\tif (is_moving(character) || smart.moving) return;\n\n\t//Loot everything\n\tloot();\n\n\t//Merchant Skills are Tier 2 actions\n\tif (character.ctype === \"merchant\") return;\n\n\t//Party follows master\n\tif (master && character.name !== master) followMaster();\n\n\t//Finds a suitable target and attacks it.\n\tlet target = getTarget();\n\tif (target) {\n\t\t//log(character.name + \" got target \" + target);\n\t\t//Kites Target\n\t\t//kiteTarget(target);\n\t\t//Circles Target\n\t\t//circleTarget(target);\n\t\t//Uses available skills\n\t\t//HINT: Offensive skills are only used if \"master\" is defined [To save mana]\n\t\tif (character.ctype === \"mage\") mageSkills(target);\n\t\tif (character.ctype === \"priest\") priestSkills(target);\n\t\tif (character.ctype === \"ranger\") rangerSkills(target, farmMonsterType);\n\t\t//Attacks the target\n\t\tautoFight(target);\n\t} else {\n\t\t//Go to farming Area\n\t\tlet coords = getFarmingSpot(farmMonsterType, \"coord\");\n\t\tif ((!master\n\t\t\t|| character.name === master)\n\t\t\t&& (Math.abs(character.x - coords.x) > 150\n\t\t\t\t|| Math.abs(character.y - coords.y) > 150)) {\n\t\t\tlog(character.name + \" moving to farming spot\");\n\t\t\tgetFarmingSpot(farmMonsterType, \"move\");\n\t\t}\n\t}\n}", "function asiCallOnload(){\n var SDM_noasci = ['meinauto'];\n var asi_p = 'IpZElE,Rdkg7V,NkqpjZ,acWaVx,RmJKxA,BnG7vD,oeu2b6,foY3mB'; //Produktion\n var asiPqTag = false; //Initialisierung, Antwort setzt auf true\n try {\n if ((sdm_vers >= 1) && !SDM_head.isinarray(SDM_noasci, SDM_resource)) {\n fXm_Head.create.twin(escape('//pq-direct.revsci.net/pql?placementIdList=' + asi_p), SDM_head.prep.asigmd, true);\n }\n } catch (ignore) {}\n\n // Audience Science Data Sharing\n if (!SDM_head.isinarray(SDM_noasci, SDM_resource)) {\n fXm_Head.create.script('//js.revsci.net/gateway/gw.js?csid=F09828&auto=t&bpid=Stroer');\n }\n}", "function scriptLoader()\n{\n addJavascript(\"phoneticMapper.js\", \"head\");\n addJavascript(\"vedatype.js\", \"head\");\n addJavascript(\"slp01.js\", \"head\"); \n}", "function mainFunction(){\r\n\r\n\tdisplayDescription(0);\r\n\r\n\tkeyObj.keyCheck=1;\r\n\r\n\tif (openCounter===1){\r\n\t\tparamNumber = Math.abs(randomize(-0.5,0.5));\r\n\t}\r\n\telse{\r\n\t\tif (paramNumber===1){\r\n\t\t\tparamNumber=0;\r\n\t\t}\r\n\t\telse{\r\n\t\t\tparamNumber=1;\r\n\t\t}\r\n\t}\r\n\r\n\tif (paramNumber===1){\r\n\t\tstimuliCurrentInfo.taskNumber++;\r\n\t\tstimuliCurrentInfo.seriesNumber++;\r\n\t}\r\n\r\n\tdisplayTask();\r\n\r\n\ttaskTimer();\r\n\r\n}", "function InitFunction()\n{\n play = function(g) {\n alert(\"Error play function isn't override by a StepX.js file\");\n };\n\n ValidBtnClick = function () {\n alert(\"Error ValidBtnClick function isn't override by a StepX.js file\");\n }\n\n UseComboClick = function () {\n alert(\"Error UseComboClick function isn't override by a StepX.js file\");\n }\n\n RollDiceClick = function () {\n alert(\"Error RollDiceClick function isn't override by a StepX.js file\");\n }\n\n CancelBtnClick = function () {\n alert(\"Error CancelBtnClick function isn't override by a StepX.js file\");\n }\n}", "function customScript(script_type) {\n if (script_type == 'simple') {\n cmd_string = '### This is a Simple Script ###\\n\\n# MiXED CaSE\\n1 iNc 2 2\\n2 end\\n\\n#The next line is\\n#commented out\\n#3 inc 2 2';\n } else if (script_type == 'add') {\n cmd_string = '1 deb 4 1 2\\n2 deb 2 3 4\\n3 inc 4 2\\n4 deb 3 5 6\\n5 inc 4 4\\n6 end\\n';\n } else if (script_type == 'sub') {\n cmd_string = '1 deb 4 1 2\\n2 deb 2 3 7\\n3 deb 3 2 4\\n4 inc 2 5\\n5 deb 2 6 9\\n6 inc 4 5\\n7 deb 3 8 9\\n8 inc 4 7\\n9 end';\n } else if (script_type == 'mul') {\n cmd_string = '1 deb 6 1 2\\n2 deb 4 2 3\\n3 deb 2 4 9\\n4 deb 3 5 6\\n5 inc 6 4\\n6 deb 6 7 3\\n7 inc 4 8\\n8 inc 3 6\\n9 end';\n } else if (script_type == 'extended') {\n cmd_string = '1 deb 4 1 2\\n2 deb 2 3 7\\n3 deb 3 2 4\\n4 inc 2 5\\n5 deb 2 6 9\\n6 inc 4 5\\n7 deb 3 8 9\\n8 inc 4 7\\n9 end\\n10 inc 2 2\\n11 deb 1 1 1\\n12 inc 2 2\\n13 deb 1 1 1\\n14 inc 2 2\\n15 deb 1 1 1\\n16 inc 2 2';\n } else {\n cmd_string = '# custom script here';\n }\n\n $('#cmd_input').val(cmd_string);\n options_popup.close();\n}", "function Chimera_OnAddOrOnLoad()\n{\n CommonChimera_OnAddOrOnLoad();\n}", "function main() {\r\n\tGM_log(\"[ - MAIN - ]\");\r\n\tif (hasThisPagePublicity()) {\t\t\t\t\t\t\tGM_log(\"[-][hasThisPagePublicity]\");\r\n\t\tremovePublicity();\r\n\t}\r\n}", "function RunScript()\n{\n \tvar professorIndex = 0; // start at first professor in list\n\tvar currentProfessor = \"\";\n\n\twhile (professorName != \"undefined\")\n\t{\n\n\t\tprofessorName = getProfessorName(professorIndex)\n\t\tcurrentProfessor = professorName;\n\t\t// only get the professor search page if its not undefined or staff\n\t\tif(professorName != \"Staff\" && professorName != \"undefined\")\n\t\t{\n\t\t\tgetProfessorLegit(professorIndex, currentProfessor);\n\t\t}\n\t\tprofessorIndex++;\n\t}\n}", "function main() {\r\n\r\n\tFM_log(3,\"main() called\");\r\n\r\n\tsuffixGlobal = server + '_' + getPlayerId();\r\n\r\n\tsuffixLocal = suffixGlobal + '_' + getActiveVillageId();\r\n\r\n\t\r\n\r\n\tFM_log(3,\"suffixGlobal is: \"+suffixGlobal);\r\n\r\n\tFM_log(3,\"suffixLocal is: \"+suffixLocal);\r\n\r\n\t\r\n\r\n\t//define Travian 3.5 Version\r\n\r\n\tgetT35version();\r\n\r\n\t\r\n\r\n\tFM_log(5,document.URL);\r\n\r\n\tvar html = document.body.innerHTML; // In case 'Unable to load site' is showed, try to Refresh the page.\r\n\r\n\tif (html.indexOf(\" <!-- ERROR ITEM CONTAINER\") != -1) {\r\n\r\n\t\twindow.location.replace(rootPath + \"a2b.php\"); \r\n\r\n\t}\r\n\r\n\t\t\r\n\r\n\tif (GM_getValue(\"Active_\" + suffixGlobal, -1) > -1 && GM_getValue(\"ReadRep_\" + suffixGlobal, -1)==1 )\r\n\r\n\t{\r\n\r\n\t\tnewreport = document.getElementsByTagName('html')[0].innerHTML.indexOf('id=\\\"n5\\\" class=\\\"i1\\\"')+document.getElementsByTagName('html')[0].innerHTML.indexOf('id=\\\"n5\\\" class=\\\"i3\\\"');\r\n\r\n\t\tif ( newreport != -2) \r\n\r\n\t\t{\r\n\r\n\t\t\tif(document.URL.indexOf(\"berichte.php\") == -1) {\r\n\r\n\t\t\t\twindow.open(\"/berichte.php\", \"_self\");\r\n\r\n\t\t\t}\r\n\r\n\t\t\tcheckreports();\r\n\r\n\t\t\treturn;\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t\r\n\r\n\t// start countdown and forward to rallypoint if FM is active\r\n\t\r\n\t// this is not working because FM script not runs on all the Travian pages\r\n\t// could be working if @includes get changed, but this probably leads to a slow browser\r\n\t\r\n\r\n\t/*\r\n\r\n\tif (GM_getValue(\"Active_\" + suffixGlobal, -1) > -1)\r\n\r\n\t{\r\n\r\n\t\t//alert(\"waiting\");\r\n\r\n\t\tsetTimeout(function(){window.open(\"/a2b.php\",\"_self\");}, 60000); //wait 1 minute then go back to rally point\r\n\r\n\t}\r\n\r\n\t*/\r\n\r\n\t\t\r\n\r\n\t// get variable for random farming\r\n\r\n\trandom = GM_getValue(\"RandomFarming_\" + suffixGlobal, 0);\r\n\r\n\t\r\n\r\n\tFM_log(3,\"Setting language, images & style\");\r\n\r\n\tsetLanguage();\r\n\r\n\tloadImage();\r\n\r\n\tloadStyle();\r\n\r\n\tvar url = document.URL;\r\n\r\n\turl = url.substring(url.lastIndexOf(\"/\") + 1);\r\n\r\n\tuser_race = GM_getValue('Tribe_' + suffixGlobal, -1);\r\n\r\n\tif (user_race != -1) {\r\n\r\n\t\tuser_race = GM_getValue('Tribe_' + suffixGlobal, 0);\r\n\r\n\t\tuser_race = parseInt(user_race);\r\n\r\n\t} else {\r\n\r\n\t\tif (url.indexOf(\"a2b.php\") != -1) {\r\n\r\n\t\t\tuser_race = 1 + 10 * getPlayerTribe();\r\n\r\n\t\t\tGM_setValue('Tribe_' + suffixGlobal, user_race);\r\n\r\n\t\t\talert(T('SCRIPT_NAME') + \" Installation complete\\n\"\r\n\r\n\t\t\t\t\t+ T('INSTALL_M1') + \"\\n\" + T('INSTALL_M2') + \" \\n-ScratchZ\");\r\n\r\n\t\t\twindow.location.replace(rootPath + \"build.php?id=39\");//ToDo: reload\r\n\r\n\t\t} else {\r\n\r\n\t\t\twindow.location.replace(rootPath + \"a2b.php\");//ToDo: reload\r\n\r\n\t\t}\r\n\r\n\r\n\r\n\t}\r\n\r\n\t\r\n\r\n\t// Set default values if not defined yet\r\n\r\n\tif (GM_getValue(\"Maximize_\" + suffixGlobal, false) === false) {\r\n\r\n\t\tGM_setValue(\"Maximize_\" + suffixGlobal, 1);\r\n\r\n\t}\r\n\r\n\tif (GM_getValue(\"MaximizeSettings_\" + suffixGlobal, false) === false) {\r\n\r\n\t\tGM_setValue(\"MaximizeSettings_\" + suffixGlobal, 0);\r\n\r\n\t}\r\n\r\n\tif (GM_getValue(\"StartIndex_\" + suffixLocal, false) === false) {\r\n\r\n\t\tGM_setValue(\"StartIndex_\" + suffixLocal, 0);\r\n\r\n\t}\r\n\r\n\tif (GM_getValue(\"EndIndex_\" + suffixLocal, false) === false) {\r\n\r\n\t\tGM_setValue(\"EndIndex_\" + suffixLocal, -1);\r\n\r\n\t}\r\n\r\n\tif (GM_getValue(\"Skipcounter_\" + suffixGlobal, false) === false) {\r\n\r\n\t\tGM_setValue(\"Skipcounter_\" + suffixGlobal, 0);\r\n\r\n\t}\r\n\r\n\t\r\n\r\n\t//Settings\r\n\tif (GM_getValue(\"RandomFarming_\" + suffixGlobal, false) == false) {\r\n\t\tGM_setValue(\"RandomFarming_\" + suffixGlobal, 0);\r\n\t}\r\n\r\n\tif (GM_getValue(\"farmMarking_\" + suffixGlobal, false) === false) {\r\n\r\n\t\tGM_setValue(\"farmMarking_\" + suffixGlobal, 0);\r\n\r\n\t}\r\n\r\n\tif (GM_getValue(\"VillageSkipping_\" + suffixGlobal, false) === false) {\r\n\r\n\t\tGM_setValue(\"VillageSkipping_\" + suffixGlobal, 0);\r\n\r\n\t}\r\n\r\n\tif (GM_getValue(\"DelTList_\" + suffixLocal, false) === false) {\r\n\r\n\t\tGM_setValue(\"DelTList_\" + suffixLocal, 1);\r\n\r\n\t}\r\n\r\n\tif (GM_getValue(\"ReadRep_\" + suffixLocal, false) === false) {\r\n\r\n\t\tGM_setValue(\"ReadRep_\" + suffixLocal, 0);\r\n\r\n\t}\t\r\n\r\n\t\r\n\r\n\t// Setting Travian Version\r\n\r\n\tif (GM_getValue(\"TravianVersion_\" + suffixGlobal, false) === false) {\r\n\r\n\t\tGM_setValue(\"TravianVersion_\" + suffixGlobal, 0);\r\n\r\n\t}\r\n\r\n\t\r\n\r\n\t//insert village selector\r\n\r\n\trp_villageSelector();\r\n\r\n\t//alert (url);\r\n\r\n\tif (url.indexOf(\"build.php?\") > -1 && (url.indexOf(\"gid=16\") > -1 || url.indexOf(\"id=39\") > -1)) {\r\n\r\n\t\tif (isReallyRallyPoint()) {\r\n\r\n\t\t\trp_mainPage();\r\n\r\n\t\t}\r\n\r\n\t\tactiveMain();\r\n\r\n\t} else if (url.indexOf(\"a2b.php\") > -1) {\r\n\r\n\t\tactiveMain();\r\n\r\n\t} else if (url.indexOf(\"karte.php?\") > -1 && url.indexOf(\"d=\") > -1\r\n\r\n\t\t\t&& url.indexOf(\"c=\") > -1) { //if user profile page\r\n\r\n\t\tfoundNewFarm();\r\n\r\n\t} else if (url.indexOf(\"berichte.php\") > -1) {\r\n\r\n\t\t// if no messages there, return to rally point\r\n\r\n\t\tnewreport = document.getElementsByTagName('html')[0].innerHTML.indexOf('id=\\\"n5\\\" class=\\\"i1\\\"')+document.getElementsByTagName('html')[0].innerHTML.indexOf('id=\\\"n5\\\" class=\\\"i3\\\"');\r\n\r\n\t\tif ( newreport == -2 && GM_getValue(\"Active_\" + suffixGlobal, -1) > -1) \r\n\r\n\t\t{\r\n\r\n\t\t\twindow.open(\"/build.php?id=39\", \"_self\");\r\n\r\n\t\t\treturn;\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t\r\n\r\n\t// farm marking in the map\r\n\r\n\tif (url.indexOf('karte.php')>-1 && url.indexOf('karte.php?d=')==-1 && GM_getValue(\"farmMarking_\" + suffixGlobal, 0)==1)\r\n\r\n\t{\r\n\r\n\t\t\t\t//get center village\r\n\r\n\t\t\t\tvar mapX = dom.get('x').textContent;\r\n\r\n\t\t\t\tvar mapY = dom.get('y').textContent;\r\n\r\n\t\t\t\t\r\n\r\n\t\t\t\tFM_log(4,\"CenterCoords=\"+mapX+\",\"+mapY);\r\n\r\n\t\t\t\t\r\n\r\n\t\t\t\tGM_setValue(\"MapCenter_\"+suffixGlobal,mapX+\",\"+mapY);\r\n\r\n\t\t\t\t\r\n\r\n\t\t\t\t// look for arrow buttons\r\n\r\n\t\t\t\tvar ex = \"//area[contains(@id,'ma_n')]\";\r\n\r\n\t\t\t\ttag = document.evaluate(ex,document,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);\r\n\r\n\t\t\t\t\r\n\r\n\t\t\t\tFM_log(4,\"adding eventListener\");\r\n\r\n\t\t\t\t\r\n\r\n\t\t\t\tfor(var i=1; i<=tag.snapshotLength;i++)\r\n\r\n\t\t\t\t{\r\n\r\n\t\t\t\t\tvar arrowButton = tag.snapshotItem(i-1);\r\n\r\n\t\t\t\t\t// call function to check again after listener was activated\r\n\r\n\t\t\t\t\tFM_log(4,\"arrowId=\"+arrowButton.id);\r\n\r\n\t\t\t\t\t\r\n\r\n\t\t\t\t\tarrowButton.addEventListener(\"click\", function (e){\r\n\r\n\t\t\t\t\t\tvar evt = e || event;\r\n\r\n\t\t\t\t\t\tvar ele = evt.target || evt.srcElement;\r\n\r\n\t\t\t\t\t\tsetTimeout(function(){getXYtoFarms(ele.id);},500);\r\n\r\n\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t}, true); // so that it will check again when scrolling.\r\n\r\n\t\t\t\t\t\t\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\tgetXYtoFarms(\"\")\r\n\r\n\t}\r\n\r\n}", "static final private internal function m106() {}", "static private protected internal function m118() {}", "leftBuild () {\n admin.prototype.scriptCallLeft();\n }", "function doOtherStuff() {}", "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}", "function setup() {\r\n var saveKey = g_savedValues[SAVE_KEY];\r\n var viewKey = g_savedValues[VIEW_KEY];\r\n\r\n // create \"User Script Commands\" menu items, in addition to keyborad shortcuts\r\n GM_registerMenuCommand(\"Save selected text (Shift-\" + saveKey + \")\", saveSelectedText);\r\n GM_registerMenuCommand(\"View saved text (Shift-\" + viewKey + \")\", viewSavedText);\r\n GM_registerMenuCommand(\"Delete all saved text\", clearSavedText);\r\n GM_registerMenuCommand(\"Change keyboard shortcuts\", changeCommandKeys);\r\n\r\n // listen for key presses to initiate commands\r\n $(document).keydown(function(event) { handleCommands(event) });\r\n\r\n // ignore key presses when an input field has focus\r\n $(\"input, textarea, select\").focus(function() { g_typingText = true });\r\n $(\"input, textarea, select\").blur( function() { g_typingText = false });\r\n\r\n // warn if there is a known conflict with the defined command keys\r\n warnIfKeyConflicts();\r\n\r\n // create and hide saved text div\r\n if ($(\"#\" + SAVED_TEXT_ID).length == 0) {\r\n var savedText = createSavedTextDiv();\r\n savedText.hide();\r\n }\r\n\r\n // create and show (but fade out) status note div\r\n if ($(\"#\" + STATUS_NOTE_ID).length == 0) {\r\n var statusNote = createStatusNoteDiv();\r\n statusNote.hide();\r\n showInstructionsOnce(statusNote);\r\n }\r\n}", "function startScript(){\n // Update when script starts.\n updateProductInfo();\n updateLocalInfo();\n // Wait for the product analysis to be set.\n setTimeout(setRecyclability, 1000);\n}", "function testRun()\r\n{\r\n}", "function addAProcess(){\n handleAddAProcess();\n}", "function main() {\n}", "function behaviorFunction() {\n return \"MM_checkPlugin\";\n}", "function runProgram(){\nwhatToBuy();\ngetProducts();\n}", "function sysopFunctions() {\n if ( wgUserGroups && !window.disableSysopJS ) {\n for ( var g = 0; g < wgUserGroups.length; ++g ) {\n if ( wgUserGroups[g] == \"sysop\" ) {\n importScript( \"MediaWiki:Sysop.js\" );\n break;\n }\n }\n }\n}", "function Bar() { WScript.Echo(\"bar\"); }", "function main () {\n\n // Process the function only if document is not empty and lines are selected\n if (( UltraEdit.document.length > 0 ) && ( UltraEdit.activeDocument.isSel() )) {\n\n // Get current column mode\n var column_mode = UltraEdit.columnMode;\n\n // Deactivate column mode\n UltraEdit.columnModeOff();\n\n // Variable declaration\n var comment_txt = UltraEdit.activeDocument.selection;\n var comment_len = comment_txt.length;\n var comment_start = 1;\n var line = \"\";\n var tab = \"\";\n var line_comment = \"#\";\n\n // Get line terminator\n if ( UltraEdit.activeDocument.lineTerminator == 0 ) {\n var line_Terminator = \"\\r\\n\";\n } else {\n var line_Terminator = \"\\n\";\n }\n\n // Get column start : selection column - selection length\n comment_start = UltraEdit.activeDocument.currentColumnNum - comment_len;\n\n // For PERL files (extenstion : pl or pm)\n if (UltraEdit.activeDocument.isExt(\"pl\") || UltraEdit.activeDocument.isExt(\"pm\")) {\n line_comment = \"#\";\n // For VHDL files (extenstion : vhd)\n } else if ( UltraEdit.activeDocument.isExt(\"vhd\")) {\n line_comment = \"--\";\n // For Verilog/SystemVerilog files (extenstion : v or sv)\n } else if (UltraEdit.activeDocument.isExt(\"sv\") || UltraEdit.activeDocument.isExt(\"v\")) {\n line_comment = \"//\";\n }\n\n // Tab value according to column start\n for (i = 1; i < comment_start; i++) {\n tab += \" \";\n }\n\n // Print line 1 : comment character + ' ' + N * '-' + ' ' + comment character + line terminator\n line += line_comment;\n for (i = 0; i < ( comment_len + 2 ); i++) {\n line += \"-\";\n }\n line += line_comment;\n line += line_Terminator;\n\n // Print line 2 : space + comment character + ' ' + comment + ' ' + comment character + line terminator\n line += tab + line_comment + \" \" + comment_txt + \" \" + line_comment + line_Terminator;\n\n // Print line 1 : space + comment character + ' ' + N * '-' + ' ' + comment character\n line += tab;\n line += line_comment;\n for (i = 0; i < ( comment_len + 2 ); i++) {\n line += \"-\";\n }\n line += line_comment;\n\n // Print cartbridge\n UltraEdit.activeDocument.write( line );\n\n // Restore column mode if was previous true\n if ( column_mode ) {\n UltraEdit.columnModeOn;\n }\n }\n}" ]
[ "0.6198107", "0.60040814", "0.59436685", "0.59292924", "0.5902363", "0.58960783", "0.5886769", "0.5821152", "0.563791", "0.56351286", "0.56059897", "0.5603091", "0.5589001", "0.5580957", "0.5580727", "0.5578116", "0.5562296", "0.556029", "0.55576056", "0.5546509", "0.5543146", "0.55346507", "0.55292004", "0.5525949", "0.5523043", "0.5520103", "0.55159765", "0.5510472", "0.5482355", "0.5477741", "0.54739887", "0.54739887", "0.54739887", "0.5458805", "0.54528826", "0.54294914", "0.54158086", "0.54158086", "0.54158086", "0.54158086", "0.54158086", "0.5373642", "0.53730446", "0.53730446", "0.5351365", "0.5346919", "0.53409916", "0.53387636", "0.53362143", "0.5327454", "0.5325811", "0.5301502", "0.52989256", "0.5289015", "0.52849966", "0.5251589", "0.52489364", "0.52482617", "0.52475226", "0.52343524", "0.52138925", "0.5203281", "0.51952285", "0.51882505", "0.51802033", "0.51760304", "0.5168555", "0.5164815", "0.51642823", "0.5158149", "0.51494485", "0.51412904", "0.51405644", "0.51319647", "0.51251394", "0.5122188", "0.5118691", "0.51186496", "0.5105845", "0.51052576", "0.5102689", "0.5101456", "0.5094743", "0.5088744", "0.50877917", "0.50816166", "0.50806713", "0.5075783", "0.5075019", "0.5073916", "0.5070953", "0.50698805", "0.50694644", "0.50674415", "0.5061087", "0.5053321", "0.5051844", "0.50492287", "0.5042241", "0.5040052", "0.5037947" ]
0.0
-1
!NAVBAR FOLD && UNFOLD SVG FUNCTIONS
function fillNET(color){ // console.log($('._NET_').length); $('._NET_').css('fill',color); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SVGWrap() {}", "function open() {\n $('body').addClass('is-collapsed');\n $('.navbar-collapse').addClass('is-active');\n // var bars = $(document.createElement('use')).attr('xlink:href', 'images/sprites/svgsprite.svg#bars') \n // var x = $(document.createElement('use')).attr('xlink:href', 'images/sprites/svgsprite.svg#x')\n $('.btn--navbar-toggle').removeClass('closed').addClass('open').find('use').attr('xlink:href', returnRoot() + 'images/sprites/svgsprite.svg#x');\n $('.fade').fadeIn(); \n }", "function navbarAnim() {\r\n let nav = document.getElementById('navbar');\r\n let navLinks = document.getElementsByClassName('navbar-links');\r\n let spans = document.getElementsByClassName('line');\r\n\r\n if (window.scrollY !== 0) {\r\n nav.style.setProperty('box-shadow', '0 .125rem .25rem rgba(0,0,0,.075)');\r\n nav.style.setProperty('background-color', '#fff');\r\n\r\n navLinks.forEach(element => {\r\n element.style.setProperty('color', '#6BBA62')\r\n })\r\n\r\n spans.forEach(element => {\r\n element.style.setProperty('stroke', '#6BBA62')\r\n })\r\n } else {\r\n nav.removeAttribute('style');\r\n navLinks.forEach(element => {\r\n element.removeAttribute('style');\r\n })\r\n spans.forEach(element => {\r\n element.removeAttribute('style');\r\n })\r\n }\r\n}", "drawSvg() {\n \n\t}", "function maximizeSVG() {\n $('#fullscreen').removeClass('hidden');\n applyPanZoom('#fullscreenSVG');\n}", "function navAction(){\n $('#topbar').slideToggle('normal', resizeTable);\n if(collapse){\n // from collapsed to not-collapsed (get bigger)\n let beforeH = $('#tree-container').height();\n var x = document.getElementById(\"tree-container\");\n x.style.height = '60vh';\n let afterH = $('#tree-container').height();\n\n var y = document.getElementById(\"viewerSVG\");\n y.style.height = '60vh';\n y.style.transition = '0.5s';\n\n d3v3.select('.treeGroup')\n .transition()\n .duration(duration)\n .attr('transform', function(d) {\n // return 'translate(' + 96 + ',' + $('#tree-container').height() / 2 +') scale(' + currentScale + ')';\n return \"translate(\" + currentPos.x + ',' + (currentPos.y + (afterH - beforeH) / 2) + \") scale(\" + currentScale + \")\";\n });\n\n collapse=false;\n } else {\n // from not-collapsed to collapsed (get smaller)\n let beforeH = $('#tree-container').height();\n var x = document.getElementById(\"tree-container\");\n x.style.height = '90vh';\n let afterH = $('#tree-container').height();\n\n var y = document.getElementById(\"viewerSVG\");\n y.style.height = '90vh';\n y.style.transition = '0.5s';\n\n d3v3.select('.treeGroup')\n .transition()\n .duration(duration)\n .attr('transform', function(d) {\n // return 'translate(' + 96 + ',' + $('#tree-container').height() / 2 +') scale(' + currentScale + ')';\n return \"translate(\" + currentPos.x + ',' + (currentPos.y + (afterH - beforeH) / 2) + \") scale(\" + currentScale + \")\";\n });\n\n collapse=true;\n }\n}", "function toggleScalebarObject(){\n //Si le style cliquer est celui qui est deplie\n //alert(classe+\" \"+style+\" \"+mapFile.currentStyle);\n \n if(mapFile.scalebarObject.expand){\n mapFile.scalebarObject.expand=false;\n mapFile.scalebarObject.clearGUI();\n $(mapFile.scalebarObject.id+'_attr').style.display=\"none\";\n }else{\n mapFile.scalebarObject.expand=true;\n $(mapFile.scalebarObject.id+'_attr').style.display=\"block\";\n mapFile.scalebarObject.initGUI();\n }\n}", "function closeNav() {\n nav.classList.remove(\"active\");\n toggle.querySelector(\"a\").innerHTML = \"<svg><use xlink:href='#icon-toggle'/></svg>\"; \n}", "function bgRect(evt) {\n var elem = document.getElementById('bigraphLines');\n var style = elem.getAttributeNS(null, \"style\");\n var v;\n if (!isDefined(style) || style === V_ON) {\n elem.setAttributeNS(null, \"style\", V_OFF);\n v = \"soft off\";\n } else {\n elem.setAttributeNS(null, \"style\", \"\");\n v = \"soft on\";\n }\n SvgNoticeText.nodeValue = \"Lines visible toggle \" + v;\n}", "function Xf(){this.ha=E(\"g\",{},null);this.Zh=E(\"path\",{\"class\":\"blocklyPathDark\",transform:\"translate(1, 1)\"},this.ha);this.gd=E(\"path\",{\"class\":\"blocklyPath\"},this.ha);this.$h=E(\"path\",{\"class\":\"blocklyPathLight\"},this.ha);this.gd.gc=this;Gf(this.gd);bg(this)}", "function changeNavStyle(objClicked, objUnchecked, navId)\r\n{\r\n restoreArea(navId); // restore the nav area\r\n\tvar clickedLeft = getElemnt(objClicked);\r\n\tvar clickedCenter = getElemnt(objClicked+\"_center\");\r\n\tvar unclickedLeft = getElemnt(objUnchecked);\r\n\tvar unclickedCenter = getElemnt(objUnchecked+\"_center\");\r\n\t// if left side is clicked\r\n\tif(unclickedLeft != null && clickedLeft != null){\r\n\t\tclickedCenter.className = \"clsCenterNavButtonOnFocus\";\r\n\t\tunclickedCenter.className = \"clsCenterNavButtonOffFocus\";\r\n\r\n\t\tif(objClicked.indexOf(\"left\") >= 0)\r\n\t\t{\r\n\t\t\tunclickedLeft.className = \"clsRightNavButtonOffFocus\";\r\n\t\t\tclickedLeft.className = \"clsLeftNavButtonOnFocus\";\r\n\t\t\tgetElemnt(\"nav\"+navId+\"data\"+\"left\").style.display = \"block\";\r\n\t\t\tgetElemnt(\"nav\"+navId+\"data\"+\"right\").style.display = \"none\";\r\n\t\t\tInternalActiveTab = \"left\";\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tunclickedLeft.className = \"clsLeftNavButtonOffFocus\";\r\n\t\t\tclickedLeft.className = \"clsRightNavButtonOnFocus\";\r\n\t\t\tgetElemnt(\"nav\"+navId+\"data\"+\"left\").style.display = \"none\";\r\n\t\t\tgetElemnt(\"nav\"+navId+\"data\"+\"right\").style.display = \"block\";\r\n\t\t\tInternalActiveTab = \"right\";\r\n\t\t}\r\n\t}\r\n}", "function toClickNavicon() {\n\t\t\tcount++;\n\t\t\tif (count % 2 != 0) {\n\t\t\t\tsidebar.style.left = 0;\n\t\t\t\tmoveLayout.style.marginLeft = 200 + 'px'\n\t\t\t\twrapper.style.opacity = 0.2;\n\t\t\t\tnavicon.style.color = 'rgb(250,250,250)';\n\t\t\t\tdocument.body.style.overflow = 'hidden';\n\t\t\t} \n\t\t\tif (count % 2 == 0) {\n\t\t\t\tsidebar.style.left = -200 + 'px';\n\t\t\t\tmoveLayout.style.marginLeft = 0;\n\t\t\t\twrapper.style.opacity = 1;\n\t\t\t\tnavicon.style.color = 'rgb(88,77,57)';\n\t\t\t\tdocument.body.style.overflow = 'auto';\n\t\t\t}\n\t\t}", "function iconswap(x) {\n var y = x.className;\n if (y.indexOf('-up') > 0) {\n x.className = y.replace('-up', '-down');\n } else if (y.indexOf('-down') > 0) {\n x.className = y.replace('-down', '-up');\n } else if (y.indexOf('-left-') > 0) {\n x.className = y.replace('-left-', '-right-');\n } else if (y.indexOf('-right-') > 0) {\n x.className = y.replace('-right-', '-left-');\n } else if (y.indexOf('-bottom-left') > 0) {\n x.className = y.replace('-bottom-left', '-top-right');\n } else if (y.indexOf('-top-right') > 0) {\n x.className = y.replace('-top-right', '-bottom-left');\n } else if (y.indexOf('-expand') > 0) {\n x.className = y.replace('-expand', '-collapse');\n } else if (y.indexOf('-collapse') > 0) {\n x.className = y.replace('-collapse', '-expand');\n }\n}", "function removeSvg() {\r\n $('table.newschart > tbody > tr > td.nval').removeClass(\"hideborder\");\r\n setPaths = false;\r\n $('svg').remove();\r\n}", "function trackDrawBGimage()\r\n{\r\n\r\n if(ActiveElem==null&&EditBGimage==false && BGimageDeleted==false)\r\n {\r\n DrawX.style(\"display\", \"inline\")\r\n DrawX.attr(\"transform\", \"translate(\"+SVGx+\" \"+SVGy+\")\")\r\n\r\n }\r\n}", "function trackDrawBGimage()\r\n{\r\n\r\n if(ActiveElem==null&&EditBGimage==false && BGimageDeleted==false)\r\n {\r\n //DrawX.style(\"display\", \"inline\")\r\n // DrawX.attr(\"transform\", \"translate(\"+SVGx+\" \"+SVGy+\")\")\r\n\r\n }\r\n}", "function burgerMenu() {\n dispatch({\n type: \"TOGGLE_THE_BURGER_MENU_SVG\",\n });\n }", "function svgAnimations() {\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar $svgOffsetPos = ($('#nectar_fullscreen_rows').length > 0) ? '200%' : 'bottom-in-view';\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ($svgIcons.length == 0) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$('.svg-icon-holder:not(.animated-in)').has('svg').each(function (i) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tvar $that = $(this);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif (nectarDOMInfo.usingMobileBrowser) {\r\n\t\t\t\t\t\t\t\t$that.attr('data-animation', 'false');\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t// Size\r\n\t\t\t\t\t\t\t$that.find('svg').css({\r\n\t\t\t\t\t\t\t\t'height': parseInt($that.attr('data-size')) + 'px',\r\n\t\t\t\t\t\t\t\t'width': parseInt($that.attr('data-size')) + 'px'\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// Animation\r\n\t\t\t\t\t\t\t$(this).find('svg').attr('id', 'nectar-svg-animation-instance-' + i);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tvar $animationSpeed = ($that.is('[data-animation-speed]') && $that.attr('data-animation-speed').length > 0) ? $that.attr('data-animation-speed') : 200;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif ($that.attr('data-animation') == 'false') {\r\n\t\t\t\t\t\t\t\t$animationSpeed = 1;\r\n\t\t\t\t\t\t\t\t$that.css('opacity', '1');\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif (!$that.hasClass('bound')) {\r\n\t\t\t\t\t\t\t\t$svgIcons[i] = new Vivus($that.find('svg').attr('id'), {\r\n\t\t\t\t\t\t\t\t\ttype: 'delayed',\r\n\t\t\t\t\t\t\t\t\tpathTimingFunction: Vivus.EASE_OUT,\r\n\t\t\t\t\t\t\t\t\tanimTimingFunction: Vivus.LINEAR,\r\n\t\t\t\t\t\t\t\t\tduration: $animationSpeed,\r\n\t\t\t\t\t\t\t\t\tonReady: svgInit\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif ($animationSpeed !== 1) {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tvar waypoint = new Waypoint({\r\n\t\t\t\t\t\t\t\t\telement: $that,\r\n\t\t\t\t\t\t\t\t\thandler: function () {\r\n\t\t\t\t\t\t\t\t\t\tif ($that.hasClass('animated-in')) {\r\n\t\t\t\t\t\t\t\t\t\t\twaypoint.destroy();\r\n\t\t\t\t\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\tcheckIfReady();\r\n\t\t\t\t\t\t\t\t\t\t$that.addClass('animated-in');\r\n\t\t\t\t\t\t\t\t\t\twaypoint.destroy();\r\n\t\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t\t\toffset: $svgOffsetPos\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tcheckIfReady();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tfunction checkIfReady() {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tvar $animationDelay = 0; \r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif($that.is('[data-animation-delay]') && \r\n\t\t\t\t\t\t\t\t$that.attr('data-animation-delay').length > 0 && \r\n\t\t\t\t\t\t\t\t$that.attr('data-animation') != 'false') {\r\n\t\t\t\t\t\t\t\t\t$animationDelay = $that.attr('data-animation-delay');\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tvar $iconID = $that.find('svg').attr('id').replace(/[^0-9]/g, '');\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif ($svgIcons[$iconID].isReady == true) {\r\n\t\t\t\t\t\t\t\t\tsetTimeout(function () {\r\n\t\t\t\t\t\t\t\t\t\t$that.css('opacity', '1');\r\n\t\t\t\t\t\t\t\t\t\t$svgIcons[$iconID].reset().play();\r\n\t\t\t\t\t\t\t\t\t}, $animationDelay);\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\tsetTimeout(checkIfReady, 50);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tfunction svgInit() {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t//set size\r\n\t\t\t\t\t\t\t\t$that.css({\r\n\t\t\t\t\t\t\t\t\t'height': parseInt($that.attr('data-size')) + 'px',\r\n\t\t\t\t\t\t\t\t\t'width': parseInt($that.attr('data-size')) + 'px'\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$that.addClass('bound');\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t// SVG in equal height column resize\r\n\t\t\t\t\t\tif ($('.vc_row-o-equal-height .svg-icon-holder[data-animation=\"true\"]').length > 0 && \r\n\t\t\t\t\t\t$('#nectar_fullscreen_rows').length == 0) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$window.on('smartresize', function () {\r\n\t\t\t\t\t\t\t\tclearTimeout($svgResizeTimeout);\r\n\t\t\t\t\t\t\t\t$svgResizeTimeout = setTimeout(function () {\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tif ($svgIcons.length > 0) {\r\n\t\t\t\t\t\t\t\t\t\t$('.svg-icon-holder.animated-in').each(function () {\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t$(this).css('opacity', '1');\r\n\t\t\t\t\t\t\t\t\t\t\tif ($(this).is('[id]')) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tvar $iconID = $(this).attr('id').replace(/[^0-9]/g, '');\r\n\t\t\t\t\t\t\t\t\t\t\t\t$svgIcons[$iconID].finish();\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t}, 300);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t} \r\n\t\t\t\t\t\r\n\t\t\t\t\t// After svg animated icons initalized\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\t$('.svg-icon-holder').addClass('animated-in').css('opacity', '1');\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Full vc row support\r\n\t\t\t\t\t$('#nectar_fullscreen_rows .svg-icon-holder.animated-in').has('svg').each(function (i) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar $animationDelay = 0; \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif($(this).is('[data-animation-delay]') && \r\n\t\t\t\t\t\t$(this).attr('data-animation-delay').length > 0 && \r\n\t\t\t\t\t\t$(this).attr('data-animation') != 'false') {\r\n\t\t\t\t\t\t\t$animationDelay = $(this).attr('data-animation-delay');\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar $that = $(this);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar $iconID = $that.find('svg').attr('id').replace(/[^0-9]/g, '');\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tclearTimeout($animatedSVGIconTimeout[i]);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif ($that.attr('data-animation') == 'false') {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$that.css('opacity', '1');\r\n\t\t\t\t\t\t\t$svgIcons[$iconID].finish();\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif ($(this).parents('.active').length > 0 || \r\n\t\t\t\t\t\t\t$(this).parents('#footer-outer').length > 0 || \r\n\t\t\t\t\t\t\t$('body.mobile').length > 0) {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$svgIcons[$iconID].reset();\r\n\t\t\t\t\t\t\t\t$animatedSVGIconTimeout[i] = setTimeout(function () {\r\n\t\t\t\t\t\t\t\t\t$svgIcons[$iconID].play();\r\n\t\t\t\t\t\t\t\t}, $animationDelay);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t$svgIcons[$iconID].reset().stop();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t}", "function makeUI(svg){\r\n //the black background\r\n var UIBG = svg.selectAll(\"rect.UIBG\")\r\n .data([7])\r\n .enter()\r\n .append(\"rect\")\r\n .attr(\"class\", \"ui\")\r\n .attr(\"x\", 0)\r\n .attr(\"y\", function(d){if(UItop){\r\n return document.body.scrollTop-d;\r\n }else{\r\n return document.body.scrollTop-d-5-uiHeight + window.innerHeight;\r\n }})\r\n .attr(\"width\", \"100%\")\r\n .attr(\"height\", uiHeight)\r\n .attr(\"fill\", \"#000000\");\r\n\r\n //down button\r\n var UIDWN = svg.selectAll(\"rect.UIBG\")\r\n .data([7])\r\n .enter()\r\n .append(\"rect\")\r\n .attr(\"class\", \"ui\")\r\n .attr(\"x\", BGWIDTH*.9)\r\n .attr(\"y\", function(d){if(UItop){\r\n return document.body.scrollTop-d;\r\n }else{\r\n return document.body.scrollTop-d-5-uiHeight + window.innerHeight;\r\n }})\r\n .attr(\"width\", \"10%\")\r\n .attr(\"height\", uiHeight)\r\n .attr(\"fill\", \"#ffff00\")\r\n .on(\"click\", d => uiFlip(d, svg));\r\n\r\n svg.append(\"text\")\r\n .attr(\"class\", \"ui\")\r\n .attr(\"font-size\", uiHeight/2)\r\n .attr(\"x\", BGWIDTH*.92)\r\n .attr(\"y\", function(d){if(UItop){\r\n return uiHeight*.6 + document.body.scrollTop\r\n }else{\r\n return document.body.scrollTop + window.innerHeight - uiHeight*.6\r\n }})\r\n .style(\"text-anchor\", \"right\")\r\n .style(\"fill\", \"#000000\")\r\n .text(\"Down\")\r\n .on(\"click\", d => uiFlip(d, svg)); \r\n\r\n renderStartAndStopPolyBtns(svg)\r\n\r\n renderDeletePolyBtn(svg)\r\n\r\n\r\n renderExpandPolyUIBtn(svg)\r\n\r\n renderDeleteImageBtn(svg)\r\n\r\n renderExpandedUI(svg)\r\n\r\n\r\n}", "function barClicked() {\n bars.classList.toggle('active');\n nav.classList.toggle('visible');\n}", "function homesvg(){\n//Background color\nvar bgColor = $(\".headerbgcolor\").css(\"background-color\");\t\n\t\n// Tux image is from creative commons, I didn't create it!\nvar s = Snap(\"#homesvg\");\nvar g = s.group();\nvar svgsource = s.attr(\"data-svgsrc\");\n//Start\nSnap.load(svgsource, function ( loadedFragment ) {\n\ng.append( loadedFragment );\ntestPath();\n\t\t\t\t\t\t\t\t\t\n//Custom\n\n//Path function Start\nfunction testPath(){\t\t\t\t\t\t\t\t\t\nvar someObj = {};\n\nvar testPath = g.selectAll(\"path\");\n//testPath.remove();\ntestPath.forEach(function(el) {\n\nvar lenB = el.getTotalLength();\n\nvar defaultColor = el.attr(\"fill\");\nvar strokeColor = el.attr(\"stroke\");\n\nvar animationTime = 4000;\nvar animationFillTime = 1000;\nel.attr({\nid: \"#fff5e7\",\nfill: bgColor,\nstrokeWidth: \"1\",\nstroke: strokeColor,\nstrokeMiterLimit: \"2\",\n\"stroke-dasharray\": lenB + \" \" + lenB,\n\"stroke-dashoffset\": lenB\n}).animate({\"stroke-dashoffset\": 0}, animationTime ,mina.easeinout,\n\n//Callback\n function(){\nel.attr({fill: bgColor}).animate({fill:defaultColor, stroke:strokeColor}, animationFillTime,mina.easeinout,loadedEl);\n\n\n}\n//Callback\n);\n//console.log(el.attr('fill'))\n});\n//console.log( testPath, someObj );\n}\n//Path Function End\n//Custom\t\t\t\t\t\t\t\t\t\n});\n//End\n}", "function transformSvg(svg, cb) {\n svg.attr({ style: 'display:none' });\n cb(null);\n}", "updateSVG(ind) {\n this.svg_element.attr(\"d\", this.pathParameters(this.edge_left, this.edge_right));\n\n //Get parabola left and right IDs\n let pl = this.parab.left ? this.parab.left._ID : \"n/a\";\n let pr = this.parab.right ? this.parab.right._ID : \"n/a\";\n\n $(\"#parab-list #par\" + this._ID).text(\"Parabola ID: \" + this._ID + \", domain: [\" + Math.round(this.edge_left) + \", \" + Math.round(this.edge_right) + \"], index: \" + ind + \" -- L: \"+pl+\" R: \"+ pr);\n }", "function transformSvg (svg, cb) {\n svg.attr({ style: 'display:none' })\n cb(null)\n}", "function SigmaEnableSVG() {\n return null;\n}", "function destroy(){\n\t\tif(!_.isUndefined(svg) && _.isFunction(svg.style))\n\t\tsvg\n\t .style('background-color', 'none');\n\t}", "function clearDarkenenedState() {\n var selected = svgDoc.getElementsByClassName('bordered');\n if (selected.length > 0) {\n var className = selected[0].getAttribute('class').replace('bordered','').trim();\n selected[0].setAttribute('class', className);\n }\n }", "function Header({ cssClass, fillOne, fillTwo, animation }) {\n\n\n\n\n return (\n <svg\n className={cssClass}\n ref={animation}\n viewBox=\"0 0 38 42\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\">\n <g clipPath=\"url(#clip0)\">\n <path d=\"M20.1074 41.2954C17.0967 41.3026 14.1222 40.6344 11.4001 39.3394C8.67808 38.0444 6.2768 36.1551 4.37084 33.8088C4.16362 33.5543 4.06532 33.2273 4.09757 32.8998C4.12982 32.5723 4.28998 32.2712 4.54281 32.0625C4.79564 31.8539 5.12043 31.755 5.44573 31.7874C5.77104 31.8199 6.07021 31.9811 6.27743 32.2357C8.04636 34.4031 10.2935 36.1248 12.84 37.2638C15.3864 38.4027 18.1618 38.9274 20.9452 38.7961C23.7286 38.6648 26.4432 37.8811 28.8727 36.5074C31.3021 35.1338 33.3795 33.208 34.9394 30.8835C35.3327 30.2919 35.5411 29.5953 35.5378 28.8833V24.3376H30.291C29.9641 24.3376 29.6506 24.2069 29.4195 23.9742C29.1884 23.7415 29.0585 23.4259 29.0585 23.0968C29.0585 22.7678 29.1884 22.4522 29.4195 22.2195C29.6506 21.9868 29.9641 21.8561 30.291 21.8561H36.7686C37.095 21.8566 37.4079 21.9873 37.6387 22.2197C37.8696 22.452 37.9994 22.7671 37.9999 23.0957V28.8833C38.004 30.0898 37.6492 31.2698 36.9812 32.2715C35.1203 35.0542 32.6076 37.3331 29.6648 38.9068C26.722 40.4806 23.4396 41.3009 20.1074 41.2954ZM35.8514 11.5042C35.6512 11.5045 35.454 11.4556 35.2768 11.3619C35.0997 11.2682 34.9478 11.1324 34.8345 10.9664C33.1907 8.56422 30.991 6.60072 28.4253 5.24526C25.8596 3.8898 23.0049 3.18306 20.1074 3.18601C15.3386 3.18601 10.857 5.04483 7.48868 8.42081C7.25654 8.65072 6.94344 8.77879 6.6178 8.77704C6.29216 8.77529 5.98044 8.64387 5.75074 8.41148C5.52104 8.1791 5.39204 7.86464 5.39191 7.5368C5.39178 7.20897 5.52053 6.89441 5.75005 6.66184C7.86414 4.54772 10.4133 2.92634 13.2176 1.91208C16.022 0.897828 19.0132 0.515395 21.9804 0.791762C24.9476 1.06813 27.8183 1.99657 30.3902 3.51158C32.9622 5.02659 35.1725 7.09128 36.8654 9.55999C36.9925 9.74623 37.0667 9.96387 37.08 10.1894C37.0933 10.415 37.0452 10.6399 36.9408 10.84C36.8365 11.04 36.6799 11.2076 36.4879 11.3247C36.2959 11.4417 36.0758 11.5038 35.8514 11.5042Z\" fill={fillOne} />\n <path d=\"M2.84957 30.258C2.61045 30.2584 2.37634 30.1889 2.17575 30.0579C1.97516 29.9268 1.81672 29.7399 1.71972 29.5199C0.563494 26.8895 0 24.1454 0 21.1336C0.00200816 17.4627 0.947967 13.8548 2.74581 10.6611C2.90712 10.3748 3.17479 10.1648 3.48993 10.0772C3.80508 9.98954 4.14189 10.0316 4.42626 10.1939C4.71064 10.3563 4.91929 10.6258 5.00631 10.9431C5.09334 11.2603 5.05161 11.5994 4.8903 11.8857C3.30235 14.7058 2.46678 17.8919 2.46493 21.1336C2.46493 23.8309 2.94473 26.1768 3.97541 28.5163C4.05864 28.7052 4.09372 28.9119 4.07745 29.1179C4.06119 29.3238 3.99409 29.5224 3.88226 29.6957C3.77043 29.8689 3.61741 30.0113 3.43707 30.1099C3.25673 30.2085 3.05479 30.2602 2.84957 30.2603V30.258ZM12.2404 29.4501C12.0514 29.4504 11.865 29.4069 11.6954 29.3231C11.5258 29.2392 11.3776 29.1172 11.2624 28.9665L5.3122 21.1832C5.14136 20.96 5.05106 20.6849 5.05616 20.4032C5.06127 20.1215 5.16147 19.8499 5.34029 19.6332L11.9182 11.6502C12.0215 11.5248 12.1484 11.421 12.2916 11.345C12.4348 11.2689 12.5914 11.2219 12.7526 11.2068C12.9138 11.1917 13.0764 11.2087 13.231 11.2568C13.3857 11.305 13.5294 11.3833 13.654 11.4874C13.7786 11.5915 13.8816 11.7193 13.9571 11.8634C14.0326 12.0076 14.0792 12.1653 14.0941 12.3276C14.1091 12.4899 14.0921 12.6535 14.0443 12.8092C13.9964 12.9649 13.9185 13.1096 13.8151 13.2349L7.86656 20.4555L13.216 27.4516C13.3565 27.635 13.4431 27.8544 13.4661 28.0848C13.4891 28.3153 13.4475 28.5476 13.3461 28.7555C13.2446 28.9634 13.0874 29.1385 12.8922 29.2611C12.697 29.3836 12.4716 29.4487 12.2415 29.4489L12.2404 29.4501Z\" fill={fillTwo} />\n </g>\n <defs>\n <clipPath id=\"clip0\">\n <rect width=\"38\" height=\"40.5909\" fill=\"white\" transform=\"translate(0 0.704529)\" />\n </clipPath>\n </defs>\n </svg>\n\n )\n}", "function svgchange(){\n var element = document.getElementById(\"svg-div\");\n element.classList.toggle(\"svgclass\");\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}", "loadSVG(e) {\n var svgDoc = e.currentTarget.contentDocument;\n var svgItems = svgDoc.getElementsByTagName(\"path\");\n for (var i = 0; i < 51; i++) {\n if (this.props.campus.sts.indexOf(svgItems[i].id) > -1) {\n svgItems[i].style.fill = \"#61DAFB\";\n svgItems[i].addEventListener(\"click\", (e) => {\n this.selectState(e.target.id);\n });\n } else {\n svgItems[i].style.fill = \"#525252\";\n }\n }\n e.currentTarget.style.opacity = \"1.0\";\n }", "function renderPreviewSVG (node, colors) {\n colors = colors || clonedColors;\n topbarVariant = themePredictor(colors['top-bar']);\n rightSidebarVariant = themePredictor(colors['right-sidebar']);\n\n var preview = Snap(node),\n fillColor = rightSidebarVariant === 'dark' ? WHITE : BLACK,\n opacity = rightSidebarVariant === 'dark' ? '0.1' : '0.3',\n teamLogo = $('.team-logo').data('identity-href');\n\n if (!preview) { return; }\n\n preview.clear();\n\n var previewContainer = preview.rect(0, 0, '100%', 170),\n dataContainer = preview.rect(0, 40, '100%', 130),\n leftSidebar = preview.rect(0, 40, '20%', 130),\n leftSidebarContent1 = preview.rect(10, 60, '15%', 10, 3),\n leftSidebarContent2 = preview.rect(10, 80, '10%', 10, 3),\n leftSidebarContent3 = preview.rect(10, 110, '15%', 10, 3),\n leftSidebarContent4 = preview.rect(10, 130, '10%', 10, 3),\n mainAreaContent1 = preview.rect('25%', 60, '30%', 10, 3),\n mainAreaContent2 = preview.rect('25%', 80, '15%', 10, 3);\n mainAreaContent3 = preview.rect('25%', 110, '15%', 10, 3),\n rightSidebar = preview.rect('60%', 40, '40%', 130),\n rightSidebarContent1 = preview.rect('60%', 60, '40%', 50),\n rightSidebarContent2 = preview.rect('60%', 120, '40%', 50),\n header = preview.rect(0, 0, '100%', 40),\n logo = preview.image(teamLogo || '/docs-assets/images/logo-glyph.png', 10, 5, 85, 30),\n headerOptions = preview.rect('85%', 12, 40, 15, 3);\n\n previewContainer.attr({\n stroke: '#D8D8D8',\n strokeWidth: 1,\n });\n\n dataContainer.attr({\n fill: WHITE,\n });\n\n leftSidebar.attr({\n fill: DEFAULT_CUSTOM_COLOR,\n opacity: '0.05'\n });\n\n leftSidebarContent1.attr({\n fill: BLACK,\n opacity: '0.2'\n });\n\n leftSidebarContent2.attr({\n fill: BLACK,\n opacity: '0.2'\n });\n\n leftSidebarContent3.attr({\n fill: BLACK,\n opacity: '0.2'\n });\n\n leftSidebarContent4.attr({\n fill: BLACK,\n opacity: '0.2'\n });\n\n mainAreaContent1.attr({\n fill: BLACK,\n opacity: '0.2'\n });\n\n mainAreaContent2.attr({\n fill: BLACK,\n opacity: '0.2'\n });\n\n mainAreaContent3.attr({\n fill: colors['highlight']\n });\n\n rightSidebar.attr({\n fill: colors['right-sidebar']\n });\n\n rightSidebarContent1.attr({\n fill: rightSidebarVariant === 'dark' ? WHITE : BLACK,\n opacity: rightSidebarVariant === 'dark' ? '0.1' : '0.3',\n });\n\n rightSidebarContent2.attr({\n fill: rightSidebarVariant === 'dark' ? WHITE : BLACK,\n opacity: rightSidebarVariant === 'dark' ? '0.1' : '0.3',\n });\n\n header.attr({\n fill: colors['top-bar'],\n stroke: topbarVariant === 'dark' ? WHITE : BLACK,\n strokeWidth: 1,\n strokeOpacity: topbarVariant === 'dark' ? '0.1' : '0.3'\n });\n\n logo.attr({\n preserveAspectRatio: \"xMinYMin\"\n })\n\n headerOptions.attr({\n fill: topbarVariant === 'dark' ? WHITE : BLACK,\n opacity: topbarVariant === 'dark' ? '0.1' : '0.3',\n });\n }", "function hackSVG() {\n\tif (SVGElement && SVGElement.prototype) {\n\n\t\tSVGElement.prototype.hasClass = function(className) {\n\t\t\treturn new RegExp('(\\\\s|^)' + className + '(\\\\s|$)').test(this\n\t\t\t\t\t.getAttribute('class'));\n\t\t};\n\n\t\tSVGElement.prototype.addClass = function(className) {\n\t\t\tif (!this.hasClass(className)) {\n\t\t\t\tthis.setAttribute('class', this.getAttribute('class') + ' '\n\t\t\t\t\t\t+ className);\n\t\t\t}\n\t\t};\n\n\t\tSVGElement.prototype.removeClass = function(className) {\n\t\t\tvar removedClass = this.getAttribute('class').replace(\n\t\t\t\t\tnew RegExp('(\\\\s|^)' + className + '(\\\\s|$)', 'g'), '$2');\n\t\t\tif (this.hasClass(className)) {\n\t\t\t\tthis.setAttribute('class', removedClass);\n\t\t\t}\n\t\t};\n\t\tSVGElement.prototype.toggleClass = function(className) {\n\t\t\tif (this.hasClass(className)) {\n\t\t\t\tthis.removeClass(className);\n\t\t\t} else {\n\t\t\t\tthis.addClass(className);\n\t\t\t}\n\t\t};\n\n\t}\n}", "function minimizeSVG() {\n $('#fullscreen').addClass('hidden');\n applyPanZoom('#map');\n}", "function svgPositioning(o) {\n $(o.targetImg)\n .css('top', o.target.offsetTop + o.target.offsetHeight - 6)\n .css('left', o.target.offsetLeft)\n .css('width', o.target.offsetWidth)\n .css('height', 8)\n .css('margin', 0)\n .css('display', 'block');\n $(o.img).css('display', 'none');\n // For All exept BLOG\n if (o.target !== $('.BLOG')) {\n $('.dropmenu').slideDown(200);\n $('dropmenu').toggleClass('upper');\n }\n $(o.a).toggleClass('hover');\n $('.BELOW_HEADER').find('a').not(o.a).toggleClass('hover')\n }", "function toggle(x) {\n _togSvgLayer(x, mapG, 'bg', 'background map');\n }", "function mouseout() {\n\t\t\t// Transition each segment to full opacity and then reactivate it.\n\t\t\tsvg.selectAll('path').style('opacity', 1);\n\t\t}", "function configureExportSVG(glyphsGB) { \n if(!glyphsGB) { return; }\n if(!glyphsGB.navCtrls) { return; }\n \n var divFrame = glyphsGB.settings_panel;\n if(!divFrame) { \n divFrame = document.createElement('div'); \n glyphsGB.settings_panel = divFrame;\n }\n glyphsGB.navCtrls.appendChild(glyphsGB.settings_panel);\n \n var navRect = glyphsGB.navCtrls.getBoundingClientRect();\n \n divFrame.setAttribute('style', \"position:absolute; text-align:left; padding: 3px 3px 3px 3px; \" \n +\"background-color:rgb(235,235,240); \" \n +\"border:2px solid #808080; border-radius: 4px; \"\n +\"left:\"+(navRect.left+window.scrollX+glyphsGB.display_width-370)+\"px; \"\n +\"top:\"+(navRect.top+window.scrollY+20)+\"px; \"\n +\"width:350px; z-index:90; \"\n );\n divFrame.innerHTML = \"\";\n var tdiv, tdiv2, tspan1, tspan2, tinput, tcheck;\n\n var exportConfig = glyphsGB.exportSVGconfig;\n\n //close button\n tdiv = divFrame.appendChild(document.createElement('div'));\n tdiv.setAttribute('style', \"float:right; margin: 0px 4px 4px 4px;\");\n var a1 = tdiv.appendChild(document.createElement('a'));\n a1.setAttribute(\"target\", \"top\");\n a1.setAttribute(\"href\", \"./\");\n a1.onclick = function() { exportSVGConfigParam(glyphsGB, 'svg-cancel'); return false; }\n var img1 = a1.appendChild(document.createElement('img'));\n img1.setAttribute(\"src\", eedbWebRoot+\"/images/close_icon16px_gray.png\");\n img1.setAttribute(\"width\", \"12\");\n img1.setAttribute(\"height\", \"12\");\n img1.setAttribute(\"alt\",\"close\");\n\n //title\n tdiv = document.createElement('div');\n tdiv.style = \"font-weight:bold; font-size:14px; padding: 5px 0px 5px 0px;\"\n tdiv.setAttribute('align', \"center\");\n tdiv.innerHTML = \"Export view as SVG image\";\n divFrame.appendChild(tdiv);\n\n //----------\n tdiv = divFrame.appendChild(document.createElement('div'));\n tdiv2 = tdiv.appendChild(document.createElement('div'));\n tdiv2.setAttribute('style', \"float:left; width:200px;\");\n tcheck = tdiv2.appendChild(document.createElement('input'));\n tcheck.setAttribute('style', \"margin: 0px 1px 0px 14px;\");\n tcheck.setAttribute('type', \"checkbox\");\n if(exportConfig && exportConfig.hide_widgets) { tcheck.setAttribute('checked', \"checked\"); }\n tcheck.onclick = function() { exportSVGConfigParam(glyphsGB, 'widgets', this.checked); }\n tspan2 = tdiv2.appendChild(document.createElement('span'));\n tspan2.innerHTML = \"hide widgets\";\n\n tdiv2 = tdiv.appendChild(document.createElement('div'));\n tcheck = tdiv2.appendChild(document.createElement('input'));\n tcheck.setAttribute('style', \"margin: 0px 1px 0px 14px;\");\n tcheck.setAttribute('type', \"checkbox\");\n if(exportConfig && exportConfig.savefile) { tcheck.setAttribute('checked', \"checked\"); }\n tcheck.onclick = function() { exportSVGConfigParam(glyphsGB, 'savefile', this.checked); }\n tspan2 = tdiv2.appendChild(document.createElement('span'));\n tspan2.innerHTML = \"save to file\";\n\n tdiv = document.createElement('div');\n tcheck = document.createElement('input');\n tcheck.setAttribute('style', \"margin: 0px 1px 0px 14px;\");\n tcheck.setAttribute('type', \"checkbox\");\n if(exportConfig && exportConfig.hide_sidebar) { tcheck.setAttribute('checked', \"checked\"); }\n tcheck.onclick = function() { exportSVGConfigParam(glyphsGB, 'sidebar', this.checked); }\n tdiv.appendChild(tcheck);\n tspan1 = document.createElement('span');\n tspan1.innerHTML = \"hide track sidebars\";\n tdiv.appendChild(tspan1);\n divFrame.appendChild(tdiv);\n\n tdiv = document.createElement('div');\n tcheck = document.createElement('input');\n tcheck.setAttribute('style', \"margin: 0px 1px 0px 14px;\");\n tcheck.setAttribute('type', \"checkbox\");\n if(exportConfig && exportConfig.hide_titlebar) { tcheck.setAttribute('checked', \"checked\"); }\n tcheck.onclick = function() { exportSVGConfigParam(glyphsGB, 'titlebar', this.checked); }\n tdiv.appendChild(tcheck);\n tspan1 = document.createElement('span');\n tspan1.innerHTML = \"hide title bar\";\n tdiv.appendChild(tspan1);\n divFrame.appendChild(tdiv);\n\n tdiv = document.createElement('div');\n tcheck = document.createElement('input');\n tcheck.setAttribute('style', \"margin: 0px 1px 0px 14px;\");\n tcheck.setAttribute('type', \"checkbox\");\n if(exportConfig && exportConfig.hide_experiment_graph) { tcheck.setAttribute('checked', \"checked\"); }\n tcheck.onclick = function() { exportSVGConfigParam(glyphsGB, 'experiments', this.checked); }\n tdiv.appendChild(tcheck);\n tspan1 = document.createElement('span');\n tspan1.innerHTML = \"hide experiment/expression graph\";\n tdiv.appendChild(tspan1);\n divFrame.appendChild(tdiv);\n\n tdiv = document.createElement('div');\n tcheck = document.createElement('input');\n tcheck.setAttribute('style', \"margin: 0px 1px 0px 14px;\");\n tcheck.setAttribute('type', \"checkbox\");\n if(exportConfig && exportConfig.hide_compacted_tracks) { tcheck.setAttribute('checked', \"checked\"); }\n tcheck.onclick = function() { exportSVGConfigParam(glyphsGB, 'compacted_tracks', this.checked); }\n tdiv.appendChild(tcheck);\n tspan1 = document.createElement('span');\n tspan1.innerHTML = \"hide compacted tracks\";\n tdiv.appendChild(tspan1);\n divFrame.appendChild(tdiv);\n\n //----------\n divFrame.appendChild(document.createElement('hr'));\n //----------\n var button1 = document.createElement('input');\n button1.type = \"button\";\n button1.className = \"medbutton\";\n button1.value = \"cancel\";\n button1.style.float = \"left\"; \n button1.onclick = function() { exportSVGConfigParam(glyphsGB, 'svg-cancel'); }\n divFrame.appendChild(button1);\n\n var button2 = document.createElement('input');\n button2.type = \"button\";\n button2.className = \"medbutton\";\n button2.value = \"export svg\";\n button2.style.float = \"right\"; \n button2.onclick = function() { exportSVGConfigParam(glyphsGB, 'svg-accept'); }\n divFrame.appendChild(button2);\n}", "function hamburgerMenu(){\n\n $('.fa-bars').on('click',(e)=>{\n $('.fa-bars').addClass('vertical-fa-bars');\n $('#hamburger_menu').removeClass('gizle');\n $('#bg_lock').addClass('bg_lock');\n })\n \n $('#bg_lock,.fa-minus').on('click',(e)=>{\n \n $('.fa-bars').removeClass('vertical-fa-bars');\n $('#hamburger_menu').addClass('gizle');\n $('#bg_lock').removeClass('bg_lock');\n })\n \n }", "function SVGParent() {}", "function toggleOn() {\n if(toggle==0)\n {\n toggle=1;\n $(\".content\").css(\"display\",\"none\");\n $(\".containeffect\").css(\"display\",\"inline-block\");\n if(equal==1)\n {\n $(\".contain\").css(\"display\",\"none\");\n $(\".fa-bar-chart\").toggleClass('bar-icon')\n $(\"svg\").css(\"display\",\"none\");\n equal=0;\n }\n }\n else {\n toggle=0;\n $(\".containeffect\").css(\"display\",\"none\");\n $(\".content\").css(\"display\",\"inline-block\");\n }\n}", "function FrameBorderCleaner() {\n push();\n translate(innerWidth/2, innerHeight/2);\n noFill();\n stroke(30);\n strokeWeight(200);\n rect(-405, -405, 810, 810);\n pop();\n}", "function fi(){this.X=L(\"g\",{},null);this.gg=L(\"path\",{\"class\":\"blocklyPathDark\",transform:\"translate(1, 1)\"},this.X);this.Bc=L(\"path\",{\"class\":\"blocklyPath\"},this.X);this.hg=L(\"path\",{\"class\":\"blocklyPathLight\"},this.X);this.Bc.ub=this;Rh(this.Bc);ji(this)}", "function InventoryItemFeetSpreaderVibratingDildoBarClick() {\n\tif (MouseIn(1885, 25, 90, 90)) DialogFocusItem = null;\n\telse if (MouseIn(1200, 650, 200, 55) && (DialogFocusItem.Property.Intensity !== -1)) InventoryItemFeetSpreaderVibratingDildoBarSetIntensity(-1 - DialogFocusItem.Property.Intensity);\n\telse if (MouseIn(1550, 650, 200, 55) && (DialogFocusItem.Property.Intensity !== 0)) InventoryItemFeetSpreaderVibratingDildoBarSetIntensity(0 - DialogFocusItem.Property.Intensity);\n\telse if (MouseIn(1200, 710, 200, 55) && (DialogFocusItem.Property.Intensity !== 1)) InventoryItemFeetSpreaderVibratingDildoBarSetIntensity(1 - DialogFocusItem.Property.Intensity);\n\telse if (MouseIn(1550, 710, 200, 55) && (DialogFocusItem.Property.Intensity !== 2)) InventoryItemFeetSpreaderVibratingDildoBarSetIntensity(2 - DialogFocusItem.Property.Intensity);\n\telse if (MouseIn(1375, 770, 200, 55) && (DialogFocusItem.Property.Intensity !== 3)) InventoryItemFeetSpreaderVibratingDildoBarSetIntensity(3 - DialogFocusItem.Property.Intensity);\n}", "function fix_IE_SVGs() {\n var SVGs = $j('.pays__svg, .ships__svg, .socials__svg');\n if (SVGs.length) {\n SVGs.each(function (i, el) {\n\n var svg_class = $j(el).attr('class').replace(/light|dark|onecolor|pays__svg|\\s/g, '');\n var svgHTML = $j(el).parent().html();\n var regex = /viewBox\\=[\\\"\\'](.*?)[\\\"\\']/g;\n var viewbox = regex.exec(svgHTML);\n\n if (typeof viewbox != \"undefined\" && viewbox) {\n viewbox = viewbox[1].split(' ');\n\n var h = $j(el).height();\n var boxWidth = viewbox[2];\n var boxHeight = viewbox[3];\n var newWidth = (boxWidth * h) / boxHeight;\n\n newWidth = newWidth.toFixed(3);\n\n if ($j(el).parent().find('style').length) {\n $j(el).parent().find('style').remove();\n }\n $j(el).after('<style>svg.pays__svg.' + svg_class + '{ width: ' + newWidth + 'px }</style>');\n }\n\n });\n }\n}", "function rouge(){\n\tToggleRectangle.classList.toggle('important');\n}", "_getSVGHandler(e){let root=this,temp=document.createElement(\"div\"),getID=function(element,alt){if(null===element.getAttribute(\"id\"))element.setAttribute(\"id\",alt);return element.getAttribute(\"id\")},setAriaLabelledBy=function(source,target,prefix){// adds title and desc elements to target and sets the aria-labelledby attribute\nlet svgElem=function(nodename){source=null!==source?source:root;//adds title or desc element to target\nlet attr=\"title\"===nodename?\"label\":nodename,query=source.querySelector(\"#\"+attr);var label=target.querySelector(nodename);//if the target doesn't have the element, add it\nif(null===label){label=document.createElement(nodename);target.prepend(label)}//populates the element with data from the source element\nif(null!==source.getAttribute(attr)){label.innerHTML=source.getAttribute(attr)}else if(null!==query&&\"\"!==query.innerHTML){label.innerHTML=query.innerHTML}//returns the new element's id\nreturn getID(label,prefix+\"-\"+attr)};//set aria-labelledby to the id's for title and descriptions\ntarget.setAttribute(\"aria-labelledby\",svgElem(\"desc\")+\" \"+svgElem(\"label\"))};//set up main svg and append to document\ntemp.innerHTML=e.detail.response;let svg=temp.querySelector(\"svg\"),svgid=getID(svg,\"svg-\"+Date.now()),hdata=dom(root).querySelectorAll(\"lrndesign-imagemap-hotspot\");setAriaLabelledBy(root,svg,svgid);this.shadowRoot.querySelector(\"#svg\").appendChild(svg);for(let i=0;i<hdata.length;i++){let hid=hdata[i].getAttribute(\"hotspot-id\"),hotspot=svg.querySelector(\"#\"+hid),clone=svg.cloneNode(!0);//clone svg for print versions and show hotspot as selected\nsetAriaLabelledBy(hdata[i],clone,hid);hdata[i].appendChild(clone);hdata[i].querySelector(\"#\"+hid).classList.add(\"selected\");hdata[i].setParentHeading(root.shadowRoot.querySelector(\"#heading\"));for(let j=0;j<hdata.length;j++){hdata[i].querySelector(\"#\"+hdata[j].getAttribute(\"hotspot-id\")).classList.add(\"hotspot\")}//configure hotspot on main (interactive) svg\nlet hbutton=document.createElement(\"button\");hbutton.setAttribute(\"tabindex\",0);hbutton.setAttribute(\"aria-label\",hdata[i].label);root.shadowRoot.querySelector(\"#buttons\").appendChild(hbutton);hbutton.addEventListener(\"focus\",function(){hotspot.classList.add(\"focus\")});hbutton.addEventListener(\"blur\",function(){hotspot.classList.remove(\"focus\")});hotspot.classList.add(\"hotspot\");hotspot.addEventListener(\"click\",e=>{this.openHotspot(hotspot,hdata[i])});hbutton.addEventListener(\"keyup\",e=>{if(13===e.keyCode||32===e.keyCode){if(!hotspot.classList.contains(\"selected\")){this.openHotspot(hotspot,hdata[i])}}})}}", "handleClickMenu(e) {\n e.preventDefault();\n console.log('The svg was clicked');\n const drawer = document.querySelector('.nav');\n this.setState(prevState => ({\n isToggleOn: !prevState.isToggleOn\n }));\n if ( drawer.classList.toggle('open') ) {\n e.stopPropagation();\n } else {\n drawer.classList.remove('open');\n }\n }", "_createAppearanceTabIcons() {\n\n // We have to add these events to the Gtk.DrawingAreas to make them actually\n // clickable. Else it would not be possible to select the tabs.\n const tabEvents = Gdk.EventMask.BUTTON_PRESS_MASK | Gdk.EventMask.BUTTON_RELEASE_MASK;\n\n // Draw six lines representing the wedge separators.\n let tabIcon = this._builder.get_object('wedges-tab-icon');\n tabIcon.add_events(tabEvents);\n tabIcon.connect('draw', (widget, ctx) => {\n const size = Math.min(widget.get_allocated_width(), widget.get_allocated_height());\n const color = widget.get_style_context().get_color(Gtk.StateFlags.NORMAL);\n\n ctx.translate(size / 2, size / 2);\n ctx.rotate(2 * Math.PI / 12);\n\n for (let i = 0; i < 6; i++) {\n ctx.moveTo(size / 5, 0);\n ctx.lineTo(size / 2, 0);\n ctx.rotate(2 * Math.PI / 6);\n }\n\n ctx.setSourceRGBA(color.red, color.green, color.blue, color.alpha);\n ctx.setLineWidth(2);\n ctx.stroke();\n\n return false;\n });\n\n // Draw on circle representing the center item.\n tabIcon = this._builder.get_object('center-tab-icon');\n tabIcon.add_events(tabEvents);\n tabIcon.connect('draw', (widget, ctx) => {\n const size = Math.min(widget.get_allocated_width(), widget.get_allocated_height());\n const color = widget.get_style_context().get_color(Gtk.StateFlags.NORMAL);\n\n ctx.translate(size / 2, size / 2);\n ctx.setSourceRGBA(color.red, color.green, color.blue, color.alpha);\n ctx.arc(0, 0, size / 4, 0, 2 * Math.PI);\n ctx.fill();\n\n return false;\n });\n\n // Draw six circles representing child items.\n tabIcon = this._builder.get_object('children-tab-icon');\n tabIcon.add_events(tabEvents);\n tabIcon.connect('draw', (widget, ctx) => {\n const size = Math.min(widget.get_allocated_width(), widget.get_allocated_height());\n const color = widget.get_style_context().get_color(Gtk.StateFlags.NORMAL);\n\n ctx.translate(size / 2, size / 2);\n ctx.setSourceRGBA(color.red, color.green, color.blue, color.alpha);\n\n for (let i = 0; i < 6; i++) {\n ctx.rotate(2 * Math.PI / 6);\n ctx.arc(size / 3, 0, size / 10, 0, 2 * Math.PI);\n ctx.fill();\n }\n\n return false;\n });\n\n // Draw six groups of five grandchildren each. The grandchild at the back-navigation\n // position is skipped.\n tabIcon = this._builder.get_object('grandchildren-tab-icon');\n tabIcon.add_events(tabEvents);\n tabIcon.connect('draw', (widget, ctx) => {\n const size = Math.min(widget.get_allocated_width(), widget.get_allocated_height());\n const color = widget.get_style_context().get_color(Gtk.StateFlags.NORMAL);\n\n ctx.translate(size / 2, size / 2);\n ctx.setSourceRGBA(color.red, color.green, color.blue, color.alpha);\n\n for (let i = 0; i < 6; i++) {\n ctx.rotate(2 * Math.PI / 6);\n\n ctx.save()\n ctx.translate(size / 3, 0);\n ctx.rotate(Math.PI);\n\n for (let j = 0; j < 5; j++) {\n ctx.rotate(2 * Math.PI / 6);\n ctx.arc(size / 10, 0, size / 20, 0, 2 * Math.PI);\n ctx.fill();\n }\n\n ctx.restore();\n }\n\n return false;\n });\n\n // Draw a line and some circles representing a trace.\n tabIcon = this._builder.get_object('trace-tab-icon');\n tabIcon.add_events(tabEvents);\n tabIcon.connect('draw', (widget, ctx) => {\n const size = Math.min(widget.get_allocated_width(), widget.get_allocated_height());\n const color = widget.get_style_context().get_color(Gtk.StateFlags.NORMAL);\n\n ctx.setSourceRGBA(color.red, color.green, color.blue, color.alpha);\n\n ctx.moveTo(0.2 * size, 0.2 * size);\n ctx.lineTo(0.4 * size, 0.6 * size);\n ctx.lineTo(0.9 * size, 0.7 * size);\n\n ctx.setLineWidth(2);\n ctx.stroke();\n\n ctx.arc(0.2 * size, 0.2 * size, 0.15 * size, 0, 2 * Math.PI);\n ctx.fill();\n\n ctx.arc(0.4 * size, 0.6 * size, 0.1 * size, 0, 2 * Math.PI);\n ctx.fill();\n\n ctx.arc(0.9 * size, 0.7 * size, 0.1 * size, 0, 2 * Math.PI);\n ctx.fill();\n\n return false;\n });\n\n // Draw three dots indicating the advanced settings.\n tabIcon = this._builder.get_object('advanced-tab-icon');\n tabIcon.add_events(tabEvents);\n tabIcon.connect('draw', (widget, ctx) => {\n const size = Math.min(widget.get_allocated_width(), widget.get_allocated_height());\n const color = widget.get_style_context().get_color(Gtk.StateFlags.NORMAL);\n\n ctx.setSourceRGBA(color.red, color.green, color.blue, color.alpha);\n\n ctx.arc(0.15 * size, 0.5 * size, 0.1 * size, 0, 2 * Math.PI);\n ctx.fill();\n\n ctx.arc(0.5 * size, 0.5 * size, 0.1 * size, 0, 2 * Math.PI);\n ctx.fill();\n\n ctx.arc(0.85 * size, 0.5 * size, 0.1 * size, 0, 2 * Math.PI);\n ctx.fill();\n\n return false;\n });\n }", "function getSVGinfo() {\n console.log(this);\n S = document.getElementById(\"DYOSVG\").contentDocument;\n var STYLESVG = []\n , NUMCOLS = [];\n var i;\n\n for (var j = 0; j < S.styleSheets.length; j++) {\n var rules = S.styleSheets[j].rules || S.styleSheets[j].cssRules;\n // This CSS code may need to be modified to handle using commas in CSS for shared code\n for (i in rules) {\n if (typeof rules[i].selectorText == 'string') {\n STYLESVG.push(rules[i].selectorText)\n }\n }\n for (i in STYLESVG) {\n var start_pos = STYLESVG[i].indexOf('.') + 1;\n var end_pos = STYLESVG[i].indexOf('.', start_pos);\n if (end_pos != -1) {\n var NC = STYLESVG[i].substring(start_pos, end_pos);\n // begin IE stupidity workaround\n var NC2 = STYLESVG[i].substring(end_pos + 1);\n if (NC == \"fill\" || NC == \"stroke\" || NC == \"stopColor\") {\n NUMCOLS.push(NC2)\n } else if (NC2 == \"fill\" || NC2 == \"stroke\" || NC2 == \"stopColor\") {\n NUMCOLS.push(NC)\n }\n }\n }\n NUMCOLS = NUMCOLS.filter(function(itm, i, a) {\n return i == a.indexOf(itm)\n });\n }\n var PREVIOUS = document.getElementsByClassName(\"colourfill\");\n for (i = PREVIOUS.length; i > 0; i--) {\n var M = (PREVIOUS[i - 1].id.indexOf(\"[\") != -1) ? PREVIOUS[i - 1].id.slice(0, PREVIOUS[i - 1].id.indexOf(\"[\")) : PREVIOUS[i - 1].id;\n var A = (PREVIOUS[i - 1].id.indexOf(\"[\") != -1) ? PREVIOUS[0].id.slice(PREVIOUS[0].id.indexOf(\"[\") + 1, PREVIOUS[0].id.length - 1) : null;\n if (A != ACTIVE) {\n continue\n }\n PREVIOUS[i - 1].material = (typeof materialController == 'function') ? materialController(M) : PREVIOUS[i - 1].material;\n var col = readCookie(PREVIOUS[i - 1].id);\n if (col && PREVIOUS[i - 1].material.indexOf(col) == -1) {\n removeCookie(PREVIOUS[i - 1].id)\n }\n if (PREVIOUS[i - 1].material.indexOf(PREVIOUS[i - 1].value) == -1) {\n if (defcols[PREVIOUS[i - 1]] && PREVIOUS[i - 1].material.indexOf(defcols[PREVIOUS[i - 1]]) != -1) {\n PREVIOUS[i - 1].value = defcols[PREVIOUS[i - 1]];\n }\n {\n var rand = Math.floor(Math.random() * PREVIOUS[i - 1].material.length);\n PREVIOUS[i - 1].value = PREVIOUS[i - 1].material[rand];\n }\n colour.call(PREVIOUS[i - 1]);\n }\n if (NUMCOLS.indexOf(PREVIOUS[i - 1].id) == -1 && PREVIOUS[i - 1].id != \"S-BallColour\") {\n PREVIOUS[i - 1].parentNode.parentNode.removeChild(PREVIOUS[i - 1].parentNode)\n }\n }\n for (i in NUMCOLS) {\n if (!document.getElementById(NUMCOLS[i]) + \"[\" + ACTIVE + \"]\") {\n addColour(NUMCOLS[i] + \"[\" + ACTIVE + \"]\")\n }\n ;colour.call(document.getElementById(NUMCOLS[i] + \"[\" + ACTIVE + \"]\"))\n }\n // Re-Initialise set values\n if (typeof svgController == 'function') {\n svgController();\n }\n if (!S.getElementById(\"Content\")) {\n var CNT = document.createElementNS(SVG_NS, \"g\");\n CNT.id = \"Content\";\n S.documentElement.appendChild(CNT)\n }\n S.getElementById(\"Content\").style.visibility = \"hidden\";\n S.getElementById(\"Content\").style.visibility = \"hidden\";\n if (document.getElementById(\"SBALL[\" + ACTIVE + \"]\")) {\n drawSBall();\n // SBall();\n // colour.call(document.getElementById(\"S-BallColour[\" + ACTIVE + \"]\"));\n }\n DL = document.getElementById(\"logos[\" + ACTIVE + \"]\").getElementsByClassName(\"logoupload\");\n DT = document.getElementById(\"logos[\" + ACTIVE + \"]\").getElementsByClassName(\"addtext\");\n DS = document.getElementById(\"logos[\" + ACTIVE + \"]\").getElementsByClassName(\"uploadselect\");\n for (var i = 0; i < DS.length; i++) {\n embellish.call(DS[i])\n }\n for (var i = 0; i < DL.length; i++) {\n if (DL[i].value) {\n if (CYCLE == true) {\n DLCount++\n }\n HFS.call(DL[i])\n }\n }\n for (var i = 0; i < DT.length; i++) {\n if (DT[i].value) {\n addText.call(DT[i])\n }\n }\n // Continue with Garment Specific Logic\t\n //\tdocument.getElementById(\"Colour1\").classList.add(\"chosen\");\n //\tif(document.getElementById(\"Colour1\")){createColourPicker.call(document.getElementById(\"Colour1\"))}else{console.log(\"dfjvdfj\")}\n // colourBranding()\n //Clone the node \n if (CYCLE == true && DLCount == 0) {\n generateImages()\n }\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 setDefaultNaviBar(nodePart) {\n var part = nodePart\n tempKey = part.data.key\n document.getElementById(\"bold\").value = part.data.bold\n document.getElementById(\"italic\").value = part.data.Italic\n document.getElementById(\"underline\").value = part.data.isUnderline\n document.getElementById(\"strikethrough\").value = part.data.isStrikethrough\n document.getElementById(\"fontsize\").value = part.data.fontsize\n $('#fontstyle2').text(part.data.fontstyle)\n\n $(\"#bold\").removeClass(\"disabled\");\n $(\"#italic\").removeClass(\"disabled\");\n $(\"#underline\").removeClass(\"disabled\");\n $(\"#strikethrough\").removeClass(\"disabled\");\n $(\".btn-md\").removeClass(\"disabled\");\n $('#fontselect').removeClass(\"disabledbutton\");\n $('#fontselect-drop').removeClass(\"display\");\n document.getElementById(\"fontsize\").disabled = false\n\n changeNaviBarBtnColor(part, \"bold\")\n changeNaviBarBtnColor(part, \"italic\")\n changeNaviBarBtnColor(part, \"underline\")\n changeNaviBarBtnColor(part, \"strikethrough\")\n\n fontSizeTypeOnNaviBar(part, \"fontsize\", \"12\")\n fontSizeTypeOnNaviBar(part, \"fontstyle\", \"新細明體\")\n\n}", "function toggleMenu() {\n if (menu.classList.contains('active')) {\n menu.classList.remove('active')\n toggle.querySelector('a').querySelector('img').src = \"/feather_icon/menu.svg\";\n } else {\n menu.classList.add('active')\n toggle.querySelector('a').querySelector('img').src = \"/feather_icon/x.svg\";\n }\n}", "function sidenavOpen () {\n sidenavBar.style.transform = 'translateX(0%)'\n sidenavStatus = true\n}", "function Themes_PreProcessNavBar(theObject)\n{\n\ttheObject.Properties[__NEMESIS_PROPERTY_BK_COLOR_DEFAULT] = \"transparent\";\n\ttheObject.Properties[__NEMESIS_PROPERTY_CLIENTEDGE] = \"No\";\n\tif (Get_String(theObject.Properties[__NEMESIS_PROPERTY_FONT], null) == null)\n\t{\n\t\tfor (var parent = theObject.Parent; parent; parent = parent.Parent)\n\t\t{\n\t\t\tif (Get_String(parent.Properties[__NEMESIS_PROPERTY_FONT], null) != null)\n\t\t\t{\n\t\t\t\ttheObject.Properties[__NEMESIS_PROPERTY_FONT] = parent.Properties[__NEMESIS_PROPERTY_FONT];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n}", "toggleAnimation(){if(this.__stopped){this.__stopped=!1;this.shadowRoot.querySelector(\"#svg\").style.visibility=\"hidden\";if(null!=this.src){this.shadowRoot.querySelector(\"#gif\").src=this.src}this.shadowRoot.querySelector(\"#gif\").alt=this.alt+\" (Stop animation.)\"}else{this.__stopped=!0;this.shadowRoot.querySelector(\"#svg\").style.visibility=\"visible\";if(null!=this.srcWithoutAnimation){this.shadowRoot.querySelector(\"#gif\").src=this.srcWithoutAnimation}this.shadowRoot.querySelector(\"#gif\").alt=this.alt+\" (Play animation.)\"}}", "function slideMenuHaburguesa() {\n if (menuValor == true) {\n if (modeStatus == \"true\") {\n menuBurguer.src = \"assets/button-close-dark.svg\";\n } else {\n menuBurguer.src = \"assets/close.svg\";\n }\n menuValor = false;\n document.getElementById(\"body\").classList.add(\"no-scroll\");\n document.getElementById(\"menu\").style.display = \"flex\";\n } else {\n menuValor = true;\n if (modeStatus == \"true\") {\n menuBurguer.src = \"assets/burger-dark.svg\";\n } else {\n menuBurguer.src = \"assets/burger.svg\";\n }\n document.getElementById(\"menu\").style.display = \"none\";\n document.getElementById(\"body\").classList.remove(\"no-scroll\");\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 left_button(){\n stroke(0);\n fill(255,0,0); \n rect(200, 370,300,150);\n}", "function updateInkBarClassName(){var elements=getElements();var newIndex=ctrl.selectedIndex,oldIndex=ctrl.lastSelectedIndex,ink=angular.element(elements.inkBar);if(!angular.isNumber(oldIndex))return;ink.toggleClass('md-left',newIndex<oldIndex).toggleClass('md-right',newIndex>oldIndex);}", "function HamburgerMenu(){\n let x = document.getElementById(\"c-mobile-nav\");\n let y = document.getElementById(\"c-page\");\n\n if (x.style.display === \"block\") {\n x.style.display = \"none\";\n y.style.borderRadius = \"30px\";\n } else {\n x.style.display = \"block\";\n y.style.borderRadius = \"0 0 30px 30px\";\n }\n}", "function esconderBarra(){\r\n\r\n $('[data-toggle=\"offcanvas\"]').click(function(){\r\n $(\"#navigation\").toggleClass(\"hidden-xs\");\r\n });\r\n\r\n\r\n\r\n }", "function logoBlink() {\n let logoBlink = new TimelineMax({});\n logoBlink.staggerTo(\".icon\", 0.3, { scale: 0, transformOrigin: \"50% 50%\" }, 0.1, \"+=0.5\")\n .staggerTo(\".icon\", 0.3, { scale: 1, ease: Back.easeOut.config(3.5), transformOrigin: \"50% 50%\" }, 0.1, \"-=0.5\");\n return logoBlink;\n}", "static sideBarFunc(){\n navIcon.addEventListener('click', () => {\n sideBar.style.display = 'block';\n })\n }", "function toggleButton() {\n var navbar_class = d3.select(\".navbar-collapse\").attr(\"class\");\n if (navbar_class.indexOf(\"show\") < 0) {\n d3.select(\".bg-text\").style(\"top\", \"33%\");\n } else {\n d3.select(\".bg-text\").style(\"top\", \"13%\");\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 ɵɵnamespaceSVG() {\n instructionState.lFrame.currentNamespace = SVG_NAMESPACE;\n }", "function TiAdjustBrightness (props) {\n return Object(_lib__WEBPACK_IMPORTED_MODULE_0__[\"GenIcon\"])({\"tag\":\"svg\",\"attr\":{\"version\":\"1.2\",\"baseProfile\":\"tiny\",\"viewBox\":\"0 0 24 24\"},\"child\":[{\"tag\":\"path\",\"attr\":{\"d\":\"M12 6.934l1-2.934c.072-.213.078-.452 0-.682-.188-.553-.789-.848-1.341-.659-.553.189-.847.788-.659 1.341l1 2.934zM4 11c-.213-.072-.452-.078-.682 0-.553.188-.848.789-.659 1.341.189.553.788.847 1.341.659l2.934-1-2.934-1zM12 17.066l-1 2.934c-.072.213-.078.452 0 .682.188.553.789.848 1.341.659.553-.189.847-.788.659-1.341l-1-2.934zM21.341 11.657c-.188-.553-.788-.848-1.341-.659l-2.934 1 2.934 1c.213.072.452.078.682 0 .552-.188.847-.789.659-1.341zM5.636 7.05l2.781 1.367-1.367-2.781c-.1-.202-.265-.375-.482-.482-.524-.258-1.157-.042-1.415.482-.257.523-.041 1.157.483 1.414zM5.153 17.432c-.257.523-.041 1.156.482 1.414.523.257 1.157.041 1.414-.482l1.367-2.781-2.781 1.367c-.201.099-.374.263-.482.482zM18.363 16.949l-2.781-1.367 1.367 2.781c.1.202.264.375.482.482.523.257 1.156.041 1.414-.482s.042-1.157-.482-1.414zM18.844 6.566c.258-.524.042-1.157-.481-1.415-.523-.257-1.157-.041-1.414.482l-1.369 2.783 2.782-1.368c.202-.1.375-.264.482-.482zM12 7.5c-2.481 0-4.5 2.019-4.5 4.5s2.019 4.5 4.5 4.5 4.5-2.019 4.5-4.5-2.019-4.5-4.5-4.5z\"}}]})(props);\n}", "function unfocusBars() {\r\n // Return all bars and logos to full opacity\r\n G_BARS.selectAll(\".data-bar\")\r\n .classed(\"focused\", false)\r\n .transition()\r\n .duration(HOVER_TRANS_TIME)\r\n .style(\"opacity\", 1);\r\n\r\n G_BARS.selectAll(\".data-image\")\r\n .classed(\"focused\", false)\r\n .transition()\r\n .duration(HOVER_TRANS_TIME)\r\n .style(\"opacity\", 1);\r\n\r\n // Hide tooltip\r\n TIP.hide();\r\n }", "function resizeEvent() {\n var width = window.innerWidth, height = window.innerHeight;\n var functionsBarHeight = height/10;\n height = height * 9 / 10;\n\n w=width; h = height;\n\n node.attr(\"r\", nodeR(width, height));\n functionBar.attr(\"width\", width).attr(\"height\", functionsBarHeight).style(\"top\",height + \"px\");\n svg.attr(\"width\", width).attr(\"height\", height);\n\n label.attr(\"dx\", nodeR(width,height)*1.3)\n .attr(\"font-size\", 5*Math.sqrt(nodeR(width,height)));\n\n force.stop();\n force.size([width, height])\n .linkDistance(linkD(width, height))\n .start();\n\n btngrp.style(\"top\", (parseInt(functionBar.style(\"height\")) - parseInt(btngrp.style(\"height\")))/2+\"px\");\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 }", "function styleNavigation() {\n let bounds = [];\n $('.invert-navbar').each(function() {\n bounds.push([$(this).offset().top, $(this).offset().top + $(this).height()]);\n });\n\n for(let b of bounds) {\n if (document.body.scrollTop >= b[0] - 50 && document.body.scrollTop <= b[1] + 25) {\n $('.navbar-invertable').addClass('navbar-inverse');\n $('.navbar-invertable').removeClass('navbar-light');\n return;\n }\n }\n $('.navbar-invertable').removeClass('navbar-inverse');\n $('.navbar-invertable').addClass('navbar-light');\n}", "function toggleNav() {\n function openNav() {\n document.getElementById(\"extendednav\").style.left = \"50px\"\n document.getElementById(\"root\").style.transitionDuration = \".5s\"\n document.getElementById(\"root\").style.marginLeft = \"200px\"\n document.getElementById(\"toggleArrow\").style.transform = \"scaleX(-1)\"\n }\n\n function closeNav() {\n document.getElementById(\"extendednav\").style.left = \"-100px\"\n document.getElementById(\"root\").style.transitionDuration = \".5s\"\n document.getElementById(\"root\").style.marginLeft = \"50px\"\n document.getElementById(\"toggleArrow\").style.transform = \"scaleX(1)\"\n }\n\n let checkbox = document.getElementById(\"toggle\")\n\n if (checkbox.checked === true) {\n openNav()\n } else { closeNav() }\n }", "function toggleFloatingNav() {\n\t\t\tconst dur = 0.4; \n\t\t\tconst easing = 'back(0.5)';\n\t\t\tif ($floatingNav.classList.contains('is-visible')) {\t\n\t\t\t\t$bc.gsap.to($floatingNav, {bottom: '-100%', duration: dur, ease: easing}).eventCallback('onComplete', () => {\n\t\t\t\t\t$floatingNav.classList.remove('is-visible');\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\t$bc.gsap.to($floatingNav, {bottom: '3%', duration: dur, ease: easing}).eventCallback('onComplete', () => {\n\t\t\t\t\t$floatingNav.classList.add('is-visible');\n\t\t\t\t});\n\t\t\t}\n\t\t}", "function closeNav() {\n document.getElementById(\"leftNav\").classList.remove(\"open\");\n document.getElementById(\"leftNav\").classList.add(\"closed\");\n document.getElementsByTagName(\"MAIN\")[0].className = \"widened\";\n document.getElementsByTagName(\"MAIN\")[0].setAttribute(\"onclick\", \"\");\n document.getElementsByTagName(\"FOOTER\")[0].dataset.view = \"widened\";\n document.getElementById(\"navToggle\").setAttribute(\"onclick\", \"openNav()\");\n document.getElementsByTagName(\"NAV\")[0].classList.remove(\"open\");\n document.getElementsByTagName(\"NAV\")[0].classList.add(\"closed\");\n document.getElementById(\"navToggle\").classList.remove(\"fa-close\");\n document.getElementById(\"navToggle\").classList.add(\"fa-bars\");\n}", "function navbarShow() {\n $$('.main--navbar').removeClass('navbar-hidden');\n $$('.main--content').removeClass('align-top');\n}", "_setSvgSettings() {\n\t\tthis.controlOptions.svg = {};\n\t\tthis.controlOptions.svg.link = linkSvg;\n\t\tthis.controlOptions.svg.refresh = refreshSvg;\n\t}", "function toggleClickPath() {\n clickPath.svg.style.setProperty('display', this.checked ? 'block' : 'none');\n}", "function toggleGrid() {\n if (!hideGrid) {\n hideGrid = true;\n $('#svgGrid').find('rect').attr('fill', 'white');\n } else {\n hideGrid = false;\n $('#svgGrid').find('rect').attr('fill', 'url(#grid)');\n }\n}", "function menu_animation() {\n\n var transform = '50% 50%';\n\n if (!Modernizr.excludedplatforms) {\n transform = '25px 25px';\n }\n\n tl.add([\n TweenMax.to('.menu-bkg', .5, {height: win_height}), //Need to come up with a dynamic way to control this\n TweenMax.to(\"#menu-open, .mobile-menu\", .25, {autoAlpha: 1}),\n TweenMax.to(\".menu-text\", .25, {autoAlpha: 0}),\n TweenMax.to(\"#futureman_face\", .25, {autoAlpha:.5}),\n TweenMax.to(\".menu-line .left\", .5, {rotation: 45, transformOrigin: transform}),\n TweenMax.to(\".menu-line .right\", .5, {rotation: -45, transformOrigin: transform}),\n ]);\n\n for (var x = 0; x < svg_menu_paths.length; x++) {\n var menu_path = svg_menu_paths[x];\n var menu_path_length = menu_path.getTotalLength();\n\n menu_path.style.strokeDasharray = menu_path_length + \" \" + menu_path_length;\n menu_path.style.strokeDashoffset = menu_path_length;\n\n tl.insert(TweenMax.to(menu_path.style, .5, {strokeDashoffset: 0}));\n }\n\n tl.to($(\"#menu-open path\"), .5, {fillOpacity: 1}, \"-=0.25\");\n }", "function mouseOut(){\n d3.select(this)\n\t .classed(\"mouseover\", false)\n\t .attr(\"r\", 3);\n bar_svg.style(\"display\", \"none\");\n svg.select(\".barSVG\").remove(); \n d3.select(\"#barTitle\").remove(); \n }", "function transformPage1() {\n document.getElementById(\"nav-bar\").style = \"height: 100%; width: 130px; position: fixed; z-index: 1; top: 0px; left: 0px; background: #ffff66; padding: 10px 0; font-family: Helvetica\"\n\n// This chunk calls any elements with a certain class name and modifies their CSS style\n var x = document.getElementsByClassName(\"nav-item\");\n var i;\n for (i = 0; i < x.length; i++) {\n x[i].style = \"padding: 6px 8px 6px 16px; text-decoration: none; font-size: 22px; color: #0066cc; display: block\"\n }\n}", "function change_nav_size(){\n console.log(\"resizing!\");\n var currY = curr_pos();\n var navibar = document.getElementById(\"global-nav\");\n if (currY < 50){\n navibar.classList.add(\"navi_bar\"); \n navibar.classList.remove(\"navi_bar_s\"); \n }\n else{\n navibar.classList.remove(\"navi_bar\");\n navibar.classList.add(\"navi_bar_s\");\n }\n}", "function mouseReleased(){\n //unstretch foreo\n on();\n }", "function right_button(){\n stroke(0);\n fill(255,0,0);\n rect(700, 370,300,150); \n}", "function showMarkingRectangle() {\n\tmarkingRectangle.classList.remove('dont-display');\n\tlet visibilityButton = document.getElementById('toggleMarkingRectangleVisibility');\n\tvisibilityButton.classList.remove('fa-eye');\n\tvisibilityButton.classList.add('fa-eye-slash');\n}", "function toggleMenu() {\r\n var menu = document.querySelector(\".main_nav\");\r\n var background = document.querySelector(\".hamburger_cntnr\");\r\n\r\n if(menu.style.display == \"block\") {\r\n menu.style.display = \"none\";\r\n background.style.background = \"none\";\r\n background.style.borderBottom = \"none\";\r\n } else {\r\n menu.style.display = \"block\";\r\n background.style.background = \"linear-gradient(90deg, rgba(255,255,255,1) 48%, rgba(146,146,146,1) 100%)\";\r\n background.style.borderBottom = \"2px solid #fff\";\r\n }\r\n}", "function vert(){\n\tToggleRectangle.classList.toggle('good');\n}", "function RemovelftrgtArrows() {\n $('#lft').css(\"display\", \"none\");\n $('#rgt').css(\"display\", \"none\");\n $('div').removeClass(\"wrapper\");\n $('div').removeClass(\"arrows\");\n $('div').removeClass(\"numWrap\");\n $('div').removeClass(\"arrows\");\n\n}", "function homeAnim() { //homepage animation on load \n qsCl(\"home__logo-fill\").left = '-177px';\n qsCl(\"home__logo-dolya\").color = 'black';\n qsCl(\"home__logo-consulting\").color = 'black';\n qsCl(\"home__logo-frame\").opacity = '1';\n qsCl(\"home__tagline-line\").width = '60px';\n qsCl(\"home__mission-statement\").color = '#303030';\n qsCl(\"home__tagline\").color = '#303030';\n qsCl(\"home__golden-thread\").color = 'var(--gold)';\n qsCl(\"path-logo\").animation = 'dash 3s ease-in forwards 1s'\n qsCl(\"path-home\").animation = 'dash 5s ease-in-out forwards 4s';\n drawn.home = true;\n}", "function get_svg()\n {\n var svg = document.getElementById('SVGobject');\n if( svg.contentDocument != null )\n { \n svg = svg.contentDocument.getElementsByTagName('svg');\n\n\t\t // Get viewbox here and check for undefined to fix IE from failing...\n\t\t var viewbox = $(svg).attr(\"viewBox\");\n if( svg != null && viewbox !== undefined )\n {\n clearInterval(get_svg_id);\n svg_elm = svg;\n viewbox = viewbox.split(/ /);\n fullwidth = parseInt(viewbox[2]);\n ratio = parseInt(viewbox[3]) / fullwidth;\n\t fitwidth = $(elm).width();\n chart_resize(fitwidth);\n $(elm).removeClass(\"noshow\"); //Makes chart show on page\n\t\t\t $(\"a.showline\").css(\"display\", \"inline\");;\n return;\n } \n }\n }", "function navBarIconClick(icon) {\n changeIcon(icon);\n openCloseNavBar();\n}", "function logoHandler() {\n if ($window.pageYOffset >= 100) {\n element.removeClass('translucent');\n }\n else {\n element.addClass('translucent');\n }\n scope.$apply();\n }", "function burgerClick() {\n nav.classList.toggle('nav-active');\n cross.classList.toggle('hide');\n burger.classList.toggle('hide');\n content.classList.toggle('blur');\n}", "function visualChart() {\n if(equal==0)\n {\n equal=1;\n $(\"svg\").css(\"display\",\"inline-block\");\n $(\".content\").css(\"display\",\"none\");\n $(\".contain\").css(\"display\",\"inline-block\");\n $(\".contain\").css(\"background\",\"black\");\n if(toggle==1){\n $(\".containeffect\").css(\"display\",\"none\");\n $(\".fa-toggle-on\").toggleClass('toggle-icon')\n toggle=0;\n }\n }\n else{\n equal=0;\n $(\"svg\").css(\"display\",\"none\");\n $(\".content\").css(\"display\",\"inline-block\");\n $(\".contain\").css(\"display\",\"none\");\n }\n}", "function Bandeau() {\n\n \n return(\n <>\n\n <div>\n <div className=\"bandeauHeader\" id=\"navBandeau\">\n <h1 className=\"bandeauH1\"><h2 className=\"HeaderTitle\">Battle Changer ⚔️</h2></h1>\n <svg classNamme=\"bandeauSvg\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 200 100\" preserveAspectRatio=\"none\">\n <circle fill=\"#D7B899\" cx=\"0\" cy=\"100\" r=\"100\" />\n <circle fill=\"#D7B899\" cx=\"200\" cy=\"100\" r=\"100\" />\n </svg>\n </div> \n </div>\n\n </>\n )\n}", "function transformPage2() {\n document.getElementById(\"nav-bar\").style = \"height: 30px; width: 100%; position: fixed; z-index: 1; top: 0px; left: 0px; background: #ffff66; padding: 10px 0; font-family: Helvetica\"\n\n// This chunk calls any elements with a certain class name and modifies their CSS style\n var x = document.getElementsByClassName(\"nav-item\");\n var i;\n for (i = 0; i < x.length; i++) {\n x[i].style = \"padding: 30px 8px 6px 20px; text-decoration: none; font-size: 22px; color: #0066cc; display: inline\"\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 BarsMenu() {\n $('#bars').on('click', function () {\n if ($('.navigation').hasClass('nav-active')==false) {\n $('.navigation').addClass('nav-active');\n }\n $('body').css({\n 'overflow': 'hidden'\n });\n return false;\n });\n\n $('#bars-close').on('click',function(){\n if ($('.navigation').hasClass('nav-active')) {\n $('.navigation').removeClass('nav-active');\n }\n $('body').css({\n 'overflow': 'visible'\n });\n return false;\n });\n $('.nav-l')\n .closest('body')\n .find('.bars')\n .css({\n 'left': '15px',\n 'right': 'auto'\n });\n $('.nav-l')\n .closest('body')\n .find('#header .logo')\n .css('margin-left', '50px'); \n }", "function bottom_bar_exit() { \n document.getElementById(\"bottom_bar\").style.zIndex = \"-3\"\n document.getElementById(\"legend1\").style.zIndex = \"0\"\n document.getElementById(\"third_bar\").style.zIndex = \"0\"\n document.getElementById(\"title_line2\").style.zIndex = \"0\"\n document.getElementById(\"credit\").style.zIndex = \"0\"\n\n if (document.getElementById(\"full_rect\") != null)\n {\n document.getElementById(\"full_rect\").remove()\n }\n\n d3.select(\"#fillgauge1\").remove()\n\n document.getElementById(\"bottom_bar\").style.background = \"rgba(0,0,0,0.5)\"\n}", "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 }" ]
[ "0.58386564", "0.5804558", "0.5715248", "0.56998134", "0.56775635", "0.5671653", "0.5662167", "0.5608296", "0.55258036", "0.5508065", "0.5490007", "0.54887545", "0.5487188", "0.54755265", "0.54603946", "0.54556006", "0.5447314", "0.543011", "0.54154235", "0.5412882", "0.5384187", "0.538387", "0.53808445", "0.5378691", "0.53721714", "0.53708494", "0.5370824", "0.53662986", "0.5358683", "0.53486365", "0.53478616", "0.53408206", "0.5329621", "0.53151387", "0.5308803", "0.53019476", "0.52981436", "0.5297888", "0.5295513", "0.52945656", "0.5266212", "0.52606714", "0.5242203", "0.5237415", "0.52314353", "0.52300614", "0.52295595", "0.5218669", "0.52168655", "0.52089393", "0.5208801", "0.5207634", "0.5183639", "0.51834416", "0.51810586", "0.51761264", "0.5173335", "0.5164659", "0.516364", "0.51545984", "0.5136397", "0.5132517", "0.51318526", "0.51314956", "0.51307905", "0.51201016", "0.5117901", "0.51149726", "0.5113999", "0.51087695", "0.5101372", "0.5100704", "0.5097819", "0.5096024", "0.50942016", "0.509247", "0.5089877", "0.5078185", "0.5077239", "0.50755894", "0.50755656", "0.5069714", "0.50663763", "0.5059102", "0.50551033", "0.50503427", "0.50490546", "0.50425327", "0.50407827", "0.5040729", "0.503834", "0.503761", "0.50348175", "0.50298804", "0.5028972", "0.5022231", "0.5020739", "0.50196326", "0.50179136", "0.5016258", "0.5016051" ]
0.0
-1
Extract checing status of the response
function checkStatus(response) { if (!response.ok) { const error = new Error(response.statusText) error.response = response throw error } return response }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function statusCheck() {\n var statusLog = document.querySelector(\".status\");\n var status = response.status;\n console.log(status);\n\n statusLog.innerHTML += status;\n }", "get status(): number {\n const NO_RESPONSE_CODE = 0;\n const DECIMAL_RADIX = 10;\n return this.exception.status\n ? parseInt(this.exception.status, DECIMAL_RADIX)\n : NO_RESPONSE_CODE;\n }", "get statusCode(){\n if(!this._fastbootInfo || !this._fastbootInfo.response) return undefined;\n return this._fastbootInfo.response.statusCode;\n }", "getStatusText() {\n return this.response.statusText;\n }", "function getStatus(res) {\n let status = 0\n res.every(r => {\n const e = r.error\n if (!e) {\n return false\n }\n if (e.code !== undefined && e.code !== 0) {\n status = e.code\n return false\n }\n return true\n })\n return status\n}", "function getStatus() {\n return status;\n }", "get statusCode() {\n let response = this.response;\n return response ? response.status : null;\n }", "get httpStatus () {\n return this._rawResponse.status\n }", "static Status () {\n return {\n \"Status-Code\": 200,\n \"Content-Type\": \"application/json\"\n }\n }", "getStatusCode() {\n return this.response.status;\n }", "static get status() {\n return {\n success: 200,\n badRequest: 400,\n unauthorized: 401,\n notFound: 404,\n conflict: 409,\n serverError: 500\n }\n }", "function getStatus() {\n // TODO: perhaps remove this if no other status added\n return status;\n }", "status() {\n return __awaiter(this, void 0, void 0, function* () {\n return {\n status: 'OK',\n };\n });\n }", "getStatus() {\n return new Promise((resolve, reject) => {\n // send hex code for getting the status of power,rgb,warm\n send(this.ip, hexToArray(\"81:8a:8b:96\"), (data, err) => {\n if (err)\n reject(err)\n else {\n if(data) {\n const status = [];\n for(let i = 0; i < data.length; i+=2){\n status.push(data[i].concat(data[i+1]))\n }\n const power = status[2] === \"23\" ? \"on\" : \"off\"\n \n const rgb = status.slice(6,9).map((el) => parseInt(el, 16));\n \n const warm = parseInt(status[9], 16)\n const out = {\"power\" : power, \"rgb\" : rgb, \"warm\" : warm}\n resolve(out)\n }\n }\n });\n })\n }", "getStatus() {\n\t\treturn this.status;\n\t}", "_getStatus(val) {\n return val ? 'ok' : 'caution';\n }", "getStatus() {\n return this.status;\n }", "get statusMessage() {\n return this.response.statusMessage;\n }", "function getStatus(res, successCallback) {\n const status = spawn('python',[\"pollingStatusMessage.py\"]);\n status.stdout.setEncoding(\"utf8\");\n status.stdout.on('data', statusData => {\n console.log('Received status from coffee maker');\n request(\"https://maker.ifttt.com/trigger/status/with/key/XXXXXXXXXX\", { form: { value1: statusData } }, function(error, response, body) {\n if (error) {\n console.log('Unable to send request to IFTTT', error);\n res.status(500).end();\n }\n console.log('Successfully triggered push to IFTTT!');\n if (successCallback) successCallback(statusData);\n });\n });\n}", "getStatus () {\r\n const timeElapsed = this._getTime()\r\n\r\n return new Status(this._dna[this._getSegIndex(timeElapsed)].pace, \"good\", this._getDistance(timeElapsed), timeElapsed)\r\n }", "getstatus() {\n return { message: this._message, errors_exists: this._errors_exists };\n }", "function status(res, expected) {\n\n deepEqual(res.status, expected,\n `Expected status to be ${expected}, but was ${res.status}`);\n\n}", "function checkStatus(response) { \n if (response.status >= 200 && response.status < 300) { \n return response.text();\n } else { \n return Promise.reject(new Error(response.status+\": \"+response.statusText)); \n } \n }", "getStatus() {\n return apiGet('server/status')\n .then(validateResponse.bind(this, 'getStatus'))\n .catch(function onGetStatusError(err) {\n let message = \"Status check error, problem with response\";\n console.log(message);\n return Promise.reject(createError(message, err));\n });\n }", "parseStatus(res) {\n let newStateAttr;\n\n if (res[\"msg_ver\"] !== undefined && !this.fanSpeeds) {\n this.detectFanSpeeds(res[\"msg_ver\"]);\n }\n\n if (res[\"state\"] !== undefined && STATUS_MAP[res[\"state\"]]) {\n let statusValue = STATUS_MAP[res[\"state\"]].value;\n let statusFlag = STATUS_MAP[res[\"state\"]].flag;\n let statusMetaData = {};\n\n if (\n res[\"in_cleaning\"] !== 0 &&\n (\n statusValue === stateAttrs.StatusStateAttribute.VALUE.PAUSED ||\n statusValue === stateAttrs.StatusStateAttribute.VALUE.RETURNING ||\n statusValue === stateAttrs.StatusStateAttribute.VALUE.DOCKED\n )\n ) {\n statusFlag = stateAttrs.StatusStateAttribute.FLAG.RESUMABLE;\n\n if (res[\"in_cleaning\"] === 2) {\n //Since this is some roborock-related weirdness, we're using the metaData to store this\n statusMetaData.zoned = true;\n } else if (res[\"in_cleaning\"] === 3) {\n statusMetaData.segment_cleaning = true;\n }\n } else if (statusValue === stateAttrs.StatusStateAttribute.VALUE.ERROR) {\n statusMetaData.error_code = res[\"error_code\"];\n statusMetaData.error_description = GET_ERROR_CODE_DESCRIPTION(res[\"error_code\"]);\n }\n\n newStateAttr = new stateAttrs.StatusStateAttribute({\n value: statusValue,\n flag: statusFlag,\n metaData: statusMetaData\n });\n\n this.robotState.upsertFirstMatchingAttribute(newStateAttr);\n }\n\n if (res[\"fan_power\"] !== undefined) {\n let matchingFanSpeed = Object.keys(this.fanSpeeds).find(key => this.fanSpeeds[key] === res[\"fan_power\"]);\n if (!matchingFanSpeed) {\n matchingFanSpeed = stateAttrs.FanSpeedStateAttribute.VALUE.CUSTOM;\n }\n\n this.robotState.upsertFirstMatchingAttribute(new stateAttrs.FanSpeedStateAttribute({\n value: matchingFanSpeed,\n customValue: matchingFanSpeed === stateAttrs.FanSpeedStateAttribute.VALUE.CUSTOM ? res[\"fan_power\"] : undefined\n }));\n }\n\n if (res[\"battery\"] !== undefined) {\n let previousBatteryAttr = this.robotState.getFirstMatchingAttributeByConstructor(stateAttrs.BatteryStateAttribute);\n let flag = stateAttrs.BatteryStateAttribute.FLAG.NONE;\n let level = res[\"battery\"] || 0;\n\n\n if (newStateAttr) {\n if (newStateAttr.value === stateAttrs.StatusStateAttribute.VALUE.DOCKED) {\n if (level === 100) {\n flag = stateAttrs.BatteryStateAttribute.FLAG.CHARGED;\n } else {\n flag = stateAttrs.BatteryStateAttribute.FLAG.CHARGING;\n }\n } else {\n flag = stateAttrs.BatteryStateAttribute.FLAG.DISCHARGING;\n }\n } else if (previousBatteryAttr) {\n flag = previousBatteryAttr.flag;\n }\n\n this.robotState.upsertFirstMatchingAttribute(new stateAttrs.BatteryStateAttribute({\n level: level,\n flag: flag\n }));\n }\n\n if (res[\"clean_area\"]) { //TODO: actually not an attribute. Use Job\n this.robotState.upsertFirstMatchingAttribute(new stateAttrs.LatestCleanupStatisticsAttribute({\n type: stateAttrs.LatestCleanupStatisticsAttribute.TYPE.AREA,\n value: Math.round(parseInt(res[\"clean_area\"]) / 100)\n }));\n }\n\n if (res[\"clean_time\"]) {\n this.robotState.upsertFirstMatchingAttribute(new stateAttrs.LatestCleanupStatisticsAttribute({\n type: stateAttrs.LatestCleanupStatisticsAttribute.TYPE.DURATION,\n value: res[\"clean_time\"]\n }));\n }\n\n let persistentMapSetting = stateAttrs.PersistentMapSettingStateAttribute.VALUE.DISABLED;\n if (res[\"lab_status\"] === 1) {\n persistentMapSetting = stateAttrs.PersistentMapSettingStateAttribute.VALUE.ENABLED;\n }\n\n this.robotState.upsertFirstMatchingAttribute(new stateAttrs.PersistentMapSettingStateAttribute({\n value: persistentMapSetting\n }));\n\n //res[\"dnd_enabled\"]\n //res[\"map_present\"]\n }", "function retStatus(success, info) {\n return {\n \"status\" : success\n , \"version\" : \"0.0.1\"\n , \"response\" : info\n };\n}", "function checkETLStatus(req, config, callback){\n var event = {\n 'stage-vars': {\n env: req['stage-vars']['env']\n },\n skip_sso: true,\n basic_auth: true,\n params: {\n querystring: {\n selection: \"RD998\",\n esb_path: \"RD300_NonSSO\"\n }\n }\n };\n ContentService.get(event, config, function(err, response, etl_status){\n if (err){\n console.log(\"err\", JSON.stringify(err));\n callback(err);\n } else {\n console.log(etl_status);\n var first_row = etl_status.rows[0];\n var last_update_time = first_row['LAST_UPDATE_TIME'];\n switch(first_row['BUILD_INDICATOR_DESCR']){\n case \"Complete\":\n callback(null, null, { \"success\":true, last_update_time:last_update_time, });\n break;\n default:\n callback(\"ETL Check status error:\" + JSON.stringify(etl_status));\n break;\n }\n }\n })\n}", "function check_status(json) {\n if (json[\"status\"] == \"OK\") return true;\n return false;\n }", "getStatus ({ commit }) {\n return api.getStatus()\n .then(response => {\n commit('SET_STATUS', `${response}`)\n })\n }", "function getStatus(arr) {\n\n for (let i = 0; i < arr.length; i++) {\n \n return arr[i].status;\n \n }\n }", "get ok() {\n\t\treturn this[INTERNALS$1$1].status >= 200 && this[INTERNALS$1$1].status < 300;\n\t}", "get leaseStatus() {\n return this.originalResponse.leaseStatus;\n }", "get leaseStatus() {\n return this.originalResponse.leaseStatus;\n }", "get leaseStatus() {\n return this.originalResponse.leaseStatus;\n }", "get leaseStatus() {\n return this.originalResponse.leaseStatus;\n }", "getStatus(of, uid) {\n return __awaiter(this, void 0, void 0, function* () {\n const response = yield fetch(`${this.props.endpoints[`${of}s`]\n .replace('%base', this.props.endpoints.base)\n .replace('%uid', uid)}/status`, {\n method: 'GET',\n mode: 'cors',\n cache: 'no-cache',\n credentials: 'same-origin',\n headers: {\n 'Content-Type': 'application/json',\n },\n referrerPolicy: 'no-referrer',\n });\n return yield response.json();\n });\n }", "_checkStatus(response) {\n // raises an error in case response status is not a success\n if (response.status >= 200 && response.status < 300) { // Success status lies between 200 to 300\n return response\n } else {\n var error = new Error(response.statusText)\n error.response = response\n throw error\n }\n }", "function isSuccess(status) { return status >= 200 && status < 300; }", "function getStatus() {\n\tapi({ data: \"cmd=getstatus\" },syncStatus);\n}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "function getStatus() {\n var xhr = new XMLHttpRequest();\n var url = SERVER_URL + '/doorbells/' + DOORBELL_ID + '/visitors?authtoken=' + AUTH_TOKEN;\n xhr.open('GET', url, true);\n\n xhr.onload = function(e) {\n var data = JSON.parse(this.response);\n if (data.length > 0) {\n var mostRecentVisitor = data[0];\n var currentTime = (new Date()).getTime();\n var visitorTime = (new Date(Date.parse(mostRecentVisitor.when))).getTime();\n var timeDelta = currentTime - visitorTime;\n if (timeDelta > 0 && timeDelta < 60000) {\n Pebble.sendAppMessage({\n status: 1,\n visitor_description: mostRecentVisitor.description\n });\n currentVisitorId = mostRecentVisitor.id;\n return;\n }\n }\n // No one is at the door.\n Pebble.sendAppMessage({\n status: 0\n });\n currentVisitorId = '';\n };\n xhr.send();\n}", "get status() {\n\t\treturn this._status;\n\t}", "status() {\r\n return this.request('GET', 'status/config');\r\n }", "async get() {\n await api.waitUntil('statusInitialized');\n return _converse.xmppstatus.get('status');\n }", "function checkStatus(response) {\n if (response.status >= 200 && response.status < 300) {\n return response.text();\n } else {\n return Promise.reject(new Error(response.status +\n \": \" + response.statusText));\n }\n }", "get status () {\n return this.promise ? this.promise.state() : 'pending';\n }", "get status () {\n\t\treturn this._status;\n\t}", "get status () {\n\t\treturn this._status;\n\t}", "get status () {\n\t\treturn this._status;\n\t}", "get status () {\n\t\treturn this._status;\n\t}", "get status () {\n\t\treturn this._status;\n\t}", "get status () {\n\t\treturn this._status;\n\t}", "get status () {\n\t\treturn this._status;\n\t}", "get status () {\n\t\treturn this._status;\n\t}", "get status () {\n\t\treturn this._status;\n\t}", "getStatus() {\n return this.status;\n }", "get STATE_RESP_P() { return 4; }", "getText (code) {\n try {\n return statuses.getStatusText(code)\n } catch (e) {\n return 'Unknown Status Code'\n }\n }", "getText (code) {\n try {\n return statuses.getStatusText(code)\n } catch (e) {\n return 'Unknown Status Code'\n }\n }", "get status() {\n return privates.get(this).status;\n }", "static getGameStatus() {\n return new Promise(\n async (resolve) => {\n try {\n resolve(Service.successResponse(''));\n } catch (e) {\n resolve(Service.rejectResponse(\n e.message || 'Invalid input',\n e.status || 405,\n ));\n }\n },\n );\n }", "async getConsumableStatus() {\n let data = await this.sendCommand(\"get_consumable\", [], {});\n return {\n mainBrushLeftTime: Math.max(0, 300 - (data[0].main_brush_work_time / 60 / 60)), // convert to hours left\n sideBrushLeftTime: Math.max(0, 200 - (data[0].side_brush_work_time / 60 / 60)), // convert to hours left\n filterLeftTime: Math.max(0, 150 - (data[0].filter_work_time / 60 / 60)), // convert to hours left\n sensorLeftTime: Math.max(0, 30 - (data[0].sensor_dirty_time / 60 / 60)) // convert to hours left\n };\n }", "status() {\n return __awaiter(this, void 0, void 0, function* () {\n const response = yield this.get(`/`);\n if (response && response.status === 200) {\n return new response_1.OAuthStatusResponse(response.data);\n }\n throw response;\n });\n }", "function get_status(callback) {\n csnLow();\n \n var buf1 = new Buffer(1);\n buf1[0] = consts.NOP;\n\n spi.transfer(buf1, new Buffer(1), function(device, buf) {\n csnHigh();\n callback(null,buf[0]);\n });\n\n }", "function checkStatus(response) {\n let msg = \"\"\n if (response.status === 0) {\n msg = 'subscription : OK'\n } else if (response.status === 1) {\n msg = 'subscription : GOOD '\n } else {\n msg = 'subscription failed !'\n }\n return msg\n}", "status(transactionId) {\n this.apiUrl = this.parent.apiConfig.getCoreApiBaseUrl() + '/' + transactionId + '/status';\n return this.parent.httpClient.request({\n requestUrl: this.apiUrl,\n httpMethod: 'get',\n serverKey: this.parent.apiConfig.get().serverKey,\n requestPayload: null\n });\n }", "@action getAllStatusesFromTicketHistoryResult() {\n return this.getAllValuesForKeyFromJSONObjectArray(this.TicketHistoryAPIResult, 'status');\n }", "function checkStatus(response) {\n \t\tif (response.status >= 200 && response.status < 300) {\n \t\t\t\treturn response.text();\n \t\t} else if (response.status == 404) {\n \t\t\treturn Promise.reject(new Error(\"Sorry, we couldn't find that page\"));\n \t\t} else {\n \t\t\treturn Promise.reject(new Error(response.status+\": \"+response.statusText));\n \t\t}\n }", "get ok() {\n return this.status >= 200 && this.status < 300;\n }", "statusFlags() {\r\n return this.request('GET', 'status/flags');\r\n }" ]
[ "0.70732677", "0.6595952", "0.6594896", "0.6550324", "0.6528779", "0.6522005", "0.64942074", "0.6407818", "0.625687", "0.62459475", "0.62366515", "0.61855304", "0.6175765", "0.61626405", "0.61067903", "0.6103855", "0.60540944", "0.6047178", "0.60424674", "0.60235035", "0.6014705", "0.60033077", "0.600186", "0.59871036", "0.5924136", "0.5921835", "0.5916031", "0.59151435", "0.59020936", "0.588143", "0.5880029", "0.58763057", "0.58763057", "0.58763057", "0.58763057", "0.5851803", "0.58473337", "0.58436424", "0.5828614", "0.58266854", "0.58266854", "0.58266854", "0.58266854", "0.58266854", "0.58266854", "0.58266854", "0.58266854", "0.58266854", "0.58266854", "0.58266854", "0.58266854", "0.58266854", "0.58266854", "0.58266854", "0.58266854", "0.58266854", "0.58266854", "0.58266854", "0.58266854", "0.58266854", "0.58266854", "0.58266854", "0.58266854", "0.58266854", "0.58266854", "0.58266854", "0.58266854", "0.58266854", "0.58266854", "0.58266854", "0.58266854", "0.5825721", "0.58227193", "0.5808065", "0.58047885", "0.57887787", "0.5784136", "0.57800317", "0.57800317", "0.57800317", "0.57800317", "0.57800317", "0.57800317", "0.57800317", "0.57800317", "0.57800317", "0.5779825", "0.5774469", "0.5773663", "0.5773663", "0.5762967", "0.5758398", "0.5752892", "0.57475936", "0.5737189", "0.57197434", "0.57112366", "0.5706476", "0.5699762", "0.56984776", "0.56944394" ]
0.0
-1
public ClassicEditorBuild = ClassicEditorBuild; public editor: CKEditor5.Editor = null; public readyEmitter = new EventEmitter();
constructor(platform, splashScreen, statusBar) { this.platform = platform; this.splashScreen = splashScreen; this.statusBar = statusBar; this.initializeApp(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_editorChanged() {\n this.dispatchEvent(\n new CustomEvent(\"editor-change\", {\n bubbles: true,\n cancelable: true,\n composed: true,\n detail: this,\n })\n );\n }", "function EditorConstructor() { }", "function EditorConstructor() { }", "function initialize(editor) {\r\n this.window = editor.getWindow();\r\n this.document = editor.getDocument();\r\n }", "constructor() {\n /**\n * Target for editing\n * @protected\n * @type {IEditorFunction}\n */\n this.editor = null;\n }", "constructor(config, editor)\n {\n this.editor = editor;\n this.config = config;\n this.oEditor = null;\n }", "init() {\n Nova.$on(`ckeditor:media:${this.attribute}:write`, this.writeContent.bind(this))\n this.ui.componentFactory.add('mediaBrowser', this.createButton.bind(this))\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 }", "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 }", "_initializeEditor(editor) {\n const that = this,\n editorTagName = 'jqx-' + JQX.Utilities.Core.toDash(editor),\n editorElement = document.createElement(editorTagName);\n\n if (editor === 'numericTextBox') {\n editorElement.spinButtons = true;\n editorElement.inputFormat = 'floatingPoint';\n }\n else if (editor === 'dateTimePicker') {\n editorElement.calendarButton = true;\n editorElement.dropDownDisplayMode = 'auto';\n editorElement.enableMouseWheelAction = true;\n editorElement.locale = that.locale;\n\n if (!editorElement.messages[that.locale]) {\n editorElement.messages[that.locale] = {};\n }\n\n editorElement.messages[that.locale].dateTabLabel = that.localize('dateTabLabel');\n editorElement.messages[that.locale].timeTabLabel = that.localize('timeTabLabel');\n }\n\n editorElement.tabIndex = '1';\n editorElement.theme = that.theme;\n editorElement.animation = that.animation;\n that.$[editor + 'Editor'] = editorElement;\n editorElement.$ = JQX.Utilities.Extend(editorElement);\n editorElement.className = editorTagName + '-editor jqx-hidden';\n that.$.editorsContainer.appendChild(editorElement);\n that['_' + editor + 'Initialized'] = true;\n }", "function BaseEditor() { }", "function BaseEditor() { }", "function initialiseCKEditor() {\n // Any textarea tag with data-type=ckeditortype is replaced by CKEditor\n var textareas = Array.prototype.slice.call(\n document.querySelectorAll('textarea[data-type=ckeditortype]')\n );\n for (var i=0; i<textareas.length; ++i) {\n var t = textareas[i];\n if (t.getAttribute('data-processed') == '0' && t.id.indexOf('__prefix__') == -1) {\n t.setAttribute('data-processed', '1');\n // CKEDITOR.replace(t.id, JSON.parse(t.getAttribute('data-config'))); // CKEditor 4\n ClassicEditor\n .create(document.querySelector('#'+t.id),\n JSON.parse(t.getAttribute('data-config')))\n .catch( error => {\n console.log( error );\n });\n }\n }\n }", "ngAfterViewInit(){\n // Configuration\n var config = this.config || {};\n this.ckeditorInit(config);\n }", "initEditor() {\n let savedCode = this.service.getCode(this.currentExo.method);\n if (savedCode)\n this.editor.setValue(savedCode);\n\n byId('editor').style.height = this.editorHeight + 'px';\n this.editor.resize();\n }", "getEditorListeners() {\n return {\n focusout: 'onEditorFocusOut',\n focusin: 'onEditorFocusIn',\n start: 'onEditorStart',\n beforecomplete: 'onEditorBeforeComplete',\n complete: 'onEditorComplete',\n cancel: 'onEditorCancel',\n thisObj: this\n };\n }", "getEditorListeners() {\n return {\n focusout: 'onEditorFocusOut',\n focusin: 'onEditorFocusIn',\n start: 'onEditorStart',\n beforecomplete: 'onEditorBeforeComplete',\n complete: 'onEditorComplete',\n cancel: 'onEditorCancel',\n thisObj: this\n };\n }", "_initializeEditor(editor) {\n const that = this;\n\n if (that.$[editor + 'Editor']) {\n that._editor = that.$[editor + 'Editor'];\n return;\n }\n\n const editorElement = document.createElement('jqx-' + JQX.Utilities.Core.toDash(editor));\n\n if (editor === 'numericTextBox') {\n editorElement.spinButtons = true;\n editorElement.inputFormat = 'floatingPoint';\n }\n else if (editor === 'dateTimePicker') {\n editorElement.dropDownAppendTo = that.$.container;\n editorElement.calendarButton = true;\n editorElement.dropDownDisplayMode = 'auto';\n editorElement.enableMouseWheelAction = true;\n editorElement.locale = that.locale;\n\n if (!editorElement.messages[that.locale]) {\n editorElement.messages[that.locale] = {};\n }\n\n editorElement.messages[that.locale].dateTabLabel = that.localize('dateTabLabel');\n editorElement.messages[that.locale].timeTabLabel = that.localize('timeTabLabel');\n }\n\n editorElement.theme = that.theme;\n editorElement.animation = that.animation;\n editorElement.$.addClass('jqx-hidden underlined');\n that.$.editorsContainer.appendChild(editorElement);\n that._editor = that.$[editor + 'Editor'] = editorElement;\n }", "function Editor() { }", "function Editor() { }", "init() {\n // Get saved editor settings if any or default values from SettingsHandler\n const initialLanguage = settingsHandler.getEditorLanguageMode();\n const initialContent = settingsHandler.getEditorContent();\n\n this.engine.setTheme('ace/theme/monokai');\n this.engine.$blockScrolling = Infinity;\n this.engine.setShowPrintMargin(false);\n // Define the language mode for syntax highlighting and editor content\n this.engine.getSession().setMode({path:'ace/mode/' + initialLanguage, inline:true});\n this.engine.setValue(initialContent);\n\n this.initEventListners();\n }", "function _onEditorChanged() {\n\t\t_close();\n\t\tcurrentEditor = EditorManager.getCurrentFullEditor();\n\n\t\tcurrentEditor.$textNode = $(currentEditor.getRootElement()).find(\".CodeMirror-lines\");\n\t\tcurrentEditor.$textNode = $(currentEditor.$textNode.children()[0].children[3]);\n\t\tcurrentEditor.$numbersNode = $(currentEditor.getRootElement()).find(\".CodeMirror-gutter-text\");\n\n\t\t\n\t}", "setBlankEditor() {\r\n \r\n // Setting content for HTML editor\r\n let htmlDoc = '<!DOCTYPE html>\\n<html>\\n<head>\\n\\t<meta charset=\"UTF-8\">\\n\\t<title>LWE</title>\\n</head>\\n<body>\\n\\t\\n</body>\\n</html>'\r\n this.editorHTML.setValue(htmlDoc)\r\n this.editorHTML.gotoLine(8, 2)\r\n this.editorHTML.focus()\r\n\r\n // Setting content for CSS editor\r\n this.editorCSS.setValue('')\r\n this.editorCSS.gotoLine(1)\r\n this.editorCSS.focus()\r\n \r\n\r\n // Setting content for JS editor\r\n this.editorJS.setValue('')\r\n this.editorJS.gotoLine(1)\r\n this.editorJS.focus()\r\n\r\n // Load changes\r\n this.type()\r\n\r\n }", "updateEditor() {\n if (typeof this.engine !== 'undefined') {\n this.engine.process(this.editor.toJSON());\n }\n }", "get editor() {\n return this._editor;\n }", "get editor() {\n return this._editor;\n }", "connectedCallback(){super.connectedCallback();let root=this;document.addEventListener(\"selectionchange\",e=>{root.range=root.getRange()});document.addEventListener(\"select-rich-text-editor-editor\",e=>{root._editorChange(e)});document.addEventListener(\"deselect-rich-text-editor-editor\",e=>{root._editorChange(e)})}", "_showEditor() {\n const EditorCls = this.richText ? CodeMirrorWrapper : TextAreaWrapper;\n\n if (this.richText) {\n RB.DnDUploader.instance.registerDropTarget(\n this.$el, gettext('Drop to add an image'),\n this._uploadImage.bind(this));\n }\n\n this._editor = new EditorCls({\n parentEl: this.el,\n autoSize: this.options.autoSize,\n minHeight: this.options.minHeight\n });\n\n this._editor.setText(this._value);\n this._value = '';\n this._richTextDirty = false;\n this._prevClientHeight = null;\n\n this._editor.$el.on(\n 'resize',\n _.throttle(() => this.$el.triggerHandler('resize'), 250));\n\n this.listenTo(this._editor, 'change', _.throttle(() => {\n /*\n * Make sure that the editor wasn't closed before the throttled\n * handler was reached.\n */\n if (this._editor === null) {\n return;\n }\n\n const clientHeight = this._editor.getClientHeight();\n\n if (clientHeight !== this._prevClientHeight) {\n this._prevClientHeight = clientHeight;\n this.$el.triggerHandler('resize');\n }\n\n this.trigger('change');\n }, 500));\n\n this.focus();\n }", "function initEditor() {\n checkSetup();\n initFirebase();\n initConstants();\n initCanvas();\n initButton();\n initEditorData();\n initEventHandlers();\n resetEditor();\n initGrid();\n initSelectorContent();\n}", "static getClassName() {\n return 'EditorContainer';\n }", "bindEditor(editor){\n\t\tlisten(editor, 'compositionstart', () => {\n\t\t\tthis.inputIsComposing = true\n\t\t})\n\t\tlisten(editor, 'compositionend', e => {\n\t\t\tthis.inputIsComposing = false\n\t\t\tthis.input(e)\n\t\t})\n\t\tlisten(editor, 'input', e => {\n\t\t\tif (!this.inputIsComposing){\n\t\t\t\tthis.input(e)\n\t\t\t}\n\t\t})\n\t}", "constructor(editor) {\n _defineProperty(this, \"editor\", void 0);\n\n _defineProperty(this, \"command\", void 0);\n\n if (!editor) {\n throw new Error('no editor');\n }\n\n this.editor = editor;\n this.command = this.getCommand();\n }", "constructor() {\n super(...arguments);\n /* Generate textarea ID for the instance. */\n let textComponents = document.getElementsByClassName('markdown-editor');\n let newId = textComponents.length + 1;\n this.textareaId = 'markdowneditor' + newId;\n\n this.previousValue = '';\n this.undoHistory = A();\n this.modal = false;\n this.result = '';\n this.dialog = '';\n this.regex = '';\n this.enter = '';\n this.promptText = '';\n this.tooltip = '';\n this.lastchar = '';\n this.selection = '';\n this.endPos = '';\n this.startPos = '';\n }", "initNodeEditor() {\n this.container = document.getElementById('d3-node-editor');\n\n this.editor = new D3NE.NodeEditor(\n `${this.name}NodeEditor${this._version}`,\n this.container,\n this.components,\n this.menu,\n );\n\n this.engine = new D3NE.Engine(`${this.name}NodeEditor${this._version}`,\n this.components);\n\n this.engine.onError =\n (msg, obj) => { console.error(`Node Editor Error: ${msg}`, obj); };\n\n this._addEventListener();\n\n this.editor.view.zoomAt(this.editor.nodes);\n this.engine.process(this.editor.toJSON());\n this.editor.view.resize();\n }", "function replaceEditor() {\r\n\t\treturn function () {\r\n\t\t\tvar editorInstance = CKEDITOR.replace(element, configObj);\r\n\t\t\tself.setEditorInstance(editorInstance);\r\n\t\t\t//See if we need to set the editor to mixed mode\r\n\t\t\teditorInstance.on('instanceReady', function () {\r\n\t\t\t\t//Perform any cleanup once the editor has been created.\r\n\t\t\t\tself.postEditorCleanup();\r\n\t\t\t\t//If we instantiated CKEditor on top of mixed content.. the editor alters content\r\n\t\t\t\t//We have to reset the content\r\n\t\t\t\t//Set the ddfreetext areas to be editable and apply css classes to top and bottom\r\n\t\t\t\tif (self.hasMixedContent()) {\r\n\t\t\t\t\teditorInstance.setData(self.getDocumentationContent());\r\n\t\t\t\t\tvar $freetextAreas = $(editorInstance.editable().$).find('.ddfreetext');\r\n\t\t\t\t\t$freetextAreas.attr('contenteditable', 'true');\r\n\t\t\t\t\teditorInstance.saveEditorSnapshot();\r\n\t\t\t\t\tself.enableMixedContent();\r\n\t\t\t\t\t$(editorInstance.editable().$).attr(\"ddactive\", true);\r\n\t\t\t\t\teditorInstance.fire('updateStructuredContent');\t\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\tself.injectFreeTextElement();\r\n\t\t\t\t}\r\n\t\t\t\tif (self.isEmrEnabled()){\r\n\t\t\t\t\tself.updateEMRContent();\r\n\t\t\t\t}\r\n\t\t\t\t//After we have made all these changes, make sure to reset the undo stack. (undoing immediately could\r\n\t\t\t\t//cause severe DOM corruption).\r\n\t\t\t\teditorInstance.resetUndo();\r\n\t\t\t\t//Ensure that undo can properly go back to current state\r\n\t\t\t\tvar cernundo = editorInstance.plugins.cernundo;\r\n\t\t\t\tcernundo.handleBaseSnapshot(editorInstance);\r\n\t\t\t\t//If structure is enabled, enable the header toggle. The toggle was disabled until the editor instance\r\n\t\t\t\t//was ready, at which point it is considered safe to switch views.\r\n\t\t\t\tif (self.getStructuredDocInd()) {\r\n\t\t\t\t\tself.enableHeaderToggle(DocumentationBaseComponent.VIEWS.STRUCTURE);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\teditorInstance.on('structureElementClicked', function(event) {\r\n\t\t\t\tif (event.data) {\r\n\t\t\t\t\tself.showStructuredView(event.data);\r\n\t\t\t\t\tself.captureNavigationTimer();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\teditorInstance.on('refreshStateChange', function(){\r\n\t\t\t\tif(editorInstance.refreshState === 'stable'){\r\n\t\t\t\t\tself.postEMRRefresh();\r\n\t\t\t\t}\r\n\t\t\t\t// Disable refreshing when refresh starts, enable after ending\r\n\t\t\t\tself.updateSaveButton();\r\n\t\t\t});\r\n\t\t\teditorInstance.on('refreshEmrFail', function(event) {\r\n\t\t\t\t//Display error message if emr refresh fails\r\n\t\t\t\tself.displayEMRError();\r\n\t\t\t});\r\n\t\t\teditorInstance.on('afterddremovesection', function(){\r\n\t\t\t\t//Update styling after removing sections\r\n\t\t\t\tself.handleEmptySections();\r\n\t\t\t});\r\n\r\n\t\t};\r\n\t}", "function initEditor() {\n renderWorkingLine();\n renderTextInput();\n renderFontColorPicker();\n renderFontSize();\n toggleStrokeBtn();\n renderStrokeColorPicker();\n renderStrokeSize();\n renderStickers();\n}", "static get properties(){return{editor:{type:Object,value:null},hidden:{type:Boolean,value:!0,reflectToAttribute:!0},observer:{type:Object,value:null},range:{type:Object,value:null,observer:\"_updateToolbar\"},toolbar:{type:Object,value:null}}}", "createEditor() {\n this.simplemde = new SimpleMDE({\n element: $(\"#txtEditor\")[0],\n autoDownloadFontAwesome: false,\n initialValue: controller.markdownText,\n toolbar: [{\n name: \"save\",\n action: (() => this.saveChanges()),\n className: \"fa fa-floppy-o\",\n title: \"Save Changes\"\n },\n //The fullscreen button will be hidden by the css. It was only added here to prevent errors in the side-by-side button\n \"|\", \"bold\", \"italic\", \"strikethrough\", \"heading\", \"|\", \"quote\", \"unordered-list\", \"ordered-list\", \"|\", \"link\", \"image\", \"table\", \"fullscreen\", \"|\",\n {\n name: \"side-by-side\",\n action: (() => this.showSideBySide()),\n className: \"fa fa-columns\",\n title: \"Side by Side Editing\"\n }, \"|\",\n {\n name: \"guide\",\n action: (() => this.showGuide()),\n className: \"fa fa-question-circle\",\n title: \"Markdown Guide\"\n }]\n });\n this.simplemde.codemirror.on(\"change\",\n () => controller.markdownText = this.simplemde.value());\n }", "installed() {\n this._initializeEditor()\n }", "static createEditor(params) {\r\n\t\tDOM.createEditor(params);\r\n\t\tInit.editor = Getter.getEditor();\r\n\t\t\r\n\t\tswitch (mode) {\r\n\t\tcase 'balloon':\r\n\t\t\t/*create popup toolbar in balloon mode*/\r\n\t\t\tInit.createToolbar('swe-toolbar-pu', 'swe-none');\r\n\t\t\tInit.setShowingPopupToolbarEvents();\r\n\t\t\t/*set selectionEnd timer value*/\r\n\t\t\tInit.selectionEndTimer = null;\r\n\t\t\tbreak;\r\n\t\tcase 'classic':\r\n\t\tdefault:\r\n\t\t\t/*create fixed toolbar in balloon mode*/\r\n\t\t\tInit.createToolbar('swe-toolbar', params.sticky ? 'swe-toolbar-sticky' : null);\r\n\t\t\tDOM.createBottomPanel();\r\n\t\t\tInit.setEventListener(Init.editor, 'input', Init.setCountersValue);\r\n\t\t\tInit.setCountersValue();\r\n\t\t}\r\n\t\t/*highlight editors images on click*/\r\n\t\tInit.setEventListener(Init.editor, 'mousedown', Images.selectImageOnClick);\r\n\t\tInit.setEventListener(document, 'mousedown', Images.removeImageFrameOnOutsideClick);\t\t\r\n\t\t/*set textarea value on input*/\r\n\t\tInit.setEventListener(Init.editor, 'input', Init.setTextAreaValue);\r\n\t\t/*highlight buttons of toolbar that have the same style as selection*/\r\n\t\tInit.setEventListener(document, 'selectionchange', Init.highlightTheButtons);\r\n\t}", "function CKE($rootScope, CKEDITOR) {\n var self = this;\n\n CKEDITOR.disableAutoInline = true;\n\n /*\n Get a copy of default config\n */\n self.getConfig = function(){\n var config = angular.extend({}, ckeditorConfig);\n return config;\n };\n\n\n /*\n Create and register editor from element\n */\n self.createEditor = function(id, element, options){\n options = options || {};\n var editor = CKEDITOR.replace(element.get(0), options);\n if (id){\n editors[id] = editor;\n }else{\n editors[editor.id] = editor;\n }\n return editor;\n };\n\n /*\n Return editor from id\n */\n self.getEditor = function(id){\n if(editors[id]){\n return editors[id];\n }\n return null;\n };\n\n /*\n Destroy editor instance\n */\n self.destroyEditor = function(id){\n if (editors[id]){\n editors[id].destroy();\n delete editors[id];\n }\n };\n\n }", "load()\n {\n this.replaceTextArea();\n this.createCustomButtons();\n if (this.config.CKEditor.editorData !== undefined) {\n this.oEditor.setData(this.config.CKEditor.editorData);\n }\n if (this.config.RichFilemanager !== undefined) {\n this.editor.on('dialogDefinition', (event) => {this.connectRichFilemanager(event);});\n }\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 createEditor() {\n\tif (editor)\n\t\tremoveEditor();\n\n\t// Create a new editor inside the <div id=\"editor\">, setting its value to html\n\t//var config = {language: 'en'};\n\t//editor = CKEDITOR.appendTo('txtDescription', config, html);\n\t\n\teditor = CKEDITOR.replace( 'txtDescription', {\n\t\t\t // //Load the English interface.\n\t\t\t language: 'en'\n\t\t\t});\n\t\n\t editor.addCommand(\"mySimpleCommand\", { // create named command\n\t\t exec: function(edt) {\n\t\t\t\n\t\t\t // Retrieve the editor contents. In an Ajax application, this data would be\n\t\t\t // sent to the server or used in any other way.\n\t\t\t //document.getElementById('editorcontents').innerHTML = html = editor.getData();\n\t\t\t //document.getElementById('contents').style.display = '';\n\t\t\t\n\t\t\t var cell = graph.getSelectionCell();\n\t\t\t\n\t\t\t graph.getModel().beginUpdate();\n\n\t\t\t try {\n\t\t\t\tvar edit = new mxCellAttributeChange(cell, \"spDescription\", editor.getData());\n\t\t\t\tgraph.getModel().execute(edit);\n\t\t\t\t\n\t\t\t\t //graph.updateCellSize(cell);\n\t\t\t }\n\t\t\t finally {\n\t\t\t\tgraph.getModel().endUpdate();\n\t\t\t\tmxLog.debug('Description saved.');\n\t\t\t }\n\t\t\t\n\t\t\t\n\t\t\t //alert(edt.getData());\n\t\t }\n\t });\n\t\n\t editor.ui.addButton('SuperButton', { // add new button and bind our command\n\t\t label: \"Save HTML\",\n\t\t command: 'mySimpleCommand',\n\t\t toolbar: 'insert',\n\t\t icon: 'https://gavinet.sharepoint.com/sites/km/SiteAssets/fh_mxgraph/mxgraph/images/Saveimg.png'\n\t });\n\n\n}", "type() {\r\n let viewer = document.getElementById('viewer')\r\n let ohead = this.editorHTML.getValue().substr(0, this.editorHTML.getValue().indexOf('</head>')-1)\r\n let css = '\\n\\t<style>\\n' + this.editorCSS.getValue() + '\\n\\t</style>'\r\n let chead = '\\n</head>\\n'\r\n let bodyTag = this.editorHTML.getValue().indexOf('<body>')\r\n let bodyLines = this.editorHTML.getValue().substr(bodyTag)\r\n let html = bodyLines.substr(0, bodyLines.length-15)\r\n let js = '\\t<script>\\n' + this.editorJS.getValue() + '\\n\\t</script>\\n'\r\n let endDoc = '</body>\\n</html>'\r\n \r\n this.content = ohead\r\n \r\n if (css.length > 18) {\r\n this.content += css\r\n }\r\n \r\n this.content += chead + html\r\n \r\n if (js.length > 21) {\r\n this.content += js\r\n }\r\n \r\n this.content += endDoc\r\n viewer.srcdoc = this.content\r\n }", "function initEditorCanvas() {\n let canvas = document.getElementById('editorCanvas');\n // Resize the canvas.\n canvas.width = EDITOR_SCALE * CHR_WIDTH;\n canvas.height = EDITOR_SCALE * CHR_HEIGHT;\n\n let ctx = cmn.getContext2DNA(canvas);\n ctx.imageSmoothingEnabled = false;\n ctx.scale(EDITOR_SCALE, EDITOR_SCALE);\n\n // Canvas is white by default.\n ctx.fillStyle = 'black';\n ctx.fillRect(0, 0, CHR_WIDTH, CHR_HEIGHT);\n\n canvas.addEventListener('mousedown', function (me) { _mouseDown = true; onMouseMove(me); });\n canvas.addEventListener('mousemove', onMouseMove);\n canvas.addEventListener('mouseup', function (me) { _mouseDown = false; });\n canvas.addEventListener('mouseleave', function (me) { _mouseDown = false; });\n}", "_initEvent() {\n this.cm.getWrapperElement().addEventListener('click', () => {\n this.eventManager.emit('click', {\n source: 'markdown'\n });\n });\n\n this.cm.on('beforeChange', (cm, ev) => {\n if (ev.origin === 'paste') {\n this.eventManager.emit('pasteBefore', {\n source: 'markdown',\n data: ev\n });\n }\n });\n\n this.cm.on('change', (cm, cmEvent) => {\n this._refreshCodeMirrorMarks(cmEvent);\n this._emitMarkdownEditorChangeEvent(cmEvent);\n });\n\n this.cm.on('focus', () => {\n this.eventManager.emit('focus', {\n source: 'markdown'\n });\n });\n\n this.cm.on('blur', () => {\n this.eventManager.emit('blur', {\n source: 'markdown'\n });\n });\n\n this.cm.on('scroll', (cm, eventData) => {\n this.eventManager.emit('scroll', {\n source: 'markdown',\n data: eventData\n });\n });\n\n this.cm.on('keydown', (cm, keyboardEvent) => {\n this.eventManager.emit('keydown', {\n source: 'markdown',\n data: keyboardEvent\n });\n\n this.eventManager.emit('keyMap', {\n source: 'markdown',\n keyMap: keyMapper.convert(keyboardEvent),\n data: keyboardEvent\n });\n });\n\n this.cm.on('keyup', (cm, keyboardEvent) => {\n this.eventManager.emit('keyup', {\n source: 'markdown',\n data: keyboardEvent\n });\n });\n\n this.cm.on('copy', (cm, ev) => {\n this.eventManager.emit('copy', {\n source: 'markdown',\n data: ev\n });\n });\n\n this.cm.on('cut', (cm, ev) => {\n this.eventManager.emit('cut', {\n source: 'markdown',\n data: ev\n });\n });\n\n this.cm.on('paste', (cm, clipboardEvent) => {\n this.eventManager.emit('paste', {\n source: 'markdown',\n data: clipboardEvent\n });\n });\n\n this.cm.on('drop', (cm, eventData) => {\n eventData.preventDefault();\n\n this.eventManager.emit('drop', {\n source: 'markdown',\n data: eventData\n });\n });\n\n this.cm.on('cursorActivity', () => this._onChangeCursorActivity());\n }", "get editorDomElement() {\n return this.$editorElm;\n }", "onCreated() {\n\t\tlet brackets = null,\n\t\t\tDocumentManager = null,\n\t\t\tdoc = null;\n\t\tthis.classList.add('closet-instant-editor');\n\t\t$(document.body).append(this);\n\t\tbrackets = utils.checkGlobalContext('brackets');\n\t\tDocumentManager = brackets.getModule('document/DocumentManager');\n\t\tdoc = DocumentManager.createUntitledDocument(1, '.html');\n\t\tthis._textEditor = new TextEditor(doc, false, this.$el);\n\t\tthis._$textEditorEl = this._textEditor.$el;\n\n\t\tthis._$textEditorEl.addClass('closet-instant-editor-item');\n\t\tthis._$textEditorEl.attr('tabindex', 0);\n\n\t\tthis._currentGrammar = null;\n\t\tthis._targetModel = null;\n\n\t\tthis._opened = false;\n\t\tthis._bindEvent();\n\t}", "function vB_AJAX_QuickEditor_Events()\n{\n}", "constructor() {\n this.emitter = new Events.EventEmitter();\n this.browser = null;\n }", "onChange() {\n if (!this.enabled) {\n return;\n }\n\n // Trigger an event\n triggerEvent.call(this.player, this.player.media, this.shown ? 'entereditor' : 'exiteditor', false);\n }", "init() {\n this.editor.style.width = this.width;\n this.editor.style.height = this.height;\n this.bar.setupToolbar();\n\n this.createTag(\"\", this.getActiveTags(), this.getActiveStyle());\n\n let tools = document.querySelectorAll(\".editor-button\");\n tools.forEach(t => {\n t.addEventListener('click', (e) => {\n this.updateStyle(e);\n });\n });\n }", "get editorDomElement() {\n return this._$editorElm;\n }", "function fnInitialiseEditor()\n {\n elRoot.parentNode.classList.add('-active');\n\n // if it’s already there…\n if (oEditor !== null)\n {\n oEditor.setup();\n return;\n }\n\n // load raw markup from the server, then use it to init the editor\n ajaxRequest( `${options.uri}.json?field=${options.property}` ).then( oJson =>\n {\n // a. swap things out\n sOldMarkup = elRoot.innerHTML;\n elRoot.innerHTML = oJson.content;\n\n // b initiate the editor\n oEditor = new Editor( elRoot, { toolbar: { buttons: EDITOR_BUTTONS }});\n });\n }", "get defaultEditor() {\n return {\n type: 'textfield',\n name: this.field\n };\n }", "get defaultEditor() {\n return {\n type: 'textfield',\n name: this.field\n };\n }", "function init() {\n var cm = new CodeMirror(document.getElementById('editor-container'), {\n mode: 'erv',\n tabSize: 4,\n indentWithTabs: false,\n indentUnit: 4,\n lineNumbers: true,\n gutters: ['error-markers'],\n hintOptions: {\n hint: getAutoCompletionHints\n }\n });\n cm.on('change', onEditorContentChange);\n return cm;\n}", "_onActiveEditorUpdated(type, editor) {\n this._designView = editor;\n }", "function ckeInitNormal(editorID) {\n\n\tvar $editor = $('#' + editorID);\n\tvar $parent = $editor.parent();\n\t\n\t\n\tif(typeof ProcessWire.config.InputfieldCKEditor.editors[editorID] != \"undefined\") {\n\t\tvar configName = ProcessWire.config.InputfieldCKEditor.editors[editorID];\n\t} else {\n\t\tvar configName = $editor.attr('data-configName');\n\t}\n\n\tif($parent.hasClass('ui-tabs-panel') && $parent.css('display') == 'none') {\n\t\t// CKEditor in a jQuery UI tab (like langTabs)\n\t\tvar parentID = $editor.parent().attr('id');\n\t\tvar $a = $parent.closest('.ui-tabs, .langTabs').find('a[href=#' + parentID + ']');\n\t\t$a.attr('data-editorID', editorID).attr('data-configName', configName);\n\t\t$parent.closest('.ui-tabs, .langTabs').on('tabsactivate', ckeInitTab);\n\t} else {\n\t\t// visible CKEditor\n\t\tvar editor;\n\t\tif(typeof ProcessWire.config[configName] != \"undefined\") {\n\t\t\tvar editor = CKEDITOR.replace(editorID, ProcessWire.config[configName]);\n\t\t} else if(typeof $editor.attr('data-configdata') != \"undefined\") {\n\t\t\t// allow for alternate option of config data being passed through a data attribute\n\t\t\t// useful for some dynamic/ajax situations\n\t\t\tvar configData = JSON.parse($editor.attr('data-configdata'));\n\t\t\tProcessWire.config[configName] = configData;\n\t\t\tvar editor = CKEDITOR.replace(editorID, configData);\n\t\t}\n\t\tif(editor) {\n\t\t\tckeInitEvents(editor);\n\t\t\t$editor.addClass('InputfieldCKEditorLoaded');\n\t\t}\n\t}\n}", "openModal(){\n this.saveSelection()\n Nova.$emit(`ckeditor:media:${this.attribute}`)\n }", "constructor(options) {\n this._cleared = new Signal(this);\n this._disposed = new Signal(this);\n this._editor = null;\n this._inspected = new Signal(this);\n this._isDisposed = false;\n this._pending = 0;\n this._standby = true;\n this._connector = options.connector;\n this._rendermime = options.rendermime;\n this._debouncer = new Debouncer(this.onEditorChange.bind(this), 250);\n }", "function attached() {\n\t/* jslint validthis:true */\n\tthis._editor = create( this, this.$.editor );\n} // end FUNCTION attached()", "function makeEditor(_ref) {var editorPluginsToRun = _ref.editorPluginsToRun;var\n\t Editor = function (_React$Component) {_inherits(Editor, _React$Component);\n\n\t function Editor(props, context) {_classCallCheck(this, Editor);var _this = _possibleConstructorReturn(this, (Editor.__proto__ || Object.getPrototypeOf(Editor)).call(this,\n\t props, context));_initialiseProps.call(_this);\n\t if (props.value) {\n\t _this.yaml = props.value;\n\t }\n\t _this.state = {\n\t editor: null,\n\t value: props.value || \"\" };\n\n\n\t // see https://gist.github.com/Restuta/e400a555ba24daa396cc\n\t _this.onClick = _this.onClick.bind(_this);return _this;\n\t }_createClass(Editor, [{ key: \"componentWillMount\", value: function componentWillMount()\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t {\n\t // add user agent info to document\n\t // allows our custom Editor styling for IE10 to take effect\n\t var doc = document.documentElement;\n\t doc.setAttribute(\"data-useragent\", navigator.userAgent);\n\t } }, { key: \"componentDidMount\", value: function componentDidMount()\n\n\t {\n\t // eslint-disable-next-line react/no-did-mount-set-state\n\t this.setState({ width: this.getWidth() });\n\t document.addEventListener(\"click\", this.onClick);\n\n\t if (this.props.markers) {\n\t this.updateMarkerAnnotations({ markers: this.props.markers }, { force: true });\n\t }\n\t } }, { key: \"componentWillReceiveProps\", value: function componentWillReceiveProps(\n\n\t nextProps) {var _this2 = this;var\n\t state = this.state;\n\t var hasChanged = function hasChanged(k) {return !(0, _eq2.default)(nextProps[k], _this2.props[k]);};\n\t var wasEmptyBefore = function wasEmptyBefore(k) {return nextProps[k] && (!_this2.props[k] || (0, _isEmpty2.default)(_this2.props[k]));};\n\n\t this.updateErrorAnnotations(nextProps);\n\t this.setReadOnlyOptions(nextProps);\n\t this.updateMarkerAnnotations(nextProps);\n\n\t if (state.editor && nextProps.goToLine && hasChanged(\"goToLine\")) {\n\t state.editor.gotoLine(nextProps.goToLine.line);\n\t }\n\n\t this.setState({\n\t shouldClearUndoStack: hasChanged(\"specId\") || wasEmptyBefore(\"value\") });\n\n\n\t } }, { key: \"shouldComponentUpdate\", value: function shouldComponentUpdate(\n\n\n\n\t nextProps) {\n\t var oriYaml = this.yaml;\n\t this.yaml = nextProps.value;\n\n\t return oriYaml !== nextProps.value;\n\t } }, { key: \"render\", value: function render()\n\n\t {var\n\t readOnly = this.props.readOnly;\n\t var value = this.yaml;\n\n\t return (\n\t _react2.default.createElement(_reactAce2.default, {\n\t value: value,\n\t mode: \"yaml\",\n\t theme: \"tomorrow_night_eighties\",\n\t onLoad: this.onLoad,\n\t onChange: this.onChange,\n\t name: \"ace-editor\",\n\t width: \"100%\",\n\t height: \"100%\",\n\t tabSize: 2,\n\t fontSize: 14,\n\t readOnly: readOnly,\n\t useSoftTabs: \"true\",\n\t wrapEnabled: true,\n\t editorProps: {\n\t \"display_indent_guides\": true,\n\t folding: \"markbeginandend\" },\n\n\t setOptions: {\n\t cursorStyle: \"smooth\",\n\t wrapBehavioursEnabled: true } }));\n\n\n\n\t } }, { key: \"componentDidUpdate\", value: function componentDidUpdate()\n\n\t {var _state =\n\t this.state,shouldClearUndoStack = _state.shouldClearUndoStack,editor = _state.editor;\n\n\t if (shouldClearUndoStack) {\n\t setTimeout(function () {\n\t editor.getSession().getUndoManager().reset();\n\t }, 100);\n\t }\n\n\t } }, { key: \"componentWillUnmount\", value: function componentWillUnmount()\n\n\t {\n\t document.removeEventListener(\"click\", this.onClick);\n\t } }]);return Editor;}(_react2.default.Component);var _initialiseProps = function _initialiseProps() {var _this3 = this;this.onChange = function (value) {// Set the value in state, now - so that we don't have lag\n\t _this3.setState({ value: value }); // Send it upstream\n\t _this3.props.onChange(value);};this.onLoad = function (editor) {var props = _this3.props,state = _this3.state;var AST = props.AST,specObject = props.specObject;var langTools = _brace2.default.acequire(\"ace/ext/language_tools\");state.editor = editor; // TODO: get editor out of state\n\t editor.getSession().setUseWrapMode(true);var session = editor.getSession();session.on(\"changeScrollLeft\", function (xPos) {// eslint-disable-line no-unused-vars\n\t session.setScrollLeft(0);});(0, _hook2.default)(editor, props, editorPluginsToRun || [], { langTools: langTools, AST: AST, specObject: specObject });editor.setHighlightActiveLine(false);editor.setHighlightActiveLine(true);};this.onResize = function () {var editor = _this3.state.editor;if (editor) {var session = editor.getSession();editor.resize();var wrapLimit = session.getWrapLimit();editor.setPrintMarginColumn(wrapLimit);}};this.onClick = function () {// onClick is deferred by 40ms, to give element resizes time to settle.\n\t setTimeout(function () {if (_this3.getWidth() !== _this3.state.width) {_this3.onResize();_this3.setState({ width: _this3.getWidth() });}}, 40);};this.getWidth = function () {var el = document.getElementById(\"editor-wrapper\");return el ? el.getBoundingClientRect().width : null;};this.updateErrorAnnotations = function (nextProps) {if (_this3.state.editor && nextProps.errors) {var editorAnnotations = nextProps.errors.toJS().map(function (err) {// Create annotation objects that ACE can use\n\t return { row: err.line - 1, column: 0, type: err.level, text: err.message };});_this3.state.editor.getSession().setAnnotations(editorAnnotations);}};this.setReadOnlyOptions = function (nextProps) {var state = _this3.state;if (nextProps.readOnly === true && state.editor) {state.editor.setOptions({ readOnly: true, highlightActiveLine: false, highlightGutterLine: false });} else if (state.editor) {state.editor.setOptions({ readOnly: false, highlightActiveLine: true, highlightGutterLine: true });}};this.updateMarkerAnnotations = function (nextProps) {var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},force = _ref2.force;var state = _this3.state;var onMarkerLineUpdate = nextProps.onMarkerLineUpdate;var size = function size(obj) {return Object.keys(obj).length;}; // FIXME: this is a hacky solution.\n\t // we should find a way to wait until the spec has been loaded into ACE.\n\t if (force === true || _this3.props.specId !== nextProps.specId || size(_this3.props.markers) !== size(nextProps.markers)) {setTimeout(_markerPlacer.placeMarkerDecorations.bind(null, { editor: state.editor, markers: nextProps.markers, onMarkerLineUpdate: onMarkerLineUpdate }), 300);}};this.yaml = this.yaml || \"\";};Editor.propTypes = { specId: _react.PropTypes.string, value: _react.PropTypes.string, onChange: _react.PropTypes.func,\n\t onMarkerLineUpdate: _react.PropTypes.func,\n\n\t readOnly: _react.PropTypes.bool,\n\n\t markers: _react.PropTypes.object,\n\t goToLine: _react.PropTypes.object,\n\t specObject: _react.PropTypes.object.isRequired,\n\n\t AST: _react.PropTypes.object.isRequired,\n\n\t errors: _reactImmutableProptypes2.default.list };\n\n\n\t Editor.defaultProps = {\n\t value: \"\",\n\t specId: \"--unknown--\",\n\t onChange: NOOP,\n\t onMarkerLineUpdate: NOOP,\n\t markers: {},\n\t readOnly: false,\n\t goToLine: {},\n\t errors: (0, _immutable.fromJS)([]) };\n\n\n\t return Editor;\n\t}", "function PBSceneAnimationEditor() {\n this.initialize.apply(this, arguments);\n}", "ready() {\n this.plugin = new window.Vue({\n el: this.shadowRoot,\n created() {\n },\n data: {msg: \"\"},\n methods: {\n onBtnClick() {\n const FS_Extra = Editor.require(\"packages://hello-world/node_modules/fs-extra\");\n let dir = Path.join(Editor.projectInfo.path, \"tmpDir\");\n FS_Extra.mkdirSync(dir);\n\n // Editor.Ipc.sendToMain('hello-world:clicked');\n },\n layout() {\n if (Editor.isMainProcess) {\n Editor.Window.main.resetLayout(\"packages://hello-world/layout.json\");\n\n } else {\n Editor.remote.Window.main.resetLayout(\"packages://hello-world/layout.json\");\n }\n },\n sceneWalker() {\n Editor.Scene.callSceneScript('hello-world', 'get-canvas-children', function (err, length) {\n console.log(`get-canvas-children callback : length - ${length}`);\n });\n }\n }\n });\n\n\n }", "function loadEditor() {\n var transaction = db.transaction([\"notes\"]);\n var objectStore = transaction.objectStore(\"notes\");\n var request = objectStore.get(\"settings\");\n request.onsuccess = function(event) {\n var toolbarOptions = [[{ 'header': [1, 2, 3, false] }]];\n if(request.result.tool_bar_standard_text_options) {\n toolbarOptions.push(['bold', 'italic', 'underline', 'strike']);\n }\n if(request.result.tool_bar_quotes) {\n toolbarOptions.push(['blockquote']);\n }\n if(request.result.tool_bar_code_box) {\n toolbarOptions.push(['code-block']);\n }\n if(request.result.tool_bar_list_bullets) {\n toolbarOptions.push([{ 'list': 'ordered'}, { 'list': 'bullet' }]);\n }\n if(request.result.tool_bar_super_sub) {\n toolbarOptions.push([{ 'script': 'sub'}, { 'script': 'super' }]);\n }\n if(request.result.tool_bar_images) {\n toolbarOptions.push(['image']);\n }\n if(request.result.tool_bar_link) {\n toolbarOptions.push(['link']);\n }\n if(request.result.tool_bar_clear_format) {\n toolbarOptions.push(['clean']);\n }\n toolbarOptions.push(['undo']);\n toolbarOptions.push(['redo']);\n toolbarOptions.push(['save']);\n toolbarOptions.push(['expand']);\n\n quill = new Quill('#editor-container', {\n modules: {\n imageResize: {\n modules: [ 'Resize', 'DisplaySize' ],\n displaySize: true,\n displayStyles: {\n backgroundColor: 'rgba(20, 143, 245,.5)',\n border: 'none',\n color: 'white'\n },\n handleStyles: {\n backgroundColor: 'black',\n border: 'none',\n color: \"white\"\n }\n },\n imageDrop: true,\n syntax: true,\n toolbar: toolbarOptions,\n history: {\n delay: 2000,\n maxStack: 500,\n userOnly: true\n },\n },\n placeholder: 'Compose an epic...',\n theme: 'snow' // or 'bubble'\n });\n\n // Creates the custom buttons\n var toolbar = quill.getModule('toolbar');\n toolbar.addHandler('expand', function() {\n console.log('expand')\n }\n );\n\n var toolbar = quill.getModule('toolbar');\n toolbar.addHandler('expand', function() {\n console.log('undo')\n }\n );\n\n var toolbar = quill.getModule('toolbar');\n toolbar.addHandler('save', function() {\n console.log('save')\n }\n );\n\n var toolbar = quill.getModule('toolbar');\n toolbar.addHandler('redo', function() {\n console.log('redo')\n }\n );\n\n var customButton = document.querySelector('.ql-expand');\n customButton.addEventListener('click', function() {\n expand();\n }\n );\n\n var customButton = document.querySelector('.ql-undo');\n customButton.addEventListener('click', function() {\n quill.history.undo();\n }\n );\n\n var customButton = document.querySelector('.ql-redo');\n customButton.addEventListener('click', function() {\n quill.history.redo();\n }\n );\n\n var customButton = document.querySelector('.ql-save');\n customButton.addEventListener('click', function() {\n updateNote();\n }\n );\n\n\n };\n}", "function EditorView() {\n var _this29 = this;\n\n var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n _classCallCheck(this, EditorView);\n\n this.plugins = [];\n this.editorAttrs = {};\n this.contentAttrs = {};\n this.bidiCache = []; /// @internal\n\n this.updateState = 2\n /* Updating */\n ; /// @internal\n\n this.measureScheduled = -1; /// @internal\n\n this.measureRequests = [];\n this.contentDOM = document.createElement(\"div\");\n this.scrollDOM = document.createElement(\"div\");\n this.scrollDOM.tabIndex = -1;\n this.scrollDOM.className = \"cm-scroller\";\n this.scrollDOM.appendChild(this.contentDOM);\n this.announceDOM = document.createElement(\"div\");\n this.announceDOM.style.cssText = \"position: absolute; top: -10000px\";\n this.announceDOM.setAttribute(\"aria-live\", \"polite\");\n this.dom = document.createElement(\"div\");\n this.dom.appendChild(this.announceDOM);\n this.dom.appendChild(this.scrollDOM);\n\n this._dispatch = config.dispatch || function (tr) {\n return _this29.update([tr]);\n };\n\n this.dispatch = this.dispatch.bind(this);\n this.root = config.root || document;\n this.viewState = new ViewState(config.state || _state.EditorState.create());\n this.plugins = this.state.facet(viewPlugin).map(function (spec) {\n return new PluginInstance(spec).update(_this29);\n });\n this.observer = new DOMObserver(this, function (from, to, typeOver) {\n applyDOMChange(_this29, from, to, typeOver);\n }, function (event) {\n _this29.inputState.runScrollHandlers(_this29, event);\n\n _this29.measure();\n });\n this.inputState = new InputState(this);\n this.docView = new DocView(this);\n this.mountStyles();\n this.updateAttrs();\n this.updateState = 0\n /* Idle */\n ;\n ensureGlobalHandler();\n this.requestMeasure();\n if (config.parent) config.parent.appendChild(this.dom);\n } /// The current editor state.", "function _onEditorConnect(editor) {\n\t\tconsole.log(\"Editor connected\");\n\n\t\t// Called when a potential old editor was disconnected (i.e. multiple instances of Brackets are not supported)\n\t\tvar next = function () {\n\t\t\t_setupEditor(editor);\n\t\t\t_connectDebugger();\n\t\t};\n\n\t\tif (_editor) {\n\t\t\t// Cleanup\n\t\t\tconsole.log(\"Disconnecting previous editor\");\n\t\t\t_editor.on(\"disconnect\", next);\n\t\t\t_editor.disconnect();\n\t\t} else {\n\t\t\tnext();\n\t\t}\n\t}", "_setEditorContentOnFormSubmit() {\n document.querySelector('#submit').addEventListener('click', () => {\n let ckeditorContent = this.editor.getData();\n $(\"textarea#entry_content\").val(ckeditorContent);\n\n return true;\n });\n }", "onShow() {\n const dialog = this;\n\n // set code and output\n // getModel is not supported on older versions\n // const widget = dialog.getModel(editor);\n const widget = window.ckeditorBinderPlugin.currentWidget;\n const preTag = widget.element.findOne('pre');\n let code = '';\n if (preTag) {\n code = preTag.getHtml();\n\n // set noCode to true\n if (preTag.hasClass('no-code')) dialog.setValueOf('tab-basic', 'no-code', true);\n }\n\n const outputTag = widget.element.findOne('div[data-output]');\n let output = '';\n if (outputTag) {\n output = outputTag.getHtml();\n } else {\n // set noOutput to be checked\n dialog.setValueOf('tab-basic', 'no-output', true);\n }\n\n const language = getLanguage(editor);\n dialog.setValueOf('tab-basic', 'language', language);\n\n const cm = getCodeMirror();\n if (cm) cm.setValue(code.trim());\n const thebelabOutputArea = document.querySelector('.cke_dialog_contents .jp-OutputArea-output');\n if (thebelabOutputArea) thebelabOutputArea.innerHTML = output;\n\n this.resize(500, 500);\n }", "function initEditor() {\n\t\t//first thing to do is set up loading page until we can establish a connection\n\t\tdrawLoadScreen();\n\t\tgetToken();\n\t}", "constructor(spec) {\n\t\tsuper(spec);\n\t\tvar make = this.make;\n\t\tthis.factory = factory;\n\t\tthis.Object_KVP = Object_KVP_Editor;\n\n\t\t//this._super(spec);\n\n\t\tthis.add_class('object-editor');\n\t\tthis.__type_name = 'object_editor';\n\n\t}", "function __getInst( api ) {\n\tvar ctx = api.context[0];\n\treturn ctx.oInit.editor || ctx._editor;\n}", "clearActiveEditor() {\n this.activeEditor = void 0;\n }", "constructor(props) {\n super(props);\n this.state = { editorHtml: \"\", theme: \"snow\", header: \"\", updating: false };\n this.handleChange = this.handleChange.bind(this);\n }", "createCommandManager() {\n this.commandManager = new CommandManager({\n editor: this\n });\n }", "function tell_editor(editor)\n {\n var transobj = {funname:\"setEditorobjForInivitation_forRemoteWebpage\", param:null}; \t \n $(editor).attr(\"fnRemoteHtmlReq-event-param\", JSON.stringify(transobj)); \n //$(editor).trigger(\"fnRemoteHtmlReq-event\") // is it work\n var event = document.createEvent(\"HTMLEvents\"); \n event.initEvent(\"fnRemoteHtmlReq-event\", true, false); \n editor.dispatchEvent(event);\n }", "function ckeditor(name, config, toolbar){\n\n\tconfig = {};\n\tconfig.entities_latin = false;\n\tconfig.filebrowserBrowseUrl ='/giadungvanphong/public/editor/ckfinder/ckfinder.html';\n\tconfig.filebrowserImageBrowseUrl = '/giadungvanphong/public/editor/ckfinder/ckfinder.html';\n\tconfig.extraPlugins = 'youtube';\n\n\tif(toolbar == 'standard'){\n\t\tconfig.toolbarGroups = [\n\t\t{ name: 'document', groups: [ 'mode', 'document', 'doctools' ] },\n\t\t{ name: 'clipboard', groups: [ 'clipboard', 'undo' ] },\n\t\t{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },\n\t\t{ name: 'editing', groups: [ 'find', 'selection', 'spellchecker', 'editing' ] },\n\t\t{ name: 'forms', groups: [ 'forms' ] },\n\t\t{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi', 'paragraph' ] },\n\t\t{ name: 'links', groups: [ 'links' ] },\n\t\t'/',\n\t\t{ name: 'insert', groups: [ 'insert' ] },\n\t\t{ name: 'styles', groups: [ 'styles' ] },\n\t\t{ name: 'colors', groups: [ 'colors' ] },\n\t\t'/',\n\t\t{ name: 'tools', groups: [ 'tools' ] },\n\t\t{ name: 'others', groups: [ 'others' ] },\n\t\t{ name: 'about', groups: [ 'about' ] }\n\t];\n\n\tconfig.removeButtons = 'Save,NewPage,Print,Templates,Cut,Copy,Paste,PasteText,PasteFromWord,Find,Replace,Scayt,Subscript,Superscript,CopyFormatting,RemoveFormat,Outdent,Indent,CreateDiv,BidiLtr,BidiRtl,Language,Anchor,Unlink,Maximize,ShowBlocks,About';\n\t}if(toolbar =='basic'){\n\t\tconfig.toolbarGroups = [\n\t\t\t{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },\n\t\t\t{ name: 'clipboard', groups: [ 'clipboard', 'undo' ] },\n\t\t\t{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi', 'paragraph' ] },\n\t\t\t{ name: 'links', groups: [ 'links' ] },\n\t\t\t{ name: 'styles', groups: [ 'styles' ] },\n\t\t\t{ name: 'document', groups: [ 'mode', 'document', 'doctools' ] },\n\t\t\t{ name: 'editing', groups: [ 'find', 'selection', 'spellchecker', 'editing' ] },\n\t\t\t{ name: 'forms', groups: [ 'forms' ] },\n\t\t\t'/',\n\t\t\t{ name: 'insert', groups: [ 'insert' ] },\n\t\t\t'/',\n\t\t\t{ name: 'colors', groups: [ 'colors' ] },\n\t\t\t{ name: 'tools', groups: [ 'tools' ] },\n\t\t\t{ name: 'others', groups: [ 'others' ] },\n\t\t\t{ name: 'about', groups: [ 'about' ] }\n\t\t];\n\n\t\tconfig.removeButtons = 'Source,Save,NewPage,Preview,Print,Templates,Cut,Copy,Paste,PasteText,Find,Replace,SelectAll,Scayt,Form,Radio,TextField,Textarea,Select,Button,ImageButton,HiddenField,Strike,Subscript,Superscript,CopyFormatting,RemoveFormat,BulletedList,NumberedList,Outdent,Blockquote,Indent,CreateDiv,JustifyRight,BidiLtr,BidiRtl,Language,Unlink,Anchor,Flash,Image,Table,Smiley,SpecialChar,PageBreak,Iframe,TextColor,BGColor,ShowBlocks,About,Maximize,PasteFromWord,Checkbox,HorizontalRule';\n\n\n\t}if(toolbar == 'full'){\n\t\tconfig.toolbarGroups = [\n\t\t\t{ name: 'document', groups: [ 'mode', 'document', 'doctools' ] },\n\t\t\t{ name: 'clipboard', groups: [ 'clipboard', 'undo' ] },\n\t\t\t{ name: 'editing', groups: [ 'find', 'selection', 'spellchecker', 'editing' ] },\n\t\t\t{ name: 'forms', groups: [ 'forms' ] },\n\t\t\t'/',\n\t\t\t{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },\n\t\t\t{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi', 'paragraph' ] },\n\t\t\t{ name: 'links', groups: [ 'links' ] },\n\t\t\t{ name: 'insert', groups: [ 'insert' ] },\n\t\t\t'/',\n\t\t\t{ name: 'styles', groups: [ 'styles' ] },\n\t\t\t{ name: 'colors', groups: [ 'colors' ] },\n\t\t\t{ name: 'tools', groups: [ 'tools' ] },\n\t\t\t{ name: 'others', groups: [ 'others' ] },\n\t\t\t{ name: 'about', groups: [ 'about' ] }\n\t\t];\n\t}\n\n\treturn CKEDITOR.replace(name, config, toolbar);\n}", "init(config = {}) {\n const els = config.container;\n if (!els) throw new Error(\"'container' is required\");\n config = { ...defaultConfig, ...config, grapesjs: this };\n config.el = isElement(els) ? els : document.querySelector(els);\n const editor = new Editor(config).init();\n\n // Load plugins\n config.plugins.forEach(pluginId => {\n let plugin = plugins.get(pluginId);\n const plgOptions = config.pluginsOpts[pluginId] || {};\n\n // Try to search in global context\n if (!plugin) {\n const wplg = window[pluginId];\n plugin = wplg && wplg.default ? wplg.default : wplg;\n }\n\n if (plugin) {\n plugin(editor, plgOptions);\n } else if (isFunction(pluginId)) {\n pluginId(editor, plgOptions);\n } else {\n console.warn(`Plugin ${pluginId} not found`);\n }\n });\n\n editor.getModel().loadOnStart();\n config.autorender && editor.render();\n editors.push(editor);\n\n return editor;\n }", "function init() {\n\n\t\t// Bind the editor elements to variables\n\t\tbindElements();\n\n\t\t// Create event listeners for keyup, mouseup, etc.\n\t\tcreateEventBindings();\n\t}", "function ckeditor(name, config, toolbar){\n\n\tconfig = {};\n\tconfig.entities_latin = false;\n\tconfig.filebrowserBrowseUrl ='/studyenglishtoday/public/editor/ckfinder/ckfinder.html';\n\tconfig.filebrowserImageBrowseUrl = '/studyenglishtoday/public/editor/ckfinder/ckfinder.html';\n\tconfig.extraPlugins = 'youtube';\n\n\n\tif(toolbar == 'standard'){\n\t\tconfig.toolbarGroups = [\n\t\t{ name: 'document', groups: [ 'mode', 'document', 'doctools' ] },\n\t\t{ name: 'clipboard', groups: [ 'clipboard', 'undo' ] },\n\t\t{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },\n\t\t{ name: 'editing', groups: [ 'find', 'selection', 'spellchecker', 'editing' ] },\n\t\t{ name: 'forms', groups: [ 'forms' ] },\n\t\t{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi', 'paragraph' ] },\n\t\t{ name: 'links', groups: [ 'links' ] },\n\t\t'/',\n\t\t{ name: 'insert', groups: [ 'insert' ] },\n\t\t{ name: 'styles', groups: [ 'styles' ] },\n\t\t{ name: 'colors', groups: [ 'colors' ] },\n\t\t'/',\n\t\t{ name: 'tools', groups: [ 'tools' ] },\n\t\t{ name: 'others', groups: [ 'others' ] },\n\t\t{ name: 'about', groups: [ 'about' ] }\n\t];\n\n\tconfig.removeButtons = 'Save,NewPage,Print,Templates,Cut,Copy,Paste,PasteText,PasteFromWord,Find,Replace,Scayt,Subscript,Superscript,CopyFormatting,RemoveFormat,Outdent,Indent,CreateDiv,BidiLtr,BidiRtl,Language,Anchor,Unlink,Maximize,ShowBlocks,About';\n\t}if(toolbar =='basic'){\n\t\tconfig.toolbarGroups = [\n\t\t\t{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },\n\t\t\t{ name: 'clipboard', groups: [ 'clipboard', 'undo' ] },\n\t\t\t{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi', 'paragraph' ] },\n\t\t\t{ name: 'links', groups: [ 'links' ] },\n\t\t\t{ name: 'styles', groups: [ 'styles' ] },\n\t\t\t{ name: 'document', groups: [ 'mode', 'document', 'doctools' ] },\n\t\t\t{ name: 'editing', groups: [ 'find', 'selection', 'spellchecker', 'editing' ] },\n\t\t\t{ name: 'forms', groups: [ 'forms' ] },\n\t\t\t'/',\n\t\t\t{ name: 'insert', groups: [ 'insert' ] },\n\t\t\t'/',\n\t\t\t{ name: 'colors', groups: [ 'colors' ] },\n\t\t\t{ name: 'tools', groups: [ 'tools' ] },\n\t\t\t{ name: 'others', groups: [ 'others' ] },\n\t\t\t{ name: 'about', groups: [ 'about' ] }\n\t\t];\n\n\t\tconfig.removeButtons = 'Source,Save,NewPage,Preview,Print,Templates,Cut,Copy,Paste,PasteText,Find,Replace,SelectAll,Scayt,Form,Radio,TextField,Textarea,Select,Button,ImageButton,HiddenField,Strike,Subscript,Superscript,CopyFormatting,RemoveFormat,BulletedList,NumberedList,Outdent,Blockquote,Indent,CreateDiv,JustifyRight,BidiLtr,BidiRtl,Language,Unlink,Anchor,Flash,Image,Table,Smiley,SpecialChar,PageBreak,Iframe,TextColor,BGColor,ShowBlocks,About,Maximize,PasteFromWord,Checkbox,HorizontalRule';\n\n\n\t}if(toolbar == 'full'){\n\t\tconfig.toolbarGroups = [\n\t\t\t{ name: 'document', groups: [ 'mode', 'document', 'doctools' ] },\n\t\t\t{ name: 'clipboard', groups: [ 'clipboard', 'undo' ] },\n\t\t\t{ name: 'editing', groups: [ 'find', 'selection', 'spellchecker', 'editing' ] },\n\t\t\t{ name: 'forms', groups: [ 'forms' ] },\n\t\t\t'/',\n\t\t\t{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },\n\t\t\t{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi', 'paragraph' ] },\n\t\t\t{ name: 'links', groups: [ 'links' ] },\n\t\t\t{ name: 'insert', groups: [ 'insert' ] },\n\t\t\t'/',\n\t\t\t{ name: 'styles', groups: [ 'styles' ] },\n\t\t\t{ name: 'colors', groups: [ 'colors' ] },\n\t\t\t{ name: 'tools', groups: [ 'tools' ] },\n\t\t\t{ name: 'others', groups: [ 'others' ] },\n\t\t\t{ name: 'about', groups: [ 'about' ] }\n\t\t];\n\t}\n\n\treturn CKEDITOR.replace(name, config, toolbar);\n}", "loadEditors() {\r\n\r\n // Loading content for HTML editor\r\n this.editorHTML = ace.edit('editorHTML')\r\n this.editorHTML.setTheme('ace/theme/sqlserver')\r\n this.editorHTML.session.setMode('ace/mode/html')\r\n let htmlDoc = '<!DOCTYPE html>\\n<html>\\n<head>\\n\\t<meta charset=\"UTF-8\">\\n\\t<title>LWE</title>\\n</head>\\n<body>\\n\\t<div id=\"welcome\">\\n\\t\\t<h1 id=\"title\">Welcome to Live Web Editor</h1>\\n\\t\\t<p>Execute HTML, CSS and JavaScript code in real time quickly and easily</p>\\n\\t\\t<p>Wherever you want, whenever you want</p>\\n\\t</div>\\n</body>\\n</html>'\r\n this.editorHTML.insert(htmlDoc)\r\n this.editorHTML.gotoLine(11,53)\r\n this.editorHTML.setShowPrintMargin(false)\r\n\r\n // Loading content for CSS editor\r\n this.editorCSS = ace.edit('editorCSS')\r\n this.editorCSS.setTheme('ace/theme/sqlserver')\r\n this.editorCSS.session.setMode('ace/mode/css')\r\n let cssDoc = '* {\\n\\tmargin: 0;\\n\\tpadding: 0;\\n}\\n\\n#welcome {\\n\\tfont-family: \"Segoe UI\";\\n\\ttext-align: center;\\n\\tmargin-top: 15%;\\n}\\n\\n#welcome h1 {\\n\\tcolor: #87CEEB;\\n}\\n\\n#welcome p {\\n\\tcolor: #009DA3;\\n}'\r\n this.editorCSS.insert(cssDoc)\r\n this.editorCSS.gotoLine(17,16)\r\n this.editorCSS.setShowPrintMargin(false)\r\n\r\n // Loading content for JS editor\r\n this.editorJS = ace.edit('editorJS')\r\n this.editorJS.setTheme('ace/theme/sqlserver')\r\n this.editorJS.session.setMode('ace/mode/javascript')\r\n let jsDoc = '// Your code here...'\r\n this.editorJS.insert(jsDoc)\r\n this.editorJS.gotoLine(1, 20)\r\n this.editorJS.setShowPrintMargin(false)\r\n \r\n }", "get editor() {\n let editor = this.data.editor;\n\n if (editor && !(editor instanceof Widget)) {\n if (typeof editor === 'string') {\n editor = {\n type: editor\n };\n }\n editor = this.data.editor = WidgetHelper.createWidget(Object.assign(this.defaultEditor, editor));\n }\n return editor;\n }", "get OSXEditor() {}", "constructor () {\n this.emitter = new Emitter()\n this.description = null\n this.docsVer = 'master'\n this.release = null\n // if false latest satisfied version should be used\n this.hasDocs = null\n this.setVersion(atom.config.get('atom-aframe.project.defaultAframeVersion'))\n }", "get editorDomElement() {\n return this._$input;\n }", "get editorDomElement() {\n return this._$input;\n }", "get editorDomElement() {\n return this._$input;\n }", "get editorDomElement() {\n return this._$input;\n }", "get editorDomElement() {\n return this._$input;\n }", "get editorDomElement() {\n return this._$input;\n }", "function TextEditor() {}", "function ckeInitEvents(editor) {\n\t\n\teditor.on('blur', ckeBlurEvent);\n\teditor.on('focus', ckeFocusEvent);\n\teditor.on('change', ckeBlurEvent);\n\teditor.on('resize', ckeResizeEvent);\n\teditor.on('fileUploadRequest', ckeUploadEvent, null, null, 4); \n\n\tvar $textarea = $(editor.element.$);\n\tvar $inputfield = $textarea.closest('.Inputfield.InputfieldColumnWidth');\n\t\n\tif($inputfield.length) setTimeout(function() {\n\t\t$inputfield.trigger('heightChanged');\n\t}, 1000);\n}", "get editorTextField() {\n return this.i.js;\n }", "createMonacoEditor() {\n\t\t// Add additonal d.ts files to the JavaScript language service and change.\n\t\t// Also change the default compilation options.\n\t\t// The sample below shows how a class Facts is declared and introduced\n\t\t// to the system and how the compiler is told to use ES6 (target=2).\n\n\t\t// validation settings\n\t\tmonaco.languages.typescript.javascriptDefaults.setDiagnosticsOptions({\n\t\t\tnoSemanticValidation: true,\n\t\t\tnoSyntaxValidation: false\n\t\t});\n\n\t\t// compiler options\n\t\tmonaco.languages.typescript.javascriptDefaults.setCompilerOptions({\n\t\t\ttarget: monaco.languages.typescript.ScriptTarget.ES6,\n\t\t\t//module: monaco.languages.typescript.ModuleKind.None,\n\t\t\tallowNonTsExtensions: true,\n\t\t\tallowJs: true,\n\t\t});\n\n\t\t// extra libraries\n\t\taddLib('/lib/template.js')\n\t\taddLib('/lib/TagSet.js')\n\t\taddLib('/templates/draw/Circle.js')\n\n\t\tthis.monacoEditor = monaco.editor.create(this.dom, {\n\t\t\tvalue: '',\n\t\t\tlanguage: \"javascript\"\n\t\t})\n\n\n\t}", "static get tag(){return\"rich-text-editor-picker\"}", "constructor(config = {}) {\n this.plugins = [];\n this.pluginMap = new Map;\n this.editorAttrs = {};\n this.contentAttrs = {};\n this.bidiCache = [];\n this.destroyed = false;\n /**\n @internal\n */\n this.updateState = 2 /* Updating */;\n /**\n @internal\n */\n this.measureScheduled = -1;\n /**\n @internal\n */\n this.measureRequests = [];\n this.contentDOM = document.createElement(\"div\");\n this.scrollDOM = document.createElement(\"div\");\n this.scrollDOM.tabIndex = -1;\n this.scrollDOM.className = \"cm-scroller\";\n this.scrollDOM.appendChild(this.contentDOM);\n this.announceDOM = document.createElement(\"div\");\n this.announceDOM.style.cssText = \"position: fixed; top: -10000px\";\n this.announceDOM.setAttribute(\"aria-live\", \"polite\");\n this.dom = document.createElement(\"div\");\n this.dom.appendChild(this.announceDOM);\n this.dom.appendChild(this.scrollDOM);\n this._dispatch = config.dispatch || ((tr) => this.update([tr]));\n this.dispatch = this.dispatch.bind(this);\n this._root = (config.root || getRoot(config.parent) || document);\n this.viewState = new ViewState(config.state || state.EditorState.create(config));\n this.plugins = this.state.facet(viewPlugin).map(spec => new PluginInstance(spec));\n for (let plugin of this.plugins)\n plugin.update(this);\n this.observer = new DOMObserver(this);\n this.inputState = new InputState(this);\n this.inputState.ensureHandlers(this, this.plugins);\n this.docView = new DocView(this);\n this.mountStyles();\n this.updateAttrs();\n this.updateState = 0 /* Idle */;\n this.requestMeasure();\n if (config.parent)\n config.parent.appendChild(this.dom);\n }", "get WindowsEditor() {}", "function initializePipelineEditor() {\n pipelineGraphEditor = new GraphEditor($('#pipelineDesigner'),\n createStep,\n handleElementRemove,\n null,\n null,\n function(metaData) {\n // Open the drawer\n loadPropertiesPanel(metaData);\n $('#step-editor-drawer').drawer('show');\n });\n\n // Pipeline Designer\n $('#save-button').click(handleSave);\n $('#new-button').click(handleNew);\n $('#copy-button').click(handleCopy);\n $('#reset-button').click(handleReset);\n $('#delete-button').click(handleDelete);\n $('#layout-pipeline-button').click(function() {\n pipelineGraphEditor.performAutoLayout();\n });\n}", "constructChangeListeners() {\n // TODO it would be best to remove the event listeners after they are fired\n // and then re-instantiate them after a new recipe loads\n\n // Listener for the editor itself\n this.qEditor.on('text-change', () => {\n this.edited = true\n })\n\n // Listener for the tagInput add and remove events\n // FIXME it does not appear that the .offs are working for these\n this.tagInput.on('add', () => {\n this.edited = true\n })\n\n this.tagInput.on('remove', () => {\n this.edited = true\n })\n\n // Listener for title change\n const titleDOM = document.getElementById('title')\n titleDOM.addEventListener('input', () => {this.edited=true})\n\n // Listener for make-soon button\n const makeSoon = document.getElementById('make-soon-box')\n makeSoon.addEventListener('change', (evt) => {\n const checked = evt.srcElement.checked\n this.edited = true\n if(checked) {\n this.makeSoon = true\n } else {\n this.makeSoon = false\n }\n })\n\n // Listener for Tried 'n' True button\n const tried = document.getElementById('tried-box')\n tried.addEventListener('change', (evt) => {\n const checked = evt.srcElement.checked\n this.edited = true\n if(checked) {\n this.triedNTrue = true\n } else {\n this.triedNTrue = false\n }\n })\n }" ]
[ "0.6608435", "0.6500894", "0.6500894", "0.6482283", "0.6478601", "0.644191", "0.640877", "0.63965636", "0.63863283", "0.63609236", "0.63380015", "0.63380015", "0.6288506", "0.62826324", "0.6277275", "0.6276858", "0.6276858", "0.62755585", "0.6264909", "0.6264909", "0.6262657", "0.62541723", "0.6222174", "0.6208687", "0.61778635", "0.61778635", "0.6137323", "0.61302775", "0.61012113", "0.60968304", "0.6093132", "0.6092181", "0.60428995", "0.6019292", "0.6002127", "0.5988207", "0.5986538", "0.5984269", "0.59838504", "0.59642094", "0.59523416", "0.59166086", "0.5913013", "0.5908266", "0.5873437", "0.58654785", "0.5853639", "0.5848995", "0.5823206", "0.5819576", "0.580552", "0.57760817", "0.5772445", "0.57709515", "0.5763128", "0.5762029", "0.5762029", "0.5749824", "0.574868", "0.5746134", "0.5743786", "0.5737916", "0.5730483", "0.5725858", "0.5714947", "0.57145995", "0.57115555", "0.57067066", "0.5696298", "0.5679858", "0.56770283", "0.56576383", "0.5655092", "0.56495464", "0.5625439", "0.56175876", "0.5605388", "0.5598139", "0.55934787", "0.55906266", "0.5587322", "0.55834097", "0.55723536", "0.55714947", "0.5552048", "0.5550242", "0.55498004", "0.55498004", "0.55498004", "0.55498004", "0.55498004", "0.55498004", "0.55413187", "0.55405897", "0.5540125", "0.55313045", "0.5513691", "0.5509742", "0.54897666", "0.54817307", "0.5479022" ]
0.0
-1
Helper method for defining associations. This method is not a part of Sequelize lifecycle. The `models/index` file will call this method automatically.
static associate(models) { // define association here this,this.belongsTo(models.users,{ foreignKey:"user_id" }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static associate(models) {\n // define association here\n // This is how Sequelize knows to create \"magic methods\"\n // These are functions that can automatically pull\n // related data.\n // For example: If I have a User object\n // I can call `await user.getContacts()` to get an\n // Array of this user's Contacts.\n Contact.belongsTo(models.User, {\n foreignKey: 'user_id'\n });\n Contact.belongsTo(models.User, {\n foreignKey: 'contact_id'\n });\n }", "static associate(models) {\n // define association here\n // this.hasMany(models.StepIngredient);\n this.belongsTo(models.Recipe);\n }", "static associate(models) {\n // define association here\n Ronda.hasMany(models.Partida,{foreignKey:'IdRonda',as:'partidas'})\n Ronda.belongsTo(models.Torneo,{foreignKey:'IdTorneo',as:'torneos'})\n }", "static associate (models) {\n // define association here\n }", "static associate (models) {\n // define association here\n }", "static associate (models) {\n // define association here\n }", "static associate(models) {\n // define association here\n Nanny.belongsTo(models.Parent);\n Nanny.belongsTo(models.Agency);\n Nanny.belongsToMany(models.Child, { through: models.NannyChild });\n Nanny.belongsTo(models.Parent, {\n sourceKey: \"id\",\n foreignKey: \"ParentId\",\n });\n Nanny.belongsTo(models.Agency, {\n sourceKey: \"id\",\n foreignKey: \"AgencyId\",\n });\n }", "static associate(models) {\n Course.belongsTo(models.Category, {\n as: 'category',\n foreignKey: 'id_cat'\n });\n Course.belongsTo(models.User, {\n as: 'author',\n foreignKey: 'author_id'\n });\n Course.belongsToMany(models.User, {\n through: 'FollowedCourses',\n as: 'followers'\n });\n Course.hasMany(models.Article, {\n as: 'exercices',\n foreignKey: 'id_course'\n })\n // define association here\n }", "static associate(models) {\n // define association here\n this.belongsTo(models.deal);\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }" ]
[ "0.7641299", "0.75082797", "0.73139536", "0.73065066", "0.73065066", "0.73065066", "0.72952354", "0.72845256", "0.7278983", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315" ]
0.0
-1
TODO upload decrypted userInfo app.globalData.userData
uploadUserData() { console.log('upload userData...') }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get userData() {}", "getUserData() {\n return JSON.parse(localStorage.getItem(SIMPLEID_USER_SESSION));\n }", "async getUserData() { }", "static getUser() {\n return JSON.parse(localStorage.getItem('userInfo'));\n }", "function getUserData() {\n\n // Retrieve all keys and values from application storage, including public app config. Set the values for select, input and textarea elements on a page in a callback\n\n EcwidApp.getAppStorage(function (allValues) {\n setValuesForPage(allValues);\n checkTestModeValue(); // Check if test mode is \n });\n\n}", "function storeUserData () {\n\t\tvar key,\n\t\tstorageData = {};\n\n\t\t// Loop thru user object and encode each name/value.\n\t\tfor (key in user) {\n\t\t\tif (user.hasOwnProperty(key)) {\n\t\t\t\tstorageData[(encryption.encode(key))] = encryption.encode(user[key]);\n\t\t\t}\n\t\t}\n\n\t\tIBM.common.util.storage.setItem(storage.key, storageData, 3600 * 24 * (user.information_level === \"basic\" ? storage.expireDaysBasic : storage.expireDaysDetailed));\n\t}", "_parseAuthInfo(){\n if(this.authInfo){\n const authCode = this.authInfo.split(/\\s+/)[1]\n const authDecode = new Buffer(authCode, 'base64').toString()\n const creds = authDecode.split(':')\n this.login = creds[0]\n this.password = creds[1]\n this.user = User.find_by_login(this.login)\n }\n if(!this.user){\n this.login = 'guest'\n this.password = ''\n this.user = User.find_by_login('guest')\n }\n // TODO: maintain log of user and actions\n // console.info(`authenticated as ${this.user.name}`)\n }", "function user_account_data() {\n \temailAddress = \"\";\n \tpassword = \"\";\n \taccountId = \"\";\n \tjwt = \"\"; // JSON Web Token\n \t\n \tdeviceTemplates: [];\n \torganizations: [];\n devices: [];\n \tselectedDevice: null;\n \tselectedDeviceData: [];\n \tselectedChannel: null;\n \tselectedDeviceChannels: [];\n}", "[USERINFO](state, userInfo) {\n //save in state\n state.userInfo = userInfo \n logger('userinfo', 'save store succeed !')\n console.log(userInfo)\n //save in localStorage\n saveUserInfo(userInfo)\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 initf() {\n if ($window.sessionStorage[\"userInfo\"]) {\n $rootScope.userInfo = JSON.parse($window.sessionStorage[\"userInfo\"]);\n }\n }", "function readUserData() {\r\n\treturn fs.readFileSync(storagePath, \"utf8\");\r\n}", "function userGet(data) {\n data = data.split(\"Logged in user name: \").pop();\n data = data.substr(0, data.indexOf('\\n'));\n data = data.substr(0, data.indexOf('\\r'));\n console.log('Got username on startup')\n console.log(data)\n if(data !== undefined){\n encrypt(data);\n messaging(setup,'userSet', true, '')\n } else {\n messaging(setup,'userSet', false, '')\n }\n return\n}", "auth_user_data(state, user){\n state.auth_user = user\n }", "function genUserInfo (userInfo, dbUser, grps, token) {\n\tlet newPayload = {};\n\tlet userData = {};\n\tuserData['name'] = dbUser['userName'];\n userData['nickName'] = dbUser['nickName'];\n userData['gender'] = dbUser['gender'];\n userData['pic'] = dbUser['pic'];\n\tuserData['email'] = dbUser['email'];\n\tuserData['cp'] = userInfo['cp'];\n newPayload['userInfo'] = userData;\n newPayload['services'] = grps;\n newPayload['role'] = dbUser['roleName'];\n newPayload['authToken'] = token;\n newPayload['responseCode'] = '000';\n\tnewPayload['responseMsg'] = 'login success';\n\treturn newPayload;\n}", "function currentUser (){\n return JSON.parse(window.sessionStorage.getItem(\"user_info\"));\n}", "static storeUserInfo(userInfo) {\n localStorage.setItem(this.KEY_USER_INFO, JSON.stringify(userInfo));\n }", "function getAuthInfo(){\n const token = localStorage.getItem('authToken');\n if (token) {\n const base64Url = token.split('.')[1];\n const base64 = base64Url.replace('-', '+').replace('_', '/');\n const obj = JSON.parse(window.atob(base64));\n return obj.user; \n }\n}", "function saveUserData() {\n var saveData = readValuesFromPage();\n\n EcwidApp.setAppStorage(saveData.private, function (savedData) {\n console.log('Private preferences saved!');\n });\n\n EcwidApp.setAppPublicConfig(saveData.public, function (savedData) {\n console.log('Public preferences saved!');\n })\n}", "UPDATE_USER_INFO(state, payload) {\n\t\t// Get Data localStorage\n\t\tlet userInfo = JSON.parse(localStorage.getItem('userInfo')) || state.AppActiveUser;\n\n\t\tfor (const property of Object.keys(payload)) {\n\t\t\tif (payload[property] != null) {\n\t\t\t\t// If some of user property is null - user default property defined in state.AppActiveUser\n\t\t\t\tstate.AppActiveUser[property] = payload[property];\n\n\t\t\t\t// Update key in localStorage\n\t\t\t\tuserInfo[property] = payload[property];\n\t\t\t}\n\t\t}\n\t\t// Store data in localStorage\n\t\tlocalStorage.setItem('userInfo', JSON.stringify(userInfo));\n\t}", "function getUserPreferences() {\r\n\treturn JSON.parse(readUserData());\r\n}", "function getUserData() {\n\n return currUserData;\n }", "get userInfo() {\n\t\treturn this.koa.userInfo;\n\t}", "function getUserData() {\n let storageResponse = localStorage.getItem(\"userData\");\n let userData = JSON.parse(storageResponse);\n return userData;\n }", "getUserData() {\n return this.userData;\n }", "async getUserInfo(ctx) {\r\n const { name } = ctx.state.user;\r\n ctx.body = { name };\r\n }", "async setUserData(key, platform) {\n await AsyncStorage.setItem('USER_KEY', key[0].toString());\n await AsyncStorage.setItem('Platform_KEY', platform);\n await AsyncStorage.setItem('Token_KEY', key[2]);\n }", "static saveUserInfo(userData) {\n localStorage.setItem('uid', userData.uid);\n localStorage.setItem('name', userData.name);\n }", "authUser (state, userData) {\n \t\tstate.idToken = userData.token\n \t\tstate.userId = userData.userId\n \t}", "async fetchUserInfo() {\n await context.store.dispatch(\"platform2/on_get_userinfo\");\n return context.store.state.platform2.storage.userinfo;\n }", "function saveUserData() {\n localStorage.setItem('locallyStored', JSON.stringify(userData))\n}", "UPDATE_USER_INFO (state, payload) {\n const userInfo = {\n token : payload.access_token,\n expiry : (new Date()).getTime() + payload.expires_in,\n user : payload.user\n }\n // Store data in localStorage\n localStorage.setItem('userInfo', JSON.stringify(userInfo))\n\n }", "function getUserData(key) {\n return userData[key];\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}", "function LoadUserInfo()\r\n{\r\n\tuser_name=globalStorage['ytfm.ashishdubey.info'].getItem(\"user\");\t\r\n\tsession_key=globalStorage['ytfm.ashishdubey.info'].getItem(\"key\");\r\n\tif(user_name=='') disp_text=\"[None]\";\r\n\telse disp_text=user_name;\r\n\tdocument.getElementById(\"ytfm-userlabel\").setAttribute(\"value\",disp_text);\r\n}", "AUTH_USER (state, userData) {\n state.idToken = userData.token\n state.userId = userData.userId\n }", "function processAuth() {\n\n // let the authProvider access the access token\n authToken = localStorage.token;\n\n if (localStorage.getItem('user') === null) {\n\n // Get the profile of the current user.\n GraphHelper.me().then(function (user) {\n\n // Save the user to localStorage.\n localStorage.setItem('user', angular.toJson(user));\n\n vm.displayName = user.displayName;\n vm.emailAddress = user.mail || user.userPrincipalName;\n });\n } else {\n let user = angular.fromJson(localStorage.user);\n\n vm.displayName = user.displayName;\n vm.emailAddress = user.mail || user.userPrincipalName;\n }\n\n }", "function setUserInfo(userInfo) {\n\n wx.setStorage({\n key: 'userInfo',\n data: userInfo\n });\n wx.setStorage({\n key: 'nikename',\n data: userInfo.nikename\n });\n wx.setStorage({\n key: 'city',\n data: userInfo.city\n });\n wx.setStorage({\n key: 'country',\n data: userInfo.country\n });\n wx.setStorage({\n key: 'avatar_url',\n data: userInfo.avatarUrl\n });\n}", "function getLogginInfo() {\n const token = jsCookie.get(TOKEN_KEY);\n if (!token)\n return undefined;\n const user = jwtDecode(token);\n return user;\n}", "function getUserInfo() {\n return authClient.token.getUserInfo()\n .then(function(value) {\n userInfo = value;\n renderApp();\n })\n .catch(function (error) {\n // This is expected when Okta SSO does not exist\n showError(error);\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 }\n }", "get userInfo () { return this.services.userInfo }", "function loadUserData() {\n const data = JSON.parse(localStorage.getItem('t_b_data'));\n const name = data.payload.data.name;\n const email = data.payload.data.email;\n const number = data.payload.data.number;\n document.querySelector('#userName').innerHTML = name.substr(0, 10) + '.....';\n document.querySelector('#userDetailName').innerHTML = name;\n document.querySelector('#userEmail').innerHTML = email;\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 userInfo(){\n\n}", "constructor(anAppId) {\n\n this.cognitoUser = undefined\n this.signUpUserOnConfirm = false\n this.keyId1 = undefined\n this.keyId2 = undefined\n\n this.appId = anAppId\n this.appIsSimpleId = (this.appId === SID_ANALYTICS_APP_ID )\n\n this.persist = {\n userUuid: undefined,\n email: undefined,\n sid: undefined\n }\n\n this.neverPersist = {\n priKey: undefined,\n password: undefined\n }\n\n\n try {\n // TODO: de-obfuscate using static symmetric encryption key SID_SVCS_LS_ENC_KEY\n const stringifiedData = localStorage.getItem(SID_SVCS_LS_KEY)\n const persistedData = jsonParseToBuffer(stringifiedData)\n if ( persistedData.hasOwnProperty('email') && persistedData.email &&\n persistedData.hasOwnProperty('userUuid') && persistedData.userUuid &&\n persistedData.hasOwnProperty('sid') && persistedData.sid ) {\n this.persist = persistedData\n }\n } catch (suppressedError) {\n log.info(`Unable to recover session data from local storage.\\n${suppressedError}`)\n }\n }", "[SESSION_INFO_PULLED] (state, {user, token}) {\n state.pullingSessionInfo = false\n state.userIsLoggedIn = !!user\n state.token = token\n state.user = user\n }", "function createUserData() {\n\n // Saves data for application storage \n EcwidApp.setAppStorage(initialConfig.private, function (value) {\n console.log('Initial private user preferences saved!');\n });\n\n // Saves data for public app config\n EcwidApp.setAppPublicConfig(initialConfig.public, function (value) {\n console.log('Initial public user preferences saved!');\n });\n\n // Function to prepopulate values of select, input and textarea elements based on default settings for new accounts\n setValuesForPage(initialConfig);\n checkTestModeValue();\n}", "static async read(){\n try {\n //read from store\n const data = await store.get(UserStore.KEY);\n //update cahched value\n _userData = data;\n return (data);\n\n } catch(error){\n console.error('Failed to read user data from store.');\n throw error;\n };\n }", "function globalViewData(req, res, next) {\n res.ViewData = res.ViewData || {};\n res.ViewData.username = \"\"; \n if (req.session.user) {\n res.ViewData.username = req.session.user.username;\n }\n next();\n }", "function getUserInformation(){\n console.log(userInformation);\n return userInformation;\n }", "getUser() {\n return decode(this.getToken());\n }", "function getUserInfo(data){\n var jsonData;\n if(data.length !== 0){\n jsonData = JSON.parse(data);\n }\n jsonData = null;\n //console.log(\"getuserinfo\", jsonData);\n userInfoMapInit(jsonData);\n \n}", "getUser(email, password) {\n this.email = email;\n this.password = password;\n\n const userData = this.app.readDataFile(userFilePath);\n\n userData.forEach((item) => {\n if (item.email === this.email && item.password === this.password) {\n this.userInfo = item;\n }\n });\n\n return this.userInfo;\n }", "async function getUserInfo() {\n let userData = await Auth.currentAuthenticatedUser();\n setUser(userData.username);\n setUserEmail(userData.attributes.email);\n }", "get info() {\n const data = { ...this.dataValues };\n delete data.password;\n return data;\n }", "function readProtect(obj, tag, ba) {\n\tobj.isProtected = true;\n\tif (tag.contentLength > 0) obj.password = ba.readString(tag.contentLength, true);\n}", "function loadData(data) {\n _userData = data.userData;\n}", "function getUserData() {\n return {\n \"id\": Math.floor(Math.random() * 100 + 1),\n \"username\": generateName(),\n \"balance\":2500\n }\n}", "function loadUserDetails() {\n loadJSON('backend/resources/json/user.json', function(response) {\n actual_JSON = JSON.parse(response);\n globalId = actual_JSON.passkey;\n onValidate();\n });\n}", "function printUserData() {\n\n\treturn `Hello World, this is ${data.name} with HNGi7 ID ${data.hngi_id} and email ${data.email} using ${data.language} for stage 2 task`;\n\t\n}", "getUserInfo(){\n return getUser()\n }", "async setUserData() {\n\t\tvar userinfo;\n\t\tawait AppX.fetch('User', 'self').then(async result => {\n\t\t\tvar info = result.data;\n\t\t\tglobal.userLogin = info.login;\n\n\t\t\tawait AppX.fetch('OrganizationDetail', info.organizationUid).then(result => {\n\t\t\t\tglobal.userOrgName = result.data.name;\n\t\t\t});\n\n\t\t});\n\t}", "getInitialUserInfo(DB, request, response) {\n\t\tDB.get_initial_user(request.params.auth_id).then((userData) => {\n\t\t\tif (userData[0]) response.status(200).send(userData);\n\t\t\telse response.status(404).send('User Not Found...');\n\t\t});\n\t}", "set userInfo(user) {\n\t\tthis.koa.userInfo = user;\n\t}", "setUserData(data) {\n this.userData = data;\n }", "function saveUserData(userData) {\n localStorage.setItem('username', userData.username);\n localStorage.setItem('accessToken', userData.accessToken);\n localStorage.setItem('id', userData.id);\n username = userData.username;\n accessToken = userData.accessToken;\n }", "function decryptToken(token) {\n var base64Url = token.split('.')[1];\n var base64 = base64Url.replace('-', '+').replace('_', '/');\n var currentUser = JSON.parse($window.atob(base64));\n\n return currentUser;\n }", "getUser() {\n return decode(this.getToken());\n }", "static async loadCurUser() {\n\n var user_result = await APISocket.get(`user/me?populate=teams&extension=true`)\n\n // User is on one team: normalize values that are stored on the TeamUser object\n if (user_result.teams.length === 1) {\n\n // Properties defined on the TeamUser that need to be normalized back into actual user properties\n var team_user = await APISocket.get(`team/${user_result.teams[0].id}/users/${user_result.id}`)\n for (let [key, value] of Object.entries(team_user)) {\n user_result[key] = value;\n }\n\n }\n\n // Rename/remap fields\n user_result.extension_secret = (\" \" + user_result.extensionSecret).slice(1);\n delete user_result.extensionSecret;\n\n return user_result;\n\n }", "getCurrentUser() {\n var data = JSON.parse(localStorage['cache_/campusm/sso/state']).data;\n\n // Actual username has a non-obvious key in local storage\n data.username = data.serviceUsername_363;\n\n return data;\n }", "async fetchUserData() {\n let token = localStorage.getItem('token');\n try {\n dispatch.breaks.setIsLoadingData(true);\n let response = await breakURL.get('/auth/me', {\n headers: { Authorization: `Bearer ${token}` },\n });\n dispatch.breaks.setUserData(response.data.data);\n localStorage.setItem('userData', JSON.stringify(response.data.data));\n dispatch.breaks.setIsLoadingData(false);\n } catch (err) {\n console.log(err);\n dispatch.breaks.setIsLoadingData(false);\n }\n }", "login (state, user_info) {\n state.user_info.user_name = user_info.user_name;\n state.user_info.user_id = user_info.user_id.toString();\n }", "get user() {\n return this.fapp.get('user');\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 }", "getUserContextData() {\n if (typeof AmazonCognitoAdvancedSecurityData === \"undefined\") {\n return;\n }\n \n var _username = \"\";\n if (this.username){\n _username = this.username;\n }\n \n var _userpoolId = \"\";\n if (this.userpoolId){\n _userpoolId = this.userpoolId;\n }\n \n if (this.advancedSecurityDataCollectionFlag) {\n return AmazonCognitoAdvancedSecurityData.getData(_username, _userpoolId, this.clientId);\n }\n }", "fetchUserInfo() {\n return this.callGetAuthString();\n }", "getAuthDataFromStorage() {\n const authData = {\n accessToken: this.localStorage.getItem('accessToken'),\n client: this.localStorage.getItem('client'),\n expiry: this.localStorage.getItem('expiry'),\n tokenType: this.localStorage.getItem('tokenType'),\n uid: this.localStorage.getItem('uid')\n };\n if (this.checkAuthData(authData)) {\n this.authData.next(authData);\n }\n }", "userInfo(ctx, payload) {\n return new Promise((resolve, reject) => {\n axios\n .get(\"admin/user\", { params: payload })\n .then(response => {\n if (localStorage.getItem(\"token\")) {\n ctx.commit(\"SET_USERINFO\", response.data.data);\n resolve(response);\n }\n })\n .catch(error => {\n reject(error);\n });\n });\n }", "returnKeyringData() {\n if (!this.state.keyringOrigin)\n return;\n // Save the login for later\n this.saveKeyringLogin();\n // Send the data back to the opener\n const data = {\n deviceID: this.state.deviceID,\n password: this.state.password,\n endpoint: constants.BASE_SIGNING_URL,\n };\n // Check if there is a custom endpoint configured\n const settings = getLocalStorageSettings();\n if (settings.customEndpoint && settings.customEndpoint !== '') {\n data.endpoint = settings.customEndpoint;\n }\n this.handleLogout();\n window.opener.postMessage(JSON.stringify(data), \"*\");\n window.close();\n }", "getUserName() {\n return this.userData.name;\n }", "static storeUser(user) {\n localStorage.setItem('userInfo', user);\n }", "getUserData(field) {\r\n\r\n // Get it\r\n var props = this.getProperties(\"userData\")\r\n\r\n // Decode it\r\n var userData = {}\r\n try {\r\n userData = JSON.parse(props.userData)\r\n } catch (e) {\r\n\r\n }\r\n\r\n // Done\r\n if (field)\r\n return userData[field]\r\n else\r\n return userData\r\n\r\n }", "function getUserSecretKey() {\n return localStorage.getItem('userSecretKey');\n}", "function getAppState() {\n return UserStore.getData();\n}", "async loadLoggedUser() {\n let userId = await AsyncStorage.getItem('userID');\n let formattedUserId = await JSON.parse(userId);\n let xAuth = await AsyncStorage.getItem('xAuth');\n let formattedXAuth = await JSON.parse(xAuth);\n this.setState({\n xAuth: formattedXAuth,\n userID: formattedUserId,\n });\n console.log(\n 'Logged user: ' +\n this.state.userID +\n ' with Xauthorization code: ' +\n this.state.xAuth,\n );\n }", "toJSON() {\n let userData = this.get() //.get built into get hte user we are working with\n delete userData.password //this removes the password so when we are passing around user info that the pw isnt a parto f that user object that gets passed between the backend and frontend..but does not remove it from the database\n return userData\n }", "function saveUserInfo(userInfo) {\r\n\t \tself._userInfo = userInfo;\r\n\t \tlocalStorage.setItem('user', JSON.stringify(userInfo));\r\n\t }", "getPrintInformation() {\n return {s:this.secret.toString('base64'),n:this.nonce.toString('base64')};\n }", "tryLoadAuthData() {\n const userType = this.getUserTypeByName(this.localStorage.getItem('userType'));\n if (userType) {\n this.userType.next(userType);\n }\n this.getAuthDataFromStorage();\n if (this.activatedRoute) {\n this.getAuthDataFromParams();\n }\n // if (this.authData) {\n // this.validateToken();\n // }\n }", "function retrieveProfileInfo() {\n return JSON.parse(sessionStorage.getItem(\"user\"));\n}", "if (data.type === \"AuthVerificationConnectionVerified\" && data.data.key) {\n const { data: userData }: Object = data;\n this.connectUser(userData);\n }", "if (data.type === \"AuthVerificationConnectionVerified\" && data.data.key) {\n const { data: userData }: Object = data;\n this.connectUser(userData);\n }", "function _update_user_from_login(data) {\n user.app = data.app;\n user.uuid = data.uuid;\n user.icon = data.user_icon;\n user.name = data.user_name;\n user.email = data.user_email;\n user.fullname = data.user_fullname;\n user.signature = data.user_signature;\n user.updatetime = data.updatetime;\n user.is_online = true;\n user.status = data.service_user_status || yvConstants.USER_STATUS.READY;\n \n if (yvSys.in_mobile_app()) {\n user.device_uuid = data.mobile_device_uuid;\n } else {\n user.device_uuid = data.browser_device_uuid;\n }\n \n user.show_badge = !!data.user_show_badge;\n user.is_distributor_user = !!data.is_distributor_user;\n user.mute_notification = !!data.user_mute_notification;\n user.silence_notification = !!data.user_silence_notification;\n user.mute_other_mobile_device = !!data.user_mute_other_mobile_device;\n \n return user;\n }", "static removeUserInfoFromStorage() {\n localStorage.removeItem(this.KEY_USER_INFO);\n }", "storeUserInfo ({ state }, userData) {\n if (!state.token) return\n \n databaseAxios.put('users/' + state.userId + DBSuffix + authDB + state.token, userData)\n .then()\n .catch(err => dispatch('handleError', err.response))\n }", "function getCurrentUserData(){\n\n ApiCalls.getCurrentUser()\n .then((res) => {\n //console.log(\"current\" ,res.data);\n setCurrentUser(res.data);\n }\n ) \n}", "constructor(props) {\n // variable which stores all user data retrieved at login\n this.userData = {};\n }", "function getUser() {\n return {\n name: 'Awotunde',\n handle: '@egunawo33', \n location: 'Orun, Aye'\n }\n}", "set userData(value) {}", "function SaveUserInfo()\r\n{\r\n\tdoc=window.content.document;\r\n\tdoc=XPCNativeWrapper.unwrap(doc);\r\n\tuser_name=doc.getElementById(\"user-name\").getAttribute(\"value\");\r\n\tsession_key=doc.getElementById(\"session-key\").getAttribute(\"value\");\r\n\tglobalStorage['ytfm.ashishdubey.info'].setItem(\"user\",user_name);\t\r\n\tglobalStorage['ytfm.ashishdubey.info'].setItem(\"key\",session_key);\r\n\tLoadUserInfo();\r\n}" ]
[ "0.62761796", "0.6135887", "0.61218244", "0.6106369", "0.60079473", "0.6005751", "0.5947759", "0.5922381", "0.5921852", "0.59195805", "0.5919454", "0.5908774", "0.589113", "0.5889766", "0.5868541", "0.5867855", "0.5855064", "0.58347976", "0.5834503", "0.5796074", "0.5774886", "0.5740494", "0.5729025", "0.5717853", "0.5711683", "0.57068735", "0.5701902", "0.5699893", "0.5689782", "0.5664058", "0.5660848", "0.5651675", "0.5638014", "0.56328285", "0.5623907", "0.5616893", "0.5600014", "0.559782", "0.5594444", "0.5582899", "0.5579917", "0.5579408", "0.55748034", "0.55734", "0.55630744", "0.5562937", "0.55448633", "0.55419666", "0.55405563", "0.55364597", "0.55217516", "0.5514711", "0.55052227", "0.5500922", "0.54992956", "0.54988056", "0.5498646", "0.5495846", "0.54870504", "0.54733783", "0.5462407", "0.54621255", "0.5460034", "0.5455066", "0.54510856", "0.54452914", "0.5436841", "0.5436785", "0.54349023", "0.54342896", "0.5433031", "0.54171985", "0.5411653", "0.54094553", "0.5408391", "0.5407946", "0.5404891", "0.5403438", "0.5399045", "0.53979063", "0.53954446", "0.5393573", "0.5392597", "0.5390264", "0.5388615", "0.538623", "0.538342", "0.53803945", "0.5379439", "0.5375351", "0.5372293", "0.5359937", "0.5359937", "0.53596807", "0.53550017", "0.53435886", "0.533882", "0.5332975", "0.53251225", "0.53248316", "0.5312012" ]
0.0
-1
End of ajax call for posting a new comment Start of ajax call for reporting a post
function ReportAPost(btn) { var postId = $(btn).attr('data-postid'); $.ajax({ type: 'POST', url: `/User/ReportAPost/${postId}`, success: function () { alert('Post reported!'); }, error: function () { alert('There was a problem with reportiing a post, please try again later.'); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function orderCommentResponse()\r\n{\r\n\tif(objAjax)\r\n\t{\r\n\t\tif(objAjax.isProcessComplete())\r\n\t\t{\r\n\t\t\tvar comments = new TRADESTONE.Comments(\"Order Comments\", objAjax.getResult());\r\n\t\t\tcomments.show();\r\n\t\t}\r\n\t\tobjAjax = null;\r\n\t}\r\n}", "function submitComment(evt) {\n evt.preventDefault();\n\n const comment = $('#comment')\n\n $.post('/community', comment, (response) => {\n $('#d-flex flex-column comment-section').append(`${response.global_comment}`);\n } )\n console.log('posted')\n}", "function submitComment(){\n var time = new Date().getTime()\n var newComment = {\n articleId : $(this).attr(\"data-id\"),\n name : $(\"input.comment-name\").val().trim(),\n body : $(\"textarea.comment-body\").val().trim(),\n time : time\n }\n var query = \"api/comments/\" + newComment.articleId;\n $.post(query, newComment, function(){\n }).then(function(){\n loadComments(newComment.articleId);\n }).catch(function(err){\n console.log(err);\n });\n\n}", "function successfulCallback(data) {\n\n\tif( data[\"flag\"]!=0 ) {\n\t console.log(\"Error: Failed to add comment :(\");\n\t return false;\n\t}\n\n\t// Get the comment div\n\tvar comment_div = data[\"comment_div\"];\n\tconsole.log(\"Comment Div:\");\n\tconsole.log(comment_div);\n\n\t// Clear the editable comment and add\n\t// the new comment that we just got \n\t$(\"#NewComment\").val('');\n\t$(\"#Comment_List\").append(comment_div);\n\t$('html').animate( {scrollTop: $(\"#Comment_List\")}, 'slow');\n\t$('#NewCommentWrapper').hide();\n\t$('#AddComment').show();\n\t$('#NoCommentsYet').remove();\n }", "function l() {\n z(\"#comment-form\")\n .find(\"input#submit\")\n .before('<p id=\"ajax-response\"></p>');\n var n = z(\"#comment-form\"),\n a = z(\"#comments-list\"),\n i = n.find(\"#name\"),\n s = n.find(\"#email\"),\n r = n.find(\"#comment\"),\n l = n.find(\"input#submit\"),\n d = z(\"#ajax-response\");\n i.focus(function () {\n d.text(\"\");\n }),\n s.focus(function () {\n d.text(\"\");\n }),\n r.focus(function () {\n d.text(\"\");\n }),\n n.submit(function (e) {\n var t = !0,\n o = /^([\\w-\\.]+@([\\w-]+\\.)+[\\w-]{2,4})?$/;\n 0 < i.length && i.val().length < 3 && (t = !1),\n 0 < s.length && !o.test(s.val()) && (t = !1),\n 0 < r.length && r.val().length < 3 && (t = !1),\n t\n ? (z.ajax({\n type: n.prop(\"method\"),\n url: n.prop(\"action\"),\n data: n.serialize(),\n success: function (e, t, o) {\n a.html(z(e).find(\"#comments-list\")[0]),\n d.text(langObj.posted_comment),\n l.removeClass(\"disabled\").val(langObj.post_comment);\n },\n error: function (e, t, o) {\n 409 == e.status &&\n (d.text(langObj.duplicate_comment),\n l.removeClass(\"disabled\").val(langObj.post_comment));\n },\n }),\n l.addClass(\"disabled\").val(langObj.posting_comment))\n : d.text(langObj.required_comment),\n e.preventDefault();\n });\n }", "function commentsToPage() {\n $.ajax({\n type: 'POST',\n url: formURL,\n data: {comment: {description: description}},\n success: function(data) {\n console.log(\"Success with data!\", data);\n\n // append new comment to page\n $(\"#comment-display\").append(\n data.description);\n\n // reset form values\n $(\"#description-val\").val(\"\");\n },\n error: function(data) {\n console.log(\"ERROR\");\n }\n }); //closing AJAX\n } //closing function commentsToPage", "function postComment() {\n\tcomment_field = document.getElementById('inputText');\n\tif(comment_field.value != \"\") {\n\t\tjson_array[index].activity_comments++;\n\t\tdisplayData();\n\t}\n}", "function comment() {\n $('.new_comment_submit').submit(function(e) {\n\n e.preventDefault();\n myself = $(this);\n console.log(myself)\n $.ajax({\n type: \"POST\",\n dataType: \"html\",\n url: $(this).attr('action'),\n data: $(this).serialize(),\n success: function(data) {\n myself.before(data);\n console.log(\"YES\");\n },\n error: function(data) {\n console.log(\"NO\");\n },\n });\n return false;\n });\n}", "function bindAjaxSubmission() {\n\tvar msgidfromcontroller = \"\";\n\tvar options = {\n\t\ttarget : \"#reviews\",\n\t};\n\t$(\"#new_review\").submit(function() {\n\t\t$(this).ajaxSubmit(options);\n\t\treturn false;\n\t});\n}", "function post_comment(post_id, sort, event) {\n $.ajax({\n type: \"POST\",\n url: $SCRIPT_ROOT + '/post_contain_comment',\n data: \"post_id=\"+ post_id + \"&sort=\" + sort,\n success: function (data) {\n $(\"#comments\").html(data.comments);\n },\n error: function (xhr, str) {\n alert('Mistake ' + xhr.responseCode);\n }\n });\n event.preventDefault();\n\n}", "function addComment() {\n let msg = {\n Text: $(\"#adCommentPlace\").val(),\n UserIdMsg: currentUserId,\n SeriesId: currentSeries.id\n }\n $(\"#adCommentPlace\").val('');\n\n\n\n let api = \"../api/Messages/\";\n ajaxCall(\"POST\", api, JSON.stringify(msg), MsgSuccessCB, ErrorCB);\n\n}", "function postComment() {\n let resource;\n let params;\n let data;\n let session_key,username,park_id,c_comment,c_date;\n \n username = document.getElementById(\"greeting-name\").innerHTML;\n \n if ( username === \"Guest\" ) {\n return; //user not logged in\n } else { //user is logged in\n \n c_comment = document.getElementById(\"comment-ta\").value;\n if ( !c_comment ) {\n alert(\"Please enter some text.\");\n return; //no text entered for comment\n }\n \n session_key = localStorage.getItem(\"session_key\");\n park_id = document.getElementsByTagName(\"body\")[0].id;\n park_id = park_id.substring(8, park_id.length);\n c_date = getDateWithUTCFormatting( new Date() );\n \n params = { \"session_key\":session_key, \"username\":username, \"park_id\":park_id, \"c_date\":c_date, \"c_comment\":c_comment };\n data = JSON.stringify(params);\n resource = \"/comments\";\n xhttp.open('POST', endPointRoot+resource, true);\n xhttp.setRequestHeader(\"Content-Type\", \"application/json\");\n xhttp.send(data);\n xhttp.onreadystatechange = function () {\n if ( this.readyState == 4 ) {\n if ( this.status == 201 ) { \n \n //n is current comment number\n let n = document.getElementsByClassName(\"user-says\");\n n = n.length + 1;\n \n //new comment div for new comment\n duplicateCommentDiv(n);\n document.getElementById(\"comment-user_\"+n).innerHTML = username;\n document.getElementById(\"comment-time_\"+n).innerHTML = c_date;\n document.getElementById(\"comment-body_\"+n).innerHTML = c_comment;\n moveCommentBoxToBottomOfPage();\n document.getElementById(\"comment-ta\").value = \"\";\n \n hideUsersEditAndDoneEditButtons(false);\n } else {\n alert( this.responseText );\n }\n }\n }\n }\n}", "function postComment (){\n\t\t\t\t\t$(\".btn-postcomment\").click(function(){\n\t\t\t\t\tvar index = $(this).data(\"id\");\n\t\t\t\t\tvar comment = $('textarea[data-id=\"comments-' + index + '\"]')\n\t\t\t\t\t\n\t\t\t\t\tvar name = $(\"input[data-id='name-\" + index + \"']\")\n\t\t\t\t\tvar appId = appArray[index].id;\n\t\t\t\t\tvar commentArray = appArray[index].comments + \", \" + comment.val(); \n\t\t\t\t\t\n\n\n\t\t\t\t\tstoreComment(appId, commentArray, name, index);\n\t\t\t\t\tname.val(\" \");\n\t\t\t\t\tcomment.val(\" \");\n\t\t\t\t\tappendComments();\n\n\t\t\t\t\t});\n \t\t\t\t}", "function submitComment() {\n var id = \"comment\";\n var commentText = getValueById(id);\n disableFieldById(id);\n var callback = function(response) {\n resetFieldById(id);\n updateComments(response);\n };\n var params = buildCommentParamsForPost(commentText);\n ajaxHandleResponse(\"addComment.php\", callback, \"POST\", params);\n}", "function post_ajax()\n\t\t\t\t\t{\n\t\t\t\t\t\t$.ajax({\n\t\t\t\t\t\t\ttype: 'POST',\n\t\t\t\t\t\t\turl: 'php/post.php',\n\t\t\t\t\t\t\tdataType: 'json',\n\t\t\t\t\t\t\tdata: $('#newPost_dialog-form').serialize(),\n\t\t\t\t\t\t\tsuccess: \tfunction (json)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t//If errors returned...\n\t\t\t\t\t\t\t\t\t\t\tif(json.error!=null)\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//Display errors and error locations\n\t\t\t\t\t\t\t\t\t\t\t\tupdateTips(json.error, json.location);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t//If no errors returned...\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\telse if(json.error==null)\n\t\t\t\t\t\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\t\t\t\t\t\t//Refresh page to show user signed in\n\t\t\t\t\t\t\t\t\t\t\t\tlocation.reload();\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}\n\t\t\t\t\t\t});\n\t\t\t\t\t}", "function Answer_new_comment(answer_id,method){\n //changing title of modal according to answer or question comment type\n $('ask_comment_title').html('answer comment')\n //changing question id for new comment submision\n $('.question_comment_form').attr('data-catid',answer_id)\n $('.question_comment_form').attr('answer_or_question','answer')\n //checking type of method\n if (method == \"GET\"){\n $('.ask_comment_spinner').show();\n $('.question_commentlist_modal').html('')\n $(\"#question_comment_modal\").modal('show')\n $.ajax( \n { \n type: 'GET',\n url: \"/answer/new_comment/\", \n data:{ answer_id : answer_id},\n dataType: 'json', \n })\n .done(function(response){\n $('.ask_comment_spinner').hide();\n $(\".question_commentlist_modal\").html(response);\n });\n\n }\n else{\n // # grab new comment\n var comment = $('.ask_comment_text').val();\n if (comment && answer_id){\n $.ajax( \n { \n type: 'POST',\n url: \"/answer/new_comment/\", \n data:{ csrfmiddlewaretoken: $(\".csrf_value\").val(),answer_id : answer_id,comment:comment},\n dataType: 'json', \n })\n .done(function(response){\n $('.ask_comment_text').val(\"\");\n $(\".question_commentlist_modal\").html(response.html);\n $('.answer_comment_count'+answer_id).html(response.count)\n });\n }\n }\n}", "function updateTaskComment(commentID) {\n var contentText = $(\"#txtTaskComment\").val().replace(new RegExp('\\n', 'g'), '<br />');\n $.ajax({\n url: \"Handler/CommentHandler.ashx\",\n data: {\n action: \"updateTaskComment\",\n projectID: projectID,\n userID: userID,\n commentID: commentID,\n content: $(\"#txtTaskComment\").val()\n },\n type: \"post\",\n success: function (message) {\n if (message == \"Success\") {\n // Update comment content in other clients' view\n var taskID = $(\"#btnSubmitComment\").attr(\"data-task-id\");\n proxyTC.invoke(\"updateComment\", commentID, contentText);\n }\n //else window.location.href = \"/404/404.html\";\n }\n });\n var comment = document.getElementById(\"comment-\" + commentID);\n var content = comment.getElementsByClassName(\"comment-content\")[0];\n content.innerHTML = contentText;\n $(\"#txtTaskComment\").val(\"\");\n $(\"#btnSubmitComment\").val(\"Send\").attr(\"onclick\", \"submitTaskComment()\");\n}", "function reply(el) {\n el = $(el);\n var editorID = el.parent().children('textarea').attr('id');\n var text = CKEDITOR.instances[editorID].getData();\n var replyLevel = (el.parent().parent().attr('data-hastype') == \"comment\") ? 1 : 0;\n var parentID;\n\n if (replyLevel)\n parentID = el.parent().parent().attr('id');\n\n if (!text.trim())\n return; // if there's no body to the comment don't add it\n\n var content = {sub:\"add\", action: \"comment\", parent: itemID, content: text, parentComment: parentID, level: replyLevel};\n $.ajax({\n url: '/action',\n type: 'POST',\n contentType: 'application/json',\n data: JSON.stringify(content)\n }).done(function(data) {\n if (data) {\n data.votes = 1;\n data.date = \"Just Now\";\n var newComment;\n if (content.level) {\n newComment = fillCommentLevel2Template(data);\n $('#' + parentID).after(newComment);\n }\n else {\n newComment = fillCommentLevel1Template(data);\n $('#comments').prepend(newComment[0]);\n activateEditors(newComment[1]);\n }\n svgConverter();\n\n var foot = $('#foot');\n if (foot.length && foot.is(\":visible\"))\n foot.hide();\n }\n else {\n // at some point show \"something went wrong\" modal\n console.log('empty response');\n }\n }).fail(function(err) {\n // at some point show \"something went wrong\" modal\n console.log(err);\n });\n}", "function report_post(post_id) {\n $.ajax({\n method: \"GET\",\n url: \"REST_api/user\",\n processData: false,\n contentType: \"application/json\",\n data: '',\n success: function (r) {\n var details = JSON.parse(r)\n\n if (details.Status == \"Good\") {\n\n $.ajax({\n method: \"GET\",\n url: \"REST_api/post_data?post_id=\" + post_id,\n processData: false,\n contentType: \"application/json\",\n data: '{\"PostId\" : \"' + post_id + '\"}',\n success: function (r) {\n\n var post = JSON.parse(r);\n\n $('#modal_report').html(\n '<div class=\"conatiner d-flex flex-row\" id=\"timeline_posts\"style=\"scroll-padding-left: 10px;\"><div class=\"p-1 flex-column\" id=\"tl_profile_img_container\"> <img ' + display_profile_image(post.PostedByImg) + ' class= \"profile_image rounded-circle border img-responsive shadow-sm visible\" id = \"profile_img_tl_comments\" loading = \"lazy\" > </div > <div class=\"p-1 flex-fill\"> <div class=\"d-flex p-0\"> <table> <tr> <td colspan=\"2\"><strong onclick = \"window.location.href = \\'profile1.php?username=' + post.PostedByName + '\\'\">' + post.PostedByName + '</strong> ∙ ' + time_conversion(post.PostedAt) + '</tr><tr></tr></table></div><div class=\"d-flex p-0\"><div class=\"p-1\" id=\"tl_post_topic\"><small> ' + post.PostTopic + ' </small></div><div class=\"p-1\" id=\"tl_post_type\"><small>' + post.PostType + '</small></div> </div> <div class=\"p-0\"><p>' + post.PostBody + '</p></div></div></div><div class=\"p-1 d-flex flex-fill \"> <textarea class = \"p-1 form_control\" rows = \"3\" id = \"report_input\" placeholder = \"Write reason for reporting this post...\" style = \"width: 90%; margin: auto;border-radius: 5px;\"></textarea> </div> <div> <button class=\"btn btn-default d-flex ml-auto ml-left\" id = \"post_report_btn\" data-report_post_id = \"' + post.PostId + '\"><small>Report</small></button> </div><hr>'\n );\n\n $('#report_modal').modal('show');\n\n $('[data-report_post_id]').click(function () {\n\n var post_id = $(this).attr('data-report_post_id');\n\n if ($('#report_input').val() && $('#report_input').val() != ' ') {\n\n var report_body = $('#report_input').val();\n\n report_body = encodeURIComponent(report_body);\n\n $.ajax({\n method: \"POST\",\n url: \"REST_api/report?post_id=\" + post_id,\n processData: false,\n contentType: \"application/json\",\n data: '{\"ReportBody\" : \"' + report_body + '\"}',\n success: function (r) {\n // var res = JSON.parse(r)\n\n console.log(r);\n\n $('#report_modal').modal('hide');\n\n },\n\n error: function () {\n console.log('error');\n }\n })\n\n $('#report_input').val(\"\");\n }\n })\n },\n\n error: function (r) {\n console.log(r);\n }\n })\n\n } else if (details.Status == \"Deactivated\") {\n alert('Sorry, you are restricted from performing that action. Your account is deactivated. Contact site administration for more details.');\n } else if (details.Status == \"Not logged in\") {\n window.location.href = 'login.html';\n } else if (details.Status == \"Admin\") {\n // window.location.href = 'admin_dashboard.html';\n }\n\n\n },\n error: function (r) {\n console.log(r);\n\n }\n });\n}", "function createPost(){\n\n //we get the form and prevent the defualt behavior off its submit button\n var newPostForm = $('#form-posts');\n // console.log(newPostForm);\n newPostForm.submit(function(defaultEvent){\n // console.log(defaultEvent);\n\n defaultEvent.preventDefault();\n\n $.ajax({\n url : \"/posts/create\",\n method:\"POST\",\n data: newPostForm.serialize(), //this converts the foem data into json\n success : function(data){\n //data recooved from the api call\n // console.log(data); //ajax req by jquery will parse the string dat into json itslef\n let newPost = newPostDom(data.data.post , data.data.userName);\n $(\"#posts-display-wrapper\").prepend(newPost );\n //adding this function to delete post fucn to it can be deleted usin ajax\n deletePost($(' .delete-post-btn-link' , newPost));\n\n new PostComments(data.data.post._id);\n //this will enable the comment section to be dynamic\n expandComment($(`#btn-${data.data.post._id}`));\n //shows flash message\n sucessFlash(\"Post Created !\");\n new ToggleLike($(' .like-btn-link', newPost));//bind the new like button of this post to this clas\n \n \n },\n error: function(error){\n console.log(error.responseText);\n errorFlash(err.responseText);\n }\n });\n\n });\n\n }", "function get_new_comments() {\n\t\n\tvar nid = jQuery('#task_nid').val();\n\tvar cid = jQuery(\"#last_comment_details\").attr(\"data-cid\");\n\tvar time = jQuery(\"#last_comment_details\").attr(\"data-time\");\n\tvar count = jQuery(\"#last_comment_details\").attr(\"data-count\");\n\tvar content;\t\n\tjQuery.ajax({\n type:\"get\", \n url: \"/js/new_comment_show/\"+cid+\"/\"+nid,\n beforeSend: function() {\n var loadText = Drupal.t('Loading...');\n jQuery( \"#new_arrival\" ).after( \"<div class='ajax-processed-throbber'>\"+loadText+\"</div>\" );\n \tjQuery('#new_comment').removeAttr('onclick');\n },\n success: function(data){\n \tcontent = data;\n \t jQuery(\"#latest_comment\").prepend(content);\n \t Drupal.attachBehaviors(jQuery(\"#latest_comment\"));\n \t jQuery(\"#post_list_content div.ajax-processed-throbber\").hide();\n \t jQuery(\"#new_arrival\").slideUp('slow');\n \t var cid_last = jQuery(\"#last_cid\").val();\n \t\tvar count_last = jQuery(\"#last_count\").val();\n \t\tjQuery(\"#last_comment_details\").attr(\"data-cid\", cid_last);\n \t\tjQuery(\"#last_comment_details\").attr(\"data-count\", count_last);\n \t\tjQuery('.comment_count a').html(count_last);\n \t\tjQuery('#new_comment').attr('onclick', 'get_latest_count();');\n }\n });\n}", "function commentSend(){\n$(\"#send_coment\").click(function(event){\n var val = $(this);\n var comment = $(\"#comment_field\").val().trim();\n if (comment == \"\"){\n $(\"#error\").html(\"<b>Please, input data</b>\");\n return(false);\n }\n\n $.ajax({\n url: this.href,\n type: 'post',\n dataType: 'json',\n data: {\n person_id: val.data('person-id'),\n user_id: val.data('user-id'),\n comment_val: comment,\n csrfmiddlewaretoken: $('input[name=\"csrfmiddlewaretoken\"]').prop('value')\n },\n success: function(data,status,xhr){\n commentGet(val.data('url-for-get'));\n $(\"#comment_field\").val(\"\");\n $(\"#comment_field\").attr(\"rows\",\"1\");\n $(\"#error\").text(\"\");\n //alert(data);\n }\n });\n return(false);\n});\n\n}", "function handler_add_comment()\n{\n //\n var table = document.getElementById('t_type').value + \"_\";\n\n var item_id = document.getElementById(table + 'item').value;\n var title = document.getElementById(table + 'title').value;\n var comment = document.getElementById(table + 'comment').value;\n // var comment=\"\";\n // var\n xajax_addComments(item_id,title,comment, manager.GetKnownIds());\n\n return false;\n}", "function postComments () {\n\tvar theComment = {\"nid\":\"105509\",\"subject\":\"Comment Subject Text\", \"comment_body\":{ \"und\":[{ \"value\":\"Comment body text\" }] }}\n\n\n \t$.ajax({\n \t\ttype: \"POST\",\n \turl: '/a/bible/serve/comment.json',\n \t\theaders: {\n \t\t'Content-Type':'application/json',\n \t\t'Authorization':'Basic dGVzdDpKYW1tZXIxMg=='\n \t\t},\n \t\tdata: JSON.stringify(theComment),\n \t\n\t\t});\n\n }", "function ajaxComment(theForm) {\n var result = '', c = '';\n jQuery('#loader').fadeIn();\n var formData = jQuery(theForm).serialize();\n var actionURL;\n actionURL = jQuery('#commentform').attr('action');\n\n jQuery.ajax({\n type: \"POST\",\n url: actionURL,\n data: formData,\n success: function(response) {\n tt_modal(jQuery('#commentform').attr('data-comment-link'));\n var i = setInterval(function() {\n if ($commentResult!=false) {\n if($commentResult) {\n jQuery('#comments').html(jQuery($commentResult).find('#comments').html());\n c='success';\n result='Success';\n formInit();\n } else {\n c='error';\n result='No coment';\n }\n\n jQuery('#LoadingGraphic').fadeOut('fast', function() {\n jQuery('#Note').removeClass('success').removeClass('error').text('');\n jQuery('#Note').show('fast');\n jQuery('#Note').html(result).addClass(c).slideDown('fast');\n });\n $commentResult=false;\n clearInterval(i);\n }\n }, 40);\n }\n }).fail(function(jqXHR, textStatus, errorThrown) {\n c = 'error';\n switch(jqXHR.status){\n case 500: {\n result='Duplicate comment detected; it looks as though you’ve already said that!';break;\n }\n default:{\n result='not';\n }\n }\n\n jQuery('#LoadingGraphic').fadeOut('fast', function() {\n jQuery('#Note').removeClass('success').removeClass('error').text('');\n jQuery('#Note').show('fast');\n jQuery('#Note').html(result).addClass(c).slideDown('fast');\n }); /* end loading image fadeOut */\n });\n\n return false;\n}", "function postmycomment(p_id) {\n\n //alert(prfidglobal);\n //alert(\"Professoir ID from cliek:\" + p_id);\n var pro_id = p_id;\n //alert(pro_id);\n // var stu_id = studentID;\n var stu_id = 3;\n //alert(\"Now Showing studnet ID\");\n //alert(stu_id);\n\n //$(\"#result\").html('');\n //var values = $(\"#form\").serialize();\n var e = document.getElementById(\"semdetails\");\n var semester = e.options[e.selectedIndex].text;\n var f = document.getElementById(\"course_combo\");\n var course_id = f.options[f.selectedIndex].text;\n var course_name = document.getElementById(\"course_textbox\").value;\n //alert(course_name);\n var g = document.getElementById(\"qu1\");\n var q_01 = g.options[g.selectedIndex].value;\n //alert(q_01);\n var h = document.getElementById(\"qu2\");\n var q_02 = h.options[h.selectedIndex].value;\n var k = document.getElementById(\"qu3\");\n var q_03 = k.options[k.selectedIndex].value;\n var p = document.getElementById(\"qu4\");\n var q_04 = p.options[p.selectedIndex].value;\n var comments_area = document.getElementById(\"carea\").value;\n //alert(comments_area);\n\n var datastring = {semester: semester, course_id: course_id, course_name: course_name, q_01: q_01, q_02: q_02, q_03: q_03, q_04: q_04, comments_area: comments_area, pro_id: pro_id, stu_id: stu_id};\n //alert(datastring);\n if (semester != \"\" && course_id != \"\" && course_name != \"\" && q_01 != \"\" && q_02 != \"\" && q_03 != \"\" && q_04 != \"\" && comments_area != \"\")\n {\n /* to chec if any box is empty or not */\n $.ajax({\n url: \"http://localhost:8888/phpfiles/postdata.php\",\n type: \"post\",\n data: datastring,\n success: function(data) {\n alert(data);\n $(\"#afterpost\").html('Submitted successfully');\n },\n error: function() {\n alert(\"failure\");\n $(\"#afterpost\").html('There is error while submit');\n }\n });\n }\n else\n {\n alert(\"You are missing any filed..!!\");\n }\n}", "function addComment(id) {\n\tvar text = document.getElementById(\"addCommentTextArea\").value;\n\tvar requestUrl = \"/\"+ appName +\"/action?type=addComment_task&tid=\" +id;\n\tvar requestPayload = \t\"<addComment><text><![CDATA[\"+text +\"]]></text></addComment>\";\n\t\n\t$.ajax({\n\t\ttype: 'POST',\n\t\turl: httpUrl + requestUrl,\n\t\tdata: requestPayload,\n\t\tcontentType: \"text/xml\",\n\t\tdataType: \"xml\",\n\t\tsuccess: function(data){\n\t\t\tvar success = data.firstChild.getElementsByTagName('success')[0].textContent;\n\t\t\tif (success == 'true'){\n\t\t\t\t//successful\n\t\t\t\talert(\"Task ADDCOMMENT success : \" +id);\n\t\t\t}else{\n\t\t\t\t//unsuccessful\n\t\t\t\talert(\"Unable to ADDCOMMENT the task : \" +id);\n\t\t\t}\n },\n error:function(response){\n \talert('Failed : ERROR OCCURED');\n \t}\n\t});\n\n\t$('#addCommentModal').modal('hide');\n\t$('#addCommentModal').on('hidden.bs.modal', function (e) {\n\t\t//update comment list in ui\n\t\tupdateComments(id);\n\t});\n\t\t\n}", "function submitPost(Post) {\n console.log(\"ajax\");\n $.post(\"/new/item\", Post, function() {\n window.location.href = \"/browse/styles/all\";\n});\n}", "function customAjaxSubmit(submitEvent) {\n\tsubmitEvent.preventDefault(); // kills the original submit\n\tvar postForm = submitEvent.target; // the form that sent this\n\t\n\t// Gathering data - we're sending the urlencoded values of IDs posttext, form_name, entity_object_id and savechanges, just like EQAL\n\tvar postData = \"posttext=\" + encodeURI(postForm.elements[2].value) + \"&form_name=\" + encodeURI(postForm.elements[3].value) + \"&entity_object_id=\" + encodeURI(postForm.elements[4].value) + \"&savechanges=\" + encodeURI(postForm.elements[5].value);\n\t\n\t// POSTing data\n\tvar sndCmntReq = new XMLHttpRequest(); \n\tsndCmntReq.open('POST', postForm.action, true);\n\tsndCmntReq.onreadystatechange = function (someEvent) { \n\t\tif (sndCmntReq.readyState == 4) { \n\t\t\tif(sndCmntReq.status == 200) {\n\t\t\t\t// If all went well, clean up and show\n\t\t\t\tpostForm.reset();\n\t\t\t\trefreshComments(getPostId(postForm.parentNode));\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\talert(\"Warning! Could not post! Server returned code \" + sndCmntReq.status);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} \n\t};\n\tsndCmntReq.setRequestHeader(\"Content-Type\", postForm.enctype);\n\t//sndCmntReq.setRequestHeader(\"Content-Length\", postData.length); // this is generated automagically by send()\n\tsndCmntReq.setRequestHeader(\"X-TheLastScript\", \"v\" + scriptVersion);\n\tsndCmntReq.setRequestHeader(\"Connection\", \"close\");\n\tsndCmntReq.send(postData);\n\t\n\t// New in v16: Since the user just posted, update their activity time\n\twriteOptionsToProfile();\n}", "function comment(divName) {\n var parent1 = divName.parentNode; //span\n var parent2 = parent1.parentNode; //actionBar div\n var parent = parent2.parentNode; // actual post div\n var divArray = parent.children;\n\n // gets the title of the post\n ti = divArray[0].id;\n t = document.getElementById(ti).innerText;\n\n // gets the content of the post\n co = divArray[1].id;\n c = document.getElementById(co).innerText;\n\n // gets the content of the comment\n var commentArray = parent1.children;\n ct = commentArray[0].id;\n newCommentText = document.getElementById(ct).value;\n\n // sends request to post the comment to the original post\n $.ajax({\n url: \"/comment/post/\" + t + \"/\" + c + \"/\" + newCommentText,\n method: \"GET\",\n success: function(result) {\n // alerts if successful or not, populatePosts if successful\n if (result != \"GOOD\") {\n alert(\"ERROR!\");\n } else {\n alert(\"Comment posted!\");\n populatePosts();\n }\n }\n });\n}", "onAfterAjax() {\n }", "function fetchLatestComment(){\n // give post id, \n $.ajax({\n type:\"GET\",\n url: allCommentsUrl,\n dataType:'json',\n data:{\n id: pk,\n csrfmiddlewaretoken:token\n },\n success: function (json) {\n newComment(currentUserName, json.results[0]['comment_text'], json.results[0]['time']);\n },\n error: function (json) {\n commentError(\"Could not load new comments, please refresh the page\")\n }\n })\n}", "function addNewComment() {\n var comment = document.getElementById(\"submitted-comment\").value;\n\n if (comment != \"\") {\n $.ajax({\n url: '/chatstorer',\n method: 'POST',\n data: {\n \"submitted-comment\" : comment\n },\n success : function(resultText){\n console.log(\"it worked\");\n },\n error : function(jqXHR, exception){\n console.log('Errror occured');\n }\n });\n }\n document.getElementById(\"submitted-comment\").value = \"\";\n}", "function newPost(id_page=null){\n if($.isNumeric(location.href.match(/([^\\/]*)\\/*$/)[1])){\n var id_page = location.href.match(/([^\\/]*)\\/*$/)[1];\n }\n if($(\"#new_post_content\").val() == ''){\n alert(\"Non puoi inserire un post vuoto!\\nInserisci qualcosa!\");\n }\n else{\n $.ajaxSetup({\n headers: {\n 'X-CSRF-TOKEN': $('meta[name=\"csrf-token\"]').attr('content')\n }\n });\n $.ajax({\n method: \"POST\",\n url: \"/home/post\",\n data: {content: $(\"#new_post_content\").val(), id_page: id_page},\n dataType : \"json\",\n success : function (data){\n if(data.ban != 1){\n $(\"#new_post_content\").val('');\n $post_clone = createPost(data)\n $post_clone.insertAfter(\".well\");\n $post_clone.show();\n $(\"#comment_panel\").hide();\n if(data.comments.length > 0){\n for(j = 0; j < data.comments.length; j++){\n $comment_clone = createcomment(data.comments[j]);\n $comment_clone.insertBefore(\"#comment_insert_\" + data.id_comment);\n $comment_clone.show();\n }\n }\n }\n else{\n alert(\"Non puoi scrivere post, sei bannato!\");\n }\n },\n error: function(data){\n var errors = data.responseJSON;\n alert(\"Qualcosa è andato storto! Prova a ricaricare la pagina.\\n\\n\" + errors.message);\n }\n });\n }\n}", "writeComment() {\n let $self = $(`#${this.idDOM}`);\n let $input = $self.children('#comment-input');\n\n $.ajax({\n url: '/Vuvuzela/services/comment/write_comment.php',\n type: 'POST',\n data: {\n text: $input.val(),\n article: this.articleID\n },\n success: (msg) => {\n if(msg['status'] === 'error') {\n this.showError('Error uploading comment');\n console.log(msg['errorMsg']);\n } else if(msg['status'] === 'success') {\n this.showComment(msg['data'], 'highlighted' /* Style modifier */);\n }\n },\n error: (jqXHR, textStatus, errorThrow) => {\n this.showError('Error uploading comment');\n console.log(jqXHR.responseText + \"\\n\" + textStatus + \"\\n\" + errorThrow)\n },\n dataType: 'json'\n });\n\n $input.val('');\n }", "function submitTaskComment() {\n var taskID = $(\"#btnSubmitComment\").attr(\"data-task-id\");\n\n var comment = {\n Task_ID: taskID,\n Project_ID: projectID,\n User_ID: userID,\n Content: $(\"#txtTaskComment\").val()\n }\n\n $.ajax({\n url: \"Handler/CommentHandler.ashx\",\n data: {\n action: \"insertTaskComment\",\n projectID: projectID,\n comment: JSON.stringify(comment)\n },\n type: \"post\",\n success: function (id) {\n var content = $(\"#txtTaskComment\").val().replace(new RegExp('\\r?\\n', 'g'), '<br />');\n var objtext = \"<div class='comment-box' id='comment-\" + id + \"'><div class='comment-panel'>\" +\n \"<img class='comment-profile' title='\" + _name + \"' src='\" + _avatar + \"'></div>\" +\n \"<div class='comment-container'><div class='comment-content'>\" + content + \"</div><div class='comment-footer'>\" +\n \"<div class='comment-button' title='Edit comment' onclick='fetchTaskComment(\" + id + \")'></div>\" +\n \"<div class='comment-button' title='Delete comment' onclick='deleteTaskComment(\" + id + \")'></div>\" +\n \"</div></div>\";\n var temp = $(objtext);\n $(\".comment-panel\", temp).css({\n \"float\": \"right\",\n \"margin-right\": \"10px\"\n });\n $(\"#commentBox\").append(temp);\n $(\"#commentBox\").scrollTop(document.getElementById(\"commentBox\").scrollHeight);\n $(\"#txtTaskComment\").val(\"\");\n\n // Send objtext to other client who is also viewing the task\n proxyTC.invoke(\"sendSubmittedComment\", id);\n }\n });\n}", "function onAddCommentSuccess(content) {\n\t$(\".ajaxloader\").hide();\n $(\"#commentList\").prepend( content );\n clearForm('#addCommentForm');\n}", "function getcomments(profid) {\n// alert(\"Starting of code. For filling comment area\");\t\n var p_id = profid;\n //alert(p_id);\n\n $.ajax({\n url: \"http://localhost:8888/phpfiles/profpagecomments.php\",\n type: \"get\",\n data: 'prof_id=' + p_id,\n success: function(data) {\n //alert(data);\n //alert(\"from commetns area\");\n var maindata = data.substring(1, data.length - 1);\n //alert(tmp);\n var seperator = maindata.replace(/},{/g, '} DELIMIT {');\n var finalop = seperator.split(\" DELIMIT \");\n //alert(finalop);\n for (var i in finalop)\n {\n // alert(finalop[i]);\n var obj = jQuery.parseJSON(finalop[i]);\n var todo_str = \"No Data Loaded\";\n var comment_data =\n \"<div class='left_comments'>\" +\n obj.user + \"</div><div class='right_comments'>@\" + obj.time +\n \"</div><div><textarea rows=\\\"2\\\" cols=\\\"100\\\" readonly>\" +\n obj.comment +\n \"</textarea>\" +\n \"</div><br>\";\n $(comment_data).appendTo(\"#professor_comments\");\n }\n },\n error: function() {\n alert(\"failure\");\n //$(\".content3\").css(\"display\", \"none\");\n }\n });\n /* ending of code - To fill the comment area */\n\n}", "function newComment(e, id, page=null){\n if(e.keyCode === 13){\n e.preventDefault();\n if($(\"#comment_insert_\" + id.split(\"_\")[2]).val() == ''){\n alert(\"Non puoi inserire un commento vuoto!\\nScrivi qualcosa!\\n\");\n }\n else{\n if($.isNumeric(location.href.match(/([^\\/]*)\\/*$/)[1])){\n var id_page = location.href.match(/([^\\/]*)\\/*$/)[1];\n }\n $.ajaxSetup({\n headers: {\n 'X-CSRF-TOKEN': $('meta[name=\"csrf-token\"]').attr('content')\n }\n });\n $.ajax({\n method: \"POST\",\n url: \"/home/comment\",\n dataType : \"json\",\n data: {content: $(\"#comment_insert_\" + id.split(\"_\")[2]).val(), id_post: id.split(\"_\")[2], id_page: id_page},\n success : function (data){\n if(data.ban != 1){\n $(\"#comment_insert_\" + data.id_post).val('');\n $comment_clone = createcomment(data);\n $comment_clone.insertBefore(\"#comment_insert_\" + data.id_post);\n $comment_clone.show();\n }\n else{\n alert(\"Non puoi commentare, sei bannato!\");\n }\n },\n error: function(data){\n var errors = data.responseJSON;\n alert(\"Qualcosa è andato storto! Prova a ricaricare la pagina.\\n\" + errors.message);\n }\n })\n }\n }\n}", "function hitQueue(postData){\n $.ajax({ type: \"POST\",url: site_url_attend+\"/ajax?for=visitorQueue\",data: postData, // change it\n success: function(A) {\n\n }\n });\n }", "function commentsOperation(response,textStatus,jqXHR){\n \n if(response && response.success === true){\n popUp(\"success\",response.message);\n setTimeout(function(){window.location.reload();},1000);\n \n }else{\n popUp(\"error\",response.message);\n }\n \n}//END commentsOperation callback function", "function post_update_comment ( task_id, comment_id ){\n\n var text = document.getElementById(task_id.toString()+comment_id.toString()).innerHTML;\n\n $.ajax({\n url: \"/task/\"+task_id+\"/comment/update/\"+comment_id+\"/\",\n method:\"POST\",\n data: {\n 'text': text\n },\n dataType: 'json',\n success: function (data) {\n approve_appear(\"Changes of comment saved \");\n }\n });\n\n\n\n}", "function post(event) {\n\n event.stopPropagation();\n\n return core.ajax('POST', url + 'new',\n function(xhr, resolve){\n logFeedback(xhr);\n\n resolve(event);\n\n },\n getMessage(),\n contentJson)\n .then(refresh)\n }", "function onAjaxSuccess(data) {\r\n\t\t// data is html returned by server\r\n\t\tvar up_div = jq(data).find('div.comment article.msg');\r\n\r\n\t\t// number of messages received from server\r\n\t\tvar newmsgs = up_div.length;\r\n\r\n\t\t// [newmsgs > msgs] means that there are new messages\r\n\t\tif (newmsgs > msgs) {\r\n\t\t\tnewid.length = 0;\r\n\t\t\tif (msgs > 0) {\r\n\t\t\t\tup_div.slice(msgs,newmsgs).each(doindent);\r\n\t\t\t} else {\r\n\t\t\t\tup_div.each(doindent);\r\n\t\t\t}\r\n\t\t\t// update message counter\r\n\t\t\tjq(\"#popupMsgs\").text(newmsgs-msgs);\r\n\t\t\tmsgs = jq('div.comment article.msg').length;\r\n\t\t\tsetCounter(thread_id, msgs);\r\n\t\t\tcnt = msgs;\r\n\r\n\t\t\tjq('a._new_').remove();\r\n\t\t\taddNavigateLinks(newid);\r\n\t\t\tif (document.getElementById(newid[0])) document.getElementById(newid[0]).scrollIntoView();\r\n\t\t\tnewid.length = 0;\r\n\r\n\t\t} else {\r\n\t\t\t// no news\r\n\t\t\t// drop temp data\r\n\t\t\tjq(\"#popupMsgs\").text('0');\r\n\t\t}\r\n\t\tjq(\"#popupContact\").show();\r\n\t\tst('$(\"#popupContact\").hide();',3000);\r\n\t}", "function submitForm14()\n\t {\n\t\t\tvar data = $(\"#com-form\").serialize();\n\n\t\t\t$.ajax({\n\n\t\t\ttype : 'POST',\n\t\t\turl : 'comment_proce.php',\n\t\t\tdata : data,\n\t\t\tbeforeSend: function()\n\t\t\t{\n\t\t\t\t$(\"#error\").fadeOut();\n\t\t\t\t$(\"#btn-reply\").html('<span class=\"glyphicon glyphicon-transfer\"></span> &nbsp; sending ...');\n\t\t\t},\n\t\t\tsuccess : function(response)\n\t\t\t {\n\t\t\t\t\tif(response==\"ok\"){\n\n\t\t\t\t\t\t//$(\"#btn-reply\").html('<img src=\"btn-ajax-loader.gif\" /> &nbsp; Posting .....');\n//\t\t\t\t\t\tsetTimeout(' window.location.href = \"index\"; ',4000);\n window.history.go(0);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\n\t\t\t\t\t\t$(\"#error\").fadeIn(1000, function(){\n\t\t\t\t$(\"#error\").html('<div class=\"alert alert-danger\"> <span class=\"glyphicon glyphicon-info-sign\"></span> &nbsp; '+response+' !</div>');\n\t\t\t\t\t\t\t\t\t\t\t$(\"#btn-reply\").html('<span class=\"glyphicon glyphicon-log-in\"></span> &nbsp; Post');\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t }\n\t\t\t});\n\t\t\t\treturn false;\n\t\t}", "function comment() {\n let newComment = {\n placeId: id,\n comment: $('#commentbox').val()\n }\n\n // Send new comments to server\n fetch(`https://tiny-lasagna-server.herokuapp.com/collections/commentTestCollection/`, {\n method: \"POST\",\n body: JSON.stringify(newComment),\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n }\n })\n .then((results) => {\n return results.json();\n })\n .then((commentResult) => {\n console.log('This is the post result', commentResult)\n location.reload();\n })\n }", "function comment() {\n //Disselect all highlighted annotations\n $( \".annot\").removeClass( \"annot-highlight\");\n //Hide the comment button\n $('.highlighter-container').hide();\n //Scroll to the comment form\n $(document).scrollTop( $(\"#respond\").offset().top );\n\n var html = $('.highlighter-container').data(\"htmlSel\");\n\n if(html != ''){\n //Add form fields to the comment form\n if($(\".comment-form-quote\").length == 0){\n $(\".comment-form-comment\").before( '<p class=\"comment-form-quote\"></p>' );\n }\n $(\".comment-form-quote\").html('<span class=\"annot-hide\">Comment on Text</span> \"'+html+'\"');\n\n if($(\"#comment_quote\").length == 0){\n $(\"#comment_parent\").after('<input type=\"hidden\" name=\"comment_quote\" id=\"comment_quote\">');\n }\n $(\"#comment_quote\").attr(\"value\", html);\n\n var idPrev = $('.highlighter-container').data(\"idPrev\");\n if($(\"#comment_quote_idprev\").length == 0){\n $(\"#comment_quote\").after('<input type=\"hidden\" name=\"comment_quote_idprev\" id=\"comment_quote_idprev\">');\n }\n $(\"#comment_quote_idprev\").attr(\"value\", idPrev);\n\n var htmlPrev = $('.highlighter-container').data(\"htmlPrev\");\n if($(\"#comment_quote_prev\").length == 0){\n $(\"#comment_quote\").after('<input type=\"hidden\" name=\"comment_quote_prev\" id=\"comment_quote_prev\">');\n }\n $(\"#comment_quote_prev\").attr(\"value\", htmlPrev);\n\n var idAfter = $('.highlighter-container').data(\"idAfter\");\n if($(\"#comment_quote_idafter\").length == 0){\n $(\"#comment_quote\").after('<input type=\"hidden\" name=\"comment_quote_idafter\" id=\"comment_quote_idafter\">');\n }\n $(\"#comment_quote_idafter\").attr(\"value\", idAfter);\n\n var htmlAfter = $('.highlighter-container').data(\"htmlAfter\");\n if($(\"#comment_quote_after\").length == 0){\n $(\"#comment_quote\").after('<input type=\"hidden\" name=\"comment_quote_after\" id=\"comment_quote_after\">');\n }\n $(\"#comment_quote_after\").attr(\"value\", htmlAfter);\n }\n }", "function recordResponse(Post) {\n $.post(\"/api/response/\", Post, function() {\n // window.location.href = \"/\";\n console.log(\"Posted: \" + JSON.stringify(Post));\n });\n}", "function sub_comment( e, commentId, value){\n //alert(\"a\");\n if (e.keyCode == 13 && !e.shiftKey)\n { \n \n e.preventDefault();\n //now call the code to submit your form\n var getId = commentId.split(\"sub_comment\");\n var id = getId[1];\n var check = value.replace( /\\s\\s+/g, '' );\n \n if(check != \"\"){\n var _token = $('input[name=\"_token\"]').val();\n $.ajax({\n //url: '/'+\"{{URL::to('/')}}\"+'post-like',\n url: app_url+'/post-sub-comment',\n type: \"POST\",\n data: { _token : _token,\n text: value,\n commentId: id \n },\n success: function(response){\n console.log(response);\n $(\"#append_sub_comment_\"+id).append(response);\n }\n });\n \n $(\"#sub_comment\"+id).val(\"\").css(\"height\", \"auto\");\n return; \n }\n \n }\n \n }", "function addComment() {\n var commentBox = document.getElementById(\"add-comment\");\n if(username) {\n if (commentBox.value != \"\") {\n // Need to grab the total number of comments, and update it.\n $.post(\"getMarker\", {\n lat: currCow.marker.getPosition().lat(),\n lng: currCow.marker.getPosition().lng()\n }, function(marker) {\n $.post(\"addComment\", {\n content: commentBox.value,\n score: 0,\n index: (marker[0].numComments + 1),\n numComments: (marker[0].numComments + 1),\n lat: currCow.marker.getPosition().lat(),\n lng: currCow.marker.getPosition().lng(),\n date: new Date()\n });\n\n $.post(\"updateNumComments\", {\n lat: currCow.marker.getPosition().lat(),\n lng: currCow.marker.getPosition().lng(),\n numComments: (marker[0].numComments + 1)\n });\n\n commentBox.value = \"\";\n loadComments();\n });\n }\n }\n\n else {\n $(\"#login-modal\").modal('show')\n }\n}", "function postComment()\n{\n\tvar postID = window.location.search.substring(1); //grabbing URL variable \n\tvar splitVariables = postID.split('='); //split at = and store in array\n\tpostID = splitVariables[1]; //we want index 2 because list should be: 'name', variableNeeded\n\n\tvar posterName = document.getElementById('name').value;\n\tvar posterEmail = document.getElementById('email').value;\n\tvar posterImage = document.getElementById('imageURLbox').value;\n\tvar posterComment = document.getElementById('comment').value;\n\tvar posterDate = \"Just now!\";\n\n\t//==============================TEMPORARY COMMENTS - DELETES ON REFRESH =====================\n\tstringBody = stringBody + \"<li><div class='comment-img'><img src='\" + posterImage + \"0'/></div><div class='comment-text'><strong><a href=''>\" + posterName +\n \"</a></strong><p>\" + posterComment + \"</p> <span class='date sub-text'>on \"\n + posterDate + \"</span></div></li>\";\n document.getElementById('comments').innerHTML = \"<b>Comments:</b>\" + stringHeader + stringBody + stringFooter;\n //=======================SAVE TO DATABASE HERE ===============================\n\n\t//Add to database!!!\t\t\n\txmlhttp=new XMLHttpRequest();\n\txmlhttp.onreadystatechange=function() {\n\t\tif (xmlhttp.readyState==4 && xmlhttp.status==200) {//executed when state = done and status = OK\n\t\t\tresponse=xmlhttp.responseText;\n\t\t\tconsole.log('Insert comment response: ' + response);\n\t\t}\n\t}\n\txmlhttp.open(\"GET\",\"comment.php?id=\"+postID+\"&text=\"+posterComment+\"&email=\"+posterEmail, true);\n\txmlhttp.send();\n\tposterComment = document.getElementById('comment').value = \"\"; //erase comment from box\n}", "function createNewPost(){\n Quas.ajax({\n url : \"/php/post-create.php\",\n type : \"POST\",\n data : {\n sid : getCookie(\"session\")\n },\n success : function(res){\n Toolbar.postID = res;\n Quas.setUrlValues({p:Toolbar.postID});\n new Notification(\"Created Post\", 3).render();\n }\n });\n}", "handleComment() {\n this.isCommentPending(true);\n return postComment(this.id, { author: this.app.author(), comment: this.newComment() }).then((event) => {\n this.newComment('');\n this.isCommentPending(false);\n return this.eventList.unshift(formatEvent(event, this.messageType));\n });\n }", "function checkForNewComments(addAutomatically) {\n var args = {\n projectID: projectID, // projectID is global variable in Project.aspx\n parentCommentID: null\n };\n serviceAjax(\"GetComments\", args, function(results) {\n // newCommentsDiff is a global variable\n newCommentsDiff = compareCommentTrees(allComments, results);\n if (newCommentsDiff.length != 0) {\n // newComments is a global vaiable\n newComments = results;\n if (addAutomatically) {\n addCommentsToView(newCommentsDiff);\n allComments = newComments;\n } else {\n // Set button text\n var newCommentCount = countComments(newComments) - countComments(allComments);\n $(\"#btn-fetch-comments\").text(newCommentCount\n + \" New Comment\"\n + (newCommentCount > 1 ? \"s\" : \"\"));\n }\n }\n }, function(error) {\n console.log(error);\n });\n}", "function appendRepost()\n{\n\t/*\n<div id='repostContainer' style='background-color: #efefef; display:none;'>\n<a id='cancelRepost'>Cancel Repost</a>\n<div id='repostUsername' style='padding-bottom:8px'></div>\n<div id='repostContent'></div>\n\t*/\n\tif (repostTemp != null && $(\"#repostContainer\").length > 0)\n\t{\n\n\t\t// repostTemp.username\n\t\t$('#repostContainer').show();\n\n\t\t// This data will be sent to server:\n\t\t$('#repostContainer').data(\"postdata\", repostTemp);\n\t\t// Also important: repostTemp.userId, repostTemp.postId\n\t\t$('#repostHeader span').text(\"You repost \"+repostTemp.username+\"'s post:\");\n\t\t$('#repostContent').text(repostTemp.content);\n\t\t$('#textfield').focus();\n\t\t\trepostTemp = null;\n\t}\n}", "function comment_click(){\n\tvar validate1= false;\n\t\tvar validate2 = false;\n\t\tvar comment_name = $('#comment_name').val();\n\t\tvar comment_text = $('#comment_body').val();\n\t\tvar post_id = $('#p_id').val();\n\t\tif (comment_text=='' || post_id==''){\n\t\t\t$('#comment_body').css('border','1px solid #EC9393');\n\t\t\t$('#comment_body').attr('placeholder','Please make a comment');\n\t\t\tvalidate1 = true;\n\t\t}\n\t\tif(comment_name==''|| post_id==''){\n\t\t\t$('#comment_name').css('border','1px solid #EC9393');\n\t\t\t$('#comment_name').attr('placeholder','please enter your name');\n\t\t\tvalidate2 = true;\n\t\t}\n\t\telse if (comment_name.length <=3 || comment_name.length >= 11){\n\t\t\t$('#comment_name').attr('placeholder','');\n\t\t\t$('#comment_name').css('border','1px solid gray');\n\t\t\t$('#comment_name').val('');\n\t\t\t$('#comment_name').attr('placeholder','please your name should be at least 4 to 10 characters ');\n\t\t\tvalidate2 = true;\n\t\t}\n\t\tif(validate2 == false && validate1 == false ){\n\t\t\t//ajax process\n\t\t\tconsole.log('username: '+comment_name+ ' text:'+comment_text+' post_id '+ post_id);\n\t\t\t$('#comment_name').attr('placeholder','');\n\t\t\t$('#comment_name').val('');\n\t\t\t$('#comment_body').val('');\n\t\t\t$.ajax({\n\t\t\t\turl:'ajax/comment_insert.php',\n\t\t\t\tmethod:'POST',\n\t\t\t\tdata:{com_insert:1, comment_name:comment_name, comment_text:comment_text, post_id:post_id},\n\t\t\t\tsuccess: function(data){\n\t\t\t\t\tcomment_insert(jQuery.parseJSON(data));\n\t\t\t\t\tconsole.log('responseText: '+ data);\n\t\t\t\t},\n\t\t\t\terror: function(data){\n\t\t\t\t\tconsole.log('responseText: '+ data);\n\t\t\t\t}\n\t\t\t});\t\n\t\t}\n}", "function createReply(postNum) {\n\tconsole.log('sending request to make new reply');\n\tconsole.log('replying to post ' + postNum);\n\tvar newPost = document.getElementById('forumPostText').value;\n\tconsole.log(newPost);\n\t\n\t//grab current date and time\n\tvar today = new Date();\n\tvar date = today.getDate() + '/' + (today.getMonth()+1) + '/' + Math.floor((today.getFullYear() % 100));\n\tvar period = (today.getHours() > 12 ? 'PM' : 'AM');\n\tvar hours = today.getHours() == 0 ? 12 : today.getHours() % 12;\n\tvar minutes = today.getMinutes() < 10 ? '0'.toString() + today.getMinutes().toString() : today.getMinutes().toString();\n\tvar time = hours + \":\" + minutes + \" \" + period;\n\tvar dateTime = date + ' ' + time;\n\n\tif (newPost != '') { //check for non-empty post\n\t\tconst requestURL = '/forumPost/reply';\n\t\t$.ajax({\n\t\t\turl: requestURL,\n\t\t\ttype: 'POST',\n\t\t\tdataType: 'JSON',\n\t\t\tdata: {\n\t\t\t\t\"problem\": userStorage.getItem('problemName'),\n\t\t\t\t\"problemID\": userStorage.getItem('problemID'),\n\t\t\t\t\"postNum\": postNum,\n\t\t\t\t\"username\": tempStorage.getItem('username'),\n\t\t\t\t\"text\": newPost,\n\t\t\t\t\"date\": dateTime\n\t\t\t},\n\t\t\tsuccess: (data) => {\n\t\t\t\t//reload forum posts\n\t\t\t\tconsole.log(data);\n\t\t\t\tremoveForumPosts();\n\t\t\t\tfetchForum(userStorage.getItem('problemID'));\n\t\t\t\tclearForumPostBox();\n\t\t\t},\n\t\t\terror:function (xhr, ajaxOptions, thrownError){\n\t\t\t\tif(xhr.status==404) {\n\t\t\t\t\talert(thrownError);\n\t\t\t\t\tconsole.log('not found');\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n}", "function insertComm() {\n var us = document.getElementById(\"user\");\n var co = document.getElementById(\"comment\");\n var pt = document.getElementById(\"pto\");\n var id = document.getElementById(\"featureid\");\n var xmlhttp = new XMLHttpRequest();\n //Make the post to the batabse\n xmlhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n //Update the map with the new point\n comments.getSource().updateParams({\"time\": Date.now()});\n //And delete the feature with the form.\n DeleteFeature(id.value);\n }\n };\n xmlhttp.open(\"POST\", \"insertComment.php?u=\"+us.value+\"&c=\"+co.value+\"&p=\"+pt.value, true);\n xmlhttp.send();\n}", "function save_cme_audit(){\r\t\r\tvar count_id = $('#id_count').val();\r var\tid = [];\r\tvar issues = [];\r\t\r\tfor(var i = 1;i<= count_id;i++){\r\t\tid[i] = $(\"#\" + i).val();\r\t\tissues[i] = $(\"#issues_text\" + id[i]).val();\r\t\t\r\t} \r\t\r\tvar data = {'id':id, 'issues_text':issues };\r\t\r\t$.ajax({\r\t\turl : \"?content=content/audit&li_class=CME\",\r\t\tmethod : \"POST\",\r\t\tdata : data,\r\t\tasync : true,\r\t\tdataType : 'json',\r\t\t\r\t\terror: function(data){\r\t\t\t\r\t\t\tjQuery.gritter.add({\r\t\t\t\ttitle: 'Success!',\r\t\t\t\ttext: 'Detail saved successfully.',\r\t\t\t\t//image: 'assets/images/user-profile-2.jpg',\t\t\t\r\t\t\t\tsticky: false,\r\t\t\t\tclass_name: 'bg-success',\r\t\t\t\ttime: '1000'\t\t\t\t\r\t\t\t});\r\t\t\t\r\t\t\tid = null;\r\t\t\t\r\t\t\tissues = null;\r\t\t\t\r\t\t\tdata = null;\r\r\t\t}\r\t});\r\t\r}", "function otbot_create_issue(key,issue,summary,description){\n\n $.post(\n \n // see tip #1 for how we declare global javascript variables\n \n ajaxurl,\n {// here we declare the parameters to send along with the request\n \n action : 'otbot_create_issue',\n // other parameters can be added along with \"action\"\n \n otbot_project_key: key,\n otbot_issueType: issue,\n otbot_summary: summary,\n otbot_description: description,\n otbot_cookieName: cookieName\n \n },\n \n function( response ) {\n if(response == 'ERROR!!!'){\n alert(\"Error creating Issue\");\n }else{\n $('#wait').hide();\n $('#creates').hide();\n $('#ot_issue_link').attr('href','http://ot.syr.edu/browse/' +response);\n $('#ot_issue_link').text('Issue created at http://ot.syr.edu/browse/' + response);\n $('#ot_issue_link').show();\n }//end if no error\n });//end ajax post\n\n}//end otbot_create_issue", "function _colorlibMainPopUp(obj)\r\n{\r\n\tif(!isValidRecord(true))\r\n\t{\r\n\t\treturn;\r\n\t}\r\n\r\n\tobjAjax = new htmlAjax();\r\n objAjax.setActionURL(\"threadedcomments.do\");\r\n objAjax.setActionMethod(\"viewcomments\");\r\n objAjax.setProcessHandler(\"colorLibCommentResponse\");\r\n objAjax.parameter().add(\"parentViewId\", 2900);\r\n objAjax.sendRequest();\r\n}", "function ajaxPost() {\n leaseId = $('#Start_Date').val();\n\n if (leaseId == 0) {\n loadSavelease();\n }\n\n}", "function Post_comment_to_db(post_id, id_user, time, vl)\n {\n $.ajax({\n type: \"POST\",\n url: \"../../Controller/users_controller.php\",\n data: {mabaidang: post_id, idnguoidung: id_user, thoigianbl: time, noidung: vl},\n success: function(data){\n // document.getElementById(\"kt\").innerHTML = data;\n }\n });\n }", "function onBeginSave() {\n console.log(\"onBeginSave\");\n postJsonData();\n}", "_submitData(event) {\n\n // prevent submit form\n event.preventDefault();\n\n if( !this._controlDataBeforeSend() ) {\n document.body.scrollTop = document.documentElement.scrollTop = 0;\n return;\n }\n\n //let xhr = new XMLHttpRequest();\n let data = {\n name: this.options.title,\n description: this.options.describe,\n clients: this.options.data\n };\n\n var xhr = $.ajax({\n type: \"POST\",\n url: this._config.url,\n contentType: \"application/json; charset=utf-8\",\n dataType: \"json\",\n data: JSON.stringify(data)\n });\n\n var complete = false;\n\n xhr\n .done(function() {\n complete = true;\n\n })\n .fail(function() {\n complete = false;\n })\n .always(function() {\n if(complete) {\n window.location = \"/autodialer/tasks?saved\";\n } else {\n noty({\n text: 'К сожалению произошла ошибка, попробуйте ещё раз!'\n });\n }\n });\n }", "function addPost() {\n var ptitle = document.getElementById(\"postTitleID\").value;\n var pcontent = document.getElementById(\"postInfoID\").value;\n\n var date3 = new Date().toDateString();\n var datetime3 = new Date(); \n var hour3 = datetime3.getHours(); \n var min3 = datetime3.getMinutes(); \n var sec3 = datetime3.getSeconds(); \n\n // var hrs = document.getElementById(\"taskDueID\").value.getHours();\n // var mins = document.getElementById(\"taskDueID\").value.getMinutes();\n // var secs = document.getElementById(\"taskDueID\").value.getSeconds();\n\n var strtime2 = fix(hour3,2)+\":\"+fix(min3,2)+\":\"+fix(sec3,2)+\" \"+date3;\n var postTime = \"Posted on \" + strtime2;\n var addPostRequest = new XMLHttpRequest();\n\n addPostRequest.onreadystatechange = function() {\n if (addPostRequest.readyState == 4) {\n if (addPostRequest.status == 200) {\n console.log(\"Successfully Added\");\n }\n if (addPostRequest.status == 404) {\n console.log('404 Not Found');\n }\n }\n };\n\n addPostRequest.open('POST', \"/users/addPost\", true);\n addPostRequest.setRequestHeader(\"Content-type\", \"application/json\");\n addPostRequest.send(JSON.stringify({ \"ptitle\": ptitle, \"postTime\": postTime, \"pcontent\": pcontent }));\n }", "function postComment(){\n\tvar textArea = document.getElementById('commentBox')\n\tvar text = textArea.value.trim()\n\tvar xmlDoc = document.implementation.createDocument(null, null, null);\n\tvar xml = xmlDoc.createElement('comment');\n\tif(text == \"\")\n\t\treturn;\n//\t\txml.appendChild( xmlDoc.createTextNode( \" \") );\n\tvar reg = /</\n\tvar match = text.search(reg)\n\tif(text.search(/</) != -1 || text.search(/>/) != -1){\n\t\ttext = text.replace(/</g, \"&lt\")\n\t\ttext = text.replace(/>/g, \"&gt\")\n\t}\n\txml.appendChild( xmlDoc.createTextNode( text) );\n\txmlDoc.appendChild( xml );\n\t\n\tvar req = new XMLHttpRequest();\n\tvar url = 'servlet/addChild/comments/' + imgSrc;\n\treq.open(\"POST\", url, true);\n\t\treq.onreadystatechange = function() {\n\t\tif ( req.readyState == 4) {\n\t\t\tvar div = document.getElementById('comment-field');\n\t\t\tvar comment = req.responseText.trim();\n\t\t\tgetComments()\n\t\t\ttextArea.value = \"\"\n\t\t\t}\t\n\t\t\t\n\t\t}\n\treq.send(xmlDoc);\n\ttext.value = '';\n}", "function Post () {\n}", "function addComment(){\n console.log(userName)\n let comT = document.getElementById(\"comment-title\").value\n if(isEmpty(comT)){\n document.getElementById(\"comment-title\").value = \"\";\n }\n else{\n let xhttp = new XMLHttpRequest();\n let comment = {\n com : comT,\n trackTask : tracker,\n by : userName\n }\n /* replace https://note-it-keeper.herokuapp.com/ to http://localhost:8000 when running locally */\n xhttp.open(\"POST\" , \"https://note-it-keeper.herokuapp.com/getComment\" , true);\n xhttp.setRequestHeader(\"Content-Type\",\"application/json; charset=utf-8\");\n xhttp.send((JSON.stringify(comment)));\n xhttp.onreadystatechange = function(){\n if (this.readyState == 4 && this.status == 200) {\n /* y is passed as true to updateData here to run displaySubTask() as a callback */\n let y = true\n updateData(tabTracker,y);\n }\n }\n document.getElementById(\"comment-title\").value = \"\";\n }\n}", "function addIssue() {\n\n//populating the data from form fields\n var data = {\n title: $('input[name=title]').val(),\n description: $('#description').val(),\n completionDate: $('input[name=completionDate]').val(),\n status: $('#status').chosen().val(),\n assigned: $('#assigned').chosen().val(),\n tracker: $('#tracker').chosen().val()\n };\n\n\n//ajax post\n $.ajax({\n\n type: \"POST\",\n url: \"/jit/app/issues/\" + getProjectName() + \"/add\",\n contentType: \"application/json\",\n dataType: 'json',\n data: JSON.stringify(data),\n beforeSend: function (xhr) {\n xhr.setRequestHeader(header, token);\n },\n success: function (data) {\n\n\n }\n });\n}", "function createPost() {\n\tvar blogTitle = $(\"#blog-title\").val();\n\tvar blogContent = $(\"#blog-content\").val();\n\tvar doctorId = $.session.get(\"doctorId\");\n\n\t// alert(tempType);\n\n\tif (blogTitle === \"\") {\n\t\t// Fancy Notification\n\t\tshowNotification('bg-red', 'Please Enter the Post Title!', 'bottom',\n\t\t\t\t'center', 'animated bounceInDown', 'animated bounceOutDown');//\n\t\t// NotifyCustom.js\n\t\t// alert(\"Please Enter the Post Title!\");\n\t} else if (blogContent === \"\") {\n\t\t// Fancy Notification\n\t\tshowNotification('bg-blue', 'Please Enter valid Blog Content!',\n\t\t\t\t'bottom', 'center', 'animated bounceInDown',\n\t\t\t\t'animated bounceOutDown');//\n\t\t// NotifyCustom.js\n\t\t// alert(\"Please Enter valid Template Name/ Template Body\");\n\t} else {\n\t\tconsole.log(Date.now());\n\t\t$.ajax({\n\t\t\turl : getPresentationLayerAddress() + \"/api/v1/blog/doctor/\"\n\t\t\t\t\t+ doctorId + \"/\",\n\t\t\ttype : \"POST\",\n\t\t\tcontentType : \"application/json; charset=utf-8\",\n\t\t\tdata : JSON.stringify({\n\t\t\t\t\"body\" : blogContent,\n\t\t\t\t\"title\" : blogTitle\n\t\t\t}),\n\t\t\tsuccess : function(result) {\n\t\t\t\tif (result._id) {\n\t\t\t\t\t// alert(\"Template Created!\");\n\t\t\t\t\t// Fancy Notification\n\t\t\t\t\tshowNotification('bg-orange', 'Post Created!', 'bottom',\n\t\t\t\t\t\t\t'left', 'animated zoomInRight',\n\t\t\t\t\t\t\t'animated zoomOutRight');// NotifyCustom.js\n\t\t\t\t\t$(\"#blog-title\").val(\"\");\n\t\t\t\t\t$(\"#blog-content\").val(\"\");\n\t\t\t\t\t// getBlogs();\n\t\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t\tlocation.reload();\n\t\t\t\t\t}, 1000);\n\t\t\t\t} else {\n\t\t\t\t\talert(\"Error: \" + JSON.stringify(result));\n\t\t\t\t}\n\t\t\t},\n\t\t\terror : function(result) {\n\t\t\t\talert('Error: ' + JSON.stringify(result));\n\t\t\t}\n\t\t});\n\n\t}// if-else\n}", "function postComment(postID, comment) {\n $.ajax( {\n url: \"/forum/postComment\",\n type: \"POST\",\n data: \"postID=\" + postID + \"&comment=\" + encodeURI( comment )\n } ).done( function ( data )\n {\n appendReplyToParentContainer( data, postID );\n } );\n \n}", "function addComment() {\n console.log(currentIndex);\n var newCommentModal = new Modal(document.getElementById(\"newCommentModal\"));\n var messageModal = new Modal(document.getElementById(\"thankyouModal\"));\n var comment = new Object();\n\n newCommentModal.hide();\n comment.movieId = movie_array[currentIndex]._id;\n comment.movie = movie_array[currentIndex].title;\n comment.username = document.getElementById(\"nickname\").value;\n comment.review = document.getElementById(\"userComments\").value;\n // comment.datePosted = new Date().toString();\n comment.rating = rating;\n\n var postComment = new XMLHttpRequest(); // new HttpRequest instance\n\n postComment.open(\"POST\", comment_url, true); //For Local Comments DB\n\n\n postComment.setRequestHeader(\"Content-Type\", \"application/json\");\n postComment.onload = function () {\n fetchComments();\n messageModal.show();\n\n };\n postComment.send(JSON.stringify(comment));\n}", "function addNewComment (record)\n{\n\tconsole.log ('[Yaniv] addLastComment(record):: called.');\n\t\t\t\n\tvar tivitID = record.find(\"input\").attr(\"tivitid\");\n\tconsole.log (\"[Yaniv] addLastComment(record):: tivitID=\", tivitID);\n\tvar lastPost = record.find ('.post');\n\tvar newcommentId = \"newcomment\" + tivitID;\n\t\t\t\t\n\tvar newComment = '<li class=\"record\" id=\"' + newcommentId + '\"></li>';\n\tconsole.log ('[Yaniv] newComment=', newComment);\n\t\t\t\n\tlastPost.before(newComment);\n\t\t\t\n\tconsole.log ('[Yaniv] addLastComment(record):: END.');\n}", "function comment( e , id){\n\n if (e.keyCode == 13 && !e.shiftKey)\n { \n e.preventDefault();\n //now call the code to submit your form\n var getId = id.split(\"description\");\n var id = getId[1];\n description = $(\"#description\"+id).val();\n check = description.replace( /\\s\\s+/g, '' );\n \n if(check != \"\"){\n var userId = $(\"#description\" + id).attr('user');\n \n var _token = $('input[name=\"_token\"]').val();\n $.ajax({\n //url: '/'+\"{{URL::to('/')}}\"+'post-like',\n url: app_url+'/post-comment',\n type: \"POST\",\n data: { _token : _token,\n userId: userId,\n text: description,\n postId: id \n },\n success: function(response){\n //\n $(\"#append_comment_\"+id).append(response);\n }\n });\n //console.log(description);\n $(\"#description\"+id).val(\"\").css(\"height\", \"auto\");\n return; \n }\n \n }\n\n // if (e.keyCode == 13 && e.shiftKey)\n // { \n // //this is the shift+enter right now it does go to a new line\n // //alert(\"shift+enter was pressed\"); \n // } \n }", "function Post() {}", "function validateNewComment() {\n ambra.formUtil.disableFormFields(_annotationForm);\n var submitMsg = dojo.byId('submitMsg');\n\n if(submitMsg.style.display != 'none') {\n var ani = dojo.fx.wipeOut({ node:submitMsg, duration: 500 });\n dojo.connect(ani, \"onEnd\", function () { startValidateNewComment(); });\n ani.play();\n } else {\n startValidateNewComment();\n }\n}", "function addCommentToComment(btn) {\n let text = $(\"#input_comment_\" + btn.id).val();\n\n perentMsgId = btn.getAttribute(\"to-msg\")\n\n\n let msg = {\n Text: text,\n UserIdMsg: currentUserId,\n SeriesId: currentSeries.id\n }\n $(\"#input_comment\").val('');\n\n let api = \"../api/Messages?perendMsgID=\" + perentMsgId;\n ajaxCall(\"PUT\", api, JSON.stringify(msg), MsgSuccessCB, ErrorCB);\n console.log(msg);\n\n}", "function updateComment(){\n\t$(\".updateLink\").click(function(e) {\n\t\t//idsString contain Album id,Photo id.\n\t\tvar jobId=$(e.currentTarget).attr(\"rel\");\n\t\tvar commentText=$(\"#jobComment_\"+jobId).val();\n\t\t$(\"#imgsave_\"+jobId).attr(\"src\", \"/\"+PROJECT_NAME+\"public/images/loading_small_black.gif\");\n\t\t$(\"#imgsave_\"+jobId).fadeIn();\n\t\t$.ajax({\n\t\t\turl : \"/\" + PROJECT_NAME + \"job/update-comment\",\n\t\t\tmethod : \"POST\",\n\t\t\tdata : \"jobID=\"+jobId+\"&comment=\"+commentText,\n\t\t\ttype : \"post\",\n\t\t\tdataType : \"json\",\n\t\t\tbeforeSend: function(){\n\t\t\t\t\n\t\t\t },\n\t\t\tsuccess : function(jsonData) {\n\t\t\t\t$(\"#imgsave_\"+jobId).hide();\n\t\t\t\tif(jsonData.msg=\"success\"){\n\t\t\t\t\tif(commentText.length>16){\n\t\t\t\t\t\t$(\"#commentBtn_\"+jobId).val(commentText.substr(0,16)+\"...\");\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t$(\"#commentBtn_\"+jobId).val(commentText);\n\t\t\t\t\t}\n\t\t\t\t\t$(\"#jobComment_\"+jobId).val(commentText);\n\t\t\t\t\t$(\"#orignalCmnt_\"+jobId).val(commentText);\n\t\t\t\t\t\n\t\t\t\t\t$(\"#commentUpdateBox_\"+jobId).hide();\n\t\t\t\t\tif(commentText!=\"\"){\n\t\t\t\t\t\t$(\"#commentBtn_\"+jobId).attr(\"src\",\"/\"+PROJECT_NAME+\"public/images/comments-icon-purple.png\");\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t$(\"#commentBtn_\"+jobId).attr(\"src\",\"/\"+PROJECT_NAME+\"public/images/comments-icon-grey.png\");\n\t\t\t\t\t}\n\t\t\t\t\t$(\"#commentBtn_\"+jobId).fadeIn();\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t});\t\t\n\t});\n}", "function show_comments(){\n if(show_check()){\n var url = \"controllers/script/comments-script.php\";\n var article_id;\n\n $(\"tr[name=data_row]\").each(function() {\n $(this).children(\"td[name=table_td-checkbox]\").children(\"div\").addClass(\"disabled\");\n if($(this).hasClass(\"selected\")){\n article_id = $(this).children(\"td[name=id]\").children(\"input\").val();\n }\n });\n\n $.ajax(url, {\n method : \"POST\",\n data : {\n \"operation\" : 1, // Show comments\n \"article_id\" : article_id\n },\n dataType : \"html\",\n success: function(response){\n $(\"#table_basic_container\").fadeIn(500);\n $(\"#no_comments\").removeClass(\"active-elem\");\n $(\"#no_comments\").addClass(\"hide-elem\");\n $(response).appendTo(\"#comments_table\").show().fadeIn(700);\n $(\"#membership_article\").val(article_id);\n\n if(!count_data_basic_row()){\n $(\"#delete_all\").hide();\n $(\"#back_table\").show();\n }else{\n $(\"#delete_all, #back_table\").show();\n }\n },\n error: function(xhr) {\n alert(\"ERROR: \" + xhr.responseText + xhr.status);\n }\n });\n }\n}", "function addNewPost() {\n\n //alert(\"addNewPost called\");\n\n // Login Information\n var newPostTitle = document.getElementById('newPostTitle').value;\n var newPostDesc = document.getElementById('newPostDesc').value;\n var newImageURL = document.getElementById('newImageURL').value;\n\n var validate = false;\n if (newPostTitle != \"\" && newPostDesc != \"\") {\n validate = true;\n }\n\n if (validate) {\n var newPost = {\n \"post_title\": newPostTitle,\n \"post_body\": newPostDesc,\n \"post_image\": newImageURL,\n }\n\n $.ajax({\n type: \"POST\",\n url: \"https://infinite-reef-90129.herokuapp.com/addForumPost\",\n data: JSON.stringify(newPost),\n datatype: \"json\",\n xhrFields: {\n withCredentials: true\n },\n async: true,\n //\"Access-Control-Allow-Origin\": \"*\",\n contentType: \"application/json; charset=utf-8\",\n success: function processData(r) {\n var myObj = JSON.parse(r);\n if (myObj[\"post_id\"] != null) {\n\n document.getElementById('newPostTitle').value = \"\";\n document.getElementById('newPostDesc').value = \"\";\n document.getElementById('newImageURL').value = \"\";\n\n\n $('#exampleModalCenter').modal('hide');\n\n snackBar();\n\n var todaysDate = new Date();\n var postData = [{\n \"post_id\": myObj[\"post_id\"],\n \"user__username\": localStorage.username,\n \"post_title\": myObj[\"post_title\"],\n \"post_body\": myObj[\"post_body\"],\n \"post_datetime\": todaysDate,\n \"post_image\": myObj[\"post_image\"],\n \"connect_count\": myObj[\"connect_count\"],\n \"reply_count\": 0,\n \"connected\": false\n }];\n\n var postType = \"addNewPost\";\n generatePostCards(postData, postType);\n\n\n\n\n } else {\n alert(\"User is not authenticated\");\n\n }\n }\n });\n } else {\n alert(\"Post title and post body cannot be empty\");\n }\n // Preparing JSON request object\n\n}", "function submitForm2() {\n\n if (stDate.length == 0) {\n\n //window.console &&console.log(\"Using standard .ajax\");\n //alert('In submitForm. This is where formPost should be updated with new dates');\n\n postReminder();\n //postAdvancement();\n /*\n var url= 'https://' + host +'/mobile/dashboard/calendar/editevent.asp?' + iEventID;\n $.ajax({\n url: url,\n type: 'POST',\n data: formPost,\n dataType: 'xxscript',\n error: function (xhr, ajaxOptions, thrownError) {\n location.href = '/mobile/500.asp?Error=' + escape('url: ' + url + ' postData: ' + formPost + ' Status: ' + xhr.status + ' thrownError: ' + thrownError + ' responseText: ' + xhr.responseText.substring(0, 400));\n }\n ,\n complete: atEnd\n });\n */\n } else {\n\n ReminderSave();\n\n }\n}", "function postOnWall(){\n //put the loading screen on\n loadingScreen();\n \n //grab the message serial and course\n var obj=new Object();\n obj.message = $('#redactor_content').val();\n obj.id = $('#postonwall_course').val();\n obj.serial = $('#postOnWallDialog_serial').val();\n obj.papa = $('#postOnWallDialog_papa').val();\n obj.equations = $('#postOnWallDialog_equations').val();\n \n //check via ajax if user is authorized \n $.ajax({\n type: \"POST\",\n url: \"/wall/postmessage/\",\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 //change the url of the wall\n $('#tabs-wall * .comment_section').html(res.items[0].html);\n \n //disappear dialog\n $('#postOnWallDialog').fadeOut('normal');\n $('#glassnoloading').fadeOut('normal');\n \n }\n else{\n setSuccessToFailed();\n //loading screen\n removeLoadingScreen();\n\n //display success failure screen\n displaySuccessFailure();\n\n $('#error').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 }\n });\n}", "function handleNewTopicForm(){\n // Add a topic via Ajax\n var thissummary = $('#addtopicsummary').val();\n var thistitle = $('#addtopictitle').val();\n\n $.ajax({\n type: \"post\",\n url: \"/newtopic/\",\n data: { title : thistitle,\n summary_text: thissummary }\n\n\n ,\n success: function(data){\n // Close Topic Form \n $('#addtopic').hide();\n location.reload(); // TODO - make this clearer\n },\n error: function (requestError, status, errorResponse) {\n var response_text = requestError.responseText;\n var response_data = $.parseJSON(response_text);\n var errorNum = requestError.status;\n\n var errorMsg = response_data['error'];\n $('#addtopic').append('<div class=\"error-message\"><p>' + errorMsg + '</p><p class=\"instruction\">(Click this box to close.)</p></div>');\n error_message = $('#addtopic').children('.error-message');\n error_message.css('display','block');\n\n $('.error-message').click(function() {\n $(this).remove();\n });\n\n }\n });\n\n \n return false;\n}", "function ajaxPost(ident, data, postto) {\n var data = {\n id: ident,\n value: data\n }\n $.ajax({\n url: postto,\n data: data,\n type: 'POST'\n }).done(function(data) {\n $(\"#pageMessage\").html(\n data\n );\n setTimeout(function() {\n $(\"#pageMessage\").html(\"\");\n }, 2000);\n });\n}", "function postFormData()\n {\n var subcategory = $('#subcategory-name').val();\n var category = $('#category-name').val();\n var projectID = $('#project_id').val();\n\n if(subcategory == '') \n { \n $(\"#data-setting-alert-warning\").show(); \n } \n else \n {\n $.ajax({\n url: \"/riskdata/ajax_subcategory_insert\",\n type: \"POST\",\n data: {subcategory: subcategory, project_id: projectID, category: category},\n dataType: \"JSON\"\n })\n .done(function(response) {\n\n // // check if response is true\n if (response.status) {\n \n // update number of settings on side bar\n $(\"#data-setting-alert-success\").show();\n\n getNumberOfProjectSettings();\n\n // update table of updated setting\n getSettings(category);\n\n $('.list-group-item').removeClass('active'); // remove active class if present from other list group item\n\n $('#'+ response.category).addClass('active'); // add active class\n }\n })\n .fail(function(xhr) {\n $(\"#data-setting-alert-danger\").show();\n }); \n }\n }", "function POST(){\n \n}", "function insert_marks_and_comment(form_name){\n\t\t$(form_name).submit(function(evt){\n\t\t\tevt.preventDefault();\n\t\t\tvar clientIp = $('.check-client-ip').attr('attr');\n\t\t\t//alert(clientIp);\n\t\t\t\n\t\t\t\tvar commentContent = tinyMCE.get('comment_article').getContent();\n\t\t\t\t//alert(commentContent);\n\t\t\t\tvar postData = $(this).serialize() + commentContent;\n\t\t\t\tvar url = $(this).attr('action');\n\t\t\t\t$.post(url, postData, function(php_table_data){\n\t\t\t\t\t$(form_name)[0].reset();\n\t\t\t\t\talert('Hvala Vam na glasanju.');\n\t\t\t\t\tlocation.reload();\n\t\t\t\t\tconsole.log(postData);\n\t\t\t\t});\n\t\t\t\n\t\t});\t\n\t}", "function updateThread(id) {\n var req = new Request.JSON({\n url: 'control.php?action=getSinglePost&id=' + id,\n onSuccess: function(post) { \n var postObject = new PostItem(post.post_id, post.username, post.date_posted, post.comment);\n postObject.display().inject($(post.thread_id + 'container')); \n $('newPostForm').dispose(); \n }\n }).send(); \n}", "function getcommentdata(){\n if(!getAmplifyValue(\"userID\"))\n {\n setAmplifyValue(\"referrer\",\"topic-detail.html\");\n window.location =\"login.html\";\n }\n var comment = {\ntopicID : \"\",\nmessage: \"\",\nchurchID: getAmplifyValue(\"churchID\"),\nUserID: getAmplifyValue(\"userID\"),\nlinks: []\n};\n //turns the form data into an object\n //sampling username here*remember to collect after acccounts \n \n comment.message=$(\"#commenttext\").val();\n comment.topicID=getAmplifyValue(\"choirpostid\");\n \n \n var numberoflinks=$('input[name=\"linktitle\"]').length;\n \n \nfor(i=0; i<numberoflinks; i++){\n comment.links.push({\n linkTitle: $('input[name=\"linktitle\"]')[i].value,\n url: $('input[name=\"link\"]')[i].value\n });\n\n}\n\n \npostcomment(comment);\n \n \n}", "function SubmitNewQuestion(textarea, nid, level, container){\n\n\tvar content = textarea.value;\n\tdid++;\n\n\t$.ajax({\n\t\tasync: true, \n\t\ttype: 'POST', \n\t\turl: \"../API/Discussion/discussion.php\",\n\t\tdata: {action: \"save\", nid: nid, level: level, content: content, classOrConcept: classOrConcept}, \n\t\tsuccess: function(result){\n\t\t\ttextarea.value = \"\";\n\t\t\tAddTextContainer(content, container, did, myname);\n\t\t}\n\t}); \n\n\treturn false;\n}", "async function addNewComment(event) {\n const enableDataCollection = $('meta[name=\"isDataCollectionEnabled\"]').attr('content') === \"true\";\n let pathArrayForHeader = window.location.pathname.split('/');\n let currentPageForHeader = pathArrayForHeader[1];\n let currentModuleForHeader = pathArrayForHeader[2];\n let target = $(event.target);\n if (!target.hasClass('link')) {\n target = target.siblings('.link');\n }\n const text = target.siblings('input.newcomment').val();\n const card = target.parents('.ui.fluid.card');\n let comments = card.find('.ui.comments');\n // no comments area - add it\n if (!comments.length) {\n const buttons = card.find('.three.ui.bottom.attached.icon.buttons');\n buttons.after('<div class=\"content\"><div class=\"ui comments\"></div>');\n comments = card.find('.ui.comments');\n }\n if (text.trim() !== '') {\n const date = Date.now();\n const ava = target.siblings('.ui.label').find('img.ui.avatar.image');\n const ava_img = ava.attr('src');\n const ava_name = ava.attr('name');\n const postID = card.attr('postID');\n\n const mess = (\n `<div class=\"comment\">\n <a class=\"avatar\"> <img src=\"${ava_img}\"> </a>\n <div class=\"content\">\n <a class=\"author\">${ava_name}</a>\n <div class=\"metadata\">\n <span class=\"date\">${humanized_time_span(date)}</span>\n <i class=\"heart icon\"></i> 0 Likes\n </div>\n <div class=\"text\">${text}</div>\n </div>\n </div>`\n );\n target.siblings('input.newcomment').val('');\n comments.append(mess);\n if (card.attr('type') == 'userPost') {\n await $.post('/userPost_feed', {\n postID: postID,\n new_comment: date,\n comment_text: text,\n _csrf: $('meta[name=\"csrf-token\"]').attr('content')\n });\n } else {\n let actionType = getActionType(currentPageForHeader);\n if (actionType === \"free play\" || enableDataCollection) {\n $.post(\"/feed\", {\n actionType: actionType,\n modual: currentModuleForHeader,\n postID: postID,\n new_comment: date,\n comment_text: text,\n _csrf: $('meta[name=\"csrf-token\"]').attr('content')\n });\n }\n }\n try {\n // We store the page's hints on the body for easy access\n document.body.hints.refresh();\n } catch (error) {\n if (!(error instanceof TypeError)) {\n console.error(error);\n }\n }\n if (currentModuleForHeader === \"cyberbullying\" && (postID === \"cyberbullying_sim_post1\" || postID === \"cyberbullying_sim_post3\" || postID === \"cyberbullying_sim_post4\")) {\n clickPost = true; //see cyberbullying_sim.pug for initialization and comments\n $(\"#confirmContinueCheck\").hide();\n }\n }\n}", "function sub_comment_update( e, subComId, value){\n //alert(value);\n if (e.keyCode == 13 && !e.shiftKey)\n { \n \n e.preventDefault();\n //now call the code to submit your form\n var getId = subComId.split(\"sub_comment\");\n var id = getId[1];\n var check = value.replace( /\\s\\s+/g, '' );\n \n if(check != \"\"){\n var _token = $('input[name=\"_token\"]').val();\n $.ajax({\n //url: '/'+\"{{URL::to('/')}}\"+'post-like',\n url: app_url+'/post-sub-comment/'+id,\n type: \"PUT\",\n data: { _token : _token,\n comment: value,\n subComId: id \n },\n success: function(response){\n console.log(response);\n $(\"#post-sub-comment-right\"+id).css('display','block');\n $(\"#sub_com_option\"+id).show();\n $(\"#edit-sub-com-app\"+id).hide();\n $(\".option_btn\").show();\n var center = $(window).height() / 2;\n var top = $(\"#si_sub_com_\"+id).offset().top;\n if (top > center) {\n $('html, body').animate({\n scrollTop: top - center }, 2000);\n $(\"#si_sub_com_\"+id).focus(); \n }else{\n $(\"#si_sub_com_\"+id).focus(); \n }\n $(\"#post-sub-comment-right\"+id).html( $.trim(response) ).effect('highlight',{},2500);\n }\n });\n \n $(\"#sub_comment\"+id).val(\"\").css(\"height\", \"auto\");\n return; \n }\n \n }\n \n }", "function post() {\n $.post(\"http://localhost:3000/db\",{\n date: sendInfo.date,\n activities: JSON.stringify(sendInfo.activities), \n survey: JSON.stringify(surveyArray)}, \n function(data){\n if(data==='done')\n {\n alert(\"login success\");\n } else {\n console.log(data);\n }\n }).done(function (data) {\n console.log(\"$.post Data Loaded\", data);\n getData()\n });\n }", "function submitComment() {\n\t\tcurrent_comment = this;\n\t\tcurrent_textbox = current_comment.parentNode.childNodes[1].value;\n\t\tif (!current_textbox.match(/\\S/)) {\n\t\t\talert(\"Type something in.\");\n\t\t\tevent.preventDefault();\n\t\t} else {\n\t\t\tvar reply_count = current_comment.parentNode.parentNode.parentNode.parentNode.parentNode.childNodes[3].childNodes[3]\n\t\t\tvar reply_text = reply_count.textContent.split(' ');\n\t\t\tif (reply_text.length == 2) {\n\t\t\t\tvar reply_text1 = reply_text.shift();\n\t\t\t\treply_text1 = parseInt(reply_text1);\n\t\t\t\treply_text1 = reply_text1 + 1;\n\t\t\t\treply_text1 = reply_text1.toString();\n\t\t\t\treply_text = reply_text1 + \" \" + reply_text;\n\t\t\t\treply_count.textContent = reply_text;\n\t\t\t\tcreateNewComment(current_textbox, current_comment);\n\t\t\t\tcurrent_comment.parentNode.childNodes[1].value = \"\"\n\t\t\t\tevent.preventDefault();\n\t\t\t} else {\n\t\t\t\treply_count.textContent = \"1 replies\";\n\t\t\t\tcreateNewComment(current_textbox, current_comment);\n\t\t\t\tcurrent_comment.parentNode.childNodes[1].value = \"\"\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t}\n\t}", "_pushJSONPost() {\n if (! this._post) {\n this.push('\"}');\n this._post = true;\n }\n }", "function showComments( parent ) {\n $.ajax( {\n type: 'POST',\n url: 'bat/comments-form.php',\n success: function ( response ) {\n let commentsContent = $( parent );\n let html = '';\n let myJson = JSON.parse( response );\n\n myJson.forEach( function ( comment ) {\n html += commentHtml( comment );\n } );\n\n commentsContent.html( html );\n }\n } );\n }", "function saveAbsence(id){\nactiveElementDiv = 'p' + activeElement;\nsickend = formatDateDash(document.getElementById(\"sickend\").value);\nsickstart = formatDateDash(document.getElementById(\"sickstart\").value);\ncomment = document.getElementById(\"comment\").value;\nif (null != addToAbsence) {\n//console.log(\"send to ?type=addtoabsence&console&aid=\"+addToAbsence+\"&end=\"+sickend);\n$.post(\"\", {\n\t\t\t\t'type': 'addtoabsence',\n\t\t\t\t'console': '',\n\t\t\t\t'aid': addToAbsence,\n\t\t\t\t'end': sickend\n }, function (data,status) {\n\t\t\t\thandleServerResponse(data, status);\n\t\t\t});\t\t\n} else {\n//console.log(\"send to ?type=markabsent&console&id=\"+activeElement+\"&start=\"+sickstart+\"&end=\"+sickend+\"&comment=\"+comment);\n//xhttp.open(\"POST\", \"?type=markabsent&console&id=\"+activeElement+\"&start=\"+sickstart+\"&end=\"+sickend+\"&comment=\"+comment, true);\n$.post(\"\", {\n\t\t\t\t'type': 'markabsent',\n\t\t\t\t'console': '',\n\t\t\t\t'id': activeElement,\n\t\t\t\t'start': sickstart,\n\t\t\t\t'end': sickend,\n\t\t\t\t'comment': comment\n }, function (data,status) {\n\t\t\t\thandleServerResponse(data, status);\n\t\t\t});\t\n}\n\n\n}", "function viewTaskComment(taskID) {\n $.ajax({\n url: \"Handler/CommentHandler.ashx\",\n data: {\n action: \"viewTaskComment\",\n projectID: projectID,\n taskID: taskID\n },\n type: \"get\",\n success: function (result) {\n $(\"#commentBox .comment-box\").remove();\n $(\"#commentBox\").prepend(result).perfectScrollbar(\"update\");\n }\n });\n}", "function See_more_Comment(id_post, val_php_js)\n { \n var count_click_see_more_cmt, val = 0, sp;\n sp = document.getElementById(id_post).querySelectorAll(\"[id^='changecmt']\");\n count_click_see_more_cmt = parseInt(sp[2].value) + 1;//so lan click tang len 1\n sp[2].value = count_click_see_more_cmt;//input type hidden chua so lan click\n\n if(sp[1].value - 8 > 0) sp[0].innerHTML = (sp[1].value - 8);\n else sp[0].innerHTML = 0;\n\n val = parseInt(count_click_see_more_cmt)*8;\n\n if(sp[1].value > 0){\n $.ajax({\n type: \"POST\",\n url: \"../../Controller/users_controller.php\",\n data: {Show_more_comments: 1, soluongbinhluan: val, mabaidang1: id_post, giatriphpjs: val_php_js},\n success: function(data)\n {\n var i, length, Ob, sp;\n Ob = JSON.parse(data);\n length = Object.keys(Ob).length;\n\n for(i = 0; i < length; i++){\n Show_comment_from_db(id_post, Ob[i].avt, Ob[i].name, Ob[i].time, Ob[i].content, Ob[i].id_cmt, 0, 0);\n }\n }\n });\n }\n sp[1].value = sp[1].value - 8;//bot di 8 binh luan, chứa số lượng bl chưa hiện ra\n \n }" ]
[ "0.66270113", "0.6527379", "0.65152454", "0.6466577", "0.6417172", "0.64071494", "0.63614815", "0.6346578", "0.63079953", "0.63055146", "0.623837", "0.62378263", "0.62342316", "0.62121546", "0.62079924", "0.61628526", "0.6152674", "0.61479276", "0.6131453", "0.61280835", "0.6123157", "0.61079776", "0.6103332", "0.61020756", "0.60990876", "0.60951334", "0.6079435", "0.60788774", "0.6057503", "0.6054763", "0.60536313", "0.6053134", "0.6051928", "0.60452247", "0.6016348", "0.6003899", "0.600301", "0.5995682", "0.59831655", "0.59810185", "0.5966619", "0.5963939", "0.5932853", "0.5918559", "0.5916533", "0.5891172", "0.58898824", "0.58816636", "0.58735085", "0.5866829", "0.5866333", "0.58626646", "0.5846623", "0.58325064", "0.582339", "0.58161294", "0.5813598", "0.581295", "0.58121663", "0.5808204", "0.5804984", "0.5789899", "0.5781051", "0.57766706", "0.5776193", "0.5765934", "0.5760257", "0.5757642", "0.57545614", "0.5738861", "0.5727709", "0.5725733", "0.5723746", "0.57210565", "0.57199484", "0.57188493", "0.5709616", "0.56977224", "0.56888425", "0.56841016", "0.56814003", "0.5674614", "0.56719923", "0.56689626", "0.56566846", "0.5655967", "0.56549835", "0.56527", "0.56437826", "0.5637534", "0.5635987", "0.5630445", "0.5624666", "0.56237954", "0.56232446", "0.56190264", "0.5612998", "0.56090325", "0.56038445", "0.5595876" ]
0.6055383
29
Start of ajax call for removing a post
function RemoveAPost(btn) { var postId = $(btn).attr('data-postid'); $.ajax({ type: 'POST', url: `/Admin/RemoveAPost/${postId}`, success: function (response) { window.location.href = response.redirectToUrl; alert('Post removed!'); }, error: function (response) { alert(response.responseText); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteThisPost() {\n $.ajax({\n //Send ID of swiped list item to PHP\n type: 'GET',\n //Value stored in each post used to identify post in database\n //When value is sent to php it can remove selected post \n data: 'myPostIDValue='+$('#myPostIDStorage').val(),\n url: 'http://wander-app.org/deletePosts.php',\n timeout: 5000,\n success: function(data){\n //ON SUCCESS CALL FUNCTION TO REMOVE ITEM\n $('#'+ $('#myPostIDStorage').val()).remove();\n },\n \n error: function(){\n //Handle Error\n alert('Error Deleting Post');\n \n }\n \n });\n \n \n return false;\n }", "function deletePost(){\n // GET INPUT VALUE ONLY AFTER CLICK\n var id = $('[name=\"delete\"]').val();\n $.ajax({\n url: apiUrl + id,\n method: \"DELETE\",\n success: function() {\n alert(\"Post with id\" + id + \" deleted\");\n }\n })\n }", "removeMovieFromAjax() { }", "function removeTagFromPost(obj, ev) {\n ev.preventDefault();\n var $el = $(obj);\n var post_id = $el.data('freq')\n .i;\n var author_id = $el.data('freq')\n .auth;\n var nid = $el.data('freq')\n .nid;\n ajaxLoading();\n var send = jAjax('/cmd.php', 'post', 'cmd=removeTagFromPost&i=' + post_id + '&auth=' + author_id);\n send.done(function(data) {\n removeAjaxLoad();\n if(data == 0) return displayErr(lang.post_not_found);\n else {\n $('#hook_FormButton_fri_' + nid)\n .trigger('click');\n }\n });\n}", "function removePost(id){\n oqituvchiService.getStatus(id,location.reload(),console.log(\"xato\"))\n}", "function adminDeletePost(evt) {\n\tvar pid = $(evt.target).parents().filter('ul').attr('id');\n\t$.ajax({\n\t\turl: \"api.php?type=post&method=adminDeletePost\",\n\t\ttype: \"POST\",\n\t\tdataType: \"json\",\n\t\tsuccess: hidePost,\n\t\terror: errorPost,\n\t\tdata: {'pid': pid}\n\t});\n\n}", "function deletePost(postTitle, postId) {\n\tvar requestType;\n\tif (window.XMLHttpRequest) {\n\t\trequestType = new XMLHttpRequest();\n\t} else {\n\t\trequestType = new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t}\n\trequestType.open(\"POST\", \"deleteMethod.php\", true);\n\trequestType.setRequestHeader(\"Content-type\",\"application/x-www-form-urlencoded\");\n\trequestType.send(\"postTitle=\"+postTitle+\"&postId=\"+postId);\n\n\trequestType.onreadystatechange = function() {\n\t\tif (requestType.readyState == 4 && requestType.status == 200) {\n \t\t\tvar storeResponce = requestType.responseText;\n\n\t\t\tif (storeResponce == \"READY\") {\n\t\t\t\t$(\".\"+postId).remove();\n\t\t\t\tdocument.cookie = \"postTitle=; expires=Thu, 01 Jan 1970 00:00:00 UTC\";\n\t\t\t}\n\t\t}\n\t}\n}", "function addRemoveReadingListItem(postId) {\n $(\".tooltip\").hide();\n var data = {\n 'post_id': postId,\n };\n addCsrf(data);\n $.ajax({\n type: 'POST',\n url: VrConfig.baseURL + '/AjaxController/addRemoveReadingListItem',\n data: data,\n success: function (response) {\n location.reload();\n }\n });\n}", "function removePost(id){\n fanTuriService.getStatus(id,location.reload(),console.log(\"xato\"))\n}", "function deletePost(id) {\n // console.log(id)\n $.ajax({\n method: \"DELETE\",\n url: \"api/private/\" + id\n })\n .then(function() {\n getPosts() // show me posts after deleting\n\n });\n }", "function deletePost(postId) {\n var url = 'deletePost';\n var token = $('input[name=_token]').val();\n var data = {postId: postId};\n $.ajax({\n url: url,\n headers: {'X-CSRF-TOKEN': token},\n data: data,\n type: 'POST',\n datatype: 'JSON',\n success: function (resp) {\n $('#post_row_' + postId).hide();\n }\n });\n}", "function deleteUserPost() {\n var url = 'deleteUserPost';\n var postId = $('#deleteUserVideo').val();\n var token = $('input[name=_token]').val();\n var data = {postId: postId};\n $.ajax({\n url: url,\n headers: {'X-CSRF-TOKEN': token},\n data: data,\n type: 'POST',\n datatype: 'JSON',\n success: function (resp) {\n if(resp.status) {\n $('#userPost-' + postId).addClass('hide');\n }\n }\n });\n}", "function handlePostDelete() {\n\n var currentId = $(this).attr(\"entryID\");\n\n deletePost(currentId);\n }", "function ajaxClearSchedule( url )\n{\n if(confirm('Are you sure you want to clear all vendors schedule.')) {\n $('.ajaxLoading').show();\n $.post( url+'/delete',function( data ) {\n\n if(data.status =='success')\n {\n console.log(\"called succes\");\n notyMessage(data.message);\n } else {\n console.log(\"called error\");\n notyMessageError(data.message);\n }\n $('.ajaxLoading').hide();\n });\n\n }\n \n}", "function deletePost(parseId){\n\n \n let xhttp=new XMLHttpRequest();\n xhttp.onreadystatechange=function(){\n if(this.readyState==4 && this.status==200){\n document.getElementById('points'+parseId).innerHTML=\"<span style='color:red;'><h3>\"+ this.responseText+\"</h3></span>\";\n }else{\n document.getElementById(\"points\"+parseId).innerHTML=this.responseText;\n }\n };\n xhttp.open(\"GET\",\"/delete?id=\"+parseId,true);\n xhttp.setRequestHeader(\"Content-type\", \"application/json\");\n xhttp.send();\n \n\n }", "function unsaveArticle(){\n // Grab the id associated with the article from the submit button\n var thisId = $(this).attr(\"data-id\");\n\n $.ajax({\n method: \"POST\",\n url: \"/unsave/\" + thisId,\n })\n // With that done\n .done(function(data) {\n // Log the response\n console.log(data);\n location.reload();\n });\n }", "function postRemoved(post) {\n return {\n type: action_types_1.PostTypes.POST_REMOVED,\n data: post,\n };\n}", "async function delPost(event) {\n event.preventDefault();\n\n let postId = $(this).data('post');\n let apiURL = `/api/blogs/${postId}`;\n\n const response = await fetch(apiURL, {\n method: 'DELETE',\n headers: { 'Content-Type': 'application/json' },\n });\n\n if (response.ok) {\n document.location.replace('/dashboard');\n }\n }", "function interest_company_post(){\n $(\".interest-post\").click( function(){\n var post_id = $(this).attr('post-id');\n $.ajax({\n url: \"/ucjobs/interest_company_post/\" + post_id,\n type: \"GET\",\n dataType: \"html\",\n success: function(html){\n $(\".interest_list\").empty();\n $(\".interest_list\").first().prepend(html);\n },\n });\n return false;\n });\n}", "function deletegroup(group) {\n $.ajax({\n type: \"POST\",\n url: BASE_URL + \"/group/groupdelete\",\n data: {\n \"group\": group\n },\n success: function(result) {\n var resultArr = result.split('~#~');\n if (resultArr[0] != '0') {\n $('#delete-group-wrapper').hide();\n $('#delete-group-message').show();\n $('#mygroup-row-' + resultArr[1]).remove();\n $.dbeePopup('close');\n //$('#mygroup-row-'+group).remove(); \n if ( $('#my-dbees li').length == 0) {\n $('.postListing')\n .append('<div align=\"center\" class=\"noFound\">You are not a member of any Groups</div>');\n }\n\n }\n }\n });\n\n}", "function deleteHistory() {\n // Ajax to send a DELETE request to server\n $.ajax({\n method: 'Delete',\n url: '/history'\n })\n .then(function (response) {\n console.log(response);\n submissions = 0;\n })\n .catch(function (error) {\n console.log('Error:', error);\n });\n getHistory();\n}", "function deletePosts(postId) {\n let $postDiv = $(`#${'delete' + postId}`);\n $.ajax({\n async: true,\n type: 'DELETE',\n url: `${$HEROKU_URL}/api/v1/posts/${postId}`,\n dataType: 'json',\n success: function () {\n },\n error: function () {\n }\n });\n $postDiv.empty();\n}", "removePost(id){\n console.log(\"remove id:\" + id);\n fetch(\"http://localhost:8080/delete/\" + id, {\n method: 'DELETE',\n });\n }", "function removeItem(id,type){\n $.ajax({\n url: Routing.generate('fly_platform_package_calendar_events_remove',{id: id, type: type}),\n type: 'POST',\n format: 'json',\n async: false,\n data: {},\n success: function (res, textStatus, xhr) {\n // console.log(res.data);\n if(res.asc == 'success'){\n $('#calendar').fullCalendar( 'refetchEvents' );\n showHideModal('#newPkgModal','hide');\n }else{\n alert(res.msg);\n }\n\n },\n error: function(){\n alert('errors');\n }\n });\n}", "function removeArticle(id) {\n console.log(\"called removeArticle:\", id);\n let idx = id.replace('jumbotron-','');\n console.log(data.articles[idx].title);\n article = {\n \"key\": data.articles[idx].publishedAt\n }\n\n $.ajax({\n url: \"/remove-article\",\n type: 'POST',\n data: JSON.stringify(article),\n processData: false,\n contentType: 'application/json'\n }).success(function (data) {\n console.log(data);\n $('#'+id).remove();\n });\n}", "function delete_post(post_id) {\n\n $.ajax({\n method: \"GET\",\n url: \"REST_api/user\",\n processData: false,\n contentType: \"application/json\",\n data: '',\n success: function (r) {\n var details = JSON.parse(r)\n\n if (details.Status == \"Good\") {\n\n $.ajax({\n method: \"DELETE\",\n url: \"REST_api/post?post_id=\" + post_id,\n processData: false,\n contentType: \"application/json\",\n data: '',\n success: function (r) {\n console.log(r);\n },\n\n error: function (r) {\n console.log(r);\n }\n });\n\n } else if (details.Status == \"Deactivated\") {\n alert('Sorry, you are restricted from performing that action. Your account is deactivated. Contact site administration for more details.');\n } else if (details.Status == \"Not logged in\") {\n window.location.href = 'login.html';\n } else if (details.Status == \"Admin\") {\n // window.location.href = 'admin_dashboard.html';\n }\n },\n error: function (r) {\n console.log(r);\n\n }\n });\n\n}", "remove(){\r\n try{\r\n this.request.abort();\r\n }catch(e){\r\n // fails silently\r\n }\r\n try{\r\n if(this.event != null){\r\n this.event.remove();\r\n }\r\n Object.keys(this).forEach(function(key) { \r\n if(this && this[key]){\r\n delete this[key];\r\n } \r\n });\r\n }catch(e){\r\n console.warn('Error deleting XHR object: ' + e.message);\r\n }\r\n }", "function removeFromPlaylist(button, playlistId) {\n var songId = $(button).prevAll(\".songId\").val();\n\n $.post(\"include_files/form_handlers/ajax/removeFromPlaylist.php\", { playlistId: playlistId, songId: songId })\n .done(function(error) {\n\n if(error != \"\") {\n alert(error);\n return;\n }\n\n //do something when ajax returns\n openPage(\"playlist.php?id=\" + playlistId);\n });\n}", "function remove(element,event) {\n event.preventDefault();\n var href;\n if (window.location.search)\n {\n href = element.search.replace('?', '&');\n } else\n {\n href = element.search;\n }\n var url_string = window.location.href + href;\n var url = new URL(url_string);\n var path = url.searchParams.get('path');\n $.ajax({\n url:\"delete.php\",\n type:\"POST\",\n data: {path: path},\n success:function(response)\n {\n $('.cont').html(response);\n }\n })\n\n}", "function delete_post(e){\n\te.preventDefault();\n\n\tif(e.target.classList.contains(\"delete\")){\n\t\tparent = e.target.parentElement.parentElement.parentElement\n\t\tconst parent_id = parent.id\n\t\tconst postId = parent_id.split(\"-\")[1]\n\t\tconst uid = parent_id.split(\"-\")[2]\n\n\t\t///user/:id/:pid\n\t\tconst url = \"/user/\" + uid + \"/\" + postId\n\t\tfetch(url, {method:\"delete\"})\n\t\t.then((res) => {\n\t\t\tif(res.status === 200){\n\t\t\t\tif(display_allPost_flag === true){\n\t\t\t\t\tdisplay_allPost()\n\t\t\t\t\tdisplay_allPost_flag = false\n\t\t\t\t} else {\n\t\t\t\t\tdisplay_name(false)\n\t\t\t\t}\n\n\t\t\t} else{\n\t\t\t\talert(\"delete failed\")\n\t\t\t}\n\t\t}).catch((error) => {\n\t\t\tconsole.log(error)\n\t\t})\n\t}\n}", "function prefListRemove(event, ui){\n console.log($(ui.item).attr('data-id') + \" removed\");\n $.post( \"/people/delpreference/\"+ $($('.highlight').find(\"td:nth-child(1)\")).attr('data-id'),{pub: $(ui.item).attr('data-id')});\n}", "function _delete_post(post_id) {\n if(confirm('Do you realy want to delete post #' + post_id + '?')) {\n endpoint = '/admin/post/';\n var params = new Array();\n params['setting'] = 'delete';\n params['value_0'] = post_id;\n params['csrf_token'] = document.getElementById('__csrf_token').value;\n params['next'] = window.location;\n\n make_post_request(endpoint, params);\n }\n else\n return;\n}", "function ajaxDelete(ident, postto) {\n var confirmPrompt = confirm(\"Are you sure you want to delete?\");\n if(!confirmPrompt) {\n return false;\n }\n var data = {\n id: ident\n }\n $.ajax({\n url: postto,\n data: data,\n type: 'POST'\n }).done(function(data) {\n $(\"table tr[data-pageid=\"+ident+\"]\").fadeOut();\n $(\"#pageMessage\").html(\n data\n );\n setTimeout(function() {\n $(\"#pageMessage\").html(\"\");\n }, 2000);\n });\n}", "function Delete(shoot){\n \n $.ajax({\n type: \"POST\",\n url: \"/delete\",\n data : {\n shoot: shoot\n },\n cache: false,\n }).done(function( data ) {\n M.toast({html: \"Shooting deleted.\"});\n var element = $('*[data-name=\"'+shoot+'\"]');\n element.css(\"background-color\",\"red\")\n element.hide();\n element.remove();\n });\n \n}", "function deleteSlide() {\r\n var data = {};\r\n data.action = \"deleteActiveSlide\";\r\n data.handler = \"slide\";\r\n var url = \"ajax.php\";\r\n\r\n Ajax.post(data, url, function (json) {\r\n\r\n if (json.error) {\r\n $('#activeSlideContainer').innerHTML = json.error;\r\n }\r\n else {\r\n // update slide\r\n // reload updated presentation\r\n showPresentation(json.id);\r\n console.log(json.slideId);\r\n }\r\n });\r\n}", "function checkDeletezoom(uid){\n // console.log(uid+\"loginid\");\n var pid = post_delete;\n // console.log(pid+\"pid\")\n var drop = document.getElementById(\"dropdown-content-zoom\");\n if(drop.classList.contains(\"added\")){\n drop.classList.remove(\"added\");\n }\n else{\n drop.classList.add(\"added\");\n }\n var check = document.getElementById(\"delete\");\n $.ajax({\n url: \"/checkdeletewelcomezoom/\",\n type: \"POST\",\n data: { postid: pid },\n success: function (dataa) {\n // console.log(dataa.post_user_id+\"hh\");\n if(dataa[0].post_user_id === uid){\n check.classList.remove(\"remove\");\n }\n else{\n check.classList.add(\"remove\");\n }\n },\n });\n}", "function deletePost (x) {\r\n let id = x.parentElement.parentElement.id\r\n\r\n let post = {id}\r\n\r\n let stringfiedPost = JSON.stringify(post)\r\n\r\n const options = {method:\"DELETE\", \r\n headers: new Headers({'content-type': 'application/json'}),\r\n body: stringfiedPost \r\n }\r\n fetch(ip+\"/api/erase\", options)\r\n .then(handleErrors)\r\n .then((res)=>{\r\n updatePosts()\r\n }).catch((error) => {console.log(error);errorMessage();})\r\n\r\n}", "function removeOfficialTravelRequest(id){\n\n\t$('.modal-submit').on('click',function(){\n\n\t\t//loading\n\t\tpreviewLoadingEffect()\n\t\t\n\t\t//disable onclick\n\t\t$(this).attr('disabled','disabled')\n\n\t\t$(this).html('Removing . . .')\n\n\t\t$.ajax({\n\t\t\turl:'api/travel/official/'+id,\n\t\t\tmethod:'DELETE',\n\t\t\tdata: { _token: $(\"input[name=_token]\").val()},\n\t\t\tsuccess:function(data){\n\t\t\t\tif(data==1){\n\t\t\t\t\t//ajax here\n\t\t \t\tsetTimeout(function(){\n\n\t\t \t\t\t$('.preview-content').fadeOut()\n\t\t \t\t\t$('.preview-section').html('<center style=\"margin-top:10vh;\"><h3 class=\"text-danger\"><i class=\"material-icons\">check_circle</i> Deleted successfully!</h3><p>This request was deleted from the database and no longer link in any other request</p></center>')\n\n\t\t \t\t\tvar nextItem=$(selectedElement).next();\n\t\t \t\t\t$(selectedElement).remove();\n\n\t\t \t\t\t//select next\n\t\t \t\t\t$(nextItem).click()\n\t\t \t\t\t\n\t\t \t\t},1000)\n\n\t\t \t\t$('#preview-modal').modal('hide');\n\n\t\t\t\t}else{\n\t\t\t\t\talert('Oops! Something went wrong.Try to refresh the page')\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\n\t\t\n\t\t//back to original\n\t\t$(this).attr('disabled','enabled')\n\t})\n\t\n}", "function deletePost(id,userId,name) {\n $.ajax({\n method: \"DELETE\",\n url: \"/api/posts/\" + id\n })\n .then(function() {\n getPosts(userId,name);\n });\n }", "function post() {\n currentUid = null;\n}", "function quitarmensaje(id){\n\n\t\t\t$.ajax({\n\t\t\t \t\turl: \"http://www.nanuvet.com/Controllers/home/quitarMensajeTodosUsuarios.php\",\n\t\t\t \t\tasync:false, \n \tcache:false,\n\t\t\t dataType: \"html\",\n\t\t\t type : 'POST',\n\t\t\t data: {\n\t\t\t \t id : id\n\t\t\t \t \n\t\t\t \t},\n\t\t\t success: function() {\n\t\t\t \t\n\t\t\t \t$(\"#tr_mensaje_\"+id).remove(); \n\t\t\t }\n\t\t\t \t});\t\t\n\t\n}", "function removeForm(id,callback,error){\r\n jQuery.ajax({\r\n type: \"POST\",\r\n url: '/wp-admin/admin-ajax.php',\r\n data: {action: 'remove_form','id':id},\r\n dataType: 'html',\r\n error: error,\r\n success: callback\r\n });\r\n}", "function deleteRecg(questionId) {\n if (confirm('Are you sure??')) {\n $.ajax({\n url: 'recognition.php',\n method: 'post',\n dataType: 'text',\n data: {\n key: 'deleteRecg',\n questionId: questionId\n }, success: function (response) {\n $(\"#question\"+questionId).parent().remove();\n alert(response);\n location.reload();\n }\n });\n }\n}", "function onDeleteAll() {\n\t\t$.get(url, function (response) {\n\t\t\tresponse.forEach(function (record) {\n\t\t\t\tvar newUrl = url + record._id;\n\t\t\t\t$.ajax({\n\t\t\t\t\turl: newUrl,\n\t\t\t\t\tmethod: 'DELETE'\n\t\t\t\t});\n\t\t\t});\n\t\t}, 'json');\n\t\t$imageUrl.val('');\n\t\t$imageCaption.val('');\n\t\t$gallery.html('');\n\t\t$gallery.hide();\n\t}", "function preAjaxCaller() {\n $('#zoomModal').remove();\n }", "function removeComplete(t){\n data ={\n id: userId,\n tsid:t\n }\n function fnsucc() {\n alert(\"task is removed successfully\");\n window.location.href = \"index.html\";\n }\n function fnerr (){\n alert(\"having issue in removing\");\n }\n DoAjaxWork(baseUrl+'removeComplete','POST',data,fnsucc,fnerr)\n }", "function remove(service_id, user_id)\n{\n var service_remove = [\n {\"service_id\": service_id, \"user_id\": user_id}\n ];\n $.ajax ({\n type: \"POST\",\n url: \"/service_joined\",\n data: JSON.stringify(service_remove),\n contentType: \"application/json\",\n dataType: 'json', \n success: function (result) {\n if(result.processed === \"true\") {\n window.location.reload(true);\n $(document).ready(function(){\n $(window).scrollTop(0);\n });\n }\n }\n });\n}", "function removeTask(taskCard)\n{\n // Task object\n var taskID = taskCard.attr('id');\n\n // Call php function to delete task\n jQuery.ajax({\n type: \"POST\",\n url: '../actions/deleteTask.php',\n dataType: 'html',\n data: {func: 'justTesting', taskID: taskID},\n\n success: function(data)\n {\n // Refresh page\n location.reload(true);\n }\n });\n}", "function remove_item(id) {\n var deleting = $.post('dlt-todo.php',{\n delete_id: id\n });\n\n deleting.done(function(){\n $('#'+id).remove();\n $('.alert-delete').show();\n setTimeout(function(){ $('.alert-delete').hide(); }, 3000);\n })\n\n\n }", "function removePost(arr,index){\n\tdocument.getElementById(\"posts\").removeChild(arr[index]);\n\treturn true;\n}", "function remove_quicklist(obj,vid)\r\n{\r\n\r\n set_cookie_secure(\"btn-q-\"+vid, null);\r\n $.post(page,\r\n {\r\n mode : 'quicklist',\r\n todo : 'remove',\r\n vid : vid\r\n },\r\n function(data)\r\n {\r\n if(!data)\r\n alert(\"No data\");\r\n else\r\n {\r\n $(obj).slideUp();\r\n $(obj).hide();\r\n $('.cb-btn-quick-'+vid).addClass('add_icon');\r\n $('.cb-btn-quick-'+vid).removeClass('check_icon');\r\n }\r\n },'text');\r\n}", "function feDel() {\n var fe_item = $('.sublist input[name=new]:checked');\n var fe_name = fe_item.attr('value');\n \n jQuery.ajax({url: '/delete_frameelement/', type: 'POST', dataType: 'text',\n data: {\n fe_name: fe_name,\n frame_name: frameName\n },\n success: function(data) {\n location.reload();\n },\n error: errorFunc\n });\n}", "function deletePost(eventDetails) {\n let ajax = new XMLHttpRequest();\n\n ajax.onreadystatechange = function () {\n if (this.readyState === 4 && this.status === 200) {\n console.log(this.responseText);\n }\n }\n \n let idToDelete = document.getElementById('deleteId').value;\n ajax.open(\"DELETE\", `https://jsonplaceholder.typicode.com/posts/${idToDelete}`, true);\n ajax.setRequestHeader(\"Content-Type\", \"application/json\");\n ajax.send();\n}", "function delete_record(del_url,elm){\n\n\t$(\"#div_service_message\").remove();\n \n \tretVal = confirm(\"Are you sure to remove?\");\n\n if( retVal == true ){\n \n $.post(base_url+del_url,{},function(data){ \n \n if(data.status == \"success\"){\n //success message set.\n service_message(data.status,data.message);\n \n //grid refresh\n refresh_grid();\n \n }\n else if(data.status == \"error\"){\n //error message set.\n service_message(data.status,data.message);\n }\n \n },\"json\");\n } \n \n}", "function delete_record(del_url,elm){\n\n\t$(\"#div_service_message\").remove();\n \n \tretVal = confirm(\"Are you sure to remove?\");\n\n if( retVal == true ){\n \n $.post(base_url+del_url,{},function(data){ \n \n if(data.status == \"success\"){\n //success message set.\n service_message(data.status,data.message);\n \n //grid refresh\n refresh_grid();\n \n }\n else if(data.status == \"error\"){\n //error message set.\n service_message(data.status,data.message);\n }\n \n },\"json\");\n } \n \n}", "function deleteLesson() {\n //notify the server of what lesson we want to delete\n $.post('lessons', {\n code: previousDeleteCode,\n request: 'delete'\n }).done(function (data) {\n var data = $.parseJSON(data);\n if (data['status'] == 'Success') {\n //the lesson got deleted, so refresh the lesson list and hide the deletion modal\n getLessons();\n $('#deleteModal').modal('hide');\n }\n });\n}", "function deleteResortAjax(path){\n $.ajax({\n url: path,\n type: 'DELETE',\n headers: { Authorization: 'Token token=' + sessionStorage.getItem('powder-token')}\n })\n .done(function() {\n console.log(\"Deleted\");\n loadResortsAjax();\n })\n .fail(function() {\n console.log(\"error\");\n });\n }", "function DeleteQuestion(){\n\tvar id = Q[flag - 1][9];\n\tSimpleAjax(\"del_question.php\",\"POST\",\"username=\" + login + \"&id=\" + id,onSuccess,onFailure);\n\talert(\"Submitted successfully!\");\n}", "function DeleteMyNabcast() {\r\n\tvar nabcastId = $(\"#idNabcast\").val();\r\n\t\r\n\tcustomConfirmN( msg_txt['nabcats_confirm_delete'] + \"<br /> <span style='font-weight:bold;'>\" + $(\"#nabcastName\").val() +\"</span>\", null, function(){\r\n\r\n\t\t$.ajax({ type: \"GET\", url: \"myNabaztalandCreate.do?idNabcast=\"+nabcastId+\"&mode=4\", dataType: \"html\" });\r\n\t\r\n\t\t$(\"#myNabcastsList_\"+nabcastId).destroyMe();\r\n\t\tdivChangeUrl(\"contentPublier\", \"myNabaztalandCreate.do\");\r\n\t});\t\r\n\t\r\n\t\r\n}", "function remove(post) {\n console.log(post);\n var index = vm.posts.indexOf(post);\n console.log(index);\n vm.posts.splice(index, 1);\n }", "function overlayRemoveEntity(projectId, dataGid, backPage) {\n $.ajax({ async : false,\n type: 'POST',\n url: \"/project/noderemove/\" + projectId + \"/\" + dataGid,\n success: function(r) {\n\t\t\t if (r) {\n\t\t\t displayMessage(r, 'errorMessage');\n\t\t\t } else {\n\t\t\t displayMessage(\"Node succesfully removed!\");\n\t\t\t lastSelectedNode = undefined;\n \t\t\t\t\t\t\tlastSelectedNodeType = undefined;\n\t\t\t closeAndRefreshNodeDetailsOverlay(0, backPage);\n\t\t\t }\n },\n error: function(r) {\n displayMessage(r, 'errorMessage');\n }\n });\n}", "function unVote(id) {\n\n controllerurl='/posts/unvote';\n\n console.log(\"before UNVOTE call:\" + controllerurl + \" for Post Id \" + id);\n\n $.ajax({ url: controllerurl,\n type: 'post',\n dataType: 'json',\n data: { id: id }\n\n }).done(function(data,textStatus, jqXHR) {\n console.log(\"unvote remote call successful with returned value: \" + jqXHR.responseText);\n })\n .fail(function(data,textStatus, jqXHR) {\n console.log(\"unvote failed\"); \n });\n\n\n}", "delete(post) {\n if (confirm('Are you sure?')) {\n this.sendAction('destroyPost', post);\n }\n }", "function unApprovedPostAtHome(postId) {\n\t$.ajax({\n\t\ttype : \"post\",\n\t\turl : \"post/editor/unapproved\",\n\t\tdata : {\n\t\t\tpostId : postId,\n\t\t},\n\t\tsuccess : function(response) {\n\t\t\tlocation.reload();\n\t\t},\n\t\terror : function(e) {\n\t\t\tlocation.reload();\n\t\t}\n\t});\n}", "function deletePainting(token,id){\n\n $.ajax({\n url: `${baseUrl}/api/media/${id}` ,\n type: \"DELETE\",\n crossDomain: true,\n data: {},\n async: false,\n beforeSend: function (xhr) {\n xhr.setRequestHeader('Authorization', 'Bearer '+ token);\n },\n success: function (response) {\n \n },\n error: function( ) {\n },\n complete: function () {\n\n $('#imgDiv').empty();\n for(var i=0; i<paintingList.length; i++){\n if(paintingList[i].media.id == id){\n \n paintingList.splice(i,1);\n }\n }\n setAllPaintings(paintingList);\n bindEvent();\n } \n });\n}", "function remove_suggest_shop(element, is_slider, event) {\n var nid = $(element).attr('data-id');\n var url = window.location.protocol + \"//\" + window.location.hostname + \"/home/api_content/remove_suggest_shop/\"+nid;\n $.ajax({\n type: \"POST\",\n url: url,\n dataType: \"json\",\n beforeSend: function () {\n if(is_slider == true) {\n var $slickElement = $(element).closest('.js-slider-suggest');\n var index = $(element).closest('.js-item').attr('data-slick-index');\n $slickElement.slick('slickRemove', index);\n var i = 0;\n $slickElement.find(\".js-item.slick-slide\").each(function(){\n $(this).attr(\"data-slick-index\",i);\n i++;\n });\n } else {\n $(element).closest('.js-item').remove();\n }\n },\n success: function (response) {\n console.log(response.mgs);\n },\n error: function () {\n alert(\"Lỗi kết nối!!!\");\n }\n });\n}", "function deletePost(id) {\n if (confirm(\"Are you sure?\")) {\n xmlRequest(\"GET\", \"deletepost.php?pid=\" + id);\n getMyPosts();\n }\n}", "function RemoveReview(reviewID) {\n $.ajax({\n url: \"/Product/DeleteReview?reviewId=\" + reviewID,\n success: function (data) {\n $('#review-content').load(\"/Product/Review?productId=\" + $('#detailId').val());\n $('#reviewCount').text(\"Đánh giá (\" + data + \")\");\n toastr.success('Xoá thành công', '', { positionClass: \"toast-bottom-right\" });\n },\n error: function (error) {\n toastr.error('Xoá thất bại');\n }\n })\n}", "function clear_data(req_url){\r\n\t\t \r\n\t\t $.ajax({\r\n\t\t\t//url : req_url,\r\n\t\t\turl : path+'admin/'+req_url,\r\n\t\t\tdataType : 'html',\r\n\t\t\tbeforeSend : function() {\r\n\t\t\t\taddLoader();\r\n\t\t\t\t$(\"#sort_field_error\").removeClass(\".form-group has-error\");\r\n\t\t\t\t$(\"#sort_type_error\").removeClass(\".form-group has-error\");\r\n\t\t\t\t$(\"#cat\").removeClass(\".form-group has-error\");\r\n\t\t\t},\r\n\t\t\tcomplete : function() {\r\n\t\t\t\tremoveLoader();\r\n\t\t\t},\r\n\t\t\tsuccess : function(html) {\r\n\t\t\t\t$('#results').html(html);\r\n\t\t\t},\r\n\t\t\terror : function(xhr, ajaxOptions, thrownError) {\r\n\t\t\t\t\t\t\t\t\t\tconsole.log(xhr);\r\n\t\t\t\t\t\tnew PNotify({\r\n\t\t\t\t\t\t\ttype: 'error',\r\n\t\t\t\t\t\t\ttitle: xhr.statusText,\r\n\t\t\t\t\t\t\ttext: 'Something went wrong!!!'\r\n\t\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t});\r\n\t}", "function delete_member()\n{\n\t$(function(e){\n\t\t$(\".delete_object\").on(\"click\",function(e)\n\t\t{\n\t\te.preventDefault();\n\t\tvar id=$(this).attr('delete_id');\n\t\t$.ajax({\n\t\turl:\"member_delete.php\",\n\t\tmethod:\"POST\",\n\t\tdata:{id:id},\n\t\tsuccess: function( response)\n\t\t{\n\t\t\talert(response);\n\t\t\tconsole.log(response);\n\t\t\tlocation.reload();\n\t\t}\n\t\t});\n\t\t});\n\t\t});\n}", "function borrarMovimiento(id, tag) \n{\n $.ajax\n ({\n type: \"POST\",\n url: \"crud/borrarMovimiento\",\n data: {\"id\":id},\n success: function(jso)\n {\n try\n { \n var bandera = parseInt(JSON.parse(jso));\n if (bandera == 1) \n {\n // Get the <ul> element with id=\"myList\"\n var list = document.getElementById(tag);\n // As long as <ul> has a child node, remove it\n while (list.hasChildNodes())\n { \n list.removeChild(list.firstChild);\n }\n }; \n if(document.getElementById('EE').hasChildNodes())\n { \n var nrcnumEE = id.split(\":\");\n var clic = document.getElementById(nrcnumEE[0]);\n clic.click();\n }\n }catch(e)\n {\n alert('Exception while resquest...');\n } \n },\n error: function()\n {\n alert('Error while resquest..');\n }\n });\n}", "function delete_album(value){\n var album_image=$(value).data('album_image');\n var album_id=$(value).data('album_id');\n var sendpost={'album_image':album_image,'album_id':album_id,'target':'delete_album'};\n $.ajax({\n url: 'process.php',\n type: 'POST',\n data: sendpost,\n enctype:'multipart/form-data',\n dataType:'json',\n success: function(data){\n $('#album_'+data.album_id).remove();\n }\n });\n}", "addDeleteListener() {\n this.deleteBtn.click(() => {\n $.ajax({\n type: \"DELETE\",\n url: `/api/chirps/${this.id}`\n }).then(() => this.div.remove())\n .catch(e => console.log(e));\n });\n }", "function delete_sticky() {\n var id=$(this).parent().parent().attr('id');\n $(this).parents(\".sticky\").remove();\n $.ajax({\n type:\"POST\",\n url:'/delete_sticky',\n data:'id='+id,\n });\n}", "function cancelAdd(dataid) {\n $.ajax({\n method: 'POST',\n url: \"inc/MyCommunity/deleteAskForAdd.php\",\n data: {profileid:dataid}\n }).done(function(msg) {\n if(msg != 'err')\n {\n $elem = $('button[data-cancel-add=\"' + dataid + '\"]').parents('.contact-container');\n $elem.removeClass('request-sent');\n AJAXloader(false, $elem.find('.loader-container'));\n $elem.html(msg);\n imgSmoothLoading();\n }\n else{\n window.location.reload();\n }\n });\n}", "function inStockBIND (event) {\n\tvar self = this;\n\tevent.preventDefault();\n\tvar id = $(this).attr('id');\n\tconsole.log('id:', id);\n\t$.post(\"delete\", {\n\t\t_id: id\n\t})\n\t\t.done(function (data, status) {\n\t\t\tconsole.log(data.message);\n\t\t\t$(self).remove();\n\t\t})\n\t\t.error(onError);\n }", "async function removeOne(_e) {\n //let url: string = \"http://localhost:8100\";\n let url = \"https://icecreamforyou.herokuapp.com\";\n let formData = new FormData(document.forms[0]);\n // tslint:disable-next-line: no-any\n let query = new URLSearchParams(formData);\n // url += \"/\";\n let clickedButton = _e.target;\n let parentDivRemove = clickedButton.parentElement;\n let idToRemove = parentDivRemove.getAttribute(\"_id\");\n url += \"/deleteOne?id=\" + idToRemove;\n url += query.toString();\n parentDivRemove.remove();\n let response = await fetch(url);\n console.log(\"Removed one: \" + await response.json());\n }", "function deleteSearch(elem)\n{\n\t$(\".editpop-cross\").attr('disabled','disabled');\n\tvar search_id=$(elem).attr(\"rel\");\n\t//var uid=$(event).attr(\"uid\");\n\t$(\"#imggrp_\"+search_id).removeAttr(\"onclick\");\n\t$(\"#imggrp_\"+search_id).css(\"max-width\",\"20px\");\n\t$(\"#imggrp_\"+search_id).attr(\"src\", \"/\"+PROJECT_NAME+\"public/images/loading_small_black.gif\");\n\tjQuery.ajax({\n url: \"/\" + PROJECT_NAME + \"job/delete-saved-search\",\n type: \"POST\",\n dataType: \"json\",\n data: { \"saved_search_id\" : search_id },\n timeout: 50000,\n success: function(jsonData) \n {\n \tif(jsonData == 1)\n \t{\n \t\t$(\"div#grp_\"+search_id).remove();\n \t\t$(\"a#search_\"+search_id).remove();\n// \t\t$(\".alert-box\").remove();\n// \t\t\t$(\".alert-box1\").remove();\n// \t\t\t$(\".alert-box2\").remove();\n// \tshowDefaultMsg( \"serach deleted successfully.\", 1 ); \n// \t\t\n \t}\n \telse if( jsonData == 0 )\n\t\t\t{\n\t\t\t\t$(\"div.message_box\").remove();\n\t\t\t\tshowDefaultMsg( \"An error occurred! Please try again.\", 2 );\n\t\t\t}\t\n }\n\t});\n \t\t\n}", "unpublish() {\n return this.client._request('POST', `/posts/${this.id}`, { body: '' });\n // TODO: handle errors\n }", "function deleteFixum(fixumID) {\n\n //alert(fixumID.toString());\n var xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function () {\n if (this.readyState == 4 && this.status == 200) {\n\n $('#' + fixumID).remove();\n }\n };\n xhttp.open(\"DELETE\", \"../controller/fixumController.php/?id=\" + fixumID, false);\n xhttp.send();\n return false;\n}", "remove(){\n if(this.requests.length <= 1) {\n this.requests = [];\n }\n else {\n this.requests.splice(1);\n }\n }", "function removeTag(rem) {\n\t\tvar remParent = rem.parent();\n\t\t$.ajax({\n\t\t\turl: \"http://localhost:8080/Freelance/removeusertag\",\n\t\t\ttype: \"POST\",\n\t\t\tdata: {\n\t\t\t\tid: remParent.attr('id')\n\t\t\t},\n\t\t\tsuccess: function() {\n\t\t\t\tremParent.remove();\n\t\t\t}\n\t\t});\n\t}", "function deleteUser(anchor,user_id)\n{\n $.ajax({\n type: \"POST\",\n url: base_url+'user/delete_user',\n data: {id : user_id},\n dataType: 'json',\n success:function(data) {\n if(data.status==true)\n $(anchor).parent().parent().remove();\n } \n });\n}", "function RemoveFromMyGallery(objectId) {\n //debugger;\n\n $.ajax({\n type: \"POST\",\n url: \"../my-gallery.aspx/RemoveFromMyGallery\",\n data: JSON.stringify({ id: objectId }),\n contentType: \"application/json; charset=utf-8\",\n dataType: \"json\",\n success: OnRemoveFromMyGallerySuccess,\n error: OnRemoveFromMyGalleryError\n });\n}", "function del_post_by_yourself(id_post)\n {\n var yesno = confirm(\"Bạn chắc chắn muốn xóa bài đăng này cuả chính bạn ???\");\n if(yesno == true){\n document.getElementById(id_post).style.display = \"none\";\n\n $.ajax({\n type: \"POST\",\n url: \"../../Controller/users_controller.php\",\n data: {banxoabaidang_mabd: id_post},\n success: function (data){\n // $(\"#kt\").html(data);\n }\n });\n }\n }", "function deleteStateChange(){\n\tif(xmlHttp.readyState == 4 && xmlHttp.status==200){\n\t\t//Elimino il div padre del pulsante\n\t\tvar parent_div = btn.parentNode;\n\t\t$(parent_div).fadeOut('slow');\t\t\n\t}\n}", "function Delete_Wishlist_item(id) {\n $.ajax({\n url: '/wishlist/delete_item',\n method:\"GET\",\n data:{ \n pid:id,\n },\n success: function (response) {\n if(response['deleteSts'] == 1){\n $(\"#WishlistTr\"+id).remove();\n total_wishlist_itmes()\n Toastify({\n text: response['status'],\n backgroundColor: \"linear-gradient(to right, #F50057, #1B1F85)\",\n className: \"error\",\n }).showToast();\n }\n }\n });\n}", "function delete_fun(url, redirect, loadcom) {\n $(\".ski_loader\").css(\"display\", \"block\");\n // console.log('loading');\n var durl = url;\n $.ajax({\n type: 'GET',\n url: durl,\n })\n .done(function(response) {\n $(\".ajax_point\").load(redirect);\n if (loadcom == 0) {\n console.log(null);\n }else{\n SnackBar.show({text:loadcom,\n pos: 'top-center',\n duration: '9000',});\n }\n // console.log('note deleted');\n $(\".ski_loader\").css(\"display\", \"none\");\n })\n .fail(function(data) {\n SnackBar.show({\n text:\"Opps there seems to be an error\",\n pos: 'top-center',\n backgroundColor: '#e53935'\n });\n $(\".ski_loader\").css(\"display\", \"none\");\n\n });\n console.log(redirect);\n }", "function removeSaved(event) {\n event.preventDefault();\n\n // Hide the tooltip for this element so that they don't hang\n // around (Resolves display issues with tooltips for removed\n // articles).\n $(this).tooltip('hide');\n\n // Get the article _id that was clicked. This comes from the\n // javascript object that was attached, using the .data() method,\n // when the card was created.\n const article = $(this).parents('.card').data();\n\n // Set the state of the article.\n article.saved = false;\n\n // Here we set the content-type and convert the data to JSON\n // so that when it reaches express, the boolean values are\n // maintained.\n $.ajax({\n method: 'patch',\n url: `/api/headlines/${article.id}`,\n data: JSON.stringify(article),\n headers: { 'X-CSRF-Token': token },\n contentType: 'application/json',\n }).done((data) => {\n if (data.saved) {\n // If the record was successfully saved, refresh the\n // page content for the case of saved headlines === 0.\n initPage();\n }\n });\n }", "function deletePost(e){\n e.preventDefault();\n \n console.log(e.target.parentElement.dataset.id);\n //linha abaixo faz propagação de evento\n if (e.target.parentElement.classList.contains('delete')) {\n const id = e.target.parentElement.dataset.id;\n if (confirm('Are you sure about that?')) {\n http.delete(`http://localhost:3000/posts/${id}`)\n .then(data => {\n ui.showAlert('Post removed', 'alert alert-success');\n getPosts();\n })\n .catch(err => console.log(err));\n }\n }\n}", "function deletedb() {\n\tdebugger\n\tvar y = {};\n\ty.Mail = data.email;\n\tconsole.log(data)\n\t$.ajax({\n\t\turl: \"/del/\" + data[0].email,\n\t\ttype: \"POST\",\n\t\tdata: y,\n\t\tdataType: \"JSON\",\n\t\tsuccess: function (data1) {\n\t\t\tconsole.log('success', data1);\n\t\t\talert(data1);\n\t\t},\n\t\terror: function (XMLHttpRequest, textStatus, errorThrown) {\n\t\t\tconsole.log('error', errorThrown);\n\t\t}\n\t});\n\t// window.location.replace(\"./home.html\");\n}", "function dellStudent() {\n if (!confirm(\"Вы уверены?\"))\n return;\n var student = window.event.currentTarget;\n var studentId = student.id;\n student = student.parentElement;\n student = student.parentElement;\n\n var rootUrl = location.host;\n var url = location.protocol + \"//\" + rootUrl + \"/Admin/DellStudent\";\n\n jQuery.ajax({\n url: url,\n type: \"POST\",\n data: { studentId: studentId },\n success: function () {\n student.remove();\n }\n });\n}", "function imageRemoval() {\r\n\r\n\t\tjQuery('span.be-image-remove').on('click', function(event) {\r\n\t\t\t\r\n\t\t\tvar image\t= jQuery(this).attr('rel');\r\n\t\t\tvar parent\t= jQuery('form#post input#post_ID').prop('value');\r\n\t\t\t\r\n\t\t\tvar data = {\r\n\t\t\t\taction: 'gallery_remove',\r\n\t\t\t\timage: image,\r\n\t\t\t\tparent: parent\r\n\t\t\t};\r\n\r\n\t\t\tjQuery.post(ajaxurl, data, function(response) {\r\n\t\t\t\tvar obj;\r\n\t\t\t\ttry {\r\n\t\t\t\t\tobj = jQuery.parseJSON(response);\r\n\t\t\t\t}\r\n\t\t\t\tcatch(e) { // bad JSON catch\r\n\t\t\t\t\t// add some error messaging ?\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\tif(obj.success === true) { // it worked. AS IT SHOULD.\r\n\t\t\t\t\tjQuery('div#be_gallery_metabox').find('div.be-image-wrapper').replaceWith(obj.gallery);\r\n\t\t\t\t\timageRemoval();\r\n\t\t\t\t\t// add some success messaging ?\r\n\t\t\t\t}\r\n\t\t\t\telse { // something else went wrong\r\n\t\t\t\t\t// add some error messaging?\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t});\r\n\r\n\t}", "function deletePostCallback() {\n\t\tprops.history.push('/');\n\t}", "function remove_suggest_friend(element, is_slider, event) {\n var nid = $(element).attr('data-id');\n var url = window.location.protocol + \"//\" + window.location.hostname + \"/home/api_content/remove_suggest_user/\"+nid;\n $.ajax({\n type: \"POST\",\n url: url,\n dataType: \"json\",\n beforeSend: function () {\n if(is_slider == true) {\n var $slickElement = $(element).closest('.js-slider-suggest');\n var index = $(element).closest('.js-item').attr('data-slick-index');\n $slickElement.slick('slickRemove', index);\n var i = 0;\n $slickElement.find(\".js-item.slick-slide\").each(function(){\n $(this).attr(\"data-slick-index\",i);\n i++;\n });\n } else {\n $(element).closest('.js-item').remove();\n }\n },\n success: function (response) {\n console.log(response.mgs);\n },\n error: function () {\n alert(\"Lỗi kết nối!!!\");\n }\n });\n}", "function del(page, id){\n \n $.ajax({\n url: page,\n method: \"GET\",\n dataType: \"text\",\n data: \"imdbID=\" + id,\n success: function(){\n return;\n }\n });\n}", "function remove(id){\r\n\t$.get('/cartpurchase/unique/'+id,function(data){\r\n\t\t$('#cartProduct'+id).remove();\r\n\t\t$.post('/cartpurchase/delete',data).done(function(response){\r\n\t\t\tif(data.data.ok == true){\r\n\t\t\t\tconsole.log(\"cartpurchase deleted\");\r\n\t\t\t}\r\n\t\t});\r\n\t});\r\n}", "function handlePostDelete() {\n dispatch(deletePostWithApi(postId));\n history.push(\"/\");\n }", "function supTemplatePostValid() {\n $('.supTemplatePost').on('click', function (e) {\n e.preventDefault();\n var pathLoad = $(this).data('path');\n var csrf = $('#csrfSupTemplatePost').val();\n $(\"#loadingViewTemplatePost\").show();\n $.ajax({\n type: \"POST\",\n url: pathLoad,\n data: {\n name: presentNamePost,\n csrf: csrf\n },\n success: function (response) {\n $(\"#loadingViewTemplatePost\").hide();\n $(\"#templateLoad\").html(response);\n addTemplatePostValid();\n loadViewTemplatePost();\n editTemplatePostValid();\n $(\"#removeTemplatePostSuccess\").fadeIn(1000);\n $(\"#removeTemplatePostSuccess\").fadeOut(1000);\n\n }\n });\n });\n }", "function deleteMatch(id) {\n let csrftoken = Cookies.get('csrftoken');\n $.ajax({\n url: '/deleteMatch/',\n type: 'POST',\n beforeSend: function(xhr) {\n xhr.setRequestHeader(\"X-CSRFToken\", csrftoken);\n },\n data: {\n id: id\n },\n success: function (data) {\n let element = document.getElementById('match'+id);\n if (element)\n {\n element.parentNode.removeChild(element);\n } else {\n document.getElementById('controlsDiv').innerHTML = '<button onclick=\"requestMatch('+id+')\">Request Match</button>'\n }\n }\n });\n}" ]
[ "0.74011403", "0.6939452", "0.6862429", "0.6830156", "0.67660993", "0.67588466", "0.6688149", "0.667774", "0.6639187", "0.6617146", "0.65562356", "0.6553251", "0.6538168", "0.6498257", "0.6489831", "0.64780706", "0.64377844", "0.64377695", "0.64071834", "0.63691413", "0.63641673", "0.63628954", "0.6326117", "0.6304143", "0.630391", "0.6294412", "0.6293558", "0.62803006", "0.62643415", "0.6250718", "0.6247685", "0.62382805", "0.623122", "0.62263983", "0.6206908", "0.61988837", "0.6194621", "0.619425", "0.61773264", "0.61718076", "0.6160813", "0.61578065", "0.61574715", "0.6138607", "0.6133644", "0.61300486", "0.6130032", "0.6127838", "0.6125696", "0.6125428", "0.6118047", "0.6107366", "0.6093769", "0.609337", "0.609337", "0.6077896", "0.6077872", "0.6077689", "0.6074858", "0.60645676", "0.6061739", "0.6059716", "0.60419273", "0.6037389", "0.60371774", "0.60263187", "0.6026274", "0.6026216", "0.60185206", "0.6016001", "0.60155755", "0.60113204", "0.6009653", "0.60089", "0.60017455", "0.60011417", "0.59982526", "0.59932935", "0.59783226", "0.5971404", "0.5969069", "0.5966637", "0.5966155", "0.5962188", "0.5951598", "0.5947832", "0.594773", "0.5946403", "0.59443367", "0.59378284", "0.5937598", "0.59325784", "0.5931221", "0.5930872", "0.5929792", "0.59268284", "0.592154", "0.59112656", "0.5910032", "0.59050506" ]
0.70103455
1
End of ajax call for removing a post Start of ajax call for allowing a post
function PermitToPost(btn) { var postId = $(btn).attr('data-postid'); $.ajax({ type: 'POST', url: `/Admin/PermitToPost/${postId}`, success: function (response) { window.location.href = response.redirectToUrl; alert('Post permitted!'); }, error: function (response) { alert(response.responseText); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onAfterAjax() {\n }", "onBeforeAjax() {\n return false;\n }", "function supTemplatePostValid() {\n $('.supTemplatePost').on('click', function (e) {\n e.preventDefault();\n var pathLoad = $(this).data('path');\n var csrf = $('#csrfSupTemplatePost').val();\n $(\"#loadingViewTemplatePost\").show();\n $.ajax({\n type: \"POST\",\n url: pathLoad,\n data: {\n name: presentNamePost,\n csrf: csrf\n },\n success: function (response) {\n $(\"#loadingViewTemplatePost\").hide();\n $(\"#templateLoad\").html(response);\n addTemplatePostValid();\n loadViewTemplatePost();\n editTemplatePostValid();\n $(\"#removeTemplatePostSuccess\").fadeIn(1000);\n $(\"#removeTemplatePostSuccess\").fadeOut(1000);\n\n }\n });\n });\n }", "function post_ajax()\n\t\t\t\t\t{\n\t\t\t\t\t\t$.ajax({\n\t\t\t\t\t\t\ttype: 'POST',\n\t\t\t\t\t\t\turl: 'php/post.php',\n\t\t\t\t\t\t\tdataType: 'json',\n\t\t\t\t\t\t\tdata: $('#newPost_dialog-form').serialize(),\n\t\t\t\t\t\t\tsuccess: \tfunction (json)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t//If errors returned...\n\t\t\t\t\t\t\t\t\t\t\tif(json.error!=null)\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//Display errors and error locations\n\t\t\t\t\t\t\t\t\t\t\t\tupdateTips(json.error, json.location);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t//If no errors returned...\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\telse if(json.error==null)\n\t\t\t\t\t\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\t\t\t\t\t\t//Refresh page to show user signed in\n\t\t\t\t\t\t\t\t\t\t\t\tlocation.reload();\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}\n\t\t\t\t\t\t});\n\t\t\t\t\t}", "ajaxSaveAllNumbersChanged() {\n let $ = jQuery.noConflict();\n let thisClass = this;\n\n if (this.xhrIsWorking === true) {\n alert(RdPostOrderObj.txtPreviousXhrWorking);\n return false;\n }\n\n let confirmed_val = confirm(RdPostOrderObj.txtConfirm);\n\n if (confirmed_val === true) {\n thisClass.xhrIsWorking = true;\n thisClass.disablePostSortable();\n $('.form-result-placeholder').html('');\n\n let formData = $('.menu_order_value').serialize();\n let additionalFormData = {\n 'action': 'RdPostOrderSaveAllNumbersChanged',\n 'security': RdPostOrderObj.ajaxnonce,\n '_wp_http_referer': $('input[name=\"_wp_http_referer\"]').val(),\n 'paged': ($.query.get('paged') ? $.query.get('paged') : 1),\n 'hookName': RdPostOrderObj.hookName,\n }\n formData += '&' + $.param(additionalFormData);\n\n $.ajax({\n url: ajaxurl,\n type: 'POST',\n data: formData,\n dataType: 'json'\n })\n .done((response, textStatus, jqXHR) => {\n // displaying result to the page.\n thisClass.displayNoticeElement(response, response, 'notice-error');\n\n if (typeof(response) !== 'undefined') {\n thisClass._ajaxReplaceTable(response);\n }\n })\n .fail((jqXHR, textStatus, errorThrown) => {\n let errResponse = jqXHR.responseJSON;\n let errResponseText = jqXHR.responseText;\n\n thisClass.displayNoticeElement(errResponse, errResponseText, 'notice-error');\n })\n .always((jqXHR, textStatus, errorThrown) => {\n let response;\n if (textStatus === 'success') {\n response = jqXHR;\n } else {\n response = jqXHR.responseJSON;\n }\n // mark XHR is not working.\n thisClass.xhrIsWorking = false;\n // re-activate sortable\n thisClass.enablePostSortable();\n });\n }// endif; confirmed\n\n return false;\n }", "function haltSubmission() { // 943\n event.preventDefault(); // 944\n event.stopPropagation(); // 945\n endSubmit(template); // 946\n } // 947", "function RemoveAPost(btn) {\n var postId = $(btn).attr('data-postid');\n\n $.ajax({\n type: 'POST',\n url: `/Admin/RemoveAPost/${postId}`,\n success: function (response) {\n window.location.href = response.redirectToUrl;\n alert('Post removed!');\n },\n error: function (response) {\n alert(response.responseText);\n }\n });\n}", "function ajaxPost() {\n leaseId = $('#Start_Date').val();\n\n if (leaseId == 0) {\n loadSavelease();\n }\n\n}", "function deleteThisPost() {\n $.ajax({\n //Send ID of swiped list item to PHP\n type: 'GET',\n //Value stored in each post used to identify post in database\n //When value is sent to php it can remove selected post \n data: 'myPostIDValue='+$('#myPostIDStorage').val(),\n url: 'http://wander-app.org/deletePosts.php',\n timeout: 5000,\n success: function(data){\n //ON SUCCESS CALL FUNCTION TO REMOVE ITEM\n $('#'+ $('#myPostIDStorage').val()).remove();\n },\n \n error: function(){\n //Handle Error\n alert('Error Deleting Post');\n \n }\n \n });\n \n \n return false;\n }", "ajaxResetAllPostsOrder() {\n let $ = jQuery.noConflict();\n let thisClass = this;\n\n if (this.xhrIsWorking === true) {\n alert(RdPostOrderObj.txtPreviousXhrWorking);\n return false;\n }\n\n let confirmed_val = confirm(RdPostOrderObj.txtConfirmReorderAll);\n\n if (confirmed_val === true) {\n thisClass.xhrIsWorking = true;\n thisClass.disablePostSortable();\n $('.form-result-placeholder').html('');\n\n let formData = {\n 'action': 'RdPostOrderResetAllPostsOrder',\n 'security': RdPostOrderObj.ajaxnonce,\n '_wp_http_referer': $('input[name=\"_wp_http_referer\"]').val(),\n 'paged': ($.query.get('paged') ? $.query.get('paged') : 1),\n 'hookName': RdPostOrderObj.hookName,\n }\n\n $.ajax({\n url: ajaxurl,\n type: 'POST',\n data: formData,\n dataType: 'json'\n })\n .done((response, textStatus, jqXHR) => {\n // displaying result to the page.\n thisClass.displayNoticeElement(response, response, 'notice-error');\n\n if (typeof(response) !== 'undefined') {\n thisClass._ajaxReplaceTable(response);\n }\n })\n .fail((jqXHR, textStatus, errorThrown) => {\n let errResponse = jqXHR.responseJSON;\n let errResponseText = jqXHR.responseText;\n\n thisClass.displayNoticeElement(errResponse, errResponseText, 'notice-error');\n })\n .always((jqXHR, textStatus, errorThrown) => {\n let response;\n if (textStatus === 'success') {\n response = jqXHR;\n } else {\n response = jqXHR.responseJSON;\n }\n // mark XHR is not working.\n thisClass.xhrIsWorking = false;\n // re-activate sortable\n thisClass.enablePostSortable();\n });\n }// endif; confirmed\n\n return false;\n }", "function hitQueue(postData){\n $.ajax({ type: \"POST\",url: site_url_attend+\"/ajax?for=visitorQueue\",data: postData, // change it\n success: function(A) {\n\n }\n });\n }", "function ajaxPostBackEnd() {\n\tif (ajaxSpinnerVisible) {\n\t\tvar panelAjaxProgress = $(\"#divAjaxProgress\");\n\t\tvar divAjaxImgProgress = $(\"#divAjaxImgProgress\");\n\n\t\tdivAjaxImgProgress.fadeOut(\"fast\");\n\t\tpanelAjaxProgress.fadeOut(\"fast\");\n\n\t\tajaxSpinnerVisible = false;\n\t\t$(window).unbind('resize', ajaxProcesingResizing);\n\t}\n}", "function AjaxRequestPost(objForm,actionPage){\r\n\tAjaxRequestPostWithHandler(objForm,actionPage,SuccessfulOperation)\r\n}", "function preAjaxCaller() {\n $('#zoomModal').remove();\n }", "_submitData(event) {\n\n // prevent submit form\n event.preventDefault();\n\n if( !this._controlDataBeforeSend() ) {\n document.body.scrollTop = document.documentElement.scrollTop = 0;\n return;\n }\n\n //let xhr = new XMLHttpRequest();\n let data = {\n name: this.options.title,\n description: this.options.describe,\n clients: this.options.data\n };\n\n var xhr = $.ajax({\n type: \"POST\",\n url: this._config.url,\n contentType: \"application/json; charset=utf-8\",\n dataType: \"json\",\n data: JSON.stringify(data)\n });\n\n var complete = false;\n\n xhr\n .done(function() {\n complete = true;\n\n })\n .fail(function() {\n complete = false;\n })\n .always(function() {\n if(complete) {\n window.location = \"/autodialer/tasks?saved\";\n } else {\n noty({\n text: 'К сожалению произошла ошибка, попробуйте ещё раз!'\n });\n }\n });\n }", "[PROFILE.AJAX_END] (state) {\n state.profileAjaxPending = false\n }", "function submitPost(Post) {\n console.log(\"ajax\");\n $.post(\"/new/item\", Post, function() {\n window.location.href = \"/browse/styles/all\";\n});\n}", "function ajaxClearSchedule( url )\n{\n if(confirm('Are you sure you want to clear all vendors schedule.')) {\n $('.ajaxLoading').show();\n $.post( url+'/delete',function( data ) {\n\n if(data.status =='success')\n {\n console.log(\"called succes\");\n notyMessage(data.message);\n } else {\n console.log(\"called error\");\n notyMessageError(data.message);\n }\n $('.ajaxLoading').hide();\n });\n\n }\n \n}", "function removeTagFromPost(obj, ev) {\n ev.preventDefault();\n var $el = $(obj);\n var post_id = $el.data('freq')\n .i;\n var author_id = $el.data('freq')\n .auth;\n var nid = $el.data('freq')\n .nid;\n ajaxLoading();\n var send = jAjax('/cmd.php', 'post', 'cmd=removeTagFromPost&i=' + post_id + '&auth=' + author_id);\n send.done(function(data) {\n removeAjaxLoad();\n if(data == 0) return displayErr(lang.post_not_found);\n else {\n $('#hook_FormButton_fri_' + nid)\n .trigger('click');\n }\n });\n}", "function ajax_note_action() {\n // avoid page reload after ajax call\n event.preventDefault();\n\n $.ajax({\n type: \"POST\",\n crossOrigin: true,\n url: \"/ajax/note_action/\",\n data: $('#note_form').serialize(),\n beforeSend: function() {\n $('.note_dialog').hide();\n $('#cmtlst_loading').show();\n },\n success: function(rsp_data, status) {\n $('#cmtlst_loading').hide();\n buildNoteList(rsp_data);\n },\n error: function(xhr, status, error) {\n $('#cmlst_loading').hide();\n $('#cmlst_loading span').text(error);\n },\n complete: function(xhr, status) {\n ;\n }\n });\n}", "function POST(){\n \n}", "function unVote(id) {\n\n controllerurl='/posts/unvote';\n\n console.log(\"before UNVOTE call:\" + controllerurl + \" for Post Id \" + id);\n\n $.ajax({ url: controllerurl,\n type: 'post',\n dataType: 'json',\n data: { id: id }\n\n }).done(function(data,textStatus, jqXHR) {\n console.log(\"unvote remote call successful with returned value: \" + jqXHR.responseText);\n })\n .fail(function(data,textStatus, jqXHR) {\n console.log(\"unvote failed\"); \n });\n\n\n}", "function rePost_post(post_id) {\n\n $.ajax({\n method: \"GET\",\n url: \"REST_api/user\",\n processData: false,\n contentType: \"application/json\",\n data: '',\n success: function (r) {\n var details = JSON.parse(r)\n\n if (details.Status == \"Good\") {\n\n $.ajax({\n method: \"POST\",\n url: \"REST_api/share?post_id=\" + post_id,\n processData: false,\n contentType: \"application/json\",\n data: '',\n success: function (r) {\n var res = JSON.parse(r)\n\n $(\"[data-share_post_id='\" + post_id + \"']\").html('<i class=\"fa fa-share-alt \"></i><span ><small> ' + res.PostShares + '</small></span>');\n\n if (res.PostIsShared) {\n $(\"[data-share_post_id='\" + post_id + \"']\").css(\"color\", \"limegreen\");\n } else {\n $(\"[data-share_post_id='\" + post_id + \"']\").css(\"color\", \"grey\");\n }\n\n console.log(res);\n },\n\n error: function () {\n console.log('error');\n }\n })\n\n } else if (details.Status == \"Deactivated\") {\n alert('Sorry, you are restricted from performing that action. Your account is deactivated. Contact site administration for more details.');\n } else if (details.Status == \"Not logged in\") {\n window.location.href = 'login.html';\n } else if (details.Status == \"Admin\") {\n // window.location.href = 'admin_dashboard.html';\n }\n },\n error: function (r) {\n console.log(r);\n\n }\n });\n\n}", "ajaxReNumberAll() {\n let $ = jQuery.noConflict();\n let thisClass = this;\n\n if (this.xhrIsWorking === true) {\n alert(RdPostOrderObj.txtPreviousXhrWorking);\n return false;\n }\n\n let confirmed_val = confirm(RdPostOrderObj.txtConfirmReorderAll);\n\n if (confirmed_val === true) {\n thisClass.xhrIsWorking = true;\n thisClass.disablePostSortable();\n $('.form-result-placeholder').html('');\n\n let formData = {\n 'action': 'RdPostOrderReNumberAll',\n 'security': RdPostOrderObj.ajaxnonce,\n '_wp_http_referer': $('input[name=\"_wp_http_referer\"]').val(),\n 'paged': ($.query.get('paged') ? $.query.get('paged') : 1),\n 'hookName': RdPostOrderObj.hookName,\n }\n\n $.ajax({\n url: ajaxurl,\n type: 'POST',\n data: formData,\n dataType: 'json'\n })\n .done((response, textStatus, jqXHR) => {\n // displaying result to the page.\n thisClass.displayNoticeElement(response, response, 'notice-error');\n\n if (typeof(response) !== 'undefined') {\n thisClass._ajaxReplaceTable(response);\n }\n })\n .fail((jqXHR, textStatus, errorThrown) => {\n let errResponse = jqXHR.responseJSON;\n let errResponseText = jqXHR.responseText;\n\n thisClass.displayNoticeElement(errResponse, errResponseText, 'notice-error');\n })\n .always((jqXHR, textStatus, errorThrown) => {\n let response;\n if (textStatus === 'success') {\n response = jqXHR;\n } else {\n response = jqXHR.responseJSON;\n }\n // mark XHR is not working.\n thisClass.xhrIsWorking = false;\n // re-activate sortable\n thisClass.enablePostSortable();\n });\n }// endif; confirmed\n\n return false;\n }", "function clearServerSideForm() {\n // make sure we are actually leaving the page and not submitting the form (in which case\n // the methodToCall hidden will be set\n var methodToCall = jq(\"[name='methodToCall']\").val();\n if (methodToCall == null) {\n var queryData = {};\n\n queryData.methodToCall = 'clearForm';\n queryData.skipViewInit = 'true';\n queryData.formKey = jq(\"input#formKey\").val();\n\n var postUrl = getConfigParam(\"kradUrl\") + \"/listener\";\n\n jq.ajax({\n url:postUrl,\n dataType:\"json\",\n data:queryData,\n async:false,\n beforeSend:null,\n complete:null,\n error:null,\n success:null\n });\n }\n}", "function bindAjaxSubmission() {\n\tvar msgidfromcontroller = \"\";\n\tvar options = {\n\t\ttarget : \"#reviews\",\n\t};\n\t$(\"#new_review\").submit(function() {\n\t\t$(this).ajaxSubmit(options);\n\t\treturn false;\n\t});\n}", "function customAjaxSubmit(submitEvent) {\n\tsubmitEvent.preventDefault(); // kills the original submit\n\tvar postForm = submitEvent.target; // the form that sent this\n\t\n\t// Gathering data - we're sending the urlencoded values of IDs posttext, form_name, entity_object_id and savechanges, just like EQAL\n\tvar postData = \"posttext=\" + encodeURI(postForm.elements[2].value) + \"&form_name=\" + encodeURI(postForm.elements[3].value) + \"&entity_object_id=\" + encodeURI(postForm.elements[4].value) + \"&savechanges=\" + encodeURI(postForm.elements[5].value);\n\t\n\t// POSTing data\n\tvar sndCmntReq = new XMLHttpRequest(); \n\tsndCmntReq.open('POST', postForm.action, true);\n\tsndCmntReq.onreadystatechange = function (someEvent) { \n\t\tif (sndCmntReq.readyState == 4) { \n\t\t\tif(sndCmntReq.status == 200) {\n\t\t\t\t// If all went well, clean up and show\n\t\t\t\tpostForm.reset();\n\t\t\t\trefreshComments(getPostId(postForm.parentNode));\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\talert(\"Warning! Could not post! Server returned code \" + sndCmntReq.status);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} \n\t};\n\tsndCmntReq.setRequestHeader(\"Content-Type\", postForm.enctype);\n\t//sndCmntReq.setRequestHeader(\"Content-Length\", postData.length); // this is generated automagically by send()\n\tsndCmntReq.setRequestHeader(\"X-TheLastScript\", \"v\" + scriptVersion);\n\tsndCmntReq.setRequestHeader(\"Connection\", \"close\");\n\tsndCmntReq.send(postData);\n\t\n\t// New in v16: Since the user just posted, update their activity time\n\twriteOptionsToProfile();\n}", "function servletPost(xx) {\r\n\t$.ajax({\r\n\t\ttype : \"POST\",\r\n\t\turl : \"/\" + xx\r\n\t});\r\n\treturn false;\r\n}", "function ajaxPost(ident, data, postto) {\n var data = {\n id: ident,\n value: data\n }\n $.ajax({\n url: postto,\n data: data,\n type: 'POST'\n }).done(function(data) {\n $(\"#pageMessage\").html(\n data\n );\n setTimeout(function() {\n $(\"#pageMessage\").html(\"\");\n }, 2000);\n });\n}", "function addTemplatePostValid() {\n $('.addTemplatePostFormValid').on('submit', function (e) {\n e.preventDefault();\n var name = $('#sfcmsproject_cmsbundle_addtemplate_post_name').val();\n var content = $('#sfcmsproject_cmsbundle_addtemplate_post_content').val();\n var csrf = $('#csrfTemplatePost').val();\n $(\"#loadingViewTemplatePost\").show();\n\n $.ajax({\n type: \"POST\",\n url: $(this).attr('action'),\n data: {\n name: name,\n content: content,\n csrf: csrf\n },\n success: function (response) {\n $(\"#loadingViewTemplatePost\").hide();\n $(\"#templateLoad\").html(response);\n addTemplatePostValid();\n loadViewTemplatePost();\n $(\"#addTemplatePostSuccess\").fadeIn(1000);\n $(\"#addTemplatePostSuccess\").fadeOut(1000);\n\n }\n });\n });\n }", "function post() {\n currentUid = null;\n}", "function save_new_subst()\n{\njQuery(\"#ajaxresponse\").html(baseajaxurl);\n jQuery(\"#ajaxresponse\").addClass('ajax-loading');\n \nvar playerin = jQuery(\"#in\").val();\n\t\t\t\tvar playerout = jQuery(\"#out\").val();\n\t\t\t\tvar position = jQuery(\"#project_position_id\").val();\n\t\t\t\tvar time = jQuery(\"#in_out_time\").val();\n\t\t\t\tvar querystring = '&in=' + playerin + '&out=' + playerout\n\t\t\t\t\t\t+ '&project_position_id=' + position + '&in_out_time='\n\t\t\t\t\t\t+ time + '&teamid=' + teamid + '&matchid=' + matchid\n\t\t\t\t\t\t+ '&projecttime=' + projecttime;\n\t\t\t\tvar url = baseajaxurl + '&task=matches.savesubst&tmpl=component';\n //jQuery(\"#ajaxresponse\").html(url + querystring);\n \n jQuery.ajax({\n type: 'POST', // type of request either Get or Post\n url: url + querystring, // Url of the page where to post data and receive response \n //data: data, // data to be post\n dataType:\"json\",\n success: substsaved //function to be called on successful reply from server\n \n}); \n}", "function ajaxPOSTCaller (url, callback, selector, postData) {\n\t\n $.ajax({\n\t\ttype: 'POST',\n\t\tbeforeSend: ajaxStart,\n\t\turl: url,\n\t\tdata: postData,\n\t\tcontentType: \"application/json\",\n\t\tdataType: 'json',\n\t\tsuccess: function (data) {\n\t\t\tajaxStop();\n\t\t\tcallback(data, selector);\n\t\t},\n\t\terror: function (XMLHttpRequest, textStatus, errorThrown) {\n\t\t\tajaxStop();\n\t\t\tconsole.log(\"error :\" + XMLHttpRequest.responseText);\n\t\t}\n\t});\n}", "function createPost(){\n\n //we get the form and prevent the defualt behavior off its submit button\n var newPostForm = $('#form-posts');\n // console.log(newPostForm);\n newPostForm.submit(function(defaultEvent){\n // console.log(defaultEvent);\n\n defaultEvent.preventDefault();\n\n $.ajax({\n url : \"/posts/create\",\n method:\"POST\",\n data: newPostForm.serialize(), //this converts the foem data into json\n success : function(data){\n //data recooved from the api call\n // console.log(data); //ajax req by jquery will parse the string dat into json itslef\n let newPost = newPostDom(data.data.post , data.data.userName);\n $(\"#posts-display-wrapper\").prepend(newPost );\n //adding this function to delete post fucn to it can be deleted usin ajax\n deletePost($(' .delete-post-btn-link' , newPost));\n\n new PostComments(data.data.post._id);\n //this will enable the comment section to be dynamic\n expandComment($(`#btn-${data.data.post._id}`));\n //shows flash message\n sucessFlash(\"Post Created !\");\n new ToggleLike($(' .like-btn-link', newPost));//bind the new like button of this post to this clas\n \n \n },\n error: function(error){\n console.log(error.responseText);\n errorFlash(err.responseText);\n }\n });\n\n });\n\n }", "function ajax(e) {\n if (e) {\n e.preventDefault();\n }\n\n // gets the POST params\n var data = t.serialize();\n\n // adds the button field\n data += '&' + escape('action[subscribe]') + '=Send';\n\n // ajax request\n $.ajax({\n type: 'POST',\n url: opts.url,\n data: data,\n dataType: 'json',\n success: function (data) {\n if (!data.error && data['@attributes'] && data['@attributes'].result == 'success') {\n if (data['@attributes'].result) {\n\n if ($.isFunction(opts.complete)) {\n opts.complete.call(t, data);\n }\n }\n } else if ($.isFunction(opts.error)) {\n opts.error.call(t, data);\n }\n } ,\n error: function (data) {\n if ($.isFunction(opts.error)) {\n opts.error.call(t, data);\n }\n }\n });\n\n return false;\n }", "function success() {\n finish( false );\n }", "function editTemplatePostValid() {\n $('.editTemplatePostFormValid').on('submit', function (e) {\n e.preventDefault();\n var name = $('#sfcmsproject_cmsbundle_edittemplate_post_name').val();\n var content = $('#sfcmsproject_cmsbundle_edittemplate_post_content').val();\n $(\"#loadingViewTemplatePost\").show();\n var csrf = $('#csrfEditTemplatePost').val();\n\n $.ajax({\n type: \"POST\",\n url: $(this).attr('action'),\n data: {\n name: name,\n supName : presentNamePost,\n content: content,\n csrf: csrf\n },\n success: function (response) {\n $(\"#loadingViewTemplatePost\").hide();\n loadViewEditTemplatePost();\n presentNamePost = response;\n loadViewEditTemplatePost();\n loadViewListTemplatePost();\n $(\"#editTemplatePostSuccess\").fadeIn(1000);\n $(\"#editTemplatePostSuccess\").fadeOut(1000);\n\n\n }\n });\n });\n }", "function handleAjaxRequest(data, cbDone, cbFail) {\n $.post(SnthObj.ajaxurl, data, '' ,'json')\n .done(function(response) {\n if(response.type == 'success') {\n cbDone(response);\n } else {\n console.log(response.type);\n console.log(response.id);\n }\n })\n .fail(function() {cbFail()})\n }", "function process_user_end( ajax )\n{\n\twindows.location.reload();\n}", "function interest_company_post(){\n $(\".interest-post\").click( function(){\n var post_id = $(this).attr('post-id');\n $.ajax({\n url: \"/ucjobs/interest_company_post/\" + post_id,\n type: \"GET\",\n dataType: \"html\",\n success: function(html){\n $(\".interest_list\").empty();\n $(\".interest_list\").first().prepend(html);\n },\n });\n return false;\n });\n}", "function paypalDepositOld() {\n\n\t\tvar url = $('#paypalDepositForm').attr('action');\n\t\tvar form = new FormData(document.getElementById('paypalDepositForm'));\n\n\t\t$.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl: baseurl+url,\n\t\t\tdata: form,\n\t\t\tcache : false,\n\t\t\tcontentType: false,\n processData: false,\n\t\t\tsuccess: function(data){\n\n\t\t\t\t$( \"#load\" ).hide();\n\n\t\t\t\t$(\".newDeposit\").val('');\n\t\t\t\t$(\"#paypal_id\").val('');\n\t\t\t\t\n\t\t\t\t$(\"#paypaldepositModal\").modal('hide'); \n\t\t\t\t\t\n\t\t\t},error: function(xhr, status, error) {\n\t\t\t\t$( \"#load\" ).hide();\n\t\t\t\t//alert(error);\n\t\t\t\t//location.reload();\n\t\t\t},\n\t\t});\n\t\treturn false;\n\t}", "function acePost() {\n if (vm.postAced) {\n postService.unAcePost(vm.postData.id)\n .then(function() {\n --vm.postData.aceCount;\n vm.postAced = false;\n });\n } else {\n postService.acePost(vm.postData.id)\n .then(function() {\n ++vm.postData.aceCount;\n vm.postAced = true;\n });\n }\n }", "function disable() {\n $(document)\n .off('ajax:error', handleError)\n .off('ajax:success', handleSuccess);\n }", "function department_Db_Click(rowId)\r\n{\r\n\tvar token = $(\"meta[name='_csrf']\").attr(\"content\");\r\n var header = $(\"meta[name='_csrf_header']\").attr(\"content\");\r\n\turl ='/QEC_HEC_SU/department/returnDepartmentById';\r\n\tvar rowData = jQuery(\"#department-detail-grid-list\").getRowData(rowId); \r\n\tvar departmentId = rowData['departmentId'];\r\n\t//event.preventDefault();\r\n\t$.ajax({\r\n\t\turl :url,\r\n\t\t type: \"POST\",\r\n\t\t async:false,\r\n\t\t data:{departmentId : departmentId},\r\n\t\t beforeSend: function(xhr) \r\n {\r\n\t\t\t xhr.setRequestHeader(header, token);\r\n },\r\n\t\t success : function(data) {\r\n\t\t\tdepartment_Set_FormData(data);\r\n\t\t\tvar myElem = document.getElementById('department-delete-btn');\r\n\t\t\tif (myElem == null)\r\n\t\t\t{\r\n\t\t\t\t$(\"#department-save-btn\").after(\"<input type='button' id='department-delete-btn' style='margin-left: 1%;' class='btn' value='Delete' onclick='department_deleteDeaprtment();'/>\");\r\n\t\t\t}\r\n\t\t }\r\n\t});\r\n\t\r\n\t\r\n\t\r\n/*\t$.post(url,\r\n\tbeforeSend: function(xhr) \r\n\t{\r\n\t\txhr.setRequestHeader(header, token);\r\n\t},\r\n\t{\r\n\t\tdepartmentId : departmentId,\r\n\t}\r\n\t function(data) {\r\n\t\tdepartment_Set_FormData(data);\r\n\t\t\r\n\t\tvar myElem = document.getElementById('department-delete-btn');\r\n\t\tif (myElem == null)\r\n\t\t{\r\n\t\t\t$(\"#department-save-btn\").after(\"<input type='button' id='department-delete-btn' style='margin-left: 1%;' class='btn' value='Delete' onclick='department_deleteDeaprtment();'/>\");\r\n\t\t}\r\n\t\t\r\n\t});*/\r\n}", "function onAjaxPostBackEnd(sender, args) {\n\tajaxPostBackEnd();\n}", "function txnActionResult(data) {\n $(\"#btnPostAuth\").removeAttr(\"disabled\");\n $(\"#btnPostAuth2\").removeAttr(\"disabled\");\n\n if (data != null) {\n if (data.result == \"VALIDATION_ERROR\") {\n $.unblockUI();\n $(\"#postAuthForm\").data(\"validator\").invalidate(data);\n }\n else if (data.result == \"INTERNAL_ERROR\") {\n location.href = \"showError.htm?csrfToken=\" + csrfToken;\n }\n else if (data.result == \"PROCESSING_ERROR\") {\n location.href = \"../reports/showActionError.htm?csrfToken=\"\n + csrfToken\n + \"&code=\" + data.code\n + \"&description=\" + data.description\n + \"&confNbr=\" + data.confNbr;\n }\n else {\n // if all good reload the txn\n $(\"#txnDetailForm\").submit();\n }\n }\n}", "function newPost(id_page=null){\n if($.isNumeric(location.href.match(/([^\\/]*)\\/*$/)[1])){\n var id_page = location.href.match(/([^\\/]*)\\/*$/)[1];\n }\n if($(\"#new_post_content\").val() == ''){\n alert(\"Non puoi inserire un post vuoto!\\nInserisci qualcosa!\");\n }\n else{\n $.ajaxSetup({\n headers: {\n 'X-CSRF-TOKEN': $('meta[name=\"csrf-token\"]').attr('content')\n }\n });\n $.ajax({\n method: \"POST\",\n url: \"/home/post\",\n data: {content: $(\"#new_post_content\").val(), id_page: id_page},\n dataType : \"json\",\n success : function (data){\n if(data.ban != 1){\n $(\"#new_post_content\").val('');\n $post_clone = createPost(data)\n $post_clone.insertAfter(\".well\");\n $post_clone.show();\n $(\"#comment_panel\").hide();\n if(data.comments.length > 0){\n for(j = 0; j < data.comments.length; j++){\n $comment_clone = createcomment(data.comments[j]);\n $comment_clone.insertBefore(\"#comment_insert_\" + data.id_comment);\n $comment_clone.show();\n }\n }\n }\n else{\n alert(\"Non puoi scrivere post, sei bannato!\");\n }\n },\n error: function(data){\n var errors = data.responseJSON;\n alert(\"Qualcosa è andato storto! Prova a ricaricare la pagina.\\n\\n\" + errors.message);\n }\n });\n }\n}", "function removeComplete(t){\n data ={\n id: userId,\n tsid:t\n }\n function fnsucc() {\n alert(\"task is removed successfully\");\n window.location.href = \"index.html\";\n }\n function fnerr (){\n alert(\"having issue in removing\");\n }\n DoAjaxWork(baseUrl+'removeComplete','POST',data,fnsucc,fnerr)\n }", "function postAJAX() {\r\n\t\t \t$.post(currentURL + \"/api/friendsList\", userData, function(data){\r\n\t\t \t\tconsole.log(\"This Ran!\");\r\n\t\t \t});\r\n\t \t}", "function unApprovedPostAtHome(postId) {\n\t$.ajax({\n\t\ttype : \"post\",\n\t\turl : \"post/editor/unapproved\",\n\t\tdata : {\n\t\t\tpostId : postId,\n\t\t},\n\t\tsuccess : function(response) {\n\t\t\tlocation.reload();\n\t\t},\n\t\terror : function(e) {\n\t\t\tlocation.reload();\n\t\t}\n\t});\n}", "removeMovieFromAjax() { }", "function ajax_post_call(url, args, callback, error_callback, completion_callback, response_type, stringify) {\n if(response_type == null) response_type='html';\n if(stringify == null) stringify=false;\n if(error_callback == null) error_callback=ajax_error;\n var serial_args = stringify ? JSON.stringify(args) : $.param(args);\n var content_type = stringify ? \"application/json; charset=UTF-8\" : \"application/x-www-form-urlencoded; charset=UTF-8\";\n var newDataRequest = $.ajax( url, {\n type: 'POST',\n data: serial_args,\n contentType: content_type,\n dataType: response_type, // type of response data\n cache: false,\n timeout: 3600000, // timeout after 5 minutes\n success: callback ,\n error: error_callback == null ? ajax_error : error_callback,\n complete: completion_callback //Changing to always.\n });\n }", "_pushJSONPost() {\n if (! this._post) {\n this.push('\"}');\n this._post = true;\n }\n }", "function Payment(e) {\n var amount = $(\"#Payment-Amount\").val();\n var id = $(\"#Payment-Id\").val();\n var date = $(\"#Payment-Date\").val();\n var remarks = $(\"#Payment-Remarks\").val();\n\n $(e).prop('disabled', true);\n\n $.post(\"/Payables/ApTransactions/AddPayment\", { id: id, amount: amount, date: date, remarks: remarks }, (res) => {\n if (res == \"OK\") {\n //reload page\n $(\"#overlay\").hide();\n window.location.reload(false);\n $(e).prop('disabled', false);\n }\n });\n}", "function addRemoveReadingListItem(postId) {\n $(\".tooltip\").hide();\n var data = {\n 'post_id': postId,\n };\n addCsrf(data);\n $.ajax({\n type: 'POST',\n url: VrConfig.baseURL + '/AjaxController/addRemoveReadingListItem',\n data: data,\n success: function (response) {\n location.reload();\n }\n });\n}", "function post_comment(post_id, sort, event) {\n $.ajax({\n type: \"POST\",\n url: $SCRIPT_ROOT + '/post_contain_comment',\n data: \"post_id=\"+ post_id + \"&sort=\" + sort,\n success: function (data) {\n $(\"#comments\").html(data.comments);\n },\n error: function (xhr, str) {\n alert('Mistake ' + xhr.responseCode);\n }\n });\n event.preventDefault();\n\n}", "function checkValidToken() {\n $('form#reset-token').submit(function(e) {\n e.preventDefault()\n e.stopImmediatePropagation();\n var userResetToken = $('#user-reset-token');\n $.ajax({\n url: \"process/ajaxHandler.php\",\n method: \"POST\",\n dataType: \"JSON\",\n data: {\n action: \"checkToken\",\n userToken: userResetToken.val()\n },\n success: function(response) {\n if (response.status == \"success\") {\n $('form#reset-token').remove();\n $('#container').append(response.passForm)\n $('input#user-reset-pass').focus();\n resetPass();\n } else if (response.status == \"error\") {\n alert(response.description)\n }\n }\n })\n })\n}", "function OnAjaxSuccess() {\n if (typeof CleanUpInputs === 'function') { CleanUpInputs(); } \n}", "function addNewPost() {\n\n //alert(\"addNewPost called\");\n\n // Login Information\n var newPostTitle = document.getElementById('newPostTitle').value;\n var newPostDesc = document.getElementById('newPostDesc').value;\n var newImageURL = document.getElementById('newImageURL').value;\n\n var validate = false;\n if (newPostTitle != \"\" && newPostDesc != \"\") {\n validate = true;\n }\n\n if (validate) {\n var newPost = {\n \"post_title\": newPostTitle,\n \"post_body\": newPostDesc,\n \"post_image\": newImageURL,\n }\n\n $.ajax({\n type: \"POST\",\n url: \"https://infinite-reef-90129.herokuapp.com/addForumPost\",\n data: JSON.stringify(newPost),\n datatype: \"json\",\n xhrFields: {\n withCredentials: true\n },\n async: true,\n //\"Access-Control-Allow-Origin\": \"*\",\n contentType: \"application/json; charset=utf-8\",\n success: function processData(r) {\n var myObj = JSON.parse(r);\n if (myObj[\"post_id\"] != null) {\n\n document.getElementById('newPostTitle').value = \"\";\n document.getElementById('newPostDesc').value = \"\";\n document.getElementById('newImageURL').value = \"\";\n\n\n $('#exampleModalCenter').modal('hide');\n\n snackBar();\n\n var todaysDate = new Date();\n var postData = [{\n \"post_id\": myObj[\"post_id\"],\n \"user__username\": localStorage.username,\n \"post_title\": myObj[\"post_title\"],\n \"post_body\": myObj[\"post_body\"],\n \"post_datetime\": todaysDate,\n \"post_image\": myObj[\"post_image\"],\n \"connect_count\": myObj[\"connect_count\"],\n \"reply_count\": 0,\n \"connected\": false\n }];\n\n var postType = \"addNewPost\";\n generatePostCards(postData, postType);\n\n\n\n\n } else {\n alert(\"User is not authenticated\");\n\n }\n }\n });\n } else {\n alert(\"Post title and post body cannot be empty\");\n }\n // Preparing JSON request object\n\n}", "function ajax2() {\n\n }", "function checkPageExist(page) {\n $.ajax({\n type: 'POST',\n url: '/posts',\n data: {page: page + 1},\n dataType: 'json',\n success: function (result) {\n if (result == '') {\n $('#load_more').remove();\n return;\n }\n }\n });\n}", "function ajaxPost() {\r\n\t// Check the validation to see if the call should be made\r\n\tif(validate()){\r\n\t\t// AJAX call begin\r\n\t\t$.ajax(\"/register\",{\r\n\t\t\t// serialize the data\r\n\t\t\tdata:$(\"#register\").serializeArray(),\r\n\t\t\ttype:\"POST\",\r\n\t\t\tdataType:\"text\",\r\n\t\t\t// on error (which with validation there never should be)\r\n\t\t\t// inform the user\r\n\t\t\terror: function(data){alert(\"A server error has occurred.\" + data.toString());},\r\n\t\t\t// on success\r\n\t\t\tsuccess: function(data){\r\n\t\t\t\t// if there are no error messages to return\r\n\t\t\t\tif(data==\"true\"){\r\n\t\t\t\t\t// go back to the login page\r\n\t\t\t\t\twindow.location.assign(\"/login\")\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// otherwise print the error message box\r\n\t\t\t\t\terror(data);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t} else {\r\n\t\t// the validation is checking only that the form was filled out (as the\r\n\t\t// rest of the validation is handled live and won't let us click the\r\n\t\t// submit button if it doesn't pass\r\n\t\terror(\"Please complete the form before submitting!\");\r\n\t}\r\n}", "function handleNewTopicForm(){\n // Add a topic via Ajax\n var thissummary = $('#addtopicsummary').val();\n var thistitle = $('#addtopictitle').val();\n\n $.ajax({\n type: \"post\",\n url: \"/newtopic/\",\n data: { title : thistitle,\n summary_text: thissummary }\n\n\n ,\n success: function(data){\n // Close Topic Form \n $('#addtopic').hide();\n location.reload(); // TODO - make this clearer\n },\n error: function (requestError, status, errorResponse) {\n var response_text = requestError.responseText;\n var response_data = $.parseJSON(response_text);\n var errorNum = requestError.status;\n\n var errorMsg = response_data['error'];\n $('#addtopic').append('<div class=\"error-message\"><p>' + errorMsg + '</p><p class=\"instruction\">(Click this box to close.)</p></div>');\n error_message = $('#addtopic').children('.error-message');\n error_message.css('display','block');\n\n $('.error-message').click(function() {\n $(this).remove();\n });\n\n }\n });\n\n \n return false;\n}", "function _teardownAJAXHooks() {\n // jQuery will not invoke `ajaxComplete` if\n // 1. `transport.send` throws synchronously and\n // 2. it has an `error` option which also throws synchronously\n // We can no longer handle any remaining requests\n requests = [];\n\n if (typeof jQuery === 'undefined') {\n return;\n }\n\n jQuery(document).off('ajaxSend', incrementAjaxPendingRequests);\n jQuery(document).off('ajaxComplete', decrementAjaxPendingRequests);\n }", "function deletePost(){\n // GET INPUT VALUE ONLY AFTER CLICK\n var id = $('[name=\"delete\"]').val();\n $.ajax({\n url: apiUrl + id,\n method: \"DELETE\",\n success: function() {\n alert(\"Post with id\" + id + \" deleted\");\n }\n })\n }", "function update_page(ajaxurl, postData){\n\n\tvar future_scripts = [];\n\tvar future_functions = [];\n\tvar pop_it = false;\n\n\tif(postData === undefined) var postData = {};\n\tvar method = (postData.length === undefined) ? 'POST' : 'GET';\n\n\tconsole.log('ajax, lets make this happen');\n\tconsole.log('method: ' + method);\n\n\tif(method == 'POST')\n\t\tpostData['location'] = document.URL;\n\n\t$.ajax( {\n\t\turl:\t\tajaxurl,\n\t\tdata:\t\tpostData,\n\t\tdataType:\t'json',\n\t\ttype:\t\tmethod,\n\t\ttimeout:\t30000,\n\t\tsuccess:\tfunction(data) {\n\t\t\t\t\t\tconsole.log('ajax call successfull');\n\t\t\t\t\t\tconsole.log(data);\n\n\t\t\t\t\t\t$('pre[data-target=\"dump\"]').html( dump(data, 'return') );\n\n\t\t\t\t\t\t$.each(data, function(index, value){\n\t\t\t\t\t\t\tconsole.log(index);\n\n\t\t\t\t\t\t\tswitch (index) {\n\t\t\t\t\t\t\t\tcase 'progress':\n\t\t\t\t\t\t\t\t\t$.each(value, function(index, value){\n\t\t\t\t\t\t\t\t\t\tconsole.log(index + ': ' + value);\n\t\t\t\t\t\t\t\t\t\tprogress_bar(index, value);\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'target':\n\t\t\t\t\t\t\t\t\t$.each(value, function(index, value){\n\t\t\t\t\t\t\t\t\t\tconsole.log(index + ': ' + value);\n\t\t\t\t\t\t\t\t\t\t$('.ajax_targetable [data-target=\"'+index+'\"]').html( value );\n\n\t\t\t\t\t\t\t\t\t\tif(index == 'popup'){\n\t\t\t\t\t\t\t\t\t\t\tpop_it = true;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'script':\n\t\t\t\t\t\t\t\t\t$.each(value, function(index, value){\n\t\t\t\t\t\t\t\t\t\tfuture_scripts.push(value);\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'function':\n\t\t\t\t\t\t\t\t\t$.each(value, function(index, value){\n\t\t\t\t\t\t\t\t\t\tfuture_functions.push(value);\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'action':\n\t\t\t\t\t\t\t\t\tif(value == 'refresh'){\n\t\t\t\t\t\t\t\t\t\tlocation.reload(true);\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t$.each(value, function(index, value){\n\t\t\t\t\t\t\t\t\t\t\tconsole.log(index + ': ' + value);\n\t\t\t\t\t\t\t\t\t\t\tswitch (index) {\n\t\t\t\t\t\t\t\t\t\t\t\tcase 'location':\n\t\t\t\t\t\t\t\t\t\t\t\t\twindow.location = value;\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\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}\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\n\n\t\t\t\t\t\tif(pop_it == true){\n\t\t\t\t\t\t\tconsole.log('Time Saved This it is so True')\n\t\t\t\t\t\t\tadjustOverlayPos(future_scripts);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$.each(future_scripts, function(index, value) {\n\t\t\t\t\t\t\t\tgetScript(value);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t$.each(future_functions, function(index, value) {\n\t\t\t\t\t\t\t\twindow[value]();\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\n\t\t\t\t\t},\n\t\terror:\t\tfunction() {\n\t\t\t\t\t\t$('#sj_blackout').click();\n\t\t\t\t\t\tupdateProgressInterval = window.clearInterval(updateProgressInterval);\n\t\t\t\t\t\talert('Oops! I couldn\\'t \"phone home\". Please refresh the page and I\\'ll try to do better.');\n\t\t\t\t\t}\n\n\t});\n\n}", "function bopAjax(){\n\tvar callBeingFired;\n\t//var showSpotBuy = $(\"#showSpotBuy\").val();\n\t// don't make the call if it's being fired, or if it has already been called\n\tif(callBeingFired != true && $('#bulkOrderModelAddToCart').doesExist() == false) {\n\t\tcallBeingFired = true;\n\t\tjQuery.ajax({\n\t\t\t//alert(\"foot\");\n\t\t\t//url: \"/BulkOrderComponentController?action=copyPasteText\",\n\t\t\turl: contextPath+\"/BulkOrderComponentController/bopAjax?ordercode=hey\",\n\t\t\tdataType: \"text\",\n\t\t\ttype: \"GET\",\n\t\t\tcache:false,\n\t\t\tsuccess: function (data) {\n\t\t\t\tif (data === null || data === \"\") {\n\t\t\t\t\tsetTimeout(function(){location.reload(true);},500);\n\t\t\t\t} else {\n\t\t\t\t\t$(\"#bulk-order-content\").html(data).removeClass('loading');\n\t\t\t\t\tupdateBulkOrderPadCookie($(\"#countForBulkOrderPad\").val());\n\t\t\t\t\tcallBeingFired = false;\n\t\t\t\t}\n\t\t\t},\n\t\t\t error: function(error) {\n\t //do nothing\n\t\t }\n\t\t}\n\n\t\t);\n\t}\n}", "function adminDeletePost(evt) {\n\tvar pid = $(evt.target).parents().filter('ul').attr('id');\n\t$.ajax({\n\t\turl: \"api.php?type=post&method=adminDeletePost\",\n\t\ttype: \"POST\",\n\t\tdataType: \"json\",\n\t\tsuccess: hidePost,\n\t\terror: errorPost,\n\t\tdata: {'pid': pid}\n\t});\n\n}", "function doPostAuth() {\n $(\"#btnPostAuth\").attr(\"disabled\", \"disabled\");\n $(\"#btnPostAuth2\").attr(\"disabled\", \"disabled\");\n $(\"#btnPostAuth3\").attr(\"disabled\", \"disabled\");\n\n $(\".error\").hide();\n\n $.blockUI({\n message: PROCESSING,\n overlayCSS: {backgroundColor: '#E5F3FF'},\n css: {zIndex: 11000}\n });\n\n $.post(\"processPostAuth.htm\",\n $(\"#postAuthForm\").serialize(),\n txnActionResult,\n \"json\");\n}", "function submitForm2() {\n\n if (stDate.length == 0) {\n\n //window.console &&console.log(\"Using standard .ajax\");\n //alert('In submitForm. This is where formPost should be updated with new dates');\n\n postReminder();\n //postAdvancement();\n /*\n var url= 'https://' + host +'/mobile/dashboard/calendar/editevent.asp?' + iEventID;\n $.ajax({\n url: url,\n type: 'POST',\n data: formPost,\n dataType: 'xxscript',\n error: function (xhr, ajaxOptions, thrownError) {\n location.href = '/mobile/500.asp?Error=' + escape('url: ' + url + ' postData: ' + formPost + ' Status: ' + xhr.status + ' thrownError: ' + thrownError + ' responseText: ' + xhr.responseText.substring(0, 400));\n }\n ,\n complete: atEnd\n });\n */\n } else {\n\n ReminderSave();\n\n }\n}", "function edit_fetchbreed() {\nvar petid = $('#petstype').val();\njQuery.ajax({\nurl : baseUrl+'userhome/petid',\ndata: {petid:petid},\ntimeout: 10000,\ntype: 'POST',\nsuccess : function(data) {\n$(\"#breedresult\").html(data);\n},\nerror: function(){\n$('#fountainTextG').hide();\nshowMessage('#fff', '#000000', 'There is a some error please again latter');\n}\n});\n}", "function removeFromPlaylist(button, playlistId) {\n var songId = $(button).prevAll(\".songId\").val();\n\n $.post(\"include_files/form_handlers/ajax/removeFromPlaylist.php\", { playlistId: playlistId, songId: songId })\n .done(function(error) {\n\n if(error != \"\") {\n alert(error);\n return;\n }\n\n //do something when ajax returns\n openPage(\"playlist.php?id=\" + playlistId);\n });\n}", "function delete_post(post_id) {\n\n $.ajax({\n method: \"GET\",\n url: \"REST_api/user\",\n processData: false,\n contentType: \"application/json\",\n data: '',\n success: function (r) {\n var details = JSON.parse(r)\n\n if (details.Status == \"Good\") {\n\n $.ajax({\n method: \"DELETE\",\n url: \"REST_api/post?post_id=\" + post_id,\n processData: false,\n contentType: \"application/json\",\n data: '',\n success: function (r) {\n console.log(r);\n },\n\n error: function (r) {\n console.log(r);\n }\n });\n\n } else if (details.Status == \"Deactivated\") {\n alert('Sorry, you are restricted from performing that action. Your account is deactivated. Contact site administration for more details.');\n } else if (details.Status == \"Not logged in\") {\n window.location.href = 'login.html';\n } else if (details.Status == \"Admin\") {\n // window.location.href = 'admin_dashboard.html';\n }\n },\n error: function (r) {\n console.log(r);\n\n }\n });\n\n}", "function cancelPendingAjaxLoad() {\n if (goCancelAjax) {\n console.log(\"Cancelling current AJAX call\");\n goCancelAjax.cancel();\n goCancelAjax = null;\n }\n}", "function unApprovedPost() {\n\tdocument.getElementById(\"form-unpublic-post\").submit();\n}", "function create_post_tag(form, is_sub){\n var href = form.attr(\"action\")\n $(\"#tag-load\").css({\"display\" : \"block\"});\n $(\"#form-display\").css({\"display\" : \"none\"});\n $.ajax({\n data: form.serialize(),\n type: form.attr(\"method\"),\n url: form.attr(\"action\"),\n success: function(response) {\n $(\"#tag-load\").css({\"display\" : \"none\"});\n if (is_sub){\n $(\".content-sub\").html($(response).find('.content-sub'));\n }else{\n $(\".content\").html($(response).find('.content'));\n }\n\n },\n error: function(data) {\n $(\".content\").html(data);\n },\n timeout: 360000 // 360 seconds\n });\n return false;\n}", "function submitt() {\r\n\tvar token = $(\"meta[name='_csrf']\").attr(\"content\");\r\n\t\r\n\t$.ajaxSetup({\r\n\t\tbeforeSend : function(xhr) {\r\n\t\t\txhr.setRequestHeader('X-CSRF-TOKEN', token);\r\n\t\t}\r\n\t});\r\n\t$.ajax({\r\n\t\turl : 'saveOrUpdate',\r\n\t\ttype : 'POST',\r\n\t\tdata : {\r\n\t\t\tusername : $('#addu_username').val(),\r\n\t\t\tpassword : $('#addu_password').val(),\r\n\t\t\tfirstName : $('#addu_firstName').val(),\r\n\t\t\tlastName : $('#addu_lastName').val(),\r\n\t\t\temail : $('#addu_email').val(),\r\n\t\t\ttelephone : $('#addu_telephone').val(),\r\n\t\t\tnname : $('input[name=nname]').val(),\r\n\t\t\tactn : $('#addu_action').val()\r\n\t\t},\r\n\t\tsuccess : function(response) {\r\n\t\t\talert(response.message);\r\n\t\t\tload();\r\n\t\t},\r\n\t\terror : function(xhr, status, error) {\r\n\t\t\twindow.alert(\"error submit:\" + error);\r\n\t\t\twindow.alert(\"xhr:\" + xhr.responseText);\r\n\t\t}\r\n\t});\r\n\t$('#addu_username').val(\"\");\r\n\t$('#addu_password').val(\"\");\r\n\t$('#addu_firstName').val(\"\");\r\n\t$('#addu_lastName').val(\"\");\r\n\t$('#addu_email').val(\"\");\r\n\t$('#addu_telephone').val(\"\");\r\n\t$('#addu_id').val(\"\");\r\n\t$('#addu_nname').val(\"\");\r\n\t\r\n\tmodHideUadd();\r\n}", "function terminar_atendimento() {\n var strURL = '/terminar_atendimento';\n $.ajax({type: 'POST', url: strURL, data: $('#erpForm').serialize()\n }).done(function(r) {\n setEstado('terminado');\n showMSG(\"warning\",\"O seu estado foi Alterado para Atendimento Terminado\",\"#message\",\"#message_container\");\n }).fail(function(r) {\n showMSG('alert', r.responseText,\"#message\",\"#message_container\");\n });\n }", "function add_member_ajax()\n{\n\t$form=$(\".add_member\");\n\t\t\t$.ajax({\n\t\t\turl:$form.attr(\"action\"),\n\t\t\tmethod:$form.attr(\"method\"),\n\t\t\tdata:$form.serialize(),\n\t\t\tsuccess: function( response)\n\t\t\t{\n\t\t\t\talert(response);\n\t\t\t\tconsole.log(response);\n\t\t\t\tlocation.reload();\n\t\t\t}\n\t\t\t});\n}", "function updateReturnRecord(){\n $.ajax({\n method:'POST',\n url:url3,\n data:{_token:token, returnid:return_id, data: $('#form').serialize()},\n success:function(data){\n successHTML = '<div class=\"alert-success alert\"><ul>';\n successHTML += '<li> Records added successfully </li>';\n successHTML += '</ul></di>';\n $( '#form-errors' ).html( successHTML );\n $( '#wcn_btn').prop( \"disabled\", false );\n //console.log(data);\n },\n });\n console.log('done');\n\n}", "function ajaxCall(data, destUrl)\n{\n\t$.ajax({\n\t type:\"POST\",\n\t cache:false,\n\t url: destUrl,\n\t data: data, // multiple data sent using ajax\n\t success: function (html) {\n\t \tif(destUrl == '/BudgetBunny/home')\n\t \t\ttransactionSuccess(html);\n\t \t\n\t \tif(destUrl == '/BudgetBunny/budgetsetuppage')\n\t \t{\t\n\t \t\twindow.location='/BudgetBunny/home';\n\t \t\treturn;\n\t \t}\n\t \t$('.total-budget').text($(html).find('.total-budget').text());\n\t \t\n\t \tsubmitSuccess();\n\t \tclose_div();\n\t }\n\t });\n}", "function ajaxSubmit() {\n event.preventDefault();\n event.stopPropagation();\n\n let targetBtn = event.target, form = event.target.form, isDataValid = form.checkValidity(), actionUrl = form.getAttribute('action');\n \n //data is not valid\n if (!isDataValid) {\n form.reportValidity();\n return;\n }\n\n //create form data\n let data = form.querySelectorAll('input'), formData = {};\n for (let i = 0; i < data.length; ++i) {\n formData[data[i].getAttribute('name')] = data[i].value;\n }\n\n //disable all the button while processing over api\n let buttons = form.querySelectorAll('button, a');\n for (let i in buttons) {\n buttons[i].disabled = true;\n }\n \n //set button loaders\n let targetBtnName = targetBtn.innerHTML;\n targetBtn.innerHTML = 'Processing...';\n\n postData(BASE_URL + actionUrl, formData, function(response) {\n //on success\n setCookie(AUTH_TOKEN, response.token, 1);\n AuthManager.getInstance().token = response.token;\n DataManager.getInstance().refreshLeaderBoard();\n return true;\n }, function(response) {\n //server errors\n showError(response);\n return false; \n }, function(errors) {\n //validation errors\n //remove old messages\n let oldMessages = form.querySelectorAll('span.error-message'), i = 0;\n while (i < oldMessages.length) {\n oldMessages[i].parentNode.classList.remove('error-block');\n oldMessages[i].parentNode.removeChild(oldMessages[i]);\n i++;\n }\n\n for (let fieldName in errors) {\n //display errors on form\n let inputContainer = form.querySelector(\"input[name=\" + fieldName + \"]\").closest('.form-group');\n let message = document.createElement('span');\n message.classList.add('error-message');\n message.innerHTML = errors[fieldName][0];\n inputContainer.classList.add('error-block');\n inputContainer.appendChild(message);\n }\n }, function() {\n //reenable the buttons\n targetBtn.innerHTML = targetBtnName;\n for (let i in buttons) {\n buttons[i].disabled = false;\n } \n });\n}", "function cancelAdd(dataid) {\n $.ajax({\n method: 'POST',\n url: \"inc/MyCommunity/deleteAskForAdd.php\",\n data: {profileid:dataid}\n }).done(function(msg) {\n if(msg != 'err')\n {\n $elem = $('button[data-cancel-add=\"' + dataid + '\"]').parents('.contact-container');\n $elem.removeClass('request-sent');\n AJAXloader(false, $elem.find('.loader-container'));\n $elem.html(msg);\n imgSmoothLoading();\n }\n else{\n window.location.reload();\n }\n });\n}", "function ajax_send_message(message, flag) {\n\t$.ajax({\n\t\ttype: \"POST\",\n\t\turl: \"/chat/send\",\n\t\tdata: { message : message, flag : flag }, //all the user object POST vars get dragged along too\n\t\tsuccess: function(){\n\t\t$('#message').val(\"\");\t//clear the text input box\n\t\t}\n\t})//end ajax\n}", "function delayed_ajax_post_call(url, args, callback, error_callback, completion_callback, response_type, stringify, delay) {\n if(response_type == null) response_type='html';\n if(stringify == null) stringify=false;\n if(error_callback == null) error_callback=ajax_error;\n if(delay == null) delay = 180000;\n setTimeout(function () {ajax_post_call(url , args, callback, error_callback, completion_callback, response_type, stringify); }, delay );\n }", "function aalDismiss() {\n\n\n var data = {action: 'aal_dismiss_notice'};\n \n $.ajax({\n type: \"POST\",\n url: ajax_script.ajaxurl,\n data: data,\n cache: false,\n success: function(){\n $(\"#aal_notice_div\").slideUp('slow', function() {$(\"#aal_notice_div\").remove();});\n }\n });\n \t\n\t\t\n\t\t\n\t}", "function submitPost(post) {\n $.post(\"/api/posts\", post, function() {\n window.location.href = \"/addexercise\";\n });\n }", "function submitPOST(data,uri,response)\n{\n var xmlhttp = getAjax();\n xmlhttp.onreadystatechange = function() \n {\n if(xmlhttp.readyState==4 && xmlhttp.status == 200)\n\n if(email != \"\" && type != \"\")\n\n {\n $('#thank-you').show();\n $('#sign-up').hide();\n\n $.post('php/register', {\n email : email\n , role : type\n }, function() {\n console.log();\n });\n }\n });\n}", "function handleNewSourceForm() {\n\n var sourcefirstname = $('#sourcefirstname').val();\n var sourcelastname = $('#sourcelastname').val();\n var sourceemail = $('#sourceemail').val();\n var sourcephone = $('#sourcephone').val();\n\n var sourceusername = sourcefirstname + sourcelastname;\n $.ajax({\n type: \"post\",\n url: \"/api/json/users/\",\n data: { username: sourceusername,\n password : 'password',\n email : sourceemail,\n phone : sourcephone,\n first_name : sourcefirstname,\n last_name : sourcelastname,\n dont_log_user_in : true,\n\n },\n success: function(data){\n // TK - Close Topic Form \n location.reload(); // TODO - make this clearer\n },\n error: function (requestError, status, errorResponse) {\n var response_text = requestError.responseText;\n var response_data = $.parseJSON(response_text);\n var errorNum = requestError.status;\n\n var errorMsg = response_data['error'];// + response_data['error_html'];\n errorMsg += response_data['error_html'];\n $('#addsource').append('<div class=\"error-message\"><p>' + errorMsg + '</p><p class=\"instruction\">(Click this box to close.)</p></div>');\n error_message = $('#addsource').children('.error-message');\n error_message.css('display','block');\n\n $('.error-message').click(function() {\n $(this).remove();\n });\n\n }\n });\n\n \n return false;\n \n\n}", "function clear_data(req_url){\r\n\t\t \r\n\t\t $.ajax({\r\n\t\t\t//url : req_url,\r\n\t\t\turl : path+'admin/'+req_url,\r\n\t\t\tdataType : 'html',\r\n\t\t\tbeforeSend : function() {\r\n\t\t\t\taddLoader();\r\n\t\t\t\t$(\"#sort_field_error\").removeClass(\".form-group has-error\");\r\n\t\t\t\t$(\"#sort_type_error\").removeClass(\".form-group has-error\");\r\n\t\t\t\t$(\"#cat\").removeClass(\".form-group has-error\");\r\n\t\t\t},\r\n\t\t\tcomplete : function() {\r\n\t\t\t\tremoveLoader();\r\n\t\t\t},\r\n\t\t\tsuccess : function(html) {\r\n\t\t\t\t$('#results').html(html);\r\n\t\t\t},\r\n\t\t\terror : function(xhr, ajaxOptions, thrownError) {\r\n\t\t\t\t\t\t\t\t\t\tconsole.log(xhr);\r\n\t\t\t\t\t\tnew PNotify({\r\n\t\t\t\t\t\t\ttype: 'error',\r\n\t\t\t\t\t\t\ttitle: xhr.statusText,\r\n\t\t\t\t\t\t\ttext: 'Something went wrong!!!'\r\n\t\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t});\r\n\t}", "function post_action(obj){\r\n$.ajax({\r\n type:\"post\",\r\n url:\"https://5ef88b09ae8ccb0016fd725b.mockapi.io/data_to_do\",\r\n data:obj\r\n})\r\n}", "function getProfPosts() {\n var posts_length,\n myPostMold;\n $.ajax({\n url: site_host + \"posts/myposts\",\n type: \"post\",\n data: {\n ajax: true\n },\n dataType: \"json\",\n success: function (response) {\n posts_length = response.data.length;\n if (posts_length === 0) {\n // ther is no posts\n $('#main-posts > .loader').hide();\n alert(\"There is no Posts\");\n return;\n }\n for (count_posts; count_posts < posts_length; count_posts += 1) {\n $('#main-posts > .loader').before(createPostMold());\n myPostMold = $(\".publication_mold\");\n myPostMold.last().find(\".module_teacher h3\").html(response.data[count_posts].title);\n myPostMold.last()\n .find(\".module_teacher .time_pub\").html(response.data[count_posts].date_parsed);\n myPostMold.last()\n .find(\".module_teacher .module_name\").html(response.data[count_posts].type_parsed);\n myPostMold.last()\n .find(\".publication_body p\").html(response.data[count_posts].text_post);\n myPostMold.last().attr(\"data-target\", response.data[count_posts]._id_post);\n\n // change Save to Delete \n myPostMold.last().find(\".publication_body .react-bar li .save-post\")\n .removeClass('save-post').addClass('delet-post').attr('title', 'Supprimer');\n myPostMold.last().find(\".publication_body .react-bar li .delet-post\")\n .children(\"i.fa\").attr(\"class\", \"fa fa-trash fa-2x\");\n }\n $('#main-posts > .loader').hide();\n },\n complete: function () {\n autosize();\n }\n });\n }", "function ajaxPost(url, data, success, error){\r\n error = error || function(XMLHttpRequest, textStatus, errorThrown){\r\n console.error(XMLHttpRequest, textStatus, errorThrown);\r\n };\r\n $.ajax({\r\n type: 'POST',\r\n url: tripSurfingUrl + url,\r\n dataType: 'json',\r\n data: data,\r\n cache: false,\r\n success: success,\r\n error: error\r\n });\r\n}", "function IAjaxHttpHook() { }", "function unsaveArticle(){\n // Grab the id associated with the article from the submit button\n var thisId = $(this).attr(\"data-id\");\n\n $.ajax({\n method: \"POST\",\n url: \"/unsave/\" + thisId,\n })\n // With that done\n .done(function(data) {\n // Log the response\n console.log(data);\n location.reload();\n });\n }", "function afterSubmit(data) {\r\n\t var form = data.form;\r\n\t var wrap = form.closest('div.w-form');\r\n\t var redirect = data.redirect;\r\n\t var success = data.success;\r\n\r\n\t // Redirect to a success url if defined\r\n\t if (success && redirect) {\r\n\t Webflow.location(redirect);\r\n\t return;\r\n\t }\r\n\r\n\t // Show or hide status divs\r\n\t data.done.toggle(success);\r\n\t data.fail.toggle(!success);\r\n\r\n\t // Hide form on success\r\n\t form.toggle(!success);\r\n\r\n\t // Reset data and enable submit button\r\n\t reset(data);\r\n\t }", "function cancelSearch(){ \t\r\n\t$.ajax({\r\n\t\ttype: \"post\",\r\n\t\turl: \"/cancel-search\",\r\n\t\tdata: {\"playerID\": sessvars.playerID},\r\n\t\tsuccess: function(data) {\r\n\t\t}\r\n\t});\r\n}", "function handleSaveButtonAjax(e) {\n\t\te.preventDefault();\n\t\tthis.blur();\n\n\t\tif (isSaving) {\n\t\t\t// If an AJAX save is currently being performed, submit the form immediately\n\t\t\t// This is because the user expects the button to be reliable\n\t\t\t$('#picture').val('');\n\t\t\t$('#application-form').submit();\n\t\t}\n\t\telse {\n\t\t\thandleAjaxSave(function() {\n\t\t\t\t$('#application-form').submit();\n\t\t\t})\n\t\t}\n\t}", "function checkOrganisation(e) {\r\n $('#post').find('option[value!=0]').remove();\r\n var organisationvalue = $(e).val();\r\n if (organisationvalue == 0) {\r\n alert(\"Select Organisation\");\r\n } else {\r\n $.ajax({\r\n type: 'GET',\r\n url: 'model/cfc/questionMaintenance.cfc?method=getPostByOrganisation',\r\n data: { organisationId: organisationvalue },\r\n success: function (data) {\r\n var postData = JSON.parse(data);\r\n postData = postData.DATA;\r\n // console.log(postData);\r\n $.each(postData, function (index, value) {\r\n var optionEle = document.createElement(\"option\");\r\n $(optionEle).val(value[0]);\r\n $(optionEle).html(value[1]);\r\n $('#post').append(optionEle);\r\n });\r\n }\r\n });\r\n $('#addQuestion').prop(\"disabled\", false);\r\n $('#post').prop(\"disabled\", false);\r\n $('#questBank').prop(\"disabled\", false);\r\n $('#interview_question').prop(\"disabled\", false);\r\n $('#timeout').prop(\"disabled\", false);\r\n $(\"#addBtnSpan\").html('');\r\n }\r\n}", "function Del_CategoryLevel1(IDCategoryLevel1) {\n\n $.ajax({\n url: \"/Action/ProcessBackendAction.ashx?ActionObject=CategoryLevel1&action=Del&IDCategoryLevel1=\" + IDCategoryLevel1,\n type: \"POST\",\n dataType: \"json\",\n data: $(\"#frmUpd_CategoryLevel1\").serialize(),\n success: function (data) {\n if (data.status == \"success\") {\n $(\".flexgripCategoryLevel1\").flexReload();\n\t\t\t\tshowMessageBox(\"Delete thành công.\");\n\n }\n else if (data.status != \"success\") {\n showMessageBox(\"Delete lỗi: <font style='font-size:9px'>\" + data.message + \"</font>\");\n\n }\n },\n error: function (ex) {\n }\n });\n}" ]
[ "0.6603325", "0.6587009", "0.6474724", "0.6383138", "0.62390876", "0.6180867", "0.61643887", "0.6153889", "0.6102681", "0.60913277", "0.6085205", "0.60689217", "0.6061388", "0.6059175", "0.60470545", "0.6022151", "0.60166305", "0.5959152", "0.59505486", "0.5938547", "0.590362", "0.59029764", "0.5895695", "0.5892831", "0.5885044", "0.5848625", "0.5843172", "0.584267", "0.58426607", "0.5838638", "0.5834679", "0.5828628", "0.5824268", "0.5812037", "0.5784186", "0.5781913", "0.5776208", "0.5767106", "0.57659984", "0.57654196", "0.57575655", "0.57559294", "0.57543695", "0.57491297", "0.57373893", "0.5731027", "0.5728272", "0.57277346", "0.5727601", "0.57248455", "0.5723388", "0.57221764", "0.5706674", "0.57022035", "0.5687859", "0.5683917", "0.56756824", "0.56710505", "0.5667377", "0.56656307", "0.5662867", "0.5661212", "0.5660906", "0.565929", "0.5649266", "0.56470263", "0.56425095", "0.5638035", "0.56254125", "0.56230974", "0.5612926", "0.5611608", "0.56031233", "0.5601749", "0.56011313", "0.5598213", "0.55977255", "0.5594598", "0.5591296", "0.55888796", "0.55868083", "0.5581278", "0.5580566", "0.55789924", "0.5577432", "0.5577238", "0.55733883", "0.55726665", "0.5564494", "0.55632275", "0.5561634", "0.5558869", "0.55563045", "0.5552747", "0.55489373", "0.5546034", "0.55441535", "0.5541864", "0.5541461", "0.5536348" ]
0.60327744
15
eslint import/nowebpackloadersyntax: off / eslint import/extensions: off / eslint nounusedvars: off / eslintdisable jsxa11y/accessibleemoji
function DateRangePickerDoc(props) { return ( <> <div className="flex flex-1 flex-grow-0 items-center justify-end"> <Button className="normal-case" variant="contained" color="secondary" component="a" href="https://mui.com/components/date-range-picker" target="_blank" role="button" > <Icon>link</Icon> <span className="mx-4">Reference</span> </Button> </div> <Typography className="text-40 my-16 font-700" component="h1"> Date Range Picker{' '} <a href="https://material-ui.com/store/items/material-ui-pro/"> <span role="img" title="Enterprise"> ⚡️ </span> </a> </Typography> <Typography className="description"> Date pickers let the user select a range of dates. </Typography> <blockquote> <Typography className="mb-40" component="div"> ⚠️ Pro component <br /> <br /> The date range picker is intended for MUI X Pro, a commercial set of advanced components built on top of the community edition (MIT license). <br /> <br /> This paid extension will include more advanced components (rich data grid, date range picker, tree view drag &amp; drop, etc.).{' '} <a href="https://material-ui.com/store/items/material-ui-pro/">Early access</a> starts at an affordable price. </Typography> </blockquote> <Typography className="mb-40" component="div"> The date range pickers let the user select a range of dates. </Typography> <Typography className="text-32 mt-40 mb-10 font-700" component="h2"> Requirements </Typography> <Typography className="mb-40" component="div"> This component relies on the date management library of your choice. It supports{' '} <a href="https://date-fns.org/">date-fns</a>,{' '} <a href="https://moment.github.io/luxon/">luxon</a>,{' '} <a href="https://github.com/iamkun/dayjs">dayjs</a>,{' '} <a href="https://momentjs.com/">moment</a> and any other library via a public{' '} <code>dateAdapter</code> interface. </Typography> <Typography className="mb-40" component="div"> Please install any of these libraries and set up the right date engine by wrapping your root (or the highest level you wish the pickers to be available) with{' '} <code>LocalizationProvider</code>: </Typography> <FuseHighlight component="pre" className="language-jsx"> {` // or @mui/lab/dateAdapter/{dayjs,luxon,moment} or any valid date-io adapter import DateFnsAdapter from '@mui/lab/AdapterDateFns'; import LocalizationProvider from '@mui/lab/LocalizationProvider'; function App() { return ( <LocalizationProvider dateAdapter={DateFnsAdapter}>...</LocalizationProvider> ); } `} </FuseHighlight> <Typography className="text-32 mt-40 mb-10 font-700" component="h2"> Basic usage </Typography> <Typography className="mb-40" component="div"> Note that you can pass almost any prop from <a href="/api/date-picker/">DatePicker</a>. </Typography> <Typography className="mb-40" component="div"> <FuseExample className="my-24" iframe={false} component={ require('app/main/documentation/material-ui-components/components/date-range-picker/BasicDateRangePicker.js') .default } raw={require('!raw-loader!app/main/documentation/material-ui-components/components/date-range-picker/BasicDateRangePicker.js')} /> </Typography> <Typography className="text-32 mt-40 mb-10 font-700" component="h2"> Static mode </Typography> <Typography className="mb-40" component="div"> It&#39;s possible to render any picker inline. This will enable building custom popover/modal containers. </Typography> <Typography className="mb-40" component="div"> <FuseExample className="my-24" iframe={false} component={ require('app/main/documentation/material-ui-components/components/date-range-picker/StaticDateRangePickerDemo.js') .default } raw={require('!raw-loader!app/main/documentation/material-ui-components/components/date-range-picker/StaticDateRangePickerDemo.js')} /> </Typography> <Typography className="text-32 mt-40 mb-10 font-700" component="h2"> Responsiveness </Typography> <Typography className="mb-40" component="div"> The date range picker component is designed to be optimized for the device it runs on. </Typography> <ul> <li> The <code>MobileDateRangePicker</code> component works best for touch devices and small screens. </li> <li> The <code>DesktopDateRangePicker</code> component works best for mouse devices and large screens. </li> </ul> <Typography className="mb-40" component="div"> By default, the <code>DateRangePicker</code> component renders the desktop version if the media query{' '} <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/@media/pointer"> <code>@media (pointer: fine)</code> </a>{' '} matches. This can be customized with the <code>desktopModeMediaQuery</code> prop. </Typography> <Typography className="mb-40" component="div"> <FuseExample className="my-24" iframe={false} component={ require('app/main/documentation/material-ui-components/components/date-range-picker/ResponsiveDateRangePicker.js') .default } raw={require('!raw-loader!app/main/documentation/material-ui-components/components/date-range-picker/ResponsiveDateRangePicker.js')} /> </Typography> <Typography className="text-32 mt-40 mb-10 font-700" component="h2"> Form props </Typography> <Typography className="mb-40" component="div"> The date range picker component can be disabled or read-only. </Typography> <Typography className="mb-40" component="div"> <FuseExample className="my-24" iframe={false} component={ require('app/main/documentation/material-ui-components/components/date-range-picker/FormPropsDateRangePickers.js') .default } raw={require('!raw-loader!app/main/documentation/material-ui-components/components/date-range-picker/FormPropsDateRangePickers.js')} /> </Typography> <Typography className="text-32 mt-40 mb-10 font-700" component="h2"> Different number of months </Typography> <Typography className="mb-40" component="div"> Note that the <code>calendars</code> prop only works in desktop mode. </Typography> <Typography className="mb-40" component="div"> <FuseExample className="my-24" iframe={false} component={ require('app/main/documentation/material-ui-components/components/date-range-picker/CalendarsDateRangePicker.js') .default } raw={require('!raw-loader!app/main/documentation/material-ui-components/components/date-range-picker/CalendarsDateRangePicker.js')} /> </Typography> <Typography className="text-32 mt-40 mb-10 font-700" component="h2"> Disabling dates </Typography> <Typography className="mb-40" component="div"> Disabling dates behaves the same as the simple <code>DatePicker</code>. </Typography> <Typography className="mb-40" component="div"> <FuseExample className="my-24" iframe={false} component={ require('app/main/documentation/material-ui-components/components/date-range-picker/MinMaxDateRangePicker.js') .default } raw={require('!raw-loader!app/main/documentation/material-ui-components/components/date-range-picker/MinMaxDateRangePicker.js')} /> </Typography> <Typography className="text-32 mt-40 mb-10 font-700" component="h2"> Custom input component </Typography> <Typography className="mb-40" component="div"> You can customize the rendered input with the <code>renderInput</code> prop. For{' '} <code>DateRangePicker</code> it takes <strong>2</strong> parameters – for start and end input respectively. If you need to render custom inputs make sure to spread <code>ref</code>{' '} and <code>inputProps</code> correctly to the input components. </Typography> <Typography className="mb-40" component="div"> <FuseExample className="my-24" iframe={false} component={ require('app/main/documentation/material-ui-components/components/date-range-picker/CustomDateRangeInputs.js') .default } raw={require('!raw-loader!app/main/documentation/material-ui-components/components/date-range-picker/CustomDateRangeInputs.js')} /> </Typography> <Typography className="text-32 mt-40 mb-10 font-700" component="h2"> Customized day rendering </Typography> <Typography className="mb-40" component="div"> The displayed days are customizable with the <code>renderDay</code> function prop. You can take advantage of the internal <a href="/api/date-range-picker-day/">DateRangePickerDay</a>{' '} component. </Typography> <Typography className="mb-40" component="div"> <FuseExample className="my-24" iframe={false} component={ require('app/main/documentation/material-ui-components/components/date-range-picker/CustomDateRangePickerDay.js') .default } raw={require('!raw-loader!app/main/documentation/material-ui-components/components/date-range-picker/CustomDateRangePickerDay.js')} /> </Typography> </> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "extend(config, ctx) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/,\n options: {\n fix: true\n }\n })\n }", "extend (config, ctx) {\n if (ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n config.devtool = false\n }", "extend (config, ctx) {\n if (ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/,\n options: {\n fix: true\n }\n })\n }\n }", "extend (config, { isDev, isClient }) {\n /*\n // questo linta ogni cosa ad ogni salvataggio\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }*/\n }", "extend (config, ctx) {\n // if (ctx.isClient) {\n // config.module.rules.push({\n // enforce: 'pre',\n // test: /\\.(js|vue)$/,\n // loader: 'eslint-loader',\n // exclude: /(node_modules)/\n // })\n // }\n }", "extend(config, ctx) {\n // Run ESLint on save\n /*\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/,\n options : {\n fix : true\n }\n })\n }\n */\n }", "extend(config, ctx) {\n if (ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend(config) {\n if (process.server && process.browser) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "function hello2() {\n const bye = \"bye\";\n\n /**\n * For disable the es-lint on the line\n * Please put the below comment\n * now instead of the error we will have the warning for below 2\n */\n // eslint-disable-next-line\n console.log(\"this is sample \", bye);\n\n /**\n * disabling a particular rule for the eslint\n */\n // eslint-disable-next-line quotes\n console.log(\"this is sample \", 2323232);\n\n const a = 95;\n\n console.log(`vaylue for the a the `, a);\n}", "extend(config, ctx) {\n // Run ESLint on save\n // if (ctx.isDev && ctx.isClient) {\n // config.module.rules.push({\n // enforce: 'pre',\n // test: /\\.(js|vue)$/,\n // loader: 'eslint-loader',\n // exclude: /(node_modules)/,\n // options: {\n // fix: false\n // }\n // })\n // }\n }", "extend(config, ctx) {\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend(config, ctx) {\n config.devtool = \"source-map\";\n\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: \"pre\",\n test: /\\.(js|vue)$/,\n loader: \"eslint-loader\",\n exclude: /(node_modules)/,\n options: {\n fix: true,\n },\n });\n }\n\n config.module.rules.push({\n enforce: \"pre\",\n test: /\\.txt$/,\n loader: \"raw-loader\",\n exclude: /(node_modules)/,\n });\n }", "extend(config, ctx) {\n // // Run ESLint on save\n // if (ctx.isDev && ctx.isClient) {\n // config.module.rules.push({\n // enforce: 'pre',\n // test: /\\.(js|vue)$/,\n // loader: 'eslint-loader',\n // exclude: /(node_modules)/\n // })\n // }\n }", "extend(config, ctx) {\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n });\n }\n }", "extend(config, ctx) {\n if (ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/,\n });\n }\n }", "extend(config, ctx) {\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/,\n options : {\n fix : true\n }\n })\n }\n }", "extend (config, ctx) {\n if (ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend (config, ctx) {\n if (ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend (config, ctx) {\n if (ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend (config, ctx) {\n if (ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend (config, ctx) {\n if (ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend (config, ctx) {\n if (ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend(config, ctx) {\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: \"pre\",\n test: /\\.(js|vue)$/,\n loader: \"eslint-loader\",\n exclude: /(node_modules)/,\n options: {\n fix: true\n }\n });\n }\n }", "extend (config, ctx) {\n if (ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n });\n }\n }", "extend (config, ctx) {\n if (ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n });\n }\n }", "extend (config, ctx) {\n if (ctx.dev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend (config, ctx) {\n if (ctx.dev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend (config, ctx) {\n if (ctx.dev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend (config, ctx) {\n if (ctx.dev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend (config, ctx) {\n if (ctx.dev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend (config, ctx) {\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(ts|js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_module)/\n })\n }\n }", "function tryToEnableLint() {\n try {\n cm.setOption(\"lint\", false);\n cm.setOption(\"lint\", true);\n } catch (ignore) {}\n }", "extend(config, ctx) {\n // Run ESLint on save\n // if (ctx.isDev && ctx.isClient) {\n // config.module.rules.push({\n // enforce: 'pre',\n // test: /\\.(js|vue)$/,\n // loader: 'eslint-loader',\n // exclude: /(node_modules)/\n // })\n \n }", "extend (config, ctx) {\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend(config, ctx) {\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n // options: {\n // fix: true\n // }\n })\n }\n }", "extend(config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n // options: {\n // fix: true\n // },\n exclude: /(node_modules)/\n })\n }\n }", "extend(config, ctx) {\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n\n /*\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n */\n }\n }", "extend(config, ctx) {\n // Run ESLint on save\n // if (ctx.isDev && ctx.isClient) {\n // config.module.rules.push({\n // enforce: 'pre',\n // test: /\\.(js|vue)$/,\n // loader: 'eslint-loader',\n // exclude: /(node_modules)/\n // })\n // }\n }", "extend(config, ctx) {\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/,\n options: {\n fix: true\n }\n })\n }\n }", "extend(config, ctx) {\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/,\n options: {\n formatter: require('eslint-friendly-formatter'),\n fix: true\n }\n })\n }\n }", "extend(config, ctx) {\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/,\n options: {\n formatter: require('eslint-friendly-formatter'),\n fix: true\n }\n })\n }\n if (ctx.isServer) {\n config.externals = [\n nodeExternals({\n whitelist: [/^vuetify/, /^vue-resource/]\n })\n ]\n }\n }", "extend(config, { isDev }) {\n if (isDev && process.client) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend(config, ctx) {\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend(config, ctx) {\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend(config, ctx) {\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend(config, ctx) {\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend(config, ctx) {\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend(config, ctx) {\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend(config, ctx) {\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend(config, ctx) {\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend(config, ctx) {\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend(config, ctx) {\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend(config, ctx) {\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend(config, ctx) {\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend(config, ctx) {\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n });\n }\n }", "extend(config, ctx) {\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n });\n }\n }", "extend(config, ctx) {\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend(config, {\n isDev,\n isClient\n }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend(config, ctx) {\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/,\n })\n }\n }", "extend (config, ctx) {\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend (config, ctx) {\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend(config, ctx) {\n //Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend(config, { isDev }) {\n if (isDev) config.devtool = '#source-map';\n if (isDev && process.client) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/,\n });\n }\n }", "extend(config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend(config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend(config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend(config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend(config, ctx) {\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n config.module.rules\n .filter(r => r.test.toString().includes('svg'))\n .forEach(r => {\n r.test = /\\.(png|jpe?g|gif)$/\n })\n // urlLoader.test = /\\.(png|jpe?g|gif)$/\n config.module.rules.push({\n test: /\\.svg$/,\n loader: 'svg-inline-loader',\n exclude: /node_modules/\n })\n }", "extend(config, ctx) {\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend(config, ctx) {\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend(config, {isDev, isClient}) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend(config, {isDev, isClient}) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend(config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: \"pre\",\n test: /\\.(js|vue)$/,\n loader: \"eslint-loader\",\n exclude: /(node_modules)/\n });\n }\n }", "extend(config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: \"pre\",\n test: /\\.(js|vue)$/,\n loader: \"eslint-loader\",\n exclude: /(node_modules)/\n });\n }\n }", "extend(config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n });\n }\n }", "extend(config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: \"pre\",\n test: /\\.(js|vue)$/,\n loader: \"eslint-loader\",\n exclude: /(node_modules)/,\n })\n }\n }", "extend(config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/,\n })\n }\n }", "extend(config, ctx) {\n if (ctx.isClient) {\n // 配置别名\n config.resolve.alias['@'] = path.resolve(__dirname, './');\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n });\n }\n }", "extend (config, ctx) {\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n if (ctx.isServer) {\n config.externals = [\n nodeExternals({\n whitelist: [/^vuetify/]\n })\n ]\n }\n }", "extend(config, { isDev, isClient }) {\n if (isDev && isClient) {\n // config.module.rules.push({\n // enforce: 'pre',\n // test: /\\.(js|vue)$/,\n // loader: 'eslint-loader',\n // exclude: /(node_modules)/\n // })\n }\n }", "extend(config, ctx) {\n // Run ESLint on save\n // 配置vender\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend(config, { isDev }) {\n if (process.server && process.browser) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/,\n });\n }\n }", "extend(config, ctx) {\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n config.module.rules.push({\n test: /\\.json5$/,\n loader: 'json5-loader',\n exclude: /(node_modules)/\n })\n config.node = {\n fs: 'empty'\n }\n }", "extend(config, ctx) {\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: \"pre\",\n test: /\\.(js|vue)$/,\n loader: \"eslint-loader\",\n exclude: /(node_modules)/\n });\n }\n config.module.rules.push({\n resourceQuery: /blockType=i18n/,\n type: \"javascript/auto\",\n loader: [\"@kazupon/vue-i18n-loader\", \"yaml-loader\"]\n });\n }", "extend (config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend (config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend (config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend (config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend (config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend (config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend (config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend (config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend (config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend (config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend (config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend (config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend (config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend (config, { isDev, isClient,isServer }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n config.devtool = 'eval-source-map'\n }\n // if (isServer) {\n // config.externals = [\n // require('webpack-node-externals')({\n // whitelist: [/\\.(?!(?:js|json)$).{1,5}$/i, /^ai-act-ui/, /^ai-i/]\n // })\n // ]\n // }\n }", "extend (config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules|bower_components)/\n })\n }\n }", "extend(config, ctx) {\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n if (ctx.isServer) {\n config.externals = [\n nodeExternals({\n whitelist: [/^vuetify/]\n })\n ]\n }\n }", "async updateEslintIgnore() {\n const toAppend = ['', '# ember-electron', `/${electronProjectPath}/`].join(\n '\\n'\n );\n\n await this.insertIntoFile('.eslintignore', toAppend);\n }" ]
[ "0.6330731", "0.62717634", "0.6232921", "0.6222625", "0.61779165", "0.61597806", "0.60991013", "0.60978246", "0.60938466", "0.6092497", "0.6082013", "0.6081027", "0.6073714", "0.60690576", "0.6066145", "0.6062772", "0.60450524", "0.60450524", "0.60450524", "0.60450524", "0.60450524", "0.60450524", "0.60413337", "0.604093", "0.604093", "0.6034311", "0.6034311", "0.6034311", "0.6034311", "0.6034311", "0.6033844", "0.6032839", "0.6031434", "0.60309744", "0.60309505", "0.6008028", "0.6000662", "0.59990597", "0.5986156", "0.59844816", "0.59768814", "0.5944282", "0.59170187", "0.59170187", "0.59170187", "0.59170187", "0.59170187", "0.59170187", "0.59170187", "0.59170187", "0.59170187", "0.59170187", "0.59170187", "0.59170187", "0.5904838", "0.5904838", "0.59010345", "0.58973485", "0.58939904", "0.5893196", "0.5893196", "0.5885115", "0.58812344", "0.5870138", "0.5870138", "0.5870138", "0.5870138", "0.5867468", "0.5859564", "0.5859564", "0.58538467", "0.58538467", "0.5840845", "0.5840845", "0.5839762", "0.58344233", "0.5834016", "0.58235276", "0.57634795", "0.57622623", "0.5756686", "0.5755193", "0.57383066", "0.5736417", "0.5722293", "0.5722293", "0.5722293", "0.5722293", "0.5722293", "0.5722293", "0.5722293", "0.5722293", "0.5722293", "0.5722293", "0.5722293", "0.5722293", "0.5722293", "0.5717384", "0.5716501", "0.57029814", "0.565009" ]
0.0
-1
return true, if can cut into k piece by length
function count(lengthArray, woodLength, k) { var count = 0; var curLength; var i; for (i = 0; i < lengthArray.length; i++) { curLength = lengthArray[i]; while (curLength >= woodLength) { count++; curLength -= woodLength; } } return count >= k; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function testK(k) {\n let commonDivisor = (num) => {\n return mul.some((item) => (num % item[0] === 0));\n };\n return Array.prototype.every.call(s, (item, index) => (commonDivisor(k + index) === (item === '0')));\n }", "function maxLength1(a, k) {\n const isSatisfied = (a, stInd, l, k) => {\n let total = 0\n for (let i = 0; i < l; i++) {\n total = total + a[stInd + i]\n if (total > k) return false\n }\n return true\n }\n let answer = 0;\n for (let l = 1; l <= a.length; l ++) {\n for (let stInd = 0; stInd <= a.length - l; stInd ++) {\n if (isSatisfied(a, stInd, l, k)) {\n answer = l\n }\n }\n }\n return answer\n}", "function divingBoard(k, shorter, longer) {\n const lengths = [];\n let length = 0;\n\n let i = 0;\n let kCopy = k;\n\n while (kCopy >= 0) {\n length += (shorter * i);\n length += (longer * (k-i));\n lengths.push(length);\n i++;\n kCopy--;\n length = 0;\n }\n return lengths;\n}", "function place(res, k) {\n\tvar abs = Math.abs;\n\tfor (var i = 0; i < k; i++) {\n\t\tif (res[i] == res[k] || abs(res[i] - res[k]) == abs(i - k))\n\t\t\treturn false;\n\t}\n\treturn true;\n}", "checkFinish(data, k) {\n for (var i = 0; i < k; i++) {\n if (!this.compareArray(data[i].k, data[i].temp)) {\n return false\n }\n }\n return true;\n }", "function placePiece(n, k, position){\n //base ending condition\n if (k == n) {\n if(checkDiagonal(position)){\n console.log(position);\n printboard(position);\n count++;\n }\n return;\n }\n\n var localPos = position.slice(0);\n\n //recursion for k\n // 1. produce available array\n var available = allRows.filter( row => !localPos.includes(row));\n available.forEach( spot => {\n localPos[k] = spot;\n placePiece(n, k + 1, localPos);\n });\n\n}", "function partitionArray(k, numbers) {\n console.log('k:', k)\n console.log('numbers', numbers)\n const arrLen = numbers.length\n console.log('arrLen', arrLen)\n var arr1 = []\n var arr2 = []\n // if arr can by evenly divided k times proceed\n if (arrLen % k === 0) {\n console.log('yes')\n return 'Yes'\n } else {\n // else return 'no'\n console.log('no')\n return 'No'\n }\n}", "function containsCloseNums(nums, k) {\n for (let i = 0; i < nums.length; i++) {\n for (let j = 0; j < nums.length; j++) {\n if (i !== j && nums[i] === nums[j]) {\n return Math.abs(i - j) <= k\n }\n }\n }\n return false\n}", "function divingBoard (short, long, k) {\n let set = new Set();\n dfs(k, 0);\n return set;\n\n function dfs(n, length) {\n if (n === 0) return set.add(length);\n \n dfs(n - 1, length + short);\n dfs(n - 1, length + long);\n }\n}", "function cutTheSticks(a) {\n // console.log(a);\n let ret = [];\n\n if (checkArrayStickIsTheSame(a)) return a.length;\n\n for (let i = a.length; i > 1; ) {\n let temp = [...a];\n let cutt = cut(a, minArr(a));\n // console.log(\"min a = \", minArr(a));\n // console.log(\"A after cut \", cutt);\n a = cutt.arr;\n let cc = countCutInArrayStick(temp, a);\n i -= cutt.numCut;\n // console.log(a);\n // console.log(\"len a \", i);\n // console.log(\"num cut \", cc);\n ret.push(cc);\n //console.log(i);\n }\n ret.push(1);\n return ret;\n}", "function maxLength3(a, k) {\n let answer = 0\n for (i = 0; i < a.length; i++) {\n let total = 0\n let l = 0\n for (let curInd = i; curInd < a.length; curInd++) {\n total = total + a[curInd]\n if (total <= k) {\n l = curInd - i + 1\n } else break\n }\n if (l > answer) answer = l\n }\n return answer\n}", "function testKSubsets() {\n assert.deepStrictEqual(KSubsets(num, 2), [[1, 2], [1, 3], [2, 3]]);\n assert.deepStrictEqual(KSubsets(num, 0), [[]]);\n assert.deepStrictEqual(KSubsets(num, 3), [[1, 2, 3]]);\n return true;\n}", "function containDuplication(arr,k){\n if(arr.length===0)\n return false;\n let index1=0;\n let index2=0\n for(let i=0;i<arr.length;i++){\n for(let j=i+1;j<arr.length;j++){\n if(arr[i]===arr[j]){\n index1=i;\n index2=j\n } \n }\n if(index2-index1<=k) return true;\n }\n return false;\n}", "chooseKCombos (string, k) {\n // initialize combination array\n var combos = [];\n // Edge cases: make sure k >= the number of elements in set\n if (k > string.length) {\n // no solution\n return new Error(`Not enough elements to generate combinations of length ${k}`);\n } else if (k === string.length) {\n // edge case: set.length choose k < maxCombos?\n // two easy cases\n // 1. you're choosing M out of M elements\n return [string]; // only one possible combo\n } else if (k === 1) {\n // if you're choosing 1, there are M max combinations\n for (let i = 0; i < string.length; i++) {\n combos.push(string[i])\n }\n return combos;\n }\n // otherwise compute combinations\n // When the length drops below (k-1), we cannot find any (k-1)-combos, hence the upper limit for the iteration:\n for (let i = 0; i < string.length; i++) {\n var headChar = string.substring(i, i + 1);\n // Find the combinations for the tail/end of the string\n var tailCombos = this.chooseKCombos(string.slice(i + 1), k - 1);\n // For each (k-1)-combination we join it with the current\n // and store it to the set of k-combinations.\n for (let j = 0; j < tailCombos.length; j++) {\n combos.push(headChar.concat(tailCombos[j]));\n }\n }\n return combos;\n }", "function subarraysWithKDistinct(A, K) {\n function atMostK(k) {\n let start= 0;\n let res = 0;\n const count = {};\n \n for (let end= 0; end < A.length; end++) {\n if (count[A[end]] == null) count[A[end]] = 0;\n if (count[A[end]] === 0) k--;\n count[A[end]]++;\n \n while (k < 0) {\n count[A[start]]--; // shorten the window\n if (count[A[start]] === 0) k++; //if a characters stops existing, increase the total count of distinct characters\n start++; // shorten the window\n }\n res += end -start + 1;//add the subsequence count with k distinct characters\n }\n return res;\n }\n \n return atMostK(K) - atMostK(K - 1);\n }", "function maxLength2(a, k) {\n let answer = 0\n for (i = 0; i < a.length; i++) {\n let total = 0\n let l = 0\n let curInd = i\n while (total <= k && curInd < a.length) {\n l++\n total = total + a[curInd]\n console.log(total + \"total\" + l)\n curInd++\n }\n if (curInd)\n if ( l - 1 > answer) answer = l - 1\n }\n return answer\n}", "function divingBoard3(short, long, k) {\n let set = new Set();\n\n let start = short * k;\n set.add(start);\n\n let lcount = 0;\n while (lcount < k) {\n start = start - short + long;\n set.add(start);\n lcount++;\n } \n \n return set;\n}", "function killKthBit(n, k) {\n return n.toString(2)[ n.toString(2).length - k ] == '1' ?\n n -= 2 ** (k - 1) : n;\n}", "function nonDivisibleSubset(k, S) {\n // all sums % 1 are 0, and no sums % 0 are possible, so greatest subset is 1 (allowing no pairs)\n if (k <= 1) {\n return 1;\n }\n\n // store remainders in array, such that each array item is formatted as [value, count] (see helper function)\n let remainders = [];\n for (let i = 0; i < S.length; i++) {\n // using helper function\n insert(remainders, S[i] % k);\n }\n\n // identify items that, when summed, and modded k, === 0\n for (let i = 0; i < remainders.length - 1; i++) {\n for (let j = 1; j < remainders.length; j++) {\n // if an item itself % k is 0, or the item plus itself % k is 0, we can only have one of it!\n if (remainders[i][VALUE] % k === 0 || (remainders[i][VALUE] * 2) % k === 0) {\n remainders[i][COUNT] = 1;\n }\n if (remainders[j][VALUE] % k === 0 || (remainders[j][VALUE] * 2) % k === 0) {\n remainders[j][COUNT] = 1;\n }\n\n // if two items summed % k are zero, they can't coexist; reduce count of the less prevalent to 0\n if (remainders[i][VALUE] + remainders[j][VALUE] === k) {\n // if a mod match found, remove items for the lesser count\n if (remainders[i][COUNT] > remainders[j][COUNT]) {\n remainders[j][COUNT] = 0;\n }\n else {\n remainders[i][COUNT] = 0;\n }\n }\n }\n }\n\n // grab and return the total\n let result = remainders.reduce((total, current) => total + current[COUNT], 0);\n return result;\n}", "checkForSlice(fruit) {\n if (fruit.sliced || this.swipes.length < 2)\n return false;\n\n var length = this.swipes.length; // length of sword\n\n var stroke1 = this.swipes[length - 1]; // latest stroke\n var stroke2 = this.swipes[length - 2]; // second-to-latest stroke\n\n /* calculate distance from strokes 1 & 2 from fruit */\n var d1 = dist(stroke1.x, stroke1.y, fruit.position.x, fruit.position.y);\n var d2 = dist(stroke2.x, stroke2.y, fruit.position.x, fruit.position.y);\n\n /* calculate distance from stroke1 to stroke2 */\n var d3 = dist(stroke1.x, stroke1.y, stroke2.x, stroke2.y);\n\n var sliced = d1 < fruit.size || \t\t\t// if stroke1 lands directly on the fruit\n ((d1 < d3 && d2 < d3) && \t// if the fruit falls between stroke1 and stroke2\n (d3 < BLADE_LENGTH));\t\t\t// if there is a new stroke, don't connect the two\n\n fruit.sliced = sliced; // update fruit's property\n\n if(sliced) {\n if(fruit.bad) {\n boom.play();\n } else {\n splatter.play();\n }\n }\n\n return sliced;\n }", "function isCrossing(i, k){\n\t\n\tif ( i == k || i == k + 1 || i == k - 1){\n\t\treturn false;\n\t}\n\t\n\t\n\tvar path1 = [pointarray[i].LatLng, pointarray[i + 1].LatLng, pointarray[k].LatLng];\n\tvar path2 = [pointarray[i].LatLng, pointarray[i + 1].LatLng, pointarray[k + 1].LatLng];\n\tvar path3 = [pointarray[k].LatLng, pointarray[k + 1].LatLng, pointarray[i].LatLng];\n\tvar path4 = [pointarray[k].LatLng, pointarray[k + 1].LatLng, pointarray[i + 1].LatLng];\n\t\n\tvar area1 = google.maps.geometry.spherical.computeSignedArea(path1);\n\tvar area2 = google.maps.geometry.spherical.computeSignedArea(path2);\n\n\tvar area3 = google.maps.geometry.spherical.computeSignedArea(path3);\n\tvar area4 = google.maps.geometry.spherical.computeSignedArea(path4);\n\tvar s1 = area1 * area2; var s2 = area3 * area4;\n\t\n\tif ((s1 < 0) && (s2 < 0))\n\t{\n\t\t// exclude some pathological cases\n\t\t// otherwise rounding errors in computeSignedArea can lead\n\t\t// two wrong results\n\t\tif (s1 < -1 && s2 < -1){\n\t\t\treturn true;\n\t\t} \n\t}\n\t\n\treturn false;\n}", "function longestSubstringWithKDistinctCharacters(s, k) {\n\n // Map used to keep track of letters\n let map = new Map();\n\n let startWindow = 0;\n let endWindow = 0;\n\n let currentLength = Number.MIN_VALUE;\n\n while (endWindow < s.length) {\n\n if (!map.has(s.charAt(endWindow)) && map.size < k) {\n map.set(s.charAt(endWindow++), 1);\n currentLength = Math.max(currentLength, endWindow-startWindow);\n } else if (!map.has(s.charAt(endWindow)) && map.size === k) {\n // Remove the starting character from the map and then add current character\n // till the map has less than k distinct characters\n while(map.has(s.charAt(startWindow)) && map.size === k) {\n if (map.get(s.charAt(startWindow)) > 1) {\n map.set(s.charAt(startWindow), map.get(startWindow)-1);\n } else {\n map.delete(s.charAt(startWindow));\n }\n startWindow++;\n }\n // Add current character\n if (!map.has(s.charAt(endWindow)) && map.size < k) {\n map.set(s.charAt(endWindow++), 1);\n currentLength = Math.max(currentLength, endWindow-startWindow);\n }\n } else {\n map.set(s.charAt(endWindow), map.get(s.charAt(endWindow))+1);\n endWindow++;\n currentLength = Math.max(currentLength, endWindow-startWindow);\n }\n }\n\n return currentLength;\n}", "function solution(k) {\n const res = Array.from({ length: k }, () => 0);\n\n // 생성자\n for (let i = 1; i <= k; i++) {\n if (d(i) <= 10000) res[d(i)] = 1;\n }\n\n for (let i = 1; i < k; i++) {\n if (res[i] === 0) console.log(i);\n }\n}", "function hackerlandRadioTransmitters(x, k) {\n\n let houses = x.sort((a,b) => a - b);\n let count = 0;\n let index = 0;\n let location = 0;\n //[2,4,5,6,7,8,11,12]\n\n while(index < houses.length ){\n\n location = houses[index] + k;\n while(location >= houses[index]){\n index++;\n }\n\n index--;\n location = houses[index] + k;\n\n while(location >= houses[index]){\n index++;\n }\n\n count++;\n\n\n\n\n }\n\n return count;\n}", "function checkBigCard(hand) {\n let bigCard = true;\n let needAce = false;\n for (let card of hand) {\n if (card.Point < 9) {\n // besides all letters ATJQK\n bigCard = false;\n break;\n }\n if (card.Point == 9) {\n needAce = true;\n bigCard = false;\n }\n if (needAce) {\n for (let card of hand) {\n if (card.Point == \"A\") bigCard = true;\n }\n }\n }\n if (bigCard) return true;\n}", "function index (list, k) {\n\t return low.defined(list) &&\n\t low.has(list, 'length') &&\n\t k >= 0 &&\n\t k < list.length\n\t}", "function numOfSubarrays(arr, k, threshold) {\n let i = 0, sum = 0, count = 0;\n\n for (let j = 0; j < arr.length; j++) {\n sum = sum + arr[j];\n\n if (j - i + 1 == k) {\n if (sum / k >= threshold) {\n count++;\n }\n\n sum = sum - arr[i];\n\n i++;\n }\n }\n\n return count;\n}", "function luckBalance(k, contests) {\n\n let luck = 0\n\n let mustWinContests = []\n for (let i = 0; i < contests.length; i++) {\n if (contests[i][1] === 1) {\n mustWinContests.push(contests[i])\n }\n }\n mustWinContests = mustWinContests.sort(function(a, b){return a[0]-b[0]}).splice(0, mustWinContests.length - k)\n\n // for (let i = 0; i < contests.length; i++) {\n // if (mustWinContests.includes(contests[i]) === true){\n // luck--\n // } else {\n // luck++\n // }\n // }\n\n for (let i = 0; i < contests.length; i++) {\n luck += contests[i][0]\n }\n\n for (let i = 0; i < mustWinContests.length; i ++) {\n luck = luck - (2 * mustWinContests[i][0])\n }\n\n return luck\n}", "function checkSlice(chkLoc, cakeGrid, possSlice) {\n let chkSlice = cakeGrid\n .slice(chkLoc[1], chkLoc[1] + possSlice[1])\n .map(row => row.slice(chkLoc[0], chkLoc[0] + possSlice[0]))\n let pattern = /[o]/g;\n chkRaisins = chkSlice.join('').match(pattern);\n if (!chkRaisins ||\n chkRaisins.length > 1 ||\n chkLoc[0] + possSlice[0] > cakeGrid[0].length ||\n chkLoc[1] + possSlice[1] > cakeGrid.length) {\n return false;\n } else {\n return true;\n }\n}", "function getMaxLessThanK(n,k) {\n if(k >= 2) {\n let a = 1;\n let newArr = Array();\n while(n > a) {\n let b = a + 1;\n while(n >= b) {\n if( (a & b) < k ){\n newArr.push(a & b);\n }\n b++;\n }\n a++;\n }\n return Math.max(...newArr);\n }\n}", "function k_combinations(set, k) {\n var i, j, combs, head, tailcombs;\n\n if (k > set.length || k <= 0) {\n return [];\n }\n\n if (k == set.length) {\n return [set];\n }\n\n if (k == 1) {\n combs = [];\n for (i = 0; i < set.length; i++) {\n combs.push([set[i]]);\n }\n return combs;\n }\n\n // Assert {1 < k < set.length}\n\n combs = [];\n for (i = 0; i < set.length - k + 1; i++) {\n head = set.slice(i, i+1);\n tailcombs = k_combinations(set.slice(i + 1), k - 1);\n for (j = 0; j < tailcombs.length; j++) {\n combs.push(head.concat(tailcombs[j]));\n }\n }\n return combs;\n}", "function killKthBit(n, k) {\r\n return n & ~(1 << (k - 1)) ;\r\n }", "function getMaxLessThanK(n,k){\n if(n >= 2 && k >= 2) {\n let newArr = Array();\n let numArr = Array.from(Array(n), (x, index) => index + 1);\n\n for(let i = 0; i < numArr.length; i++){\n for(let j = 1; j < numArr.length - 1; j++){\n //newArr.push();\n if(((numArr[i] & numArr[j]) !== 0) && (numArr[i] & numArr[j]) < k){\n newArr.push((numArr[i] & numArr[j]));\n }\n }\n }\n }\n\n return Math.max(...newArr);\n}", "function isSliceContinous(shape, begin, size) {\n // Index of the first axis that has size > 1.\n var firstNonOneAxis = size.length;\n for (var i = 0; i < size.length; i++) {\n if (size[i] > 1) {\n firstNonOneAxis = i;\n break;\n }\n }\n for (var i = firstNonOneAxis + 1; i < size.length; i++) {\n if (begin[i] > 0 || size[i] !== shape[i]) {\n return false;\n }\n }\n return true;\n}", "function checkFirstStraightByPlace( length, x ){\n var deletedWave = historyManager.deletedInfo.getCurrentWave();\n if( !deletedWave ){ return; }\n\n for(var i = 0; i < deletedWave.vDeletePairs[x].length; i++){\n if( deletedWave.vDeletePairs[x][i].balls.length >= length ){ return true; }\n }\n return false;\n}", "function validKobon(k) {\n if (alreadyTrackedKobon(k))\n return false;\n var kPoints = k.getUniquePoints();\n if (kPoints[0].equals(kPoints[1]))\n return false;\n if (kPoints[0].equals(kPoints[2]))\n return false;\n if (kPoints[1].equals(kPoints[2]))\n return false;\n return true;\n }", "function pairsTooLong(k, arr) {\n // declare count to track number of pairs\n let count = 0\n // loop to get through values, omitting last value (no comparison)\n for (let i = 0; i < arr.length - 1; i ++) {\n // loop to compare, j determined by value of i\n for (let j = i + 1; j < arr.length; j ++) {\n let diff = Math.abs(arr[i] - arr[j])\n\n if (diff == k) {\n count = count + 1\n }\n }\n }\n // return count\n // (or)\n console.log('Final count: ', count)\n}", "possible_taken_piece(x, y) {\n let pt = false;\n let pl = false;\n let pr = false;\n let pb = false;\n\n if (this._board[x][y] === -1) {\n return false;\n }\n if (this._taken_color !== null && this._board[x][y] !== this._taken_color) {\n return false;\n }\n\n let cpt = 4;\n\n if (this.check_piece_top(x, y)) {\n if (this._board[x][y - 1] !== -1) {\n cpt--;\n pt = true;\n }\n }\n if (this.check_piece_left(x, y)) {\n if (this._board[x - 1][y] !== -1) {\n cpt--;\n pl = true;\n }\n }\n if (this.check_piece_right(x, y)) {\n if (this._board[x + 1][y] !== -1) {\n cpt--;\n pr = true;\n }\n }\n if (this.check_piece_bottom(x, y)) {\n if (this._board[x][y + 1] !== -1) {\n cpt--;\n pb = true;\n }\n }\n // si 2 alors vérifier si l'opposé diagonal est non-vide\n if (cpt === 2) {\n return this.check_is_split(x, y, pt, pl, pr, pb);\n }\n return (cpt >= 2);\n }", "function containsNearbyDuplicate(nums, k) {\n const numsMap = new Map();\n for (let i = 0; i < nums.length; i += 1) {\n const num = nums[i];\n if (numsMap.has(num) && i - numsMap.get(num) <= k) {\n return true;\n } else {\n numsMap.set(num, i);\n }\n }\n return false;\n }", "function isSliceContinous(shape, begin, size) {\n // Index of the first axis that has size > 1.\n let firstNonOneAxis = size.length;\n for (let i = 0; i < size.length; i++) {\n if (size[i] > 1) {\n firstNonOneAxis = i;\n break;\n }\n }\n for (let i = firstNonOneAxis + 1; i < size.length; i++) {\n if (begin[i] > 0 || size[i] !== shape[i]) {\n return false;\n }\n }\n return true;\n}", "function k_combinations(set, k) {\n\tvar i, j, combs, head, tailcombs;\n\n\tif (k > set.length || k <= 0) {\n\t\treturn [];\n\t}\n\n\tif (k == set.length) {\n\t\treturn [set];\n\t}\n\n\tif (k == 1) {\n\t\tcombs = [];\n\t\tfor (i = 0; i < set.length; i++) {\n\t\t\tcombs.push([set[i]]);\n\t\t}\n\t\treturn combs;\n\t}\n\n\t// Assert {1 < k < set.length}\n\n\tcombs = [];\n\tfor (i = 0; i < set.length - k + 1; i++) {\n\t\thead = set.slice(i, i+1);\n\t\ttailcombs = k_combinations(set.slice(i + 1), k - 1);\n\t\tfor (j = 0; j < tailcombs.length; j++) {\n\t\t\tcombs.push(head.concat(tailcombs[j]));\n\t\t}\n\t}\n\treturn combs;\n}", "doesAllPiecesFit(testedSize) {\n // multiply the margin by 2 because there is a margin on each side of the piece\n const pieceWidth = (SHAPE_MAX_SIZE + (2 * this._blockMargin));\n const nbBlocksToPlace = NB_OF_PIECES * (pieceWidth * pieceWidth);\n const availableBlocks = (this._positionRect.width / testedSize) * (this._positionRect.height / testedSize);\n\n if (availableBlocks < nbBlocksToPlace)\n return (false);\n return (true);\n }", "checkWin()\n {\n return (this.posting[2].length === this.numDisks)\n }", "function isFactor(k, n) {\n let factor = false;\n\n if (n % k === 0) factor = true;\n\n return factor;\n}", "function longest_substring_with_k_distinct_characters(s, k) {\n //variables\n let maxLength = 0;\n let len = 0;\n const freq = {};\n\n let left = 0;\n //sliding window\n //loop\n //expand window right\n for(let right = 0; right < s.length; right++) {\n let c = s[right];\n //add char to hashmap\n if (!(c in freq)) {\n freq[c] = 0;\n } \n freq[c]++;\n //check new max length\n len++;\n \n //if more than 3 characters in window, shrink the window from the left\n while(left < s.length && Object.keys(freq).length > k) {\n let c2 = s[left];\n freq[c2]--;\n if (freq[c2] <= 0) \n delete freq[c2];\n\n left ++;\n len--;\n }\n maxLength = Math.max(maxLength, len);\n }\n return maxLength\n}", "function kMove(color, start, end) {\n var dif1 = start[0] - end[0];\n var dif2 = start[1] - end[1];\n \n if (Math.abs(dif1) >= 2 || Math.abs(dif2) >= 2) {\n return false;\n } else if (isSquareOccupied(end[0], end[1])) {\n return take(color, end[0], end[1]);\n }\n return true;\n}", "function hookLength(part, i, j) {\n var k = 0;\n while (i + k + 1 < part.length && part[i + k + 1] > j)\n k++;\n return k + part[i] - j;\n}", "function del_k(a, k) {\n if (k == 0) {\n k++\n }\n let j = 0\n let b = []\n while (j + 1 < a.length) {\n if (j % k == 0) {\n b = b.concat([(a[j] + a[j + 1]) / 2])\n } else {\n b = b.concat([a[j], a[j + 1]])\n }\n j += 2\n }\n return b\n}", "checkKong(tile) {\n return Evaluator.getDiscardedKong(this, tile).length > 0;\n }", "function quickselect(array, k) {\n var left = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n var right = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : array.length - 1;\n var compare = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : ascending;\n\n while (right > left) {\n if (right - left > 600) {\n var n = right - left + 1;\n var m = k - left + 1;\n var z = Math.log(n);\n var s = 0.5 * Math.exp(2 * z / 3);\n var sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1);\n var newLeft = Math.max(left, Math.floor(k - m * s / n + sd));\n var newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd));\n quickselect(array, k, newLeft, newRight, compare);\n }\n\n var t = array[k];\n var i = left;\n var j = right;\n swap(array, left, k);\n if (compare(array[right], t) > 0) swap(array, left, right);\n\n while (i < j) {\n swap(array, i, j), ++i, --j;\n\n while (compare(array[i], t) < 0) {\n ++i;\n }\n\n while (compare(array[j], t) > 0) {\n --j;\n }\n }\n\n if (compare(array[left], t) === 0) swap(array, left, j);else ++j, swap(array, j, right);\n if (j <= k) left = j + 1;\n if (k <= j) right = j - 1;\n }\n\n return array;\n}", "checkValidMove(origin, destination)\n {\n\n if(this.checkEmptyStack(origin))\n {\n return false;\n }\n else if(this.posting[origin-1][this.posting[origin-1].length-1] > this.posting[destination-1][this.posting[destination-1].length-1])//checks for big disks that are on top of smaller disks\n {\n console.log(this.posting[origin-1][this.posting[origin-1].length-1]);\n console.log(this.posting[destination-1][this.posting[destination-1].length-1]);\n return false;\n }\n else\n {\n return true;\n }\n }", "checkNeighbors(cb) {\n for (let i = 1; i < this.pieces.length - 1; i++) {\n for (let j = 1; j < this.pieces[i].length - 1; j++) {\n //iterate over neighbor nodes\n for (let k = 0; k < this.pieces[i][j].neighbors.length; k++) {\n if (!cb(this.pieces[i][j], this.pieces[i][j].neighbors[k]())) {\n return false;\n }\n }\n }\n }\n return true;\n }", "function k_combinations(set, k) {\r\n var i, j, combs, head, tailcombs;\r\n if (k > set.length || k <= 0) {\r\n return [];\r\n }\r\n\r\n if (k == set.length) {\r\n return [set];\r\n }\r\n\r\n if (k == 1) {\r\n combs = [];\r\n for (i = 0; i < set.length; i++) {\r\n combs.push([set[i]]);\r\n }\r\n return combs;\r\n }\r\n combs = [];\r\n\r\n for (i = 0; i < set.length - k + 1; i++) {\r\n head = set.slice(i, i + 1);\r\n tailcombs = k_combinations(set.slice(i + 1), k - 1);\r\n for (j = 0; j < tailcombs.length; j++) {\r\n combs.push(head.concat(tailcombs[j]));\r\n }\r\n\r\n }\r\n sumcombs=[];\r\n for( i=0; i<combs.length; i++){\r\n sumOfCombinatios= summation(combs[i]);\r\n sumcombs.push(sumOfCombinatios);\r\n }\r\n return sumcombs;\r\n}", "function findConsqSums(arr, k) {\n\tif (arr.length == 0) return [];\n\tlet result = [];\n\tfor (let i = 0; i < arr.length; i++) {\n\t\tif (arr[i] > k) continue;\n\t\tlet temp = [];\n\t\tlet sum = arr[i];\n\t\ttemp.push(arr[i]);\n\t\tlet j = i;\n\t\twhile (j < arr.length && (sum + arr[j + 1]) <= k) {\n\t\t\tj++;\n\t\t\tsum += arr[j];\n\t\t\ttemp.push(arr[j]);\n\t\t\tif (sum == k) result.push([...temp]);\n\t\t\t// if (sum == k) result.push(temp.filter(() => true));\n\t\t}\n\t}\n\treturn result;\n}", "function size() {\n\t return k;\n\t }", "function numReduction(n, k) {\n let arr = [...`${n}`];\n let reduced = '';\n let reducedLen = arr.length - k;\n\n function helper(arr, k) {\n if (reduced.length === reducedLen) {return reduced;}\n let numSlice = arr.slice(0, k+1);\n let min = Math.min(...numSlice);\n let minInd = arr.indexOf(min + '');\n reduced += arr.splice(minInd, 1);\n helper(arr.slice(minInd), k - minInd);\n }\n \n helper(arr, k);\n return reduced;\n}", "function k(t){return[].slice.call(t)}", "checkChow(tile) {\n return Evaluator.getDiscardedChow(this, tile).length > 0;\n }", "function combinations(n, k) {\n let result = [];\n backtrack([], 1);\n return result;\n\n function backtrack(current, index) {\n if (current.length > k) return;\n if (current.length === k) {\n result.push(current.slice());\n return;\n }\n\n for (let i = index; i <= n; i++) {\n backtrack(current.concat(i), i + 1);\n }\n }\n}", "function main() {\n var s = readLine();\n var t = readLine();\n var k = parseInt(readLine());\n\n // case 1\n\n if(s.length + t.length <= k){\n console.log(\"Yes\");\n } else{\n // keep iterating until we reach different character\n var commonLength = 0;\n while(commonLength < s.length && commonLength < t.length && s[commonLength] == t[commonLength]){\n commonLength++;\n }\n\n // Diff is the total length of each word minus the common length of each word\n var diff = s.length + t.length - 2*commonLength;\n\n // If the difference is less than k there should be enough moves; however if the diff is odd and the k is even then there are not enough moves\n // you need diff and even and k of even or diff of odd and k of odd. Testing even is easier\n if(diff <= k && diff%2 === k%2){\n console.log(\"Yes\");\n } else {\n console.log(\"No\");\n }\n\n }\n\n}", "function shift(array, k){\n let tempOne = 0;\n let tempTwo = 0;\n for(let i = 0; i < 1; i++){\n if(array.length < 2){\n return false;\n }\n tempOne = array[0]; // 0 = 1\n array[0] = array[array.length - 1]; // 1 = 4\n array[array.length - 1] = tempOne; \n }\n return array;\n}", "function isPartition(ns) {\n return isWeaklyDecreasing(ns) && ns.every(function (x) { return x > 0; });\n}", "function size() {\n return k;\n }", "function solution(A, K) {\n // write your code in JavaScript (Node.js 8.9.4)\n let len = A.length;\n if (len <= 1){\n return A;\n }else{\n let minK = K % len;\n for(let i =0; i<minK; i++){\n let popout = A.shift();\n A.push(popout);\n }\n return A;\n }\n}", "function subsetSums(arr, k) {\n const result = [];\n function helper(subset, sum, index) {\n if (sum > k) return;\n if (sum === k) return result.push([...subset]);\n for (let i = index; i < arr.length; i += 1) {\n const cand = arr[i];\n subset.push(cand);\n sum += cand;\n helper(subset, sum, i + 1);\n subset.pop();\n sum -= cand;\n }\n }\n helper([], 0, 0);\n return result;\n}", "function spliceWorks() {\n\t\tvar n = 256,\n\t\t\ta = [];\n\t\ta[n] = 'a';\n\t\ta.splice( n + 1, 0, 'b' );\n\t\treturn a[n] === 'a';\n\t}", "function check_block() {\n var moved = false;\n reset_counts();\n check_counts(\"X\");\n\n if (countdiag1 == 2 && !moved) {\n for (i = 0; i < 3; i++) {\n moved = take_space(i * 3 + i);\n }\n }\n if (countdiag2 == 2 && !moved) {\n for (i = 0; i < 3; i++) {\n moved = take_space(i * 2 + 2);\n }\n }\n if (countrow0 == 2) {\n for (i = 0; i < 3; i++) {\n moved = take_space(i);\n }\n }\n if (countrow1 == 2 && !moved) {\n for (i = 0; i < 3; i++) {\n moved = take_space(3 + i);\n }\n }\n if (countrow2 == 2 && !moved) {\n for (i = 0; i < 3; i++) {\n moved = take_space(6 + i);\n }\n }\n if (countcol0 == 2 && !moved) {\n for (i = 0; i < 3; i++) {\n moved = take_space(i * 3);\n }\n }\n if (countcol1 == 2 && !moved) {\n for (i = 0; i < 3; i++) {\n moved = take_space(i * 3 + 1);\n }\n }\n if (countcol2 == 2 && !moved) {\n for (i = 0; i < 3; i++) {\n moved = take_space(i * 3 + 2);\n }\n }\n return moved;\n}", "function trim(x, k) {\n var i, y;\n for (i = x.length; i > 0 && !x[i - 1]; i--);\n y = new Array(i + k);\n copy_(y, x);\n return y;\n }", "isKingThreatened(kingPos, queenPos) {\n if (kingPos[0] == queenPos[0]) { // checking column\n return true;\n } else if (kingPos[1] == queenPos[1]) { // checking row\n return true;\n } else { // check diagonals next\n let colDiff = Math.abs(kingPos[0] - queenPos[0]);\n let rowDiff = Math.abs(kingPos[1] - queenPos[1]);\n if (colDiff == rowDiff) {\n return true;\n }\n }\n return false;\n }", "function solution(A, K) {\n // write your code in JavaScript (Node.js 8.9.4)\n \n const Alen = A.length;\n \n if (Alen <= 1) {\n return A;\n }\n \n // Slice array into two parts based on how many effective rotations need to be made\n const rotDiff = Alen - K % Alen;\n \n const firstPart = A.slice(rotDiff);\n const secondPart = A.slice(0, rotDiff);\n \n // join these parts and return the result\n return firstPart.concat(secondPart);\n}", "function canOccupySlice(decorations,start,end){for(var ii=start;ii<end;ii++){if(decorations[ii]!=null){return false;}}return true;}", "function nChooseKCombos(n, k){\n if(k === n){\n let onlyCombo = [] // there's only one possible combo in this case\n for(let i = 1; i <= n; i++) onlyCombo.push(i)\n return [onlyCombo]\n }\n\n if(k === 1){\n let result = []\n for(let i = 1; i <= n; i++) result.push([i])\n return result\n }\n\n if(k === n - 1){\n let result = []\n for(let i = 1; i <= n; i++){\n let combo = []\n for(let i2 = 1; i2 <= n; i2++) if(i !== i2) combo.push(i2)\n result.push(combo)\n }\n return result\n }\n\n if(k === 2){\n let result = []\n for(let item1 = 1; item1 <= n; item1++){\n for(let item2 = item1 + 1; item2 <= n; item2++){\n result.push([item1, item2])\n }\n }\n return result\n }\n\n if(k === n - 2){\n let result = []\n for(let item1 = 1; item1 <= n; item1++){\n for(let item2 = item1 + 1; item2 <= n; item2++){\n let combo = []\n for(let i = 1; i <= n; i++) if(i !== item1 && i !== item2) combo.push(i)\n result.push(combo)\n }\n }\n return result\n }\n\n console.warn(\"This scenario isn't supported by this mock function\", n, k)\n}", "function trim(x,k) {\n var i,y;\n for (i=x.length; i>0 && !x[i-1]; i--);\n y=new Array(i+k);\n copy_(y,x);\n return y;\n }", "function largestSubstringWithKDistinctChar(s, k) {\n let currentLargestSubstring = '';\n\n for (let i = 0; i < s.length; i++) {\n for (let j = i+1; j < s.length; j++) {\n let substring = s.slice(i, j);\n if (containsKDistinctChars(substring, k) && currentLargestSubstring.length < substring.length) {\n currentLargestSubstring = substring;\n } \n\n console.log(substring);\n } \n }\n\n return currentLargestSubstring;\n}", "function longestConsec(arr, k) {\n let temp = '';\n\n if (k <= 0 || k > arr.length) return '';\n\n while (arr.length > 0) {\n if (temp.length < arr.slice(0, k).join('').length) {\n temp = arr.slice(0, k).join('');\n }\n arr.shift();\n }\n\n return temp;\n}", "magicDeck() {\n return this.drawPile.concat(this.discardPile).length === 0;\n }", "isKingInCheck(kingOwner) {\n let arrPossibleMoves;\n let enemyRow, enemyCol;\n\n for (let r = 0; r <= this.MAX_ROW; r++) {\n for (let c = 0; c <= this.MAX_COL; c++) {\n // For every piece on the chessboard...\n if (this.pieceAt(r, c) !== EMPTY_CELL) {\n // ...owned by the king's enemy...\n if (this.pieceAt(r, c).owner !== kingOwner) {\n // Last parameter is false because is doesn't matter\n // if the enemy will put their king to risk,\n // if they capture the enemy king they win\n arrPossibleMoves = this.getPossibleMovesForPiece(r, c, false);\n // ...check all the cells that piece can be moved to\n for (let i = 0; i < arrPossibleMoves.length; i++) {\n // If the piece can capture another piece...\n if (arrPossibleMoves[i].isEnemy) {\n enemyRow = arrPossibleMoves[i].row;\n enemyCol = arrPossibleMoves[i].col;\n // ...and that piece is the king...\n if (this.pieceAt(enemyRow, enemyCol).type === PieceTypeEnum.King) {\n return true;\n }\n }\n }\n }\n }\n }\n }\n\n return false;\n }", "function clean_cut(_layer_, pr_second_side_bool) {\n if (there_is_at_least_one_cut) {\n var bounds, www, hhh;\n var parsed_offset = parseFloat(offset);\n for (var j = 0; j < configuration_object[i].sides.length; j++) {\n var t_obj = configuration_object[i].sides[j];\n if (t_obj.type == finishings[0]) { // is 'cut | dociecie'\n app.activeDocument.activeLayer = _layer_;\n switch (t_obj.side) {\n case \"top\":\n bounds = app.activeDocument.activeLayer.bounds;\n www = bounds[2].value - bounds[0].value;\n hhh = bounds[3].value - bounds[1].value;\n resize_layer(app.activeDocument.activeLayer, www, hhh + parsed_offset,\n AnchorPosition.BOTTOMCENTER);\n if (pr_second_side_bool) {\n sec_side_resize(AnchorPosition.BOTTOMCENTER, 'VERTICAL');\n }\n break;\n case \"left\":\n bounds = app.activeDocument.activeLayer.bounds;\n www = bounds[2].value - bounds[0].value;\n hhh = bounds[3].value - bounds[1].value;\n resize_layer(app.activeDocument.activeLayer, www + parsed_offset, hhh,\n AnchorPosition.MIDDLERIGHT);\n if (pr_second_side_bool) {\n sec_side_resize(AnchorPosition.MIDDLELEFT, 'HORIZONTAL');\n }\n break;\n case \"right\":\n bounds = app.activeDocument.activeLayer.bounds;\n www = bounds[2].value - bounds[0].value;\n hhh = bounds[3].value - bounds[1].value;\n resize_layer(app.activeDocument.activeLayer, www + parsed_offset, hhh,\n AnchorPosition.MIDDLELEFT);\n if (pr_second_side_bool) {\n sec_side_resize(AnchorPosition.MIDDLERIGHT, 'HORIZONTAL');\n }\n break;\n case \"bottom\":\n bounds = app.activeDocument.activeLayer.bounds;\n www = bounds[2].value - bounds[0].value;\n hhh = bounds[3].value - bounds[1].value;\n resize_layer(app.activeDocument.activeLayer, www, hhh + parsed_offset,\n AnchorPosition.TOPCENTER);\n if (pr_second_side_bool) {\n sec_side_resize(AnchorPosition.TOPCENTER, 'VERTICAL');\n }\n break;\n }\n }\n }\n }\n }", "function subarraySum(arr, k) {\n let left = 0;\n let right = 0;\n let maxCount = 0;\n let sum = arr[0];\n while (left <= right) {\n console.log(left, right);\n if (sum < k) {\n if (right < arr.length - 1) {\n right++;\n sum += arr[right];\n } else {\n sum -= arr[left];\n left++;\n }\n } else if (sum === k) {\n maxCount++;\n if (right < arr.length - 1) {\n sum -= arr[left];\n left++;\n right++;\n sum += arr[right];\n } else {\n sum -= arr[left];\n left++;\n }\n } else {\n if (right < arr.length - 1) {\n if (right == left) {\n sum -= arr[left];\n left++;\n right++;\n sum += arr[right];\n } else {\n sum -= arr[left];\n left++;\n }\n } else {\n sum -= arr[left];\n left++;\n }\n }\n // }\n }\n return maxCount;\n}", "function largestNum(arr, k) {\n\tif (!arr && !arr.length && !k) return false;\n\n\tlet shunk = arr.slice(0, k); //first shunk\n\tlet heap = [];\n\tshunk.forEach(n => insertHeap(heap, n));\n\n\tfor (let i = k; i < arr.length; i++) {\n\t\tif (arr[i] >= heap[0]) {\n\t\t\tupdateHeap(heap, arr[i]);\n\t\t}\n\t}\n\n\treturn heap;\n}", "function longest_substring_with_k_distinct(str, k){\n let windowStart = 0;\n let maxLength = 0;\n let charFrequency = new Map();\n\n for(let windowEnd = 0; windowEnd < str.length; windowEnd++){\n let rightChar = str[windowEnd];\n if(!rightChar in charFrequency){\n charFrequency[rightChar] = 0;\n }\n charFrequency[rightChar] += 1\n while(Object.keys(charFrequency).length > k){\n let leftChar = str[windowStart]\n charFrequency[leftChar] -= 1;\n if(charFrequency[leftChar] === 0){\n delete charFrequency[leftChar]\n }\n windowStart += 1\n\n }\n maxLength = Math.max(maxLength, windowEnd - windowStart + 1);\n\n }\n return maxLength;\n\n}", "function quickSelect(arr, k) {\n shuffle(arr)\n\n function partition(arr, low, high) {\n let i = low, j = high + 1\n\n while (true) {\n while (arr[low] > arr[++i]) {\n if (i == high) break;\n }\n\n while (arr[low] < arr[--j]) {\n if (j == low) break\n }\n\n if (i >= j) break;\n [arr[i], arr[j]] = [arr[j], arr[i]]\n }\n\n [arr[low], arr[j]] = [arr[j], arr[low]]\n\n return j\n }\n\n let low = 0\n let high = arr.length - 1\n\n while (low < high) {\n let split = partition(arr, low, high)\n\n if (split < k) {\n low = split + 1\n }\n else if (split > k) {\n high = split - 1\n }\n else {\n return arr[k]\n }\n }\n\n return arr[k]\n}", "function longest_substring_with_k_distinct(str, k) {\n // TODO: Write code here\n\n let windowStart = 0,\n maxLength = 0,\n characterFrequency = {};\n\n if(str.length == 0 || k < 1) return 0;\n\n //extends the window \n for(let windowEnd = 0; windowEnd < str.length; windowEnd++){\n const rightCharacter = str[windowEnd]; //character at the start of the String\n\n if(!(rightCharacter in characterFrequency)) { //checks to see if character has occured\n characterFrequency[rightCharacter] = 0; //add the character type if it hasn't \n }\n\n characterFrequency[rightCharacter]++; //increment the character type\n\n //shrink the sliding window until there are only 2 character types in the frequency dictionary\n while(Object.keys(characterFrequency).length > k) {\n const leftCharacter = str[windowStart]; //character at the start of the window\n\n characterFrequency[leftCharacter]--; //decrement character occurence\n\n if(characterFrequency[leftCharacter] === 0 ) { //check if any occurences of the starting character in the frequency dictionary\n delete characterFrequency[leftCharacter]; //if not, remove character type\n }\n\n windowStart++; //move window up\n }\n maxLength = Math.max(maxLength, windowEnd - windowStart + 1); //determine max length\n }\n return maxLength\n }", "function partitionArray(k, numbers) {\n // Write your code here\n\n}", "has4OfAKind() {\n const cardCount = {};\n this.hand.forEach(card => (cardCount[card.value] = ++cardCount[card.value] || 1));\n const cards = Object.keys(cardCount).filter(key => cardCount[key] === 4);\n\n if (cards.length > 0) {\n const removed = this.hand.filter(card => card.value === cards[0]);\n this.hand = this.hand.filter(card => card.value !== cards[0]);\n return removed;\n }\n return false;\n }", "function findConsqSums(arr, k) {\n let sol=[]\n let lptr=0;\n let rptr=0;\n while(sum(arr,lptr,rptr)<k){\n rptr++;\n }\n while (lptr<arr.length){\n let s=sum(arr,lptr,((rptr<arr.length)?rptr:arr.length-1))\n if(s==k){\n sol.push(arr.slice(lptr, rptr+1))\n rptr++;\n while(arr[rptr]===0){\n sol.push(arr.slice(lptr, rptr+1))\n rptr++;\n console.log(\"inner\",sum(arr,lptr,rptr))\n }\n }\n else if(s>k){\n lptr++;\n }\n else if(s<k){\n if(rptr<arr.length){\n rptr++;\n }\n else{\n break;\n }\n }\n console.log(\"outer\",sum(arr,lptr,rptr))\n }\n return sol;\n}", "checkLength(currentPos, direction, length) {\n for (var i = 0; i < length; i++) {\n var x = currentPos.x;\n var y = currentPos.y;\n if (x >= this.props.size || y >= this.props.size || x < 0 || y < 0) {\n return false;\n }\n currentPos = this.move(currentPos, direction);\n }\n return true;\n }", "function testtilepoints(idxs,len){\n\tfor(var j=0; j<idxs.length; j++){\n\t\tfor(var i=0; i<points.length; i++){\n\t\t\tif(Math.hypot( (points[i].coords[0]-points[idxs[j]].coords[0]), (points[i].coords[1]-points[idxs[j]].coords[1]) ) < ((1-epsilon)*len) ){ \n\t\t\t\tvar issametile = false;\n\t\t\t\tfor(var k=0; k<idxs.length; k++){\n\t\t\t\t\tif(i===idxs[k]){ issametile = true; }\n\t\t\t\t}\n\t\t\t\tif(!issametile){ return false; }\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}", "function hackerlandRadioTransmitters(x, k) {\n var len;\n len = x.length;\n sort(x, 0, len - 1)\n \n var l = -1, r = -1, ans = 0;\n for (var i = 0; i < len; i++) {\n if (x[i] <= r)\n continue;\n if (l == -1)\n l = x[i];\n else if (x[i] - l > k) {\n ans++;\n if (x[i] - x[i - 1] <= k)\n l = -1;\n else\n l = x[i];\n r = x[i - 1] + k;\n }\n }\n if (l != -1)\n ans++;\n return ans;\n\n}", "function lengthOfTheLongestSubstringThatContainsAtMost(s, k) {\n // Your code here\n}", "function substringKor(str,lengths)\n{\n var len = 0;\n var newStr = '';\n \n for (var i=0;i<str.length; i++) {\n var n = str.charCodeAt(i);\n var nv = str.charAt(i);\n if ((n>= 0)&&(n<256)) {\n len ++;\n } else {\n len += 2;\n\t}\n\n\tif (len>lengths)\n\t\tbreak;\n\telse\n\t\tnewStr = newStr + nv;\n }\n \n return newStr;\n}", "function kEmptySlots(flowers, k) {\n \n}", "remove_kth_from_end(k)\n {\n let counter = 0;\n let lookahead = this.head;\n\n while(counter++ < k)\n {\n lookahead = lookahead.next;\n }\n\n if(lookahead === null)\n {\n this.head = this.head.next;\n }\n\n else\n {\n let find_kth = this.head;\n\n while(lookahead.next !== null)\n {\n lookahead = lookahead.next;\n find_kth = find_kth.next;\n }\n\n find_kth.next = find_kth.next.next;\n }\n }", "function isEnd() {\n\t\tlet flag = true;\n\t\tfor (let i = 0; i < pieceCount.length; i++) {\n\t\t\t//for each puzzle piece\n\t\t\tlet top = parseInt(pieceCount[i].style.top);\n\t\t\tlet left = parseInt(pieceCount[i].style.left);\n\t\t\tif (left != (i % 4 * PIECESIZE) || top != parseInt(i / 4) * PIECESIZE) {\n\t\t\t\t//checks if each piece matches its left and top position\n\t\t\t\tflag = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn flag;\n\t}", "function longestConsec (strarr, k){\n var n = strarr.length;\n var longest=0;\n var targetIndex=0;\n var calcArr=[];\n var calc=0;\n var result;\n if(k>n || n===0 || k<=0){\n return \"\";\n } else{\n var arrLengths = [];\n for (var i=0;i<strarr.length;i++){\n arrLengths.push(strarr[i].length);\n }\n debugger;\n for (var j=0;j<arrLengths.length;j++){\n calcArr = arrLengths.slice(j,j+k);\n calc = calcArr.reduce(function(a,b){\n return a+b;\n },0);\n if (calc>longest){\n targetIndex = j;\n longest=calc;\n }\n }\n console.log (targetIndex+k-1);\n result = strarr.slice(targetIndex,targetIndex+k)\n result = result.join(\"\");\n return result;\n }\n}", "function sol(n, k, lamps) {\n // n = # of lamps\n // k = period\n // find min number of moves necessary to to make k periodic garland of lamps from given one\n\n // total 1s to right of index\n const total = Array(n).fill(0);\n // total 1s to right of index within k period\n const totalRight = Array(n).fill(0);\n // total 1s to left of an index\n const totalLeft = Array(n).fill(0);\n\n findTotals();\n\n const dp = Array(n).fill(Infinity);\n\n if (lamps[n - 1] === \"1\") {\n dp[n - 1] = 0;\n } else {\n dp[n - 1] = 1;\n }\n\n // scan from right\n\n for (let i = n - 2; i >= 0; i--) {\n if (lamps[i] === \"1\") {\n // convert to 0\n // (cost to convert to 0) + (# of 1s to right of i, OR cost to convert 1s to 0s)\n dp[i] = Math.min(dp[i], 1 + total[i]);\n // keep as 1\n // (cost to keep as 1) + (total 1s within k period) + (computed dp[i + k + 1], already computed value for the string outside of k period!!)\n dp[i] = Math.min(dp[i], 0 + totalRight[i] + (i + k < n ? dp[i + k] : 0));\n } else if (lamps[i] === \"0\") {\n // convert to 1\n dp[i] = Math.min(dp[i], 1 + totalRight[i] + (i + k < n ? dp[i + k] : 0));\n // keep as 0\n dp[i] = Math.min(dp[i], 0 + total[i]);\n }\n }\n\n // scan from left\n\n for (let i = 1; i < n; i++) {\n // assuming everything to right is k period\n // add # of 1s to left of i to dp[i]\n dp[i] += totalLeft[i];\n }\n\n return Math.min(...dp);\n\n function findTotals() {\n let sum = 0;\n for (let i = n - 1; i >= 0; i--) {\n total[i] = sum;\n\n if (lamps[i] === \"1\") {\n sum += 1;\n }\n }\n sum = 0;\n for (let i = n - 1; i >= 0; i--) {\n if (i + k < n) {\n totalRight[i] = sum - total[i + k - 1];\n } else {\n totalRight[i] = sum;\n }\n\n if (lamps[i] === \"1\") {\n sum += 1;\n }\n }\n sum = 0;\n for (let i = 0; i < n; i++) {\n totalLeft[i] = sum;\n if (lamps[i] === \"1\") {\n sum += 1;\n }\n }\n }\n}", "function longestSubstringWithKdistinctCharacters(str, k) {\n let maxLength = 0;\n let charFreq = new Map();\n let windowStart = 0;\n let rightChar = '';\n let leftChar = '';\n\n for (let windowEnd = 0; windowEnd <= str.length; windowEnd++) {\n rightChar = str[windowEnd];\n\n if (!charFreq.has(rightChar)) {\n charFreq.set(rightChar, 0);\n }\n charFreq.set(rightChar, charFreq.get(rightChar) + 1);\n\n while(charFreq.size > k) {\n leftChar = str[windowStart];\n charFreq.set(leftChar, charFreq.get(leftChar) - 1);\n\n if (charFreq.get(leftChar) === 0) {\n charFreq.delete(leftChar);\n }\n windowStart += 1;\n }\n\n maxLength = Math.max(maxLength, windowEnd - windowStart + 1);\n }\n\n return maxLength;\n}", "finished() {\n return (this.root.length >= this.totalLength * this.scale);\n }", "function getInitialKPoints(data, k){\n let kPoints = [];\n let kPointIndexes =[];\n \n //Get k number of random indexes to fetch k-points from\n while (kPointIndexes.length < k) {\n //Get random int\n let randInt = getRandomInt(data.length-1)\n //Check that the k-point isn't already in the array of k-points\n if (!kPointIndexes.includes(randInt)) {\n kPointIndexes.push(randInt);\n } \n }\n //Get the k-points from the data\n kPointIndexes.forEach(index => {\n kPoints.push(data[index]);\n });\n return kPoints;\n }", "newPieceCanDown(){\n\n\t\tlet isNoCollision = true;\n\t\tfor (let [index, element] of this.newPiece.entries()) {\n\t\t\n\t\t\tlet x = this.newPiecePosition[0] + index%this.newPieceLen;\n\t\t\tlet y = this.newPiecePosition[1]+1 + Math.trunc(index/this.newPieceLen);\n\n\t\t\tif(element > 0){\n\n\t\t\t\tif(this.board[x + y * this.boardLen] > 0 || y >= this.boardSize/this.boardLen){\n\t\t\t\t\tisNoCollision = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t}\n\t\t\n\t\t}\n\n\t\treturn isNoCollision;\n\n\t}" ]
[ "0.6280222", "0.6198108", "0.5851191", "0.5755905", "0.5754568", "0.5742839", "0.5736298", "0.5722663", "0.57152003", "0.57106644", "0.56659245", "0.56531304", "0.562795", "0.56271684", "0.5596762", "0.55515015", "0.55319893", "0.5477165", "0.54232216", "0.54221916", "0.54202914", "0.541359", "0.5409467", "0.5379728", "0.5377452", "0.53774184", "0.53520936", "0.53453934", "0.5339294", "0.5335034", "0.5332092", "0.53206146", "0.5316467", "0.531189", "0.53071105", "0.5293973", "0.5290509", "0.52895796", "0.5287632", "0.5281228", "0.5275896", "0.5271861", "0.52607083", "0.52588266", "0.52435285", "0.5243197", "0.5216505", "0.52049077", "0.5197607", "0.5191711", "0.51403475", "0.51392496", "0.51306444", "0.51274145", "0.5122482", "0.5119255", "0.51172733", "0.5115744", "0.5102234", "0.5098425", "0.508071", "0.507773", "0.50682026", "0.5066322", "0.5065094", "0.50603783", "0.50406814", "0.5035959", "0.5033377", "0.5025506", "0.5024905", "0.5024022", "0.5020649", "0.50192696", "0.50181586", "0.5013963", "0.5006082", "0.5001928", "0.49885705", "0.49828064", "0.49824098", "0.49797678", "0.4978626", "0.497761", "0.4977571", "0.49733442", "0.49684164", "0.49676612", "0.4961344", "0.4956616", "0.49553102", "0.49492815", "0.49488264", "0.49474785", "0.49423012", "0.49354732", "0.49327594", "0.49319068", "0.49304473", "0.49192518" ]
0.6333416
0
Send a heartbeat to all opened sockets
function sendHeartbeat() { _.forOwn(_this.socks, function (sock) { sock.write('hb'); }); setTimeout(sendHeartbeat, _this.heartbeatFreq); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function heartbeat() {\n io.sockets.emit('heartbeatUsers', users);\n io.sockets.emit('heartbeatMarks', marks);\n}", "function heartbeat() {\n\n board.updateEnemy();\n var data = {\n player_dico: board.player_dic,\n enemy_list: board.enemy,\n waveNum: board.wave_num\n };\n io.sockets.emit('heartbeat', data);\n}", "function heartbeat()\n{\n\tvar fn = function(key, val)\n\t{\n\t\tvar queue = val.queue;\n\t\tvar msg = (typeof queue != \"undefined\" && queue != null && queue.length > 0) ? queue.shift() : getSpam();\n\t\tvar skt = io.sockets.connected[val.id];\n\t\tif (skt)\n\t\t{\n\t\t\tif (msg.event && msg.data)\n\t\t\t\tskt.emit(msg.event, msg.data);\n\t\t}\n\t}\n\n\tkeyTree.inorder(fn, false);\n}", "function sendHeartbeat() {\n send(json_heartbeat_message());\n}", "sendHeartbeat() {\n this.sendPacket({ op: Constants.VoiceOPCodes.HEARTBEAT, d: null }).catch(() => {\n this.emit('warn', 'Tried to send heartbeat, but connection is not open');\n this.clearHeartbeat();\n });\n }", "sendHeartbeats() {\n // Send heartbeats to idle workers if it's time\n if ((new Date()).getTime() >= this.heartbeatAt) {\n this.waiting.forEach((worker) => {\n this.sendToWorker(worker, MDP.W_HEARTBEAT, null, null);\n })\n this.heartbeatAt = (new Date()).getTime() + HEARTBEAT_INTERVAL;\n }\n }", "heartbeat() {\n const now = Date.now();\n if (now - this.lastHeartbeat >= this.heartbeatInterval) {\n util.promisify(fs.writeFile)(this.heartbeatPath, \"\").catch((error) => {\n this.services.get(log_1.ILogService).warn(error.message);\n });\n this.lastHeartbeat = now;\n clearTimeout(this.heartbeatTimer); // We can clear undefined so ! is fine.\n this.heartbeatTimer = setTimeout(() => {\n if (this.onlineConnections.length > 0) {\n this.heartbeat();\n }\n }, this.heartbeatInterval);\n }\n }", "sendHeartbeat() {\n this.lastHeatbeatSend = Date.now();\n this.missedHeartbeats++;\n const nonce = this.lastHeatbeatSend;\n return this.sendPacket({\n op: 3 /* Heartbeat */,\n d: nonce,\n });\n }", "function heartBeat() {\n httpRequest('GET', SERVER_PATH, 'heartbeat', 'gid=' + gid + '&pid=' + pid + \"&count=\" + count);\n}", "schedule_heartbeat() {\n\t\tclearTimeout(this.heartbeat_timer);\n\t\tif (this.heartbeat_period > 0) {\n\t\t\tthis.heartbeat_timer = setTimeout(() => this.ws.ping(), this.heartbeat_period);\n\t\t}\n\t}", "function heartbeat() {\n client.publish('/heartbeat', { id: '1', type: 'emitter' });\n}", "heartbeat() {\n logger.info(`[${P2P_PREFIX}] Start heartbeat`);\n this.intervalHeartbeat = setInterval(() => {\n this.server.clients.forEach(ws => {\n ws.ping();\n });\n }, HEARTBEAT_INTERVAL_MS);\n }", "function sendHeartbeat(hostName) {\n\t\tvar socket \t = connections[hostName];\n\t\tvar heartBeat = {\"messagetype\":\"heartbeat\", \"hostName\": util.address.val, \"port\": util.port};\n\t\tsendSecure(socket, hostName, JSON.stringify(heartBeat));\t\t\n\t}", "function heartbeat () { this.isAlive = true }", "sendHeartbeat() {\n this._clearHeartbeatTimeouts();\n if (!this.heartbeatsEnabled) {\n return;\n }\n\n if (this.socket && !this.canSend('text/x-msrp-heartbeat')) {\n MsrpSdk.Logger.warn(`[Session]: Cannot start heartbeats for session ${this.sid}. Peer does not support 'text/x-msrp-heartbeat' content.`);\n return;\n }\n\n let timedOut = false;\n\n const msgQueued = this.sendMessage('HEARTBEAT', 'text/x-msrp-heartbeat', null, status => {\n if (timedOut) {\n return;\n }\n this._clearHeartbeatTimeouts();\n if (status === MsrpSdk.Status.OK) {\n MsrpSdk.Logger.debug('Successful heartbeat for session', this.sid);\n } else {\n this._raiseHeartbeatFailure(status);\n }\n this.resetHeartbeat();\n });\n\n if (!msgQueued) {\n this._raiseHeartbeatFailure(MsrpSdk.Status.INTERNAL_SERVER_ERROR);\n this.resetHeartbeat();\n return;\n }\n\n this.heartbeatTimeout = setTimeout(() => {\n timedOut = true;\n this.heartbeatTimeout = null;\n this._raiseHeartbeatFailure(MsrpSdk.Status.REQUEST_TIMEOUT);\n this.resetHeartbeat();\n }, MsrpSdk.Config.heartbeatTimeout * 1000);\n }", "onConnect() {\n this.socket && this.socket.write(this.handshake);\n this.healthCheck = setInterval(() => {\n if (new Date() - this.lastRead > 35000) {\n this.close(false);\n }\n }, 5 * 1000);\n }", "queueHeartbeat() {\n\t\t\tif (this.options.ignoreHeartbeat) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!(this.hasHandshook && this.open)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (this.heartbeatTimeout !== undefined) {\n\t\t\t\tclearTimeout(this.heartbeatTimeout);\n\t\t\t}\n\n\t\t\tthis.heartbeatTimeout = setTimeout(\n\t\t\t\t() => {\n\t\t\t\t\tthis.sendMessage([\n\t\t\t\t\t\t___R$project$rome$$internal$events$types_ts$BridgeMessageCodes.HEARTBEAT,\n\t\t\t\t\t]);\n\t\t\t\t},\n\t\t\t\t1_000,\n\t\t\t);\n\t\t}", "function socketAlive() {\n setTimeout(function() {\n socket.emit('socket_alive');\n socketAlive();\n }, 3200);\n }", "heartbeat(message)\n {\n WebsocketClient.LogMsg('heartbeat(' + message.id + ')');\n\n // Clear timeout\n clearTimeout(this.#pingTimeout);\n\n // Ping server\n const msg = WebsocketClient.#instance.#idMsg;\n msg.type = 'heartbeat';\n msg.id = message.id;\n this.#client.send(JSON.stringify(msg));\n\n this.#pingTimeout = setTimeout(() =>\n {\n WebsocketClient.LogMsg('[websocket] pingTimeout() reconnect');\n // WebsocketClient.#instance.#client.close();\n WebsocketClient.#instance.connect();\n }, 8000 + 5000);\n }", "setHeartbeatInterval(ms) {\n if (typeof this.heartbeatInterval !== 'undefined')\n clearInterval(this.heartbeatInterval);\n if (ms > 0) {\n this.heartbeatInterval = setInterval(() => {\n if (this.lastHeatbeatSend !== 0 && this.missedHeartbeats >= 3) {\n // Missed too many heartbeats - disconnect\n this.ws.close();\n this.setHeartbeatInterval(-1);\n }\n this.sendHeartbeat();\n }, ms);\n }\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}", "heartbeat () {\n }", "function startPing()\n{\n var heartbeat = 90;\n heartbeatTimerId = window.setInterval(opPing, heartbeat*1000);\n}", "function pingAllClients()\n{\n // For each client ...\n server.clients.forEach ( function each ( socket )\n {\n console.log ( \"In pingAllClients(), socket id:\", socket.id );\n\n // Is it no longer living?\n if ( false === requireProperty ( socket, \"isAlive\" ) )\n {\n console.log ( \"In pingAllClients(), terminating\" );\n\n // It's not alive so terminate it.\n socket.terminate();\n }\n\n // Otherwise, it is alive.\n else\n {\n console.log ( \"In pingAllClients(), still alive\" );\n\n // This will get reset to true in the \"pong\" handler.\n socket.isAlive = false;\n\n // Ping the client. If everything is connected this will result\n // in the \"pong\" handler being called.\n socket.ping ( doNothing );\n }\n } );\n}", "function checkHeartBeat() {\n for (var username in users) {\n sendHeartBeatToAnUser(username);\n }\n}", "function checkClientsHeartbeat() {\n var now = Date.now();\n _.forOwn(_this.socks, function (sock) {\n if (sock.hb + _this.clientTimeout < now) {\n logout(sock);\n }\n });\n setTimeout(checkClientsHeartbeat, 1000)\n }", "function heartbeat() {\n this.isAlive = true;\n}", "_startHardbeat() {\n var timeout = this.get('heartbeatTimeout');\n this.storage.setItem('singleton:heartbeat', Date.now());\n return setInterval(() => {\n this.storage.setItem('singleton:heartbeat', Date.now());\n }, timeout);\n }", "function updateSockets()\n{\n\tif(runningCrawler)\n\t{\n\t\t// Send the queue size to the clients\n\t\tio.sockets.emit('queueSize', crawler.getQueued().length);\n\t\t// Send the next crawled url to the clients\n\t\t/*\n\t\tcrawler.nextCrawl(function(strUrl)\n\t\t{\n\t\t\tif(strUrl != \"\")\n\t\t\t{\n\t\t\t\tio.sockets.emit('crawl', {url: strUrl});\n\t\t\t} else\n\t\t\t{\n\t\t\t\tsetTimeout(updateSockets, 5);\n\t\t\t}\n\t\t});\n\t\t*/\n\t}\n\t\n\tsetTimeout(updateSockets, 4000);\n}", "ackHeartbeat() {\n this.debug(`Heartbeat acknowledged, latency of ${Date.now() - this.lastPingTimestamp}ms`);\n this.client._pong(this.lastPingTimestamp);\n }", "function sendperiodicdata() {\n mySocket.connect(porttolisten, myHost);\n mySocket.on('connect', senddata);\n}", "function connect() {\n\t\t\tvar ajaxData, heartbeatData;\n\n\t\t\t// If the connection to the server is slower than the interval,\n\t\t\t// heartbeat connects as soon as the previous connection's response is received.\n\t\t\tif ( settings.connecting || settings.suspend ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tsettings.lastTick = time();\n\n\t\t\theartbeatData = $.extend( {}, settings.queue );\n\t\t\t// Clear the data queue, anything added after this point will be send on the next tick\n\t\t\tsettings.queue = {};\n\n\t\t\t$document.trigger( 'heartbeat-send', [ heartbeatData ] );\n\n\t\t\tajaxData = {\n\t\t\t\tdata: heartbeatData,\n\t\t\t\tinterval: settings.tempInterval ? settings.tempInterval / 1000 : settings.mainInterval / 1000,\n\t\t\t\t_nonce: typeof window.heartbeatSettings === 'object' ? window.heartbeatSettings.nonce : '',\n\t\t\t\taction: 'heartbeat',\n\t\t\t\tscreen_id: settings.screenId,\n\t\t\t\thas_focus: settings.hasFocus\n\t\t\t};\n\n\t\t\tif ( 'customize' === settings.screenId ) {\n\t\t\t\tajaxData.wp_customize = 'on';\n\t\t\t}\n\n\t\t\tsettings.connecting = true;\n\t\t\tsettings.xhr = $.ajax({\n\t\t\t\turl: settings.url,\n\t\t\t\ttype: 'post',\n\t\t\t\ttimeout: 30000, // throw an error if not completed after 30 sec.\n\t\t\t\tdata: ajaxData,\n\t\t\t\tdataType: 'json'\n\t\t\t}).always( function() {\n\t\t\t\tsettings.connecting = false;\n\t\t\t\tscheduleNextTick();\n\t\t\t}).done( function( response, textStatus, jqXHR ) {\n\t\t\t\tvar newInterval;\n\n\t\t\t\tif ( ! response ) {\n\t\t\t\t\tsetErrorState( 'empty' );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tclearErrorState();\n\n\t\t\t\tif ( response.nonces_expired ) {\n\t\t\t\t\t$document.trigger( 'heartbeat-nonces-expired' );\n\t\t\t\t}\n\n\t\t\t\t// Change the interval from PHP\n\t\t\t\tif ( response.heartbeat_interval ) {\n\t\t\t\t\tnewInterval = response.heartbeat_interval;\n\t\t\t\t\tdelete response.heartbeat_interval;\n\t\t\t\t}\n\n\t\t\t\t$document.trigger( 'heartbeat-tick', [response, textStatus, jqXHR] );\n\n\t\t\t\t// Do this last, can trigger the next XHR if connection time > 5 sec. and newInterval == 'fast'\n\t\t\t\tif ( newInterval ) {\n\t\t\t\t\tinterval( newInterval );\n\t\t\t\t}\n\t\t\t}).fail( function( jqXHR, textStatus, error ) {\n\t\t\t\tsetErrorState( textStatus || 'unknown', jqXHR.status );\n\t\t\t\t$document.trigger( 'heartbeat-error', [jqXHR, textStatus, error] );\n\t\t\t});\n\t\t}", "async function sendHeartBeatToLeader(numberHigh){\n console.log('Escoger al server mayor')\n for (const server in servers) {\n if(servers[server].id == numberHigh){\n console.log(servers[server].path)\n leaderHost = servers[server].path\n servers[server].isLeader = true;\n console.log('Serverhigh', server)\n //Hacer un post enviandole\n await axios({\n method: 'post',\n url : `${servers[server].path}leader`,\n data: {\n high: server\n }\n }).then(response => {\n console.log('Resultado:', response.data);\n taskheartbeat.start()\n }).catch(err => {\n console.log(\"Error\")\n });\n }\n }\n //Otra vez envia el mensaje a todos con el nuevo lider.\n console.log('Enviando server mayor a todos...')\n sendLeader('new_leader')\n}", "function updateSockets() {\n\t\tfor(var id in context.sockets) {\n\t\t\tupdateSocket(context.sockets[id]);\n\t\t}\n\t}", "function sendMessages() {\n setTimeout(sendMessages,1000);\n for(var i=0; i<socket.sockets.clients().length; i++) {\n var sock = socket.sockets.clients()[i];\n if(sock) {\n var client = clientMap[sock.sessId];\n logger.debug('Client with sessid: ' + sock.sessId + ' with state: ' + client.state);\n switch(client.state) {\n case 'none':\n break;\n case 'progress':\n sock.emit('progress',client.percent);\n break;\n case 'url':\n sock.emit('url',client.url);\n client.state = 'wait-description';\n break;\n case 'wait-description':\n logger.debug('Waiting for description from: ' + sock.sessId);\n break;\n case 'done':\n break;\n case 'error':\n sock.emit('error','An error has ocurred, please try uploading again!');\n client.state = 'done';\n break;\n default:\n logger.error('Unknown state!');\n }\n }\n }\n}", "function doHeartbeat() {\n\t\n\t\t// JSON call to do the heartbeat.\n $.ajax({\n url:'http://' + hostname + ':5000/heartbeat',\n type:\"POST\",\n dataType:\"json\"\n }).done(function(data) {\n wifiSSID = data.SSID;\n wifiQuality = data.Quality;\n wifiSignal = data.Signal;\n });\n }", "function broadcastServerStatus() {\n\tfor(var i = 0; i < wsConnections.length; i++) {\n \t// Could have been set to null if client closed\n \tif (wsConnections[i] !== null) {\n\t \twsConnections[i].send(ServerStatus[currentServerStatus]);\n\t }\n\t}\n}", "function heartbeat(){\n this.isAlive = true;\n}", "sockCloseAll() {\n Object.keys( this._socks ).forEach( id => this.sockClose( id ) );\n }", "function broadcast() {\n wss.clients.forEach((client) => {\n if (client.readyState === client.OPEN)\n client.send(JSON.stringify(gameState));\n });\n}", "sendHeartbeat(localNode) {\n\t\treturn this.publish(new Packet(P.PACKET_HEARTBEAT, null, {\n\t\t\tcpu: localNode.cpu\n\t\t})).catch(err => this.logger.error(\"Unable to send HEARTBEAT packet.\", err));\n\n\t}", "function hangup(){\n socket.emit(\"hangup\");\n}", "function broadcast(data) {\n for (myConnection in connections) { // iterate over the array of connections\n try {\n connections[myConnection].send(data); // send the data to each connection\n }\n catch (err)\n {\n console.log(err);\n }\n }\n}", "_heartbeatIntervalFired() {\n // don't send ping if we've seen a packet since we last checked,\n // *or* if we have already sent a ping and are awaiting a timeout.\n // That shouldn't happen, but it's possible if\n // `this.heartbeatInterval` is smaller than\n // `this.heartbeatTimeout`.\n if (!this._seenPacket && !this._heartbeatTimeoutHandle) {\n this._sendPing(); // Set up timeout, in case a pong doesn't arrive in time.\n\n this._startHeartbeatTimeoutTimer();\n }\n\n this._seenPacket = false;\n }", "refreshAll (socket) {\n\t\t\tif (this.list.length === 0) {\n\t\t\t\tsocket.server.sockets.emit('refreshLobby', []);\n\t\t\t}\n\t\t\tsocket.server.sockets.emit('refreshLobby', this.list);\n\t\t}", "function sendAlive(id) {\n\tresetTimer(id);\n\tsessions[id]++;\n\tsendMessage(ALIVE, id);\n}", "function wrf_heartbeat(req, res) {\n\tconsole.log(\"WRF: heartbeat\");\n\tres.json({success: true, ready: true, status: \"Online\"});\n}", "function broadcast(data) {\n //debugMsgln(\"broadcast - number of clients \" + wss.clients.size);\n try {\n wss.clients.forEach(function each(client) {\n client.send(data);\n });\n //} catch (e) { console.log(e); }\n } catch (e) { console.log(\"WebSocket send requested but not open\"); }\n}", "onKeepAliveInterval() {\n let update_difference = Date.now() - this.keepalive_timestamp_;\n\n // The valid threshold value is 3 to 7 seconds.\n // A value greater than 7 seconds is considered as a previous session\n // or other garbage value.\n if( update_difference > 4000 && update_difference < 7000) {\n logger.error('Sending bye command triggered by KeepAlive timeout : ' + update_difference);\n\n // send bye message to device\n this.websocketClient_.doSendMessage(JSON.stringify({ \n what: \"hangup\"\n }));\n\n // reset the connection state\n this.deactivateSession_();\n }\n }", "function sendPing() {\n let now = new Date().getTime()\n // record new ping\n current = current + 1\n let last_message = [current, now, -1]\n\n // Try to send new ping.\n if (messaging.peerSocket.readyState === messaging.peerSocket.OPEN) {\n // Send the data to peer as a message\n try {\n messaging.peerSocket.send(last_message)\n status = ''\n } catch (error) {\n status = error\n last_message[2] = '-2'\n }\n // Record the event.\n past.push(last_message)\n } else {\n // Peer is not open. Don't sent anything.\n status = ''\n last_message[2] = '-3'\n last_message[1] = 0\n let previous_message = past[past.length - 1]\n if (previous_message && previous_message[2] == '-3') {\n // Last message was also for a closed.\n // Don't add a new event, just update the last one.\n previous_message[0] = current\n previous_message[1] = Math.round((now - state_changed) / 1000)\n } else {\n // Record the new event type.\n past.push(last_message)\n }\n }\n\n // Remove old entries.\n if (past.length > LINES) {\n past = past.slice((past.length - LINES), past.length)\n }\n}", "connected(socket) {\n for (let eventName in events) {\n socket.on(eventName, (function (eventName) {\n return function (userdata) {\n events[eventName](socket, userdata);\n };\n })(eventName));\n }\n }", "function slowloop() {\n // Build the minimap\n logs.minimap.set();\n readmap = getminimap();\n // Build the leaderboard\n readlb = getleaderboard();\n logs.minimap.mark();\n // Check sockets\n let time = util.time();\n clients.forEach(socket => {\n //if (socket.timeout.check(time)) socket.kick('Kicked for inactivity.');\n if (time - socket.statuslastHeartbeat > c.maxHeartbeatInterval) socket.kick('Lost heartbeat.'); \n });\n }", "function traffic(socket) {\n let strikes = 0;\n // This function will be called in the slow loop\n return () => {\n // Kick if it's d/c'd\n if (util.time() - socket.status.lastHeartbeat > c.maxHeartbeatInterval) {\n socket.kick('Heartbeat lost.'); return 0;\n }\n // Add a strike if there's more than 50 requests in a second\n if (socket.status.requests > 50) {\n strikes++;\n } else { \n strikes = 0;\n }\n // Kick if we've had 3 violations in a row\n if (strikes > 3) {\n socket.kick('Socket traffic volume violation!'); return 0; \n }\n // Reset the requests\n socket.status.requests = 0;\n };\n }", "_onHeartbeatTimeout() {\n\t\tDebug( '%s: heartbeat timeout', this.node.id );\n\n\t\tthis.emit( 'heartbeat timeout' );\n\n\t\tthis.node.transition( 'candidate', true );\n\t}", "shutdown () {\r\n for (let ix = 0; ix < this._sockets.length; ix++) {\r\n this.close(this._sockets[ix]);\r\n }\r\n this._sockets.length = 0;\r\n }", "function onSocketServerBusy() {\n this[owner_symbol][kServerBusy]();\n}", "function sendFlush() \r\n{\r\n\tsocketSend('F');\r\n}", "onSocketFullyConnected() {\n this.debugOut('socketFullyConnected()');\n this.last_socket_error = null;\n this.emit('open');\n }", "function broadcast(data) {\n for (myConnection in connections) { // iterate over the array of connections\n connections[myConnection].send(data); // send the data to each connection\n }\n}", "function broadcast(data) {\n for (myConnection in connections) { // iterate over the array of connections\n connections[myConnection].send(data); // send the data to each connection\n }\n}", "function onOpenHandler() {\n socket_ok = true;\n $(\".ws_status\").children().empty();\n $(\".ws_status\").children().first().attr(\"id\", \"ws_online\");\n $(\".ws_status\").children().append(\"ONLINE\");\n \n /* Send the initial request to the server */\n socket.send(update_req);\n \n /* Wait 5 seconds, then request resources updates every 500 msec */\n setTimeout(function() {\n update_timer = setInterval(requestUpdate, 500);\n }, 5000);\n \n}", "function broadcast(data) {\n for (c in connections) { // iterate over the array of connections\n connections[c].send(JSON.stringify(data)); // send the data to each connection\n }\n}", "function timerConnected(client, server) { setInterval(function() { checkLastStanza(client, server); }, 100); }", "function broadcast(data) {\n for (c in connections) {\n // iterate over the array of connections\n connections[c].send(JSON.stringify(data)); // send the data to each connection\n }\n}", "_beat() {\n // We should not be running heartbeat if the idle transaction is finished.\n if (this._finished) {\n return;\n }\n\n const heartbeatString = Object.keys(this.activities).join('');\n\n if (heartbeatString === this._prevHeartbeatString) {\n this._heartbeatCounter += 1;\n } else {\n this._heartbeatCounter = 1;\n }\n\n this._prevHeartbeatString = heartbeatString;\n\n if (this._heartbeatCounter >= 3) {\n (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.log('[Tracing] Transaction finished because of no change for 3 heart beats');\n this.setStatus('deadline_exceeded');\n this.finish();\n } else {\n this._pingHeartbeat();\n }\n }", "sendPing(){\n if(!this.isAlive()){\n this.emit('noPong');\n if(this.state === CONST.STATE.CONNECTED){\n this.state = CONST.STATE.NOT_CONNECTED;\n }\n return;\n }\n this.setHalfDead();\n this.ping();\n }", "clearHeartbeat() {\n if (!this.heartbeatInterval) {\n this.emit('warn', 'Tried to clear a heartbeat interval that does not exist');\n return;\n }\n clearInterval(this.heartbeatInterval);\n this.heartbeatInterval = null;\n }", "_beat() {\n\t // We should not be running heartbeat if the idle transaction is finished.\n\t if (this._finished) {\n\t return;\n\t }\n\n\t const heartbeatString = Object.keys(this.activities).join('');\n\n\t if (heartbeatString === this._prevHeartbeatString) {\n\t this._heartbeatCounter += 1;\n\t } else {\n\t this._heartbeatCounter = 1;\n\t }\n\n\t this._prevHeartbeatString = heartbeatString;\n\n\t if (this._heartbeatCounter >= 3) {\n\t (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log('[Tracing] Transaction finished because of no change for 3 heart beats');\n\t this.setStatus('deadline_exceeded');\n\t this.finish();\n\t } else {\n\t this._pingHeartbeat();\n\t }\n\t }", "function sockets() {\t \n\tio.sockets.on('connection', function(socket) {\n\t socket.send('connected...');\n\t \n\t socket.on('message', function(data) {\n\t\t//~ if (data == 'turn on') {\n\t\t //~ console.log('+');\n\t\t //~ board.digitalWrite(ledPinL, board.HIGH);\n\t\t //~ socket.broadcast.send(\"let there be light!\");\n\t\t//~ }\n\t\t//~ if (data == 'turn off') {\n\t\t //~ console.log('-');\n\t\t //~ board.digitalWrite(ledPinL, board.LOW);\n\t\t //~ socket.broadcast.send(\"who turned out the light?\");\n\t\t//~ }\n\t\t if (data == 'Get moisture') {\n\t\t\tsocket.send(lastMoisture);\n\t\t }\t\t \n\t\treturn;\n\t });\n\t \n\t socket.on('disconnect', function() {\n\t\tsocket.send('disconnected...');\n\t });\n\t});\n}", "_beat() {\n // We should not be running heartbeat if the idle transaction is finished.\n if (this._finished) {\n return;\n }\n\n const heartbeatString = Object.keys(this.activities).join('');\n\n if (heartbeatString === this._prevHeartbeatString) {\n this._heartbeatCounter++;\n } else {\n this._heartbeatCounter = 1;\n }\n\n this._prevHeartbeatString = heartbeatString;\n\n if (this._heartbeatCounter >= 3) {\n (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log('[Tracing] Transaction finished because of no change for 3 heart beats');\n this.setStatus('deadline_exceeded');\n this.finish();\n } else {\n this._pingHeartbeat();\n }\n }", "function broadcast(data) {\n for (myConnection in connections) { // iterate over the array of connections\n connections[myConnection].send(data); // send the data to each connection\n }\n}", "function tick() {\n var now = new Date().toISOString();\n userSockets.notifyAll('clock', {data:now});\n}", "function keepAlive() {\n var timeout = 30000;\n if (gamesock.readyState == gamesock.OPEN) {\n var message = { 'color': \"\", 'from': \"\", 'to': \"\", 'flags': \"keepAlive\", 'piece': \"p\", 'san': \"e4\", 'fen': \"\" }\n gamesock.send(JSON.stringify(message));\n }\n timerId = setTimeout(keepAlive, timeout);\n}", "function sendEventsToAll(newState) {\n const data = `data: ${JSON.stringify(state)}\\n\\n`;\n clients.forEach(c => c.res.write(data));\n}", "refresh (socket) {\n\t\t\tif (this.list.length === 0) {\n\t\t\t\tsocket.emit('refreshLobby', []);\n\t\t\t}\n\t\t\tsocket.emit('refreshLobby', this.list);\n\t\t}", "function broadcast(data) {\n console.log(data);\n for (c in connections) {\n connections[c].send(data);\n }\n}", "sendPing() {\n Object.keys(this.sessionsDict).forEach(key => {\n this.sessionsDict[key].write(\"@ping@\\n\");\n });\n }", "function socketFullyConnected() {\n that.debugOut('Socket fully connected');\n that.reconnect_attempts = 0;\n that.connected = true;\n last_socket_error = null;\n that.emit('socket connected');\n }", "broadcast(sender, message) {\n let aaa = 0;\n for (let c of this.clients) {\n if (c.readyState === 1) {\n aaa++;\n c.send(message)\n //p(`aaa => ${aaa}`)\n //p(`message => ${message}`)\n }\n }\n }", "function broadcast(socket, msg) {\n var i = socket.clients.length;\n while(i--){\n socket.clients[i].send(msg);\n }\n}", "function pingPhone(){\n //console.log(\"pinging\");\n if (peerSocket.readyState === peerSocket.OPEN){\n peerSocket.send({time: Date.now()})\n }\n}", "function refresh() {\n\t\ttry {\n\t\t\tif (!connected) {\n\t\t\t\tdoConnect();\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.log(\"Socket.IO is not loaded properly.\");\n\t\t}\n\t}", "onOpen() {\n debug(\"socket open\");\n this.readyState = \"open\";\n Socket.priorWebsocketSuccess = \"websocket\" === this.transport.name;\n this.emit(\"open\");\n this.flush(); // we check for `readyState` in case an `open`\n // listener already closed the socket\n\n if (\"open\" === this.readyState && this.opts.upgrade && this.transport.pause) {\n debug(\"starting upgrade probes\");\n let i = 0;\n const l = this.upgrades.length;\n\n for (; i < l; i++) {\n this.probe(this.upgrades[i]);\n }\n }\n }", "function wssBroadcast(data) {\n wss.clients.forEach(function each(client) {\n if (client.readyState === WebSocket.OPEN) {\n client.send(data);\n }\n });\n}", "function disconnect() {\n for (var i = 1; i < length.ip; i++){\n websocket[i].close();\n document.getElementById(i).style.backgroundColor = \"black\";\n }\n}", "function onclose () {\n\t onerror('socket closed');\n\t }", "function onclose () {\n\t onerror('socket closed');\n\t }", "function onclose () {\n\t onerror('socket closed');\n\t }", "function onclose () {\n\t onerror('socket closed');\n\t }", "function onclose () {\n\t onerror('socket closed');\n\t }", "start() {\n\t\tthis._stopped = false;\n\t\tthis.heartbeatTimeout.restart();\n\t}", "_constructSocketListeners () {\n /* Handles our open event */\n this._ws.addEventListener('open', evt => {\n setInterval(() => {\n this._sendArray([{ m: '+ls' }])\n }, this._roomScanMS)\n this._isConnected = true\n this._sendArray([{ m: 'hi' }])\n this._heartbeatInterval = setInterval(() => {\n this._sendArray([{ m: 't', e: Date.now() }])\n }, this._heartbeatMS)\n this.emit('connected')\n this.setChannel('lobby')\n this._noteFlushInterval = setInterval(() => {\n if (this._noteBufferTime && this._noteBuffer.length > 0) {\n this._sendArray([{ m: 'n', t: this._noteBufferTime + this._serverTimeOffset, n: this._noteBuffer }])\n this._noteBufferTime = 0\n this._noteBuffer = []\n }\n }, this._noteFlushIntervalMS)\n })\n\n /* Handles our close event */\n this._ws.addEventListener('close', evt => {\n clearInterval(this._heartbeatInterval)\n clearInterval(this._noteFlushInterval)\n if (!this.hasErrored) this.emit('disconnected')\n })\n\n /* Handles our errors */\n this._ws.addEventListener('error', error => {\n if (error.message === 'WebSocket was closed before the connection was established') return\n this.emit('error', new Error(error))\n this._ws.close()\n })\n\n /* Handles generic messages */\n this._ws.addEventListener('message', evt => {\n if (typeof evt.data !== 'string') return\n try {\n const transmission = JSON.parse(evt.data)\n for (var i = 0; i < transmission.length; i++) {\n var msg = transmission[i]\n if (msg.m === 'hi') {\n this._recieveServerTime(msg.t, msg.e || undefined)\n }\n if (msg.m === 't') {\n this._recieveServerTime(msg.t, msg.e || undefined)\n }\n if (msg.m === 'a') {\n this.emit('message', {\n content: msg.a,\n user: {\n id: msg.p.id,\n name: msg.p.name,\n color: msg.p.color\n },\n time: msg.t\n })\n }\n if (msg.m === 'ch') {\n this.room.name = msg.ch._id\n this._channelHasJoined = true\n if (this.room.users.length !== 0) return\n msg.ppl.forEach(person => {\n this.room.users.push({\n id: person.id,\n name: person.name,\n color: person.color\n })\n })\n }\n if (msg.m === 'p') {\n const formattedUser = {\n id: msg.id,\n name: msg.name,\n color: msg.color\n }\n this.emit('userJoined', formattedUser)\n this.room.users.push(formattedUser)\n }\n if (msg.m === 'bye') {\n const user = this.room.users.filter(e => e.id === msg.p)[0]\n this.room.users = this.room.users.filter(e => e.id !== msg.p)\n this.emit('userLeave', user)\n }\n if (msg.m === 'ls') {\n this.rooms = []\n msg.u.forEach(room => {\n this.rooms.push({\n name: room._id,\n count: room.count\n })\n })\n this._sendArray([{ m: '-ls' }])\n }\n if (msg.m === 'n') {\n this.emit('notePress', {\n note: msg.n,\n user: msg.p\n })\n }\n }\n } catch (error) {\n this.emit('error', error)\n }\n })\n }", "function keepAlive()\n{\n\t//debugLog(\"Calling keepalive \" );\n\tvar listIPs = tokenRing.getRing();\n\tcount++;\n\tfor( var i = 0; i < listIPs.length; i++) \n\t{\n\t\tvar post_data = { myIP : i };\n\t\tif (listIPs[i] != tokenRing.getMyIP())\n\t\t{\n\t\t\tgeneralPOST ( listIPs[i], '/do_keepalive', post_data );\n\t\t}\n\t}\n\t\n\tsetTimeout( keepAlive, keepAliveTimeout );\n}", "socketClose() {\n console.log('sock close');\n\n GlobalVars.reset();\n this.reset();\n\n this.reconnect();\n }", "onOpen() {\n debug(\"socket open\");\n this.readyState = \"open\";\n Socket.priorWebsocketSuccess = \"websocket\" === this.transport.name;\n this.emit(\"open\");\n this.flush();\n\n // we check for `readyState` in case an `open`\n // listener already closed the socket\n if (\n \"open\" === this.readyState &&\n this.opts.upgrade &&\n this.transport.pause\n ) {\n debug(\"starting upgrade probes\");\n let i = 0;\n const l = this.upgrades.length;\n for (; i < l; i++) {\n this.probe(this.upgrades[i]);\n }\n }\n }", "onOpen() {\n debug(\"socket open\");\n this.readyState = \"open\";\n Socket.priorWebsocketSuccess = \"websocket\" === this.transport.name;\n this.emit(\"open\");\n this.flush();\n\n // we check for `readyState` in case an `open`\n // listener already closed the socket\n if (\n \"open\" === this.readyState &&\n this.opts.upgrade &&\n this.transport.pause\n ) {\n debug(\"starting upgrade probes\");\n let i = 0;\n const l = this.upgrades.length;\n for (; i < l; i++) {\n this.probe(this.upgrades[i]);\n }\n }\n }", "onOpen() {\n debug(\"socket open\");\n this.readyState = \"open\";\n Socket.priorWebsocketSuccess = \"websocket\" === this.transport.name;\n this.emitReserved(\"open\");\n this.flush();\n // we check for `readyState` in case an `open`\n // listener already closed the socket\n if (\"open\" === this.readyState &&\n this.opts.upgrade &&\n this.transport.pause) {\n debug(\"starting upgrade probes\");\n let i = 0;\n const l = this.upgrades.length;\n for (; i < l; i++) {\n this.probe(this.upgrades[i]);\n }\n }\n }", "_onConnected() {\n this.emit(\"connected\");\n for (let marketSymbol of this._tickerSubs.keys()) {\n this._sendSubTicker(marketSymbol);\n }\n for (let marketSymbol of this._tradeSubs.keys()) {\n this._sendSubTrades(marketSymbol);\n }\n for (let marketSymbol of this._level2SnapshotSubs.keys()) {\n this._sendSubLevel2Snapshots(marketSymbol);\n }\n for (let marketSymbol of this._level2UpdateSubs.keys()) {\n this._sendSubLevel2Updates(marketSymbol);\n }\n for (let marketSymbol of this._level3UpdateSubs.keys()) {\n this._sendSubLevel3Updates(marketSymbol);\n }\n this._watcher.start();\n }" ]
[ "0.7641542", "0.74248743", "0.722528", "0.7070184", "0.7062787", "0.6954447", "0.69473207", "0.678155", "0.67734224", "0.6717606", "0.6688937", "0.667452", "0.6626364", "0.6515311", "0.64502543", "0.6448521", "0.6386508", "0.6329419", "0.63277787", "0.6290269", "0.62535113", "0.62535113", "0.62535113", "0.6230178", "0.6180346", "0.6171713", "0.6142069", "0.60754925", "0.5975084", "0.59519875", "0.5900695", "0.5890304", "0.5889899", "0.58352", "0.58287984", "0.5827156", "0.5802419", "0.5777871", "0.5744899", "0.5735598", "0.57279426", "0.5689714", "0.5677495", "0.56766117", "0.5671184", "0.56658053", "0.5652157", "0.5646939", "0.56456345", "0.5634967", "0.5576365", "0.5574556", "0.55649745", "0.5564392", "0.5552347", "0.55384594", "0.5530242", "0.55276906", "0.55231553", "0.55172676", "0.54964876", "0.54964876", "0.5492129", "0.54917735", "0.5481091", "0.54633373", "0.54622847", "0.5452", "0.54517925", "0.5446529", "0.54393876", "0.5428292", "0.5408469", "0.54023784", "0.53993565", "0.5387965", "0.53831977", "0.5367079", "0.53620654", "0.5345955", "0.5345352", "0.5330099", "0.53271896", "0.53261274", "0.5324645", "0.5313551", "0.53033763", "0.5302572", "0.5302572", "0.5302572", "0.5302572", "0.5302572", "0.5296973", "0.5296239", "0.5294219", "0.52925766", "0.5288057", "0.5288057", "0.5286504", "0.52856624" ]
0.8098782
0
Check that all clients respond to the heartbeat in time
function checkClientsHeartbeat() { var now = Date.now(); _.forOwn(_this.socks, function (sock) { if (sock.hb + _this.clientTimeout < now) { logout(sock); } }); setTimeout(checkClientsHeartbeat, 1000) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkHeartBeat() {\n for (var username in users) {\n sendHeartBeatToAnUser(username);\n }\n}", "function funCheckHB() {\n try {\n for (let i = 0; i < global.aryClients.length; i++) {\n // If current time > (last HB received + timeout e.g. 30 seconds)\n if (Date.now() > global.aryClients[i].lastHB + config.cintHBTimeout) {\n // mRU.funUpdateServerMonitor(\"No HB Disconnect: \" + global.aryClients[i].connectionCode, true);\n // Disconnect That Client\n global.aryClients[i].socket.disconnect();\n }\n }\n } catch (err) {\n // If someone disconnect, there will be an error because aryClients.length changes\n // mRU.funUpdateServerMonitor(\"No HB Disconnect Error: \" + err, true);\n }\n\n // Check Every (Timeout / 3) Milliseconds\n setTimeout(funCheckHB, Math.floor(config.cintHBTimeout / 3));\n}", "sendHeartbeats() {\n // Send heartbeats to idle workers if it's time\n if ((new Date()).getTime() >= this.heartbeatAt) {\n this.waiting.forEach((worker) => {\n this.sendToWorker(worker, MDP.W_HEARTBEAT, null, null);\n })\n this.heartbeatAt = (new Date()).getTime() + HEARTBEAT_INTERVAL;\n }\n }", "function heartbeat() {\n io.sockets.emit('heartbeatUsers', users);\n io.sockets.emit('heartbeatMarks', marks);\n}", "heartbeat() {\n const now = Date.now();\n if (now - this.lastHeartbeat >= this.heartbeatInterval) {\n util.promisify(fs.writeFile)(this.heartbeatPath, \"\").catch((error) => {\n this.services.get(log_1.ILogService).warn(error.message);\n });\n this.lastHeartbeat = now;\n clearTimeout(this.heartbeatTimer); // We can clear undefined so ! is fine.\n this.heartbeatTimer = setTimeout(() => {\n if (this.onlineConnections.length > 0) {\n this.heartbeat();\n }\n }, this.heartbeatInterval);\n }\n }", "function sendHeartbeat() {\n _.forOwn(_this.socks, function (sock) {\n sock.write('hb');\n });\n setTimeout(sendHeartbeat, _this.heartbeatFreq);\n }", "function heartbeat()\n{\n\tvar fn = function(key, val)\n\t{\n\t\tvar queue = val.queue;\n\t\tvar msg = (typeof queue != \"undefined\" && queue != null && queue.length > 0) ? queue.shift() : getSpam();\n\t\tvar skt = io.sockets.connected[val.id];\n\t\tif (skt)\n\t\t{\n\t\t\tif (msg.event && msg.data)\n\t\t\t\tskt.emit(msg.event, msg.data);\n\t\t}\n\t}\n\n\tkeyTree.inorder(fn, false);\n}", "function heartBeat() {\n httpRequest('GET', SERVER_PATH, 'heartbeat', 'gid=' + gid + '&pid=' + pid + \"&count=\" + count);\n}", "ackHeartbeat() {\n this.debug(`Heartbeat acknowledged, latency of ${Date.now() - this.lastPingTimestamp}ms`);\n this.client._pong(this.lastPingTimestamp);\n }", "heartbeat() {\n logger.info(`[${P2P_PREFIX}] Start heartbeat`);\n this.intervalHeartbeat = setInterval(() => {\n this.server.clients.forEach(ws => {\n ws.ping();\n });\n }, HEARTBEAT_INTERVAL_MS);\n }", "function checkPulse(){\n var heartbeat = this.node.heartbeat();\n var stale = Date.now() - this.timeout > heartbeat;\n if (stale) this.emit('change', 'candidate');\n}", "function heartbeat() {\n\n board.updateEnemy();\n var data = {\n player_dico: board.player_dic,\n enemy_list: board.enemy,\n waveNum: board.wave_num\n };\n io.sockets.emit('heartbeat', data);\n}", "function funCheckHB() {\n try {\n\n // Check for auto print\n // if (Date.now() - timLastPrint > intMustPrintOnceTime) {\n // console.log('auto print to keep printer on');\n // funPrint(['自动打印...']);\n // }\n\n // Disconnect client if client has no HB for a long time\n for (let i = 0; i < aryClients.length; i++) {\n if (Date.now() > aryClients[i].lastHB + intHBTimeout) {\n funUpdateServerMonitor(\"No HB Disconnect: \" + aryClients[i].connectionCode, true);\n aryClients[i].socket.disconnect();\n }\n }\n } catch (err) {\n // If someone disconnect, there will be an error because aryClients.length changes\n // funUpdateServerMonitor(\"No HB Disconnect Error: \" + err, true);\n }\n\n // let dtTemp = Date.now();\n setTimeout(funCheckHB, intHBTimeout);\n}", "heartbeat () {\n }", "function sendHeartbeat() {\n send(json_heartbeat_message());\n}", "sendHeartbeat() {\n this.lastHeatbeatSend = Date.now();\n this.missedHeartbeats++;\n const nonce = this.lastHeatbeatSend;\n return this.sendPacket({\n op: 3 /* Heartbeat */,\n d: nonce,\n });\n }", "function timerConnected(client, server) { setInterval(function() { checkLastStanza(client, server); }, 100); }", "queueHeartbeat() {\n\t\t\tif (this.options.ignoreHeartbeat) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!(this.hasHandshook && this.open)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (this.heartbeatTimeout !== undefined) {\n\t\t\t\tclearTimeout(this.heartbeatTimeout);\n\t\t\t}\n\n\t\t\tthis.heartbeatTimeout = setTimeout(\n\t\t\t\t() => {\n\t\t\t\t\tthis.sendMessage([\n\t\t\t\t\t\t___R$project$rome$$internal$events$types_ts$BridgeMessageCodes.HEARTBEAT,\n\t\t\t\t\t]);\n\t\t\t\t},\n\t\t\t\t1_000,\n\t\t\t);\n\t\t}", "function pingAllClients()\n{\n // For each client ...\n server.clients.forEach ( function each ( socket )\n {\n console.log ( \"In pingAllClients(), socket id:\", socket.id );\n\n // Is it no longer living?\n if ( false === requireProperty ( socket, \"isAlive\" ) )\n {\n console.log ( \"In pingAllClients(), terminating\" );\n\n // It's not alive so terminate it.\n socket.terminate();\n }\n\n // Otherwise, it is alive.\n else\n {\n console.log ( \"In pingAllClients(), still alive\" );\n\n // This will get reset to true in the \"pong\" handler.\n socket.isAlive = false;\n\n // Ping the client. If everything is connected this will result\n // in the \"pong\" handler being called.\n socket.ping ( doNothing );\n }\n } );\n}", "sendHeartbeat() {\n this._clearHeartbeatTimeouts();\n if (!this.heartbeatsEnabled) {\n return;\n }\n\n if (this.socket && !this.canSend('text/x-msrp-heartbeat')) {\n MsrpSdk.Logger.warn(`[Session]: Cannot start heartbeats for session ${this.sid}. Peer does not support 'text/x-msrp-heartbeat' content.`);\n return;\n }\n\n let timedOut = false;\n\n const msgQueued = this.sendMessage('HEARTBEAT', 'text/x-msrp-heartbeat', null, status => {\n if (timedOut) {\n return;\n }\n this._clearHeartbeatTimeouts();\n if (status === MsrpSdk.Status.OK) {\n MsrpSdk.Logger.debug('Successful heartbeat for session', this.sid);\n } else {\n this._raiseHeartbeatFailure(status);\n }\n this.resetHeartbeat();\n });\n\n if (!msgQueued) {\n this._raiseHeartbeatFailure(MsrpSdk.Status.INTERNAL_SERVER_ERROR);\n this.resetHeartbeat();\n return;\n }\n\n this.heartbeatTimeout = setTimeout(() => {\n timedOut = true;\n this.heartbeatTimeout = null;\n this._raiseHeartbeatFailure(MsrpSdk.Status.REQUEST_TIMEOUT);\n this.resetHeartbeat();\n }, MsrpSdk.Config.heartbeatTimeout * 1000);\n }", "async triggerHeartbeat() {\r\n const platformLogger = this.container\r\n .getProvider('platform-logger')\r\n .getImmediate();\r\n // This is the \"Firebase user agent\" string from the platform logger\r\n // service, not the browser user agent.\r\n const agent = platformLogger.getPlatformInfoString();\r\n const date = getUTCDateString();\r\n if (this._heartbeatsCache === null) {\r\n this._heartbeatsCache = await this._heartbeatsCachePromise;\r\n }\r\n // Do not store a heartbeat if one is already stored for this day\r\n // or if a header has already been sent today.\r\n if (this._heartbeatsCache.lastSentHeartbeatDate === date ||\r\n this._heartbeatsCache.heartbeats.some(singleDateHeartbeat => singleDateHeartbeat.date === date)) {\r\n return;\r\n }\r\n else {\r\n // There is no entry for this date. Create one.\r\n this._heartbeatsCache.heartbeats.push({ date, agent });\r\n }\r\n // Remove entries older than 30 days.\r\n this._heartbeatsCache.heartbeats = this._heartbeatsCache.heartbeats.filter(singleDateHeartbeat => {\r\n const hbTimestamp = new Date(singleDateHeartbeat.date).valueOf();\r\n const now = Date.now();\r\n return now - hbTimestamp <= STORED_HEARTBEAT_RETENTION_MAX_MILLIS;\r\n });\r\n return this._storage.overwrite(this._heartbeatsCache);\r\n }", "sendHeartbeat() {\n this.sendPacket({ op: Constants.VoiceOPCodes.HEARTBEAT, d: null }).catch(() => {\n this.emit('warn', 'Tried to send heartbeat, but connection is not open');\n this.clearHeartbeat();\n });\n }", "function wrf_heartbeat(req, res) {\n\tconsole.log(\"WRF: heartbeat\");\n\tres.json({success: true, ready: true, status: \"Online\"});\n}", "function checkstatus()\n\t{\n\t\tif(disconnectwarned || !AjaxLife.Network.Connected) return;\n\t\tvar now = new Date();\n\t\tif(!now.getTime() - lastmessage.getTime() > 60000)\n\t\t{\n\t\t\tdisconnectwarned = true;\n\t\t\talert(\"No data has been received for over a minute. You may have been disconnected.\");\n\t\t}\n\t}", "function heartbeat() {\n client.publish('/heartbeat', { id: '1', type: 'emitter' });\n}", "function checkAlive() {\n for(var i = 0; i < pingSet.length; i++) {\n var ip = pingSet[i];\n setTimeout(pingHost(ip), 1000);\n }\n}", "_heartbeatIntervalFired() {\n // don't send ping if we've seen a packet since we last checked,\n // *or* if we have already sent a ping and are awaiting a timeout.\n // That shouldn't happen, but it's possible if\n // `this.heartbeatInterval` is smaller than\n // `this.heartbeatTimeout`.\n if (!this._seenPacket && !this._heartbeatTimeoutHandle) {\n this._sendPing(); // Set up timeout, in case a pong doesn't arrive in time.\n\n this._startHeartbeatTimeoutTimer();\n }\n\n this._seenPacket = false;\n }", "schedule_heartbeat() {\n\t\tclearTimeout(this.heartbeat_timer);\n\t\tif (this.heartbeat_period > 0) {\n\t\t\tthis.heartbeat_timer = setTimeout(() => this.ws.ping(), this.heartbeat_period);\n\t\t}\n\t}", "checkRemoteNodes() {\n\t\tlet now = Date.now();\n\t\tthis.nodes.forEach(node => {\n\t\t\tif (now - (node.lastHeartbeatTime || 0) > this.options.heartbeatTimeout * 1000) {\n\t\t\t\tthis.nodeDisconnected(node.nodeID);\n\t\t\t}\n\t\t});\n\t}", "heartbeat(message)\n {\n WebsocketClient.LogMsg('heartbeat(' + message.id + ')');\n\n // Clear timeout\n clearTimeout(this.#pingTimeout);\n\n // Ping server\n const msg = WebsocketClient.#instance.#idMsg;\n msg.type = 'heartbeat';\n msg.id = message.id;\n this.#client.send(JSON.stringify(msg));\n\n this.#pingTimeout = setTimeout(() =>\n {\n WebsocketClient.LogMsg('[websocket] pingTimeout() reconnect');\n // WebsocketClient.#instance.#client.close();\n WebsocketClient.#instance.connect();\n }, 8000 + 5000);\n }", "_onHeartbeatTimeout() {\n\t\tDebug( '%s: heartbeat timeout', this.node.id );\n\n\t\tthis.emit( 'heartbeat timeout' );\n\n\t\tthis.node.transition( 'candidate', true );\n\t}", "onConnect() {\n this.socket && this.socket.write(this.handshake);\n this.healthCheck = setInterval(() => {\n if (new Date() - this.lastRead > 35000) {\n this.close(false);\n }\n }, 5 * 1000);\n }", "function checks(){\n\t\t// check if all players have voted.\n\n\t\t$.post('./handle/heartbeat.php',{},\n\t\t\tfunction(data){\n\t\t\t\tvar array = JSON.parse(data);\n\t\t\t\t// if the player is inactive, send them back to home screen\n\t\t\t\tif (array['checkPlayer'] == 1){\n\t\t\t\t\twindow.location.href= \"http://\"+location.host+\"/game\";\n\t\t\t\t}\n\t\t\t\telse{}\n\t\t\t\t\n\t\t\t\t// if everybody has voted, set a new black card and refresh the screen\n\t\t\t\tif (array['checkVote'] == 1){\n\t\t\t\t\t$('.player').removeClass('played');\n\t\t\t\t}\n\t\t\t\telse{}\n\t\t});\n\t}", "onKeepAliveInterval() {\n let update_difference = Date.now() - this.keepalive_timestamp_;\n\n // The valid threshold value is 3 to 7 seconds.\n // A value greater than 7 seconds is considered as a previous session\n // or other garbage value.\n if( update_difference > 4000 && update_difference < 7000) {\n logger.error('Sending bye command triggered by KeepAlive timeout : ' + update_difference);\n\n // send bye message to device\n this.websocketClient_.doSendMessage(JSON.stringify({ \n what: \"hangup\"\n }));\n\n // reset the connection state\n this.deactivateSession_();\n }\n }", "function heartbeat () { this.isAlive = true }", "function pingCheck() {\n if (timer) { clearTimeout(timer);}\n var pong = new Date() - start;\n if (typeof callback === \"function\") {\n callback(pong);\n }\n }", "function checkTimer() {\r\n var now = new Date().getTime(),\r\n switched = false;\r\n\r\n for (var i = 0; i < config.groups.length; i++) {\r\n for (var j = 0; j < config.groups[i].items.length; j++) {\r\n var item = config.groups[i].items[j];\r\n\r\n if (typeof(item.timer) != \"undefined\" && item.timer.length > 0) {\r\n for (var k = item.timer.length -1; k >= 0 ; k--){\r\n // check if the time has passed...\r\n if (now > item.timer[k].time) {\r\n var state = parseInt(item.timer[k].type == 2 ? (item.state == 1 ? 0 : 1) : item.timer[k].type);\r\n switchInternal(item, state);\r\n item.timer.splice(k, 1);\r\n switched = true;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (switched) {\r\n updateAllClients();\r\n }\r\n\r\n setTimeout(checkTimer, config['timer-check-interval'] * 1000);\r\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 startPing()\n{\n var heartbeat = 90;\n heartbeatTimerId = window.setInterval(opPing, heartbeat*1000);\n}", "function autoDisconnectCheck(allMyChats) {\r\n // checks all chats and if they are disconnected\r\n if (allMyChats.length !== 0) {\r\n allMyChats.forEach( chat => {\r\n // check if customer still online\r\n const seconds = new Date().getTime() / 1000;\r\n const docRef = db.collection(\"connectionCheck\").doc(chat.chatId);\r\n docRef.get().then((doc) => {\r\n if (doc.exists) {\r\n if (seconds-doc.data().lastCheck > 20) {\r\n chat.borders = 'redBorders';\r\n updateChatsPanel();\r\n } else {\r\n // chat is still online\r\n }\r\n }\r\n });\r\n });\r\n } else {\r\n // no chats\r\n }\r\n}", "function _heartbeat(menusComp)\n {\n //don't send heartbeat if one is pending\n if(menusComp.get(\"beatPending\")) return\n \n menusComp.set(\"beatPending\", true) \n //send ajax request to server\n Ajax.Get(\"SearchHeartbeat\", {clientVersion: menusComp.get(\"version\")}, function(response)\n {\n menusComp.set(\"beatPending\", false)\n //if a response was given, parse it for its value\n if(response)\n response = JSON.parse(response)\n //if the parsed response has content\n if(response)\n {\n menusComp.set(\"Version\", response.Version)\n menusComp.set(\"Venders\", response.VenderData)\n }\n })\n }", "function sch_next_check() {\n\t\tclearTimeout(checkPerodically);\n\t\tcheckPerodically = setTimeout(function () {\n\t\t\ttry {\n\t\t\t\tws_server.check_for_updates(null);\n\t\t\t}\n\t\t\tcatch (e) {\n\t\t\t\tconsole.log('');\n\t\t\t\tlogger.error('Error in sch next check\\n\\n', e);\n\t\t\t\tsch_next_check();\n\t\t\t\tws_server.check_for_updates(null);\n\t\t\t}\n\t\t}, 8000);\t\t\t\t\t\t\t\t\t\t\t\t\t\t//check perodically, should be slighly shorter than the block delay\n\t}", "function sendHeartbeat(hostName) {\n\t\tvar socket \t = connections[hostName];\n\t\tvar heartBeat = {\"messagetype\":\"heartbeat\", \"hostName\": util.address.val, \"port\": util.port};\n\t\tsendSecure(socket, hostName, JSON.stringify(heartBeat));\t\t\n\t}", "_beat() {\n\t // We should not be running heartbeat if the idle transaction is finished.\n\t if (this._finished) {\n\t return;\n\t }\n\n\t const heartbeatString = Object.keys(this.activities).join('');\n\n\t if (heartbeatString === this._prevHeartbeatString) {\n\t this._heartbeatCounter += 1;\n\t } else {\n\t this._heartbeatCounter = 1;\n\t }\n\n\t this._prevHeartbeatString = heartbeatString;\n\n\t if (this._heartbeatCounter >= 3) {\n\t (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log('[Tracing] Transaction finished because of no change for 3 heart beats');\n\t this.setStatus('deadline_exceeded');\n\t this.finish();\n\t } else {\n\t this._pingHeartbeat();\n\t }\n\t }", "function isReady (messagesFromAll) {\n\tconst { leaderHeartbeat, followerHeartbeat, newStateLeader } = messagesFromAll\n\n\tconst recentLeaderHb = getRecentHeartbeats(leaderHeartbeat)\n\tconst recentFollowerHb = getRecentHeartbeats(followerHeartbeat)\n\n\treturn recentLeaderHb.length > 0 && recentFollowerHb.length > 0 && newStateLeader.length === 0\n}", "verificarConexion() {\n if (espinoClients.length != 0) {\n espinoClients.forEach((host) => {\n ping.sys.probe(host, (isAlive) => {\n if (!isAlive) { //Si algun cliente espino esta desconectado, se manda notificacion\n var i;\n for (i = 0; i < hostAvisados.length; i++) {\n if (hostAvisados[i] === host) {\n return;\n }\n }\n alert = 'host ' + host + ' no esta conectado';\n console.log(alert);\n serverClient.publish('web/messages', alert);\n serverClient.publish('bot/messages', alert);\n email.sendMail(alert);\n hostAvisados.push(host);\n } else {\n var i;\n for (i = 0; i < hostAvisados.length; i++) {\n if (hostAvisados[i] === host) {\n hostAvisados[i] = '';\n }\n }\n }\n });\n });\n }\n }", "_beat() {\n // We should not be running heartbeat if the idle transaction is finished.\n if (this._finished) {\n return;\n }\n\n const heartbeatString = Object.keys(this.activities).join('');\n\n if (heartbeatString === this._prevHeartbeatString) {\n this._heartbeatCounter += 1;\n } else {\n this._heartbeatCounter = 1;\n }\n\n this._prevHeartbeatString = heartbeatString;\n\n if (this._heartbeatCounter >= 3) {\n (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.log('[Tracing] Transaction finished because of no change for 3 heart beats');\n this.setStatus('deadline_exceeded');\n this.finish();\n } else {\n this._pingHeartbeat();\n }\n }", "_heartbeatTimeoutFired() {\n this._heartbeatTimeoutHandle = null;\n\n this._onTimeout();\n }", "function checkMessage(client){\n\t\t\tclient.on('message', function(msg){\n\t\t\t\t// the message stored should be equal to the message received\n\t\t\t\tmessage.should.equal(msg)\n\t\t\t\tclient.disconnect()\n\t\t\t\tmessageCounter++\n\t\t\t\t// Only if the 3 clients receive the message we asume the test has been correct.\n\t\t\t\tif(messageCounter === 3)\n\t\t\t\t\tdone()\n\t\t\t})\n\t\t}", "function doHeartbeat() {\n\t\n\t\t// JSON call to do the heartbeat.\n $.ajax({\n url:'http://' + hostname + ':5000/heartbeat',\n type:\"POST\",\n dataType:\"json\"\n }).done(function(data) {\n wifiSSID = data.SSID;\n wifiQuality = data.Quality;\n wifiSignal = data.Signal;\n });\n }", "verificarEstado() {\n espinoClients.forEach((host) => {\n ping.sys.probe(host, (isAlive) => {\n msg = isAlive ? 'host ' + host + ' esta conectado' : 'host ' + host + ' no esta conectado';\n console.log(msg);\n serverClient.publish('web/messages', msg);\n serverClient.publish('bot/messages', msg);\n serverClient.publish('Espino/' + host, 'C1');\n });\n });\n }", "_beat() {\n // We should not be running heartbeat if the idle transaction is finished.\n if (this._finished) {\n return;\n }\n\n const heartbeatString = Object.keys(this.activities).join('');\n\n if (heartbeatString === this._prevHeartbeatString) {\n this._heartbeatCounter++;\n } else {\n this._heartbeatCounter = 1;\n }\n\n this._prevHeartbeatString = heartbeatString;\n\n if (this._heartbeatCounter >= 3) {\n (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log('[Tracing] Transaction finished because of no change for 3 heart beats');\n this.setStatus('deadline_exceeded');\n this.finish();\n } else {\n this._pingHeartbeat();\n }\n }", "_startHardbeat() {\n var timeout = this.get('heartbeatTimeout');\n this.storage.setItem('singleton:heartbeat', Date.now());\n return setInterval(() => {\n this.storage.setItem('singleton:heartbeat', Date.now());\n }, timeout);\n }", "function pingClients() {\n\tvar length = players.length;\n\tfor(var i = 0; i < length; i++) {\n\t\tif (players[i].id) {\n\t\t\tpings[players[i].id] = { time: Date.now(), ping: 0 };\n\t\t\t//console.log('Ping? '+ players[i].id); //log filler\n\t\t\tgame.sockets[players[i].id].emit('ping');\n\t\t}\n\t}\n}", "async function healthCheckDurationHeartbeat () {\n const randomBytes = promisify(crypto.randomBytes)\n try {\n parseEnvVarsAndArgs()\n } catch (e) {\n console.error(`\\nIncorrect usage: ${e.message}`)\n return\n }\n\n try {\n // Generate signature using local key\n const randomBytesToSign = (await randomBytes(18)).toString()\n const signedLocalData = generateTimestampAndSignature({ randomBytesToSign }, PRIVATE_KEY)\n // Add randomBytes to outgoing request parameters\n const reqParam = signedLocalData\n reqParam.randomBytes = randomBytesToSign\n let requestConfig = {\n url: `${CREATOR_NODE_ENDPOINT}/health_check/duration/heartbeat`,\n method: 'get',\n params: reqParam,\n responseType: 'json'\n }\n let resp = await axios(requestConfig)\n assert.deepStrictEqual(resp.status, 200)\n console.log('✓ Heartbeat duration health check passed')\n } catch (e) {\n console.error(e)\n }\n}", "setHeartbeatInterval(ms) {\n if (typeof this.heartbeatInterval !== 'undefined')\n clearInterval(this.heartbeatInterval);\n if (ms > 0) {\n this.heartbeatInterval = setInterval(() => {\n if (this.lastHeatbeatSend !== 0 && this.missedHeartbeats >= 3) {\n // Missed too many heartbeats - disconnect\n this.ws.close();\n this.setHeartbeatInterval(-1);\n }\n this.sendHeartbeat();\n }, ms);\n }\n }", "isAvailable () {\n const lessThanOneHourAgo = (date) => {\n const HOUR = 1000 * 60 * 60;\n const anHourAgo = Date.now() - HOUR;\n\n return date > anHourAgo;\n }\n\n return this.socket !== null || (this.lastSeen !== null && lessThanOneHourAgo(this.lastSeen))\n }", "function socketAlive() {\n setTimeout(function() {\n socket.emit('socket_alive');\n socketAlive();\n }, 3200);\n }", "async function sendHeartBeatToLeader(numberHigh){\n console.log('Escoger al server mayor')\n for (const server in servers) {\n if(servers[server].id == numberHigh){\n console.log(servers[server].path)\n leaderHost = servers[server].path\n servers[server].isLeader = true;\n console.log('Serverhigh', server)\n //Hacer un post enviandole\n await axios({\n method: 'post',\n url : `${servers[server].path}leader`,\n data: {\n high: server\n }\n }).then(response => {\n console.log('Resultado:', response.data);\n taskheartbeat.start()\n }).catch(err => {\n console.log(\"Error\")\n });\n }\n }\n //Otra vez envia el mensaje a todos con el nuevo lider.\n console.log('Enviando server mayor a todos...')\n sendLeader('new_leader')\n}", "function checkEveryoneIsReady(players) {\n return (countReadyPlayers(players) > 5) ? true : false\n}", "function updateClients(elapsedTime) {\n for (let clientId in activeClients) {\n let client = activeClients[clientId];\n let update = {\n type: 'update-self',\n clientId: clientId,\n lastMessageId: client.lastMessageId,\n momentum: client.player.momentum,\n direction: client.player.direction,\n position: client.player.position,\n username: client.player.username,\n score: client.player.score,\n hyperspaceJump: client.player.reportHyperspaceJump,\n crashed: client.player.crashed,\n updateWindow: elapsedTime,\n };\n if (client.player.reportUpdate) {\n client.socket.emit('message', update);\n\n update.type = 'update-other';\n\n //\n // Notify all other connected clients about every\n // other connected client status...but only if they are updated.\n for (let otherId in activeClients) {\n if (otherId !== clientId) {\n activeClients[otherId].socket.emit('message', update);\n }\n }\n }\n if (client.player.crashed){ client.player.crashed = false; } //reset crashed after it was sent\n }\n\n for (let clientId in activeClients) {\n activeClients[clientId].player.reportUpdate = false;\n activeClients[clientId].player.reportHyperspaceJump = false;\n }\n lastUpdateTime = present();\n}", "function heartbeat() {\n this.isAlive = true;\n}", "poll(req, res, next) {\n res\n .status(200)\n .send({ alive: 'okay' })\n }", "function checkConnection(){\n viewModel.notOnline(!navigator.onLine);\n // requests next check in 500 ms\n setTimeout(checkConnection, 500);\n}", "async function checkConnection() {\n let isConnected = false;\n while (!isConnected) {\n console.log(\"Connecting to ES\");\n try {\n const health = await client.cluster.health({});\n // console.log(health.body);\n // only log the body part :)\n isConnected = true;\n return health;\n } catch (err) {\n console.log(\"Connection Failed, Retrying...\", err);\n }\n }\n}", "function callAtInterval() {\n apiSrvc.getData($rootScope.apiUrl + '/Default.aspx?remotemethodaddon=heartbeat').then(function (response) {\n });\n }", "function _checkHealth() {\n \n var checkItems = _.map(_checkers, function(item, key) {\n return _.extend({ id: key }, item);\n }),\n serverAvailable = true;\n \n function checkItem(checker, itemCallback) {\n var timer = 0;\n \n if (checker.check) {\n timer = setTimeout(function() {\n log.debug('health check for system \"' + checker.id + '\" timed out');\n itemCallback();\n }, config.monitor.checkTimeout * 1000);\n \n try {\n log.debug('checking system \"' + checker.id + '\" availability');\n checker.check(function(results) {\n var available = true;\n\n // iterate through the results\n (Array.isArray(results) ? results : [results]).forEach(function(checkData) {\n if (typeof checkData == 'object') {\n // add the id to the check data\n checkData.id = checker.id;\n\n // determine the overall system availability\n available = available && (checkData.available || checkData.warning);\n \n // update the system status\n _systemStatus.systems[checker.id] = checkData;\n }\n else {\n log.warn('invalid check result returned from checker: ' + checker.id);\n }\n \n });\n \n log.debug('system \"' + checker.id + '\" available: ' + available);\n clearTimeout(timer);\n \n // update the overall system availability\n // true if the system is available or the warning flag is set\n serverAvailable = serverAvailable && available;\n \n // report the status\n itemCallback();\n });\n }\n catch (e) {\n clearTimeout(timer);\n log.error('Error running health check for system: ' + checker.id, e);\n \n itemCallback();\n }\n }\n };\n \n async.forEach(checkItems, checkItem, function(err) {\n // update the overall system status\n _systemStatus.available = serverAvailable;\n \n // schedule the health check again\n _healthCheckTimer = setTimeout(_checkHealth, config.monitor.checkInterval * 1000);\n });\n} // _checkHealth", "onMessage(message) {\n if (message.type === 'PING_SERVER') {\n const { id, playerID } = message.data;\n const handler = this.pingChecks[id];\n if (handler) {\n const { resolve, start } = handler;\n const end = Date.now();\n const time = end - start;\n resolve(time);\n delete this.pingChecks[id];\n }\n } else {\n GM.emitEvent(message);\n }\n }", "function keepAlive()\n{\n //if (debug) debugLog(\"Calling keepalive \" );\n var listIPs = tokenRing;\n for( var i = 0; i < listIPs.length; i++) \n {\n var post_data = { myIP : i, role: node_functionality };\n if (listIPs[i] != getMyIP())\n {\n generalPOST ( listIPs[i], '/do_keepalive', post_data, tokeRingPort );\n }\n }\n \n setTimeout( keepAlive, keepAliveTimeout );\n}", "function slowloop() {\n // Build the minimap\n logs.minimap.set();\n readmap = getminimap();\n // Build the leaderboard\n readlb = getleaderboard();\n logs.minimap.mark();\n // Check sockets\n let time = util.time();\n clients.forEach(socket => {\n //if (socket.timeout.check(time)) socket.kick('Kicked for inactivity.');\n if (time - socket.statuslastHeartbeat > c.maxHeartbeatInterval) socket.kick('Lost heartbeat.'); \n });\n }", "anyOneAlive (excludeNode, aliveTime) {\n const nowTime = new Date().getTime();\n for (const [key, value] of this.metrics.entries()) {\n if (key !== excludeNode) {\n const lastSeenAgo = nowTime - value.timestamp;\n if (lastSeenAgo < aliveTime) {\n debug('metrics', `${key} is alive.`);\n return true;\n }\n }\n }\n return false;\n }", "function checkServerTime () {\n $q.all([getEndBackendTime(),getServerTime()])\n .then(function (){\n var duration = self.endBackendTime - self.currentBackendTime;\n if ( duration <= 0 ){\n finishTest();\n }\n });\n }", "function keepAlive()\n{\n\t//debugLog(\"Calling keepalive \" );\n\tvar listIPs = tokenRing.getRing();\n\tcount++;\n\tfor( var i = 0; i < listIPs.length; i++) \n\t{\n\t\tvar post_data = { myIP : i };\n\t\tif (listIPs[i] != tokenRing.getMyIP())\n\t\t{\n\t\t\tgeneralPOST ( listIPs[i], '/do_keepalive', post_data );\n\t\t}\n\t}\n\t\n\tsetTimeout( keepAlive, keepAliveTimeout );\n}", "function intervalHeartbeat() {\n if (document.webkitHidden || document.hidden) {\n clearTimers();\n document.location = \"http://bestpint.net\";\n }\n }", "function checkIfNormalClientDisconnect()\n {\n \tvar is_server_up = checkIfServerIsUp(preferred_ip_address);\n \tconsole.log(\"Normal client disconnect : \" + is_server_up);\n \tif(is_server_up == true) {\n \t\treturn true;\n \t}\n \t\n \treturn false;\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 }", "function sch_next_check() {\n\t\tclearTimeout(checkPeriodically);\n\t\tcheckPeriodically = setTimeout(function () {\n\t\t\ttry {\n\t\t\t\tws_server.check_for_updates(null);\n\t\t\t}\n\t\t\tcatch (e) {\n\t\t\t\tconsole.log('');\n\t\t\t\tlogger.error('Error in sch next check\\n\\n', e);\n\t\t\t\tsch_next_check();\n\t\t\t\tws_server.check_for_updates(null);\n\t\t\t}\n\t\t}, cp_general.blockDelay + 2000);\n\t}", "function check() {\n const url = \"ws://\"+broker.value\n // test connection\n var client = mqtt.connect(url, {keepalive:0, reconnectPeriod:0 });\n\n client.on('connect', function () {\n connectstatus.className=\"connected\";\n connectstatus.textContent=\"connected\";\n })\n \n client.on('error', function () {\n connectstatus.className=\"notconnected\";\n connectstatus.textContent=\"not connected\";\n })\n}", "function checkAttend(client) {\n if (client.mesa) return true\n return false\n }", "function getHeartBeats(onSuccess) {\n console.log(\"sending: GET to /heartbeat\");\n // $('#loading-animation').fadeIn();\n $.ajax({\n url: 'heartbeat',\n type: 'GET',\n success: function(res) {\n console.log(res)\n onSuccess(res);\n },\n error: function (e) {\n console.log(e);\n change_status(4, e.responseJSON.error, e.responseJSON.message);\n }\n });\n}", "ejabberdTimeout() {\r\n let val = true;\r\n // Check for disconnected state from the process connection method.\r\n if (Strophe_Interface_1.connStatus.DISCONNECTED) {\r\n while (val) {\r\n this.sleep(13000);\r\n if (Strophe_Interface_1.connStatus.CONNECTED) {\r\n val = false;\r\n }\r\n else {\r\n val = true;\r\n }\r\n }\r\n }\r\n }", "function intervalCallback() {\n var delta = (new Date().getTime() - time_last_peer) / 1000;\n winston.debug(util.format(\"delta is %s\", delta));\n if (delta > argv.timeoutNoPeers) {\n\n if (ip_hashmap.keys().length > 0) {\n winston.info(\"Got no new peers in time. Terminating\");\n if (!terminating) { //this should prevent timeoutCallback from being called in parallel. Not sure if it works though...\n timeoutCallback();\n }\n } else {\n winston.info(\"Didn't terminate yet because no peers at all have been found\");\n }\n }\n time_last_peer = new Date().getTime();\n }", "function checkTimers(){\n createTimerCallback(amatriadata.sleepTimes)\n console.log( Date(Date.now()) + 'Checking Timers')\n}", "healthCheck() {\n\t\tlet now = new Date();\n\n\t\t// Iterate over sensors\n\t\tthis.Sensors.forEach((sensor, key) => {\n\t\t\t// Only remove if there is no Homey device associated\n\t\t\tif (sensor.display !== undefined && sensor.raw !== undefined) {\n\t\t\t\tif (!sensor.display.paired && (now - sensor.raw.lastupdate > this.inactiveTime)) {\n\t\t\t\t\tthis.driver.log('Removing', key, 'from display list');\n\t\t\t\t\tthis.Sensors.delete(key);\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t\t// Iterate over devices\n\t\tthis.Devices.forEach((device, key) => {\n\t\t\t// Check if the device needs to be set unavailable\n\t\t\tlet last = device.getSetting('update');\n\t\t\tlet lastUTC = device.getStoreValue('update');\n\t\t\t// Due to a Homey bug that converts the Date type to String in the store, we have to parse the value\n\t\t\tif (device.getAvailable() && now - Date.parse(lastUTC) > this.inactiveTime) {\n\t\t\t\tthis.driver.log('Marking', key, 'as inactive');\n\t\t\t\tdevice.setUnavailable(this.driver.homey.__('error.no_data', { since: last }))\n\t\t\t\t\t.catch(err => this.driver.error('Cannot mark device as unavailable', err.message))\n\t\t\t\tif (this.activityNotifications & INACTIVE) {\n\t\t\t\t\tthis.driver.homey.notifications.createNotification({\n\t\t\t\t\t\texcerpt: this.driver.homey.__('notification.inactive', { name: device.getName() })\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}", "function checkEnsures() {\n var now = Date.now();\n for(var id in this.registry) {\n if(now > this.registry[id].timeout) {\n this.registry[id].error_callback.apply(this, this.registry[id].args);\n this.emit('timeout', this.registry[id]);\n delete this.registry[id];\n }\n }\n if(this.run) {\n setTimeout(function() { this.checkEnsures() }.bind(this), this.freq * 1000);\n }\n}", "async function check() {\n if (isCanceled) {\n return;\n }\n\n const state = await getDbConnectionState(dbServerUrl, userName, fetch);\n onCheckResult(state);\n\n setTimeout(check, HEARTBEAT_INTERVAL);\n }", "function heartbeat(){\n this.isAlive = true;\n}", "function sch_next_check() {\n\t\tclearTimeout(checkPeriodically);\n\t\tcheckPeriodically = setTimeout(function () {\n\t\t\ttry {\n\t\t\t\tws_server.check_for_updates(null);\n\t\t\t}\n\t\t\tcatch (e) {\n\t\t\t\tlogger.error('Error in sch next check\\n\\n', e);\n\t\t\t\tsch_next_check();\n\t\t\t\tws_server.check_for_updates(null);\n\t\t\t}\n\t\t}, cp.getBlockDelay() + 2000);\n\t}", "polling() {\n const hourInSec = PASConfig.pollingTimeDevelop || 3200; // Use develop value if available for this RI\n const hourInMS = hourInSec * 1000;\n const fiveMin = hourInMS / 12;\n\n // Poll every 5 minutes in the first half hour\n let numPolls = 1;\n let context = this;\n let polling = setInterval(function () {\n context.getLatestResponse();\n if (numPolls >= 6 || context.getClaimResponse().outcome != \"queued\") {\n clearInterval(polling);\n numPolls += 1;\n }\n }, fiveMin);\n\n // Poll every hour until claim comes back\n polling = setInterval(function () {\n context.getLatestResponse();\n if (context.getClaimResponse().outcome != \"queued\")\n clearInterval(polling);\n }, hourInMS);\n }", "function pii_check_if_stats_server_up() {\n var stats_server_url = \"http://woodland.gtnoise.net:5005/\"\n\ttry {\n\t var wr = {};\n\t wr.guid = (sign_in_status == 'signed-in') ? pii_vault.guid : '';\n\t wr.version = pii_vault.config.current_version;\n\t wr.deviceid = (sign_in_status == 'signed-in') ? pii_vault.config.deviceid : 'Not-reported';\n\n\t var r = request({\n\t\t url: stats_server_url,\n\t\t content: JSON.stringify(wr),\n\t\t onComplete: function(response) {\n\t\t\tif (response.status == 200) {\n\t\t\t var data = response.text;\n\t\t\t var is_up = false;\n\t\t\t var stats_message = /Hey ((?:[0-9]{1,3}\\.){3}[0-9]{1,3}), Appu Stats Server is UP!/;\n\t\t\t is_up = (stats_message.exec(data) != null);\n\t\t\t my_log(\"Appu stats server, is_up? : \"+ is_up, new Error);\n\t\t\t}\n\t\t\telse {\n\t\t\t //This means that HTTP response is other than 200 or OK\n\t\t\t my_log(\"Appu: Could not check if server is up: \" + stats_server_url\n\t\t\t\t\t+ \", status: \" + response.status.toString(), new Error);\n\t\t\t print_appu_error(\"Appu Error: Seems like server was down. \" +\n\t\t\t\t\t \"Status: \" + response.status.toString() + \" \"\n\t\t\t\t\t + (new Date()));\n\t\t\t}\n\t\t }\n\t\t});\n\n\t r.post();\n\t}\n\tcatch (e) {\n\t my_log(\"Error while checking if stats server is up\", new Error);\n\t}\n last_server_contact = new Date();\n}", "_keepAlive() {\n Utils_1.logWithLevelInternal(Utils_1.LogLevel.DEBUG, () => `[CLIENT] _keepAlive() ${this._state}/${this._currentConnectionStartTime}`);\n if (this._state === exports.ClientState.ACTIVE && this._currentConnectionStartTime) {\n const now = Date.now();\n const lastPacketDuration = now - (this._lastPacketTime || this._currentConnectionStartTime);\n const lastStatePacketDuration = now - (this._lastStatePacketTime || this._currentConnectionStartTime);\n if (lastPacketDuration > this._options.silenceTimeout\n || (this._choseToLogIn && lastStatePacketDuration > this._options.stateSilenceTimeout)) {\n if (this._client !== undefined) {\n Utils_1.logWithLevelInternal(Utils_1.LogLevel.DEBUG, () => `[CLIENT] _keepAlive silence tripped, lastPacket: ${lastPacketDuration}, lastStatePacket: ${lastStatePacketDuration}`);\n const msg = `Server has not responded for too long, forcing disconnect`;\n Utils_1.logWithLevelInternal(Utils_1.LogLevel.INFO, msg);\n this._disconnected(msg);\n }\n }\n else {\n this.TxCmd(constants.FCTYPE.NULL, 0, 0, 0);\n }\n }\n }", "function isConnected(cb) {\n client.ping({\n requestTimeout: 30000,\n }, function(error) {\n cb(error);\n })\n}", "heartbeat() {\n if (this.trackPageViewCalled) {\n error(\n `heartbeat() was called after a pageViewed() call, which is not supported by Snowplow.\n Remove the pageViewed() call.`\n )\n }\n\n // The arguments to enableActivityTracking are secsBeforeFirstHeartbeat and secsBetweenHeartbeats;\n // we have no need to have these as different values though.\n this.tracker('enableActivityTracking', secsBetweenHeartbeats, secsBetweenHeartbeats)\n this.viewed()\n }", "function botIsAlone() {\r\n let currentChannel = backend.getCurrentChannel();\r\n let clients = currentChannel ? currentChannel.getClientCount() : 0;\r\n return (clients <= 1) \r\n }", "function funShowClients() {\n for (let i = 0; i < aryClients.length; i++) {\n try {\n funUpdateServerMonitor(\"Connection Code: \" + aryClients[i].connectionCode + \"&nbsp;&nbsp;&nbsp;User ID: \" + aryClients[i].userId, true);\n } catch (err) {\n //\n }\n }\n // let dtTemp = Date.now();\n setTimeout(funShowClients, 10000);\n}", "clearHeartbeat() {\n if (!this.heartbeatInterval) {\n this.emit('warn', 'Tried to clear a heartbeat interval that does not exist');\n return;\n }\n clearInterval(this.heartbeatInterval);\n this.heartbeatInterval = null;\n }", "function checkTimesAndReport(bot) {\n getStandupTimes(function(err, standupTimes) { \n if (!standupTimes) {\n return;\n }\n var currentHoursAndMinutes = getCurrentHoursAndMinutes();\n for (var channelId in standupTimes) {\n var standupTime = standupTimes[channelId];\n if (compareHoursAndMinutes(currentHoursAndMinutes, standupTime)) {\n getStandupData(channelId, function(err, standupReports) {\n bot.say({\n channel: channelId,\n text: getReportDisplay(standupReports),\n mrkdwn: true\n });\n clearStandupData(channelId);\n });\n }\n }\n });\n}", "function connect() {\n\t\t\tvar ajaxData, heartbeatData;\n\n\t\t\t// If the connection to the server is slower than the interval,\n\t\t\t// heartbeat connects as soon as the previous connection's response is received.\n\t\t\tif ( settings.connecting || settings.suspend ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tsettings.lastTick = time();\n\n\t\t\theartbeatData = $.extend( {}, settings.queue );\n\t\t\t// Clear the data queue, anything added after this point will be send on the next tick\n\t\t\tsettings.queue = {};\n\n\t\t\t$document.trigger( 'heartbeat-send', [ heartbeatData ] );\n\n\t\t\tajaxData = {\n\t\t\t\tdata: heartbeatData,\n\t\t\t\tinterval: settings.tempInterval ? settings.tempInterval / 1000 : settings.mainInterval / 1000,\n\t\t\t\t_nonce: typeof window.heartbeatSettings === 'object' ? window.heartbeatSettings.nonce : '',\n\t\t\t\taction: 'heartbeat',\n\t\t\t\tscreen_id: settings.screenId,\n\t\t\t\thas_focus: settings.hasFocus\n\t\t\t};\n\n\t\t\tif ( 'customize' === settings.screenId ) {\n\t\t\t\tajaxData.wp_customize = 'on';\n\t\t\t}\n\n\t\t\tsettings.connecting = true;\n\t\t\tsettings.xhr = $.ajax({\n\t\t\t\turl: settings.url,\n\t\t\t\ttype: 'post',\n\t\t\t\ttimeout: 30000, // throw an error if not completed after 30 sec.\n\t\t\t\tdata: ajaxData,\n\t\t\t\tdataType: 'json'\n\t\t\t}).always( function() {\n\t\t\t\tsettings.connecting = false;\n\t\t\t\tscheduleNextTick();\n\t\t\t}).done( function( response, textStatus, jqXHR ) {\n\t\t\t\tvar newInterval;\n\n\t\t\t\tif ( ! response ) {\n\t\t\t\t\tsetErrorState( 'empty' );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tclearErrorState();\n\n\t\t\t\tif ( response.nonces_expired ) {\n\t\t\t\t\t$document.trigger( 'heartbeat-nonces-expired' );\n\t\t\t\t}\n\n\t\t\t\t// Change the interval from PHP\n\t\t\t\tif ( response.heartbeat_interval ) {\n\t\t\t\t\tnewInterval = response.heartbeat_interval;\n\t\t\t\t\tdelete response.heartbeat_interval;\n\t\t\t\t}\n\n\t\t\t\t$document.trigger( 'heartbeat-tick', [response, textStatus, jqXHR] );\n\n\t\t\t\t// Do this last, can trigger the next XHR if connection time > 5 sec. and newInterval == 'fast'\n\t\t\t\tif ( newInterval ) {\n\t\t\t\t\tinterval( newInterval );\n\t\t\t\t}\n\t\t\t}).fail( function( jqXHR, textStatus, error ) {\n\t\t\t\tsetErrorState( textStatus || 'unknown', jqXHR.status );\n\t\t\t\t$document.trigger( 'heartbeat-error', [jqXHR, textStatus, error] );\n\t\t\t});\n\t\t}" ]
[ "0.7300449", "0.70118845", "0.6828728", "0.6795977", "0.67125016", "0.668401", "0.6624302", "0.66224736", "0.65680563", "0.6559366", "0.6551395", "0.6535189", "0.6523065", "0.6519578", "0.6452377", "0.6451966", "0.6442796", "0.6367847", "0.6357087", "0.63551205", "0.63424665", "0.63237846", "0.63019484", "0.6284379", "0.627751", "0.62763447", "0.6244739", "0.6235734", "0.6232941", "0.61563456", "0.6136818", "0.6079582", "0.60767597", "0.6023977", "0.60217047", "0.6013677", "0.59839654", "0.59815323", "0.59815323", "0.59815323", "0.5947986", "0.59298986", "0.59062034", "0.58616257", "0.5848063", "0.58240664", "0.58193624", "0.58170336", "0.5809374", "0.57772523", "0.5772328", "0.5760974", "0.57579225", "0.5757419", "0.5714072", "0.5706687", "0.56979716", "0.5692835", "0.56629586", "0.56457055", "0.56421256", "0.5611077", "0.5602426", "0.5598637", "0.5597732", "0.5563765", "0.5556837", "0.5534719", "0.55330026", "0.55183566", "0.55089533", "0.549926", "0.54867035", "0.5483926", "0.5476346", "0.5471867", "0.5468448", "0.54570675", "0.5451516", "0.54423743", "0.5433947", "0.54263544", "0.54183537", "0.54147375", "0.5403093", "0.54021204", "0.5394638", "0.53699815", "0.53676796", "0.536741", "0.53668517", "0.5360459", "0.53584176", "0.5355064", "0.5329617", "0.5317513", "0.5315249", "0.53136903", "0.5310849", "0.53021926" ]
0.78225017
0
this function checks that the number is a palindrome (can be read both ways)
function palintest(num) { var inverted = ""; num = num.toString(); for (var i= num.length - 1 ;i>-1;i--) { inverted += num[i] } if (inverted == num) {return true} else return false }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function palindrome(num) {\n if (\n num\n .toString()\n .split(\"\")\n .reverse()\n .join(\"\") === num.toString()\n ) {\n return true;\n } else {\n return false;\n }\n}", "function isPalindromeNumber(n) {\n var head, tail;\n var digits = [];\n while (n >= 10) {\n digits.push(n % 10);\n n = Math.floor(n / 10);\n }\n digits.push(n);\n head = digits.length - 1;\n tail = 0;\n while (head > tail) {\n if (digits[head] !== digits[tail]) {\n return false;\n }\n head--;\n tail++;\n }\n return true;\n}", "function checkPal(){\n // plan\n // determine how to find the palindromes\n // brute:\n // go from the bottom up until your at or past number\n \n // non brute: \n // find a way to get it from above down\n // use a math equsation to find this\n \n\n}", "function isPalindromicNumber(number) {\n var string = String(number);\n var copy = string.split('').reverse().join('');\n return string === copy;\n}", "function isPalindrome (n) {\n n = n.toString()\n\n var parts = split(n)\n\n return parts[0] === reverse(parts[1])\n}", "isNumberPalindrome(num) {\n try {\n var rev = \"\";\n var num1 = num;\n while (num != 0) {\n /*\n *logic to get reverse of a number\n */\n var digit = num % 10;\n rev = rev + digit;\n num = num / 10;\n }\n if (rev == num1) {//checks if reverse of a number is equal to the original number\n console.log(arr[i] + \" is a palindrome\");\n }\n return false;\n }\n catch (error) {\n console.log(error.message);\n\n }\n\n}", "function isPalindrom(nr) {\n\tvar invers=0;\n\tvar dubluraNr=nr;\n\twhile(dubluraNr!=0) {\n\t\tinvers=(invers*10)+(dubluraNr%10);\n\t\tdubluraNr=parseInt(dubluraNr/10);\n\t}\n\tif(invers==nr) return true;\n\telse return false;\n}", "function isPalendrome(num) {\n // digitize the number\n const digits = digitize(num);\n\n // get the digits in reverse\n const reversed = digits.slice().reverse();\n\n // compare the digits with the reversed digits\n let result = true;\n\n for (let i = 0; i < digits.length && result; i++) {\n result = (digits[i] === reversed[i]);\n }\n\n return result;\n}", "function isPalindrome(int) {\n int = int.toString();\n let check = \"\";\n\n //for loop builds out the reverse string of the number one character at a time\n for (i = int.length-1; i >= 0; i--) {\n check = check + int[i];\n }\n\n //if int is the same as its reverse, int is a palindrome\n return (int == check);\n\n}", "function isPalindromic(num) {\n var digits = num.toString().split(\"\");\n\n for (var i = 0; i<=digits.length/2; i++) {\n if (digits[i] !== digits[digits.length - i - 1]) {\n return false;\n }\n }\n\n return true;\n}", "function checkForPalindrome(Input) {\n let tempInput = Input;\n let reverseNum = 0;\n while (Input > 0) {\n reverseNum = reverseNum * 10 + Input % 10;\n Input = Math.floor(Input / 10);\n }\n if (reverseNum == tempInput)\n return true;\n else\n return false;\n }", "function esPalindromo(numero){\n var palindromo = true;\n var splitnumero = numero.split(\"\");\n var splitnumeroInvertido = numero.split(\"\")\n splitnumeroInvertido.reverse();\n for(i=0;i<numero.length;i++){\n if(splitnumero[i]!= splitnumeroInvertido[i]){\n palindromo = false;\n }\n }\n return palindromo;\n}", "function palindromeWithin(n) {\n return !Number.isInteger(n) || n < 0 ? \"Not valid\" : /(\\d)\\d?\\1/.test('' + n);\n}", "function isPalindrome(x) {\n if(x < 0) return false;\n const str = x.toString();\n for(let i = 0; i < Math.floor(str.length / 2); i++) {\n if(str[i] !== str[str.length - 1 - i]) {\n return false\n }\n }\n return true\n}", "function checkPalindrome(num) {\r\n var n = num.toString();\r\n return Number(n.split('').reverse().join(''));\r\n}", "function isPalindrom(n){\n // let reverseN = n.split('').reverse().join('');\n // if(n === reverseN) return true;\n // return false;\n let arrN = n.split('');\n let len = arrN.length;\n for (let i = 0; i < len/2; i++){\n if(arrN[i] !== arrN[len - i - 1]){\n return false;\n }\n }\n return true;\n}", "function palindrome(value3) {\n return value3 === reversal(value3);\n}", "function palindrom(x) {\n return (\n x ===\n Number(\n x\n .toString()\n .split('')\n .reverse()\n .join('')\n )\n );\n}", "function palindrome(str) {\n return true;\n}", "function isPalindrome(str) {\n\n}", "function validPalindrome(value) {\n const str = value.replace(/[^0-9a-z]/gi, '').toLowerCase(); \n let left = 0;\n let right = str.length - 1;\n while(left < right){\n if(str[left] !== str[right]){\n return false\n }\n left += 1\n right -= 1\n }\n return true\n}", "function isPalindrome(x) {\n if (x < 0) {\n return false;\n }\n\n if (x === 0) {\n return true;\n }\n\n // edge case that leds to incorrect comparisons because of initial zero\n if (x % 10 === 0) {\n return false;\n }\n\n let reverseX = 0;\n while (x) {\n const digit = x % 10;\n reverseX = reverseX * 10 + digit;\n\n // check for not even digit numbers\n if (reverseX === x) {\n return true;\n }\n\n x = (x - digit) / 10;\n\n // check for even digit numbers\n if (reverseX === x) {\n return true;\n }\n\n if (reverseX > x) {\n return false;\n }\n }\n\n return false;\n}", "function palindrome(str) {}", "function isPalNum(checkNum) {\n\tvar string = (checkNum + \"\");\n\tvar fh = string.substring(0, Math.ceil(string.length / 2));\n\tvar lh = string.substring(Math.floor(string.length / 2), string.length);\n\t\n\tlh = lh.split(\"\").reverse().join(\"\");\n\n\treturn fh == lh;\n}", "function isPalindrome(x){\n let char = x.toString();\n let i = 0;\n let j = char.length - 1;\n while(i <= j){\n if(!(char[i++] === char[j--])){\n return false;\n }\n }\n return true;\n}", "function palindrome(str) {\n \n // pre-process\n str = str.toLowerCase();\n \n // find unwanted characters and replace\n const re = /[^a-z\\d]+/g;\n\tstr = str.replace(re, '');\n\t\n // for reversing a string\n function reverseString(txt) {\n return txt.split('').reverse().join('');\n\t}\n\n\t// A question of symmetry:\n // find length & middle, split and reverse one piece\n // then check for equality\n \n\t// even if odd length string, this will give us enough to\n\t// check two halves are palindromic\n\tconst half = Math.floor(str.length / 2);\n\t\n\tconst flipped = reverseString(str.substring(str.length - half));\n\t\n\treturn str.substring(0, half) === flipped;\n \n}", "function palidrome(firstNumber , secondNumber){ \n let reverse = 0;\n let remainder = 0;\n while(secondNumber > 0){\n remainder = Math.floor(secondNumber % 10) ;\n reverse = reverse * 10 + remainder;\n secondNumber = Math.floor(secondNumber / 10 );\n }\n if(firstNumber == reverse){\n console.log(\"Number is Palidrome\");\n }\n else{\n console.log(\"Number is not palidrome\");\n }\n}", "function isPalindromic(a) {\n let rev = a.toString().split('').reverse('').join('');\n console.log(rev)\n return a === rev ? true : false;\n}", "function palindrome(str) {\r\n // Good luck!\r\n return true;\r\n}", "function palindrome(string) {\n\n}", "function getPalindrome(number) {\n let reverseNum = 0;\n while (number > 0) {\n reverseNum = reverseNum * 10 + number % 10;\n number = Math.floor(number / 10);\n }\n return reverseNum;\n }", "function palindrome2(str) {\n str = str.match(/[A-Za-z0-9]/gi).join(\"\").toLowerCase();\n var polindromo = str.split('').reverse().join('');\n return polindromo === str;\n}", "function isPalendromeTest() {\n return this.isPalendrome(959);\n}", "function isPalindrome(s) {\n var str = s.replace(/[^a-zA-Z0-9]/g, '').toLowerCase()\n var half = Math.floor(str.length / 2)\n var lastIndex = str.length - 1\n for (var i = 0; i < half; i++) {\n if (str[i] !== str[lastIndex - i]) {\n return false\n }\n }\n\n return true\n}", "function demoFun(num,palindrome){\nvar arr=num.split('').reverse().join('')\nif(arr == num){\npalindrome()\n}\n}", "function isPalindrome(s) {\n var pal = s.split('').reverse().join('');\n return s == pal;\n}", "function isPalindrome(word) {\n if(word.length <= 1) return true;\n return Boolean(Number(\n word[0] == word[word.length-1]) * isPalindrome(word.slice(1, word.length-1)\n ))\n}", "function isPalindrome(palindrome) {\n palindrome = uniformString(palindrome);\n\tfor ( var i=0; i <palindrome.length/2; i++) {\n\t\treturn (palindrome.charAt(i) === palindrome.charAt(palindrome.length-1));\n //Compares characters starting at both ends of the String\n\t}\n}", "function isPalindrome(x) {\n let rev=x.toLowerCase().split('').reverse().join('');\n return x.toLowerCase()===rev? true:false;\n}", "function palindrom(x) {\n return x === invers(x);\n}", "function isPalindrome(str) {\nlet end = str.length - 1;\nfor (let idx = 0; idx < str.length / 2; idx += 1) {\n if (str[idx] !== str[end]) {\n return false;\n }\n end -= 1;\n}\nreturn true;\n}", "function palindrome(str) \n{\n\n str = str.toLowerCase();\n\nlet strlength = str.length; \n \nfor (let i = 0; i < strlength/2; i++) \n{\nif (str[i] !== str[strlength - 1 - i]) \n{ \n return `${str} is not a palindrome`;\n}\n\n}\nreturn `${str} is a palindrome`;\n}", "function isPalindrome(someStr) {\r\n \r\n thePalin = someStr.split('').reverse().join('');\r\n if (thePalin == someStr)\r\n return true;\r\n else\r\n return false;\r\n \r\n}", "function palindrome(str) {\n\t// Array.prototype.every -- is used to do a boolean check on every element within an array\n\t// arr.every((val) => val > 5);\n\t// If any function returns false, then the overall expression returns false as well\n\treturn str.split('').every((char,i) => {\n\t\treturn char === str[str.length -i -1]; // mirrored element\n\t});\n}", "function palindrome(word) {\n var ln = word.length;\n for (var i = 0; i <= ln / 2;)\n if (word[i++] !== word[ln - i]) return false;\n return true\n}", "function isPalindrome(string) {\n let long = string.length;\n let mid = Math.floor(long / 2);\n\n for (let i = 0; i < mid; i++) {\n if (string[i] !== string[long - 1 - i]) {\n return false;\n }\n }\n return true;\n}", "function isPalindrome(str) {\n\n //str = str.toString().replace(/[^a-z0-9]/gi, '').toLowerCase()\n str = str.replace(/[^a-z0-9]/gi, '').toLowerCase()\n\n let x = 0\n let y = str.length - 1\n\n if (str[x] != str[y]) {\n return false\n }\n x += 1\n y -= 1\n\n return true\n}", "function palindrome(word){\n var long=word.length;\t\nfor(var i=0; i<word.length;i++)\t{\n\tif(word[i] !=word[long-1-i]){\n return false;\n\t}\n }\n return true;\n}", "function isPalindrome(str) {\n let remSpace = str.split(\" \").join(\"\");\n console.log(\"remSpace is: \" + remSpace);\n let revRemSpace = remSpace.split(\"\").reverse().join(\"\");\n console.log(\"revRemSpace is: \" + revRemSpace);\n if (revRemSpace === remSpace) {\n console.log(\"Yep, that's a palindrome\");\n var box3El = document.getElementById('box3');\n box3El.innerHTML = \"Yep, that's a palindrome\";\n } else {\n console.log(\"That's not a palindrome\");\n var box3El = document.getElementById('box3');\n box3El.innerHTML = \"That's not a palindrome\";\n }\n }", "function check_Palindrome(str_entry){\r\n var cstr = str_entry.toLowerCase().replace(/[^a-zA-Z0-9]+/g,'');\r\n var ccount = 0;\r\n if(cstr===\"\") {\r\n document.write(\"Nothing found!\");\r\n return false;\r\n }\r\n if ((cstr.length) % 2 === 0) {\r\n ccount = (cstr.length) / 2;\r\n } else {\r\n if (cstr.length === 1) {\r\n document.write(\"Entry is a palindrome.\"+\"<br>\");\r\n return true;\r\n } else {\r\n ccount = (cstr.length - 1) / 2;\r\n }\r\n }\r\n for (var x = 0; x < ccount; x++) {\r\n if (cstr[x] != cstr.slice(-1-x)[0]) {\r\n document.write(\"Entry is not a palindrome.\"+\"<br>\");\r\n return false;\r\n }\r\n }\r\n document.write(\"The entry is a palindrome.\"+\"<br>\");\r\n return true;\r\n}", "function palindrome(word){\r\n\t\t\t\tvar middle=Math.ceil(word.length/2), i;\r\n\r\n\t\t\t\tfor (i=0; i<=middle; ++i){\r\n\t\t\t\t\tif (word[i]!== word[(word.length-1)-i]){\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn true;\r\n\t\t\t}", "function palindrome(pal){\n\tlet palLength = pal.length;\n\tlet palArr = pal.split('');\n\tfor(let i = 0; i < palArr.length; i++){\n\t\tif(palArr[i] === palArr[(palArr.length -1) - i]){\n\t\t} else {\n\t\t console.log('nope!');\n\t\t return 'sorry, this is not a palindrome!';\n\t\t}\n\t};\n return pal + ' is a palindrome!';\n}", "function palindrome(str){\r\n return reverseString(str) === str;\r\n}", "function Palindrome(str) \r\n {\r\n var cstr = str.toLowerCase().replace(/[^a-zA-Z0-9]+/g,)\r\n var count = 0\r\n if ((str.length) / 2 ===0 )\r\n {\r\n\r\n }\r\n else \r\n {\r\n if(str.length ===1)\r\n {\r\n document.write(\"Entry is palindrome\")\r\n }\r\n else\r\n {\r\n count = (str.length -1 ) /2 \r\n }\r\n }\r\n for (var i = 0; i <count.length; i++) \r\n {\r\n if (str[i] != srt.slice(-1-x)[0])\r\n {\r\n document.write(\"The entry is not palindrome\")\r\n }\r\n }\r\n document.write(\"The entry is palindrome\" + \"<br>\")\r\n }", "function check_Palindrome(str_entry){\n var cstr = str_entry.toLowerCase().replace(/[^a-zA-Z0-9]+/g,'');\n\tvar ccount = 0;\n\tif(cstr===\"\") {\n\t\tconsole.log(\"Nothing found!\");\n\t\treturn false;\n\t}\n\tif ((cstr.length) % 2 === 0) {\n\t\tccount = (cstr.length) / 2;\n\t} else {\n\t\tif (cstr.length === 1) {\n\t\t\tconsole.log(\"Entry is a palindrome.\");\n\t\t\treturn true;\n\t\t} else {\n\t\t\tccount = (cstr.length - 1) / 2;\n\t\t}\n\t}\n\tfor (var x = 0; x < ccount; x++) {\n\t\tif (cstr[x] != cstr.slice(-1-x)[0]) {\n\t\t\tconsole.log(\"Entry is not a palindrome.\");\n\t\t\treturn false;\n\t\t}\n\t}\n\tconsole.log(\"The entry is a palindrome.\");\n\treturn true;\n}", "function isPalindrome(string){\n for (var i = 0; i < string.length / 2; i++){\n if (string[i] !== string[string.length - 1 -i]) {\n return false\n }\n }\n return true\n }", "function palindrome(string) {\n for (var i = 0; i < Math.floor(string.length / 2); i++) {\n if (string[i] !== string[string.length - 1 - i]) {\n return false;\n }\n }\n return true;\n}", "function isPalindrome (string) {\n var halfString = Math.floor(string.length / 2);\n for (var i = 0; i < halfString; i++)\n if (string[i] !== string[string.length - i - 1])\n return false;\n return true;\n}", "function isPalindrome_V2(str){\n if(str.split('').reverse().join('')==str){\n return true;\n }\n return false;\n \n}", "function isPalindrome(checkingStr) {\n let flag = true;\n for (let i = 0; i < checkingStr.length / 2; i++) {\n\n if (checkingStr[i] !== checkingStr[checkingStr.length - 1 - i]) {\n flag = false;\n break\n }\n\n }\n return flag ? checkingStr : flag;\n}", "function isPalindrome(line) {\n var Line = line.toString()\n for ( let i=0 ; i < Line.length ; i++){\n if (Line[i] !== (Line[Line.length-1-i])){\n return false\n }\n }\n return true;\n }", "function isPalindrome(str) {\n const len = str.length;\n\n for (let i = 0; i < len / 2; i++) {\n if (str[i] !== str[len - 1 - i]) {\n return false;\n }\n }\n\n return true;\n}", "function isPalidrome(str){\n let reverseStrArray = str.split('').reverse();\n let reverseStr = reverseStrArray.join(''); \n \n if (str === reverseStr){\n return true;\n }\n \n return false;\n }", "function isPalindrome(str){\r\n // add whatever parameters you deem necessary - good luck!\r\n \r\n function reverse(str){\r\n //console.log(\"STR: \"+str);\r\n if(str === ''){ \r\n return '';\r\n }\r\n \r\n return str.charAt(str.length-1)+reverse(str.substr(0,str.length-1));\r\n }\r\n \r\n return str === reverse(str) ? true : false;\r\n \r\n }", "function palindrome(input) {\n let cleanedInput = input.split(\" \").join(\"\");\n let reversedCleanedInput = cleanedInput.split(\"\").reverse().join(\"\")\n if (cleanedInput == reversedCleanedInput) {\n return true\n } else {\n return false\n }\n}", "function palindrome(str){\n\tconst middle = Math.floor(str.length/2);\n\n\tconst firsthalf = str.substring(0, middle);\n\tconst secondhalf = (str.length % 2 === 0)? str.substring(middle) : str.substring(middle + 1);\n\t\n\treturn (firsthalf === reverse(secondhalf));\n}", "function palindromeChecker(palindrome) {\n var array = [];\n array = palindrome.split(\"\");\n // console.log(array);\n var reversedPal = array.reverse();\n // console.log(reversedPal);\n if (array.equals(reversedPal)) {\n return console.log(palindrome +\" is a Palindrome!\")\n } else {\n return console.log(palindrome + \"is not a palindrome.\")\n }\n}", "function isPalindrome(x) {\n return x.toLowerCase() === x.toLowerCase().split('').slice().reverse().join('') ? true : false;\n}", "function isPalendrome(word) {\n // palendrom is same forward and backwards\n // take in word as is\n // create new word that is the reverse\n // compare and return\n let reverseWord = word.split(\"\").reverse().join(\"\");\n //console.log('Word', word)\n //console.log('Reverse', reverseWord);\n return reverseWord === word ? true : false;\n}", "function checkForPalindrome(word) {\r\n if (word === reverseString(word)) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n}", "function checkPalindrome(word) {\n let isPalindrome;\n let reverseWord = reverse(word);\n\n if(word === reverseWord) {\n isPalindrome = true;\n } else {\n isPalindrome = false;\n }\n\n return isPalindrome;\n}", "function isPalindrome(str)\n{\n var reverse = reverseStr(str);\n if(str === reverse)\n {\n return true;\n }\n return false;\n\n}", "function isPalindrome(str) {\n // const revString = str\n // .split(\"\") // turn a string into an array\n // .reverse() // reverse, duh\n // .join(\"\"); // method returns the array as a string.\n // return revString === str;\n}", "function palindrome() {\r\nlet value = document.getElementById(\"input\").value; //This acts as the parameter, taking the value of the input text box.\r\nlet holder = value.toLowerCase().replace(/[^a-z0-9]+/g, \"\").split(\"\"); //This uses 3 methods and regex to eliminate any spaces between letters make everything lowercase and remove any non alphanumeric symbols.\r\nlet count = (holder.length %2 == 0) ? holder.length / 2: (holder.length-1) / 2 ; //Using a ternary operator this assigns a number to this let so that it is always half of the total length of the input string.\r\nlet first = holder.slice(0, count).join(\"\");\r\nlet second = holder.slice(holder.length - count, holder.length).reverse().join(\"\"); //Using count as a numerical value these 2 lines cut the string in half, ignoring the central character if it is an odd numbered length as that doesn't matter. THey are then turned back into strings and second is reversed so both can be accurately compared\r\nlet result = (first == second) ? true : false; //Final ternary, if the 2 modified strings of characters are the same then result = true.\r\n if(value.length <= 1){\r\n nothing.style.opacity = \"1\";\r\n } else if(result == true){\r\ncorrect.style.opacity = \"1\";\r\n} else {\r\nwrong.style.opacity = \"1\";\r\n} //This decides which message is displayed. \r\n}", "function isPalindrome(x) {\r\n // your code here\r\n x = x.toLowerCase();\r\n x = x.replace(/\\W/g, \"\");\r\n return (\r\n x ===\r\n x\r\n .split(\"\")\r\n .reverse()\r\n .join(\"\")\r\n );\r\n}", "function isPalindrome(str){\n for(let i=0; i<str.length; i++){\n //loop through first to last\n if(str[i]!=str[str.length-1-i]){\n return false;\n }\n }\n return true;\n}", "function isPalindrome(string) {\r\n left = 0\r\n right = string.length - 1\r\n while (left < right) {\r\n if (string[left] != string[right]) return false\r\n left++\r\n right--\r\n }\r\n return true\r\n}", "function validPalindrome(s) {\n // only have alphanumeric\n s = s.replace(/[^0-9a-zA-Z]+/gim, \"\")\n s = s.toLowerCase()\n\n // using two pointer\n // one starts at the beginning\n // one at end of s\n let l = 0\n let r = s.length - 1\n // while 0 < length - 1\n while (l <= r) {\n // if char doesn't match return false right away\n if (s[l] !== s[r]) {\n return false\n }\n // else increment the pointer\n l++\n r--\n }\n // once all string has been traversed return true\n return true\n}", "function isPolindrome(input, length){\n for(var i=0; i < Math.floor(length/2); i++){\n if(input[i] !== input[ length - 1 - i]) \n return false;\n }\n return true;\n}", "function palindrome(string){\n let len = string.length;\n for(let i = 0; i < string.length; i++){\n if(string[i] != string[len - i - 1]){\n return false;\n }\n }\n return true;\n}", "function palindrome(str) {\n const rev = str.split('').reverse().join('');\n return str === rev;\n}", "function isPal(arr) {\n for (var left = 0; left < arr.length / 2; left++) {\n var right = arr.length - 1 - left;\n if (arr[left] != arr[right]) {\n return \"Not a pal-indrome!\";\n }\n }\n return \"Pal-indrome!\";\n}", "function isPalindrome(string) {\n // Write your code here.\n // reverse string and compare string\n // string.reverse()\n // string === new string\n // O(n) O(1) ST\n\n let pointerEndIndex = string.length - 1;\n // only needs to travse to half the string\n for ( let i = 0; i < string.length / 2; i++) {\n // check first value with last value\n if ( string[i] === string[pointerEndIndex]) { \n pointerEndIndex--;\n continue;\n } else { \n return false;\n }\n } \n return true;\n }", "function isPalindrome(phrase){\r\n return true;\r\n}", "function palindrome(word) {\n for (i=0; i<word.length/2; i++) {\n if (word.charAt(i) != word.charAt(word.length - i - 1)) {\n return false;\n }\n } return true;\n}", "function isPalindrome(s) {\n s = s.replace(/( |[^a-zA-Z0-9])/g, '').toLowerCase()\n var i = 0\n var j = s.length - 1\n\n while (i < j){\n if (s[i] === s[j]) {\n i++\n j--\n } else {\n return false\n }\n }\n\n return true\n}", "isPalindrome() {\n }", "function isPalindrome(string) {\n let revIdx = string.length - 1\n let idx = 0\n\n while (idx < revIdx) {\n if (string[revIdx] !== string[idx]) {\n return false\n }\n idx += 1\n revIdx -= 1\n } \n return true\n }", "function checkIsPalindrome(inputString) {\n\n if (typeof inputString !== \"string\") {\n return \"no\";\n }\n\n // checking palindromes is kind of weird.\n // take the length of the string.\n // grab string [0] and string [n]; compare for sameness\n // iterate until floor(n/2), I guess\n // as long as the bit is true, it's a palindrome?\n\n let wordArr = inputString.split('');\n for (let i = 0; i < wordArr.length / 2; i++) {\n if (wordArr[i] !== wordArr[wordArr.length - i - 1]) {\n return \"no\";\n }\n }\n return \"yes\";\n\n}", "function isPalindrome (x) {\n\tvar reverse = '';\n\tvar reverseString = function (x) {\n\t\tfor (var i = x.length - 1; i >= 0; i--) {\n\t\t\treverse += x[i];\n\t\t}\n\t\treturn reverse;\n\t}\n\tif (reverseString(x) === reverse) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "function isPalindrome(string) {\n\tif (string.length === 1) return true;\n let firstPointer = 0;\n\tlet secondPointer = string.length - 1;\n\twhile (firstPointer <= secondPointer) {\n\t\tif (string[firstPointer] !== string[secondPointer]) {\n\t\t\treturn false;\n\t\t}\n\t\tfirstPointer++;\n\t\tsecondPointer--;\n\t}\n\treturn true;\n}", "function checkPalindrome() {\n // take input\n var string = prompt('Enter a string:', \"\");\n let isPalindrome = true;\n\n // find the length of a string\n const len = string.length;\n\n // loop through half of the string\n for (let i = 0; i < len / 2; i++) {\n\n // check if first and last string are same\n if (string[i] !== string[len - 1 - i]) {\n isPalindrome = false;\n }\n }\n if (isPalindrome) {\n document.getElementById(\"output\").textContent = \"Palindrome\";\n } else {\n document.getElementById(\"output\").textContent = \"Not Palindrome\";\n }\n}", "function isPalindrome(word) {\n const reverse = word\n .split(\"\")\n .reverse()\n .join(\"\");\n return word === reverse;\n}", "function isPalindrome(string) {\n let leftIdx = 0;\n let rightIdx = string.length - 1;\n while (leftIdx < rightIdx) {\n if (string[leftIdx] !== string[rightIdx]) return false;\n leftIdx++;\n rightIdx--\n }\n return true\n}", "function palindrome(string){\n var newWord='';\n for (var i=string.length-1; i>=0; i--){\n newWord+=string[i];\n \n }\n if (newWord===string){\n return string +' is a palindrome'\n \n } else{\n return string +' is not a palindrome'\n }\n \n }", "function isPalindrome(string) {\n // Write your code here.\n\tlet leftIdx = 0\n\tlet rightIdx = string.length - 1\n\twhile (leftIdx < rightIdx) {\n\t\tif (string[leftIdx] !== string[rightIdx]) return false\n\t\tleftIdx++\n\t\trightIdx--\n\t}\n\treturn true\n}", "function palindrome(str) {\n const string = str.toLowerCase().replace(/[^0-9a-z]/gi, '').trim(),\n reversed = string.split('').reverse().join('');\n\n if (reversed === string) {\n return true;\n }\n\n return false;\n}", "function isPalindrome(str){\n var left = 0;\n var right = str.length - 1;\n while (left < right){\n if (str[left] != str[right]){\n return false;\n }\n left++;\n right--;\n }\n return true;\n}", "function isPalindrome(str) {\n return str.split('').reverse().join('') === str\n}", "function strictPalindrome(str){\n var len = str.length\n\n for (let i = 0, j = len-1; i < Math.floor(len/2); i++, j--){\n if (str.charAt(i) != str.charAt(j)){\n return false\n }\n }\n\n return true\n}" ]
[ "0.83378977", "0.82282364", "0.8210567", "0.8166243", "0.8153877", "0.80765694", "0.8004502", "0.7984957", "0.7939395", "0.79181904", "0.78944266", "0.78919333", "0.78709644", "0.7850241", "0.7848473", "0.7808613", "0.7733663", "0.7685777", "0.76662964", "0.7653265", "0.763304", "0.76301324", "0.7613064", "0.7598241", "0.7578366", "0.7571556", "0.7564334", "0.7559061", "0.75062704", "0.742399", "0.7421758", "0.7420062", "0.74155205", "0.7400557", "0.7399065", "0.7387681", "0.73774904", "0.73705703", "0.7351789", "0.7346638", "0.7345371", "0.7343361", "0.7341608", "0.7339893", "0.7337548", "0.7337527", "0.7327973", "0.7313072", "0.73126173", "0.7305217", "0.73013806", "0.73004395", "0.7299207", "0.7295498", "0.7291727", "0.72865283", "0.728585", "0.72811407", "0.72786397", "0.7277795", "0.7271347", "0.724821", "0.72460103", "0.72418654", "0.7231118", "0.7227764", "0.7219954", "0.7219544", "0.72140044", "0.72086704", "0.7208433", "0.72024924", "0.72010666", "0.7200085", "0.71978927", "0.7195244", "0.7192774", "0.7191333", "0.71831995", "0.7182805", "0.7178747", "0.7175623", "0.7172954", "0.71719736", "0.7170828", "0.7167857", "0.7163742", "0.7163134", "0.7157316", "0.71569526", "0.71528304", "0.71524185", "0.7150805", "0.7147654", "0.7147096", "0.71465796", "0.7141522", "0.7139922", "0.7133722", "0.7130888" ]
0.74363357
29
sets context for React Router. Necessary for redirects after deleting colors
static get contextTypes() { return { router: React.PropTypes.object.isRequired, }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "render() {\n return (\n <div className=\"app w-screen m-0 p-0 font-sans\">\n <AppContext.Provider value={this.state}>\n \n <BrowserRouter>\n <Switch>\n <Route path=\"/hunts\" component={HuntsListPage} />\n <Route path=\"/signup\" component={Signup} />\n <Route path=\"/hunt/:id\" component={HuntPage} />\n <Route path=\"/createhunt\" component={CreateHunt} />\n <Route path=\"/createevent\" component={CreateEvent} />\n <Route path=\"/\" component={Login} />\n </Switch>\n </BrowserRouter>\n </AppContext.Provider>\n </div>\n )\n }", "setContext(context) {\n this.context = context;\n }", "getChildContext() {\n return {color: this.props.color}\n }", "function setContext() {\n\n $context = $( Config.get( 'context' ) );\n\n }", "getChildContext() {\n return {\n history: this.history,\n location: window.location,\n };\n }", "function App() {\n\tconst [didRedirect, setDidRedirect] = React.useState(false);\n\n\tconst playerDidRedirect = React.useCallback(() => {\n\t\tsetDidRedirect(true);\n\t}, []);\n\n\tconst playerDidNotRedirect = React.useCallback(() => {\n\t\tsetDidRedirect(false);\n\t}, []);\n\n\tconst [userName, setUserName] = React.useState('');\n\n\treturn (\n\t<ColorContext.Provider value = {{didRedirect: didRedirect, playerDidRedirect: playerDidRedirect, playerDidNotRedirect: playerDidNotRedirect}}>\n\t\t<Router>\n\t\t<Switch>\n\t\t\t<Route path = \"/single\" exact>\n\t\t\t\t<SingleRPS\n\t\t\t\t userName = {userName}\n\t\t\t\t>\n\t\t\t\t</SingleRPS>\n\t\t\t</Route>\n\t\t\t<Route path = \"/rock\" exact>\n\t\t\t\t<Rock\n\t\t\t\t userName = {userName}\n\t\t\t\t>\n\t\t\t\t</Rock>\n\t\t\t</Route>\n\t\t\t<Route path = \"/paper\" exact>\n\t\t\t\t<Paper\n\t\t\t\t userName = {userName}\n\t\t\t\t>\n\t\t\t\t</Paper>\n\t\t\t</Route>\n\t\t\t<Route path = \"/scissors\" exact>\n\t\t\t\t<Scissors\n\t\t\t\t userName = {userName}\n\t\t\t\t>\n\t\t\t\t</Scissors>\n\t\t\t</Route>\n\t\t\t<Route path = \"/\" exact>\n\t\t\t\t<Main setUserName = {setUserName}/>\n\t\t\t</Route>\n\t\t\t<Route path = \"/game/:gameid\" exact>\n\t\t\t\t{didRedirect ? \n\t\t\t\t<React.Fragment>\n\t\t\t\t\t<JoinGame userName = {userName} isHost = {true} />\n\t\t\t\t\t<Game myUserName = {userName} isHost = {true} />\n\t\t\t\t</React.Fragment>\n\t\t\t\t:\n\t\t\t\t<JoinRoom />}\n\t\t\t</Route>\n\t\t\t<Route path = \"/end\" exact>\n\t\t\t\t<div>Thanks for playing rock-paper-scissors</div>\n\t\t\t\t<a href={hubUrl}>Back to hub</a>\n\t\t\t</Route>\n\t\t\t<Redirect to = \"/\" />\n\t\t</Switch>\n\t\t</Router>\n\t</ColorContext.Provider>\n\t);\n}", "render() {\n const {themeColor} = this.context\n console.log('this', this)\n return (\n <div>\n <h3 className={themeColor}>HomePage</h3>\n <UserPage />\n </div>\n )\n }", "componentDidMount() {\n if (this.context.username) {\n this.props.history.push(\"/\");\n }\n }", "function App() {\n // const { user } = useContext(GlobalContext);\n return (\n <div className=\"App\">\n <GlobalContextProvider>\n <Router basename={process.env.PUBLIC_URL}>\n <Switch>\n <Route exact path=\"/\" component={LandingPage} />\n <Route exact path=\"/home\" component={HomePage} />\n <Route exact path=\"/about\" component={AboutMePage} />\n <Route exact path=\"/portfolio\" component={PortfolioPage} />\n <Route exact path=\"/contact\" component={ContactPage} />\n\n </Switch>\n </Router>\n </GlobalContextProvider>\n </div>\n );\n}", "render() {\n let {themeColor} = this.context\n return (\n <div>\n <h3 className={themeColor}>HomePage_2</h3>\n <UserPage></UserPage>\n </div>\n )\n }", "function decorateContextFunction(ctx, next) {\r\n ctx.render = (content) => render(content, document.querySelector('main'));\r\n ctx.setUserNav = setUserNav;\r\n next();\r\n}", "render() {\n\n return (\n <BrowserRouter>\n <div className=\"root-container\">\n <AuthContextProvider>\n <Route path=\"/\" exact component={Title} />\n <Route path=\"/home\" component={Controller} />\n <Route path=\"/home/login\" exact component={SignIn} />\n <Route path=\"/home/register\" exact component={SignUp} />\n <Route path=\"/pacing-interface\" component={PacingInterface} />\n <Route path=\"/electrogram\" component={Electrogram} />\n </AuthContextProvider>\n </div>\n </BrowserRouter>\n \n\n );\n }", "render() {\n return (\n <GlobalContext.Provider value={this.state.globalContextObj}>\n <HashRouter>\n <div className='App'>\n <style ref={this.state.styleSheetRef}></style>\n {/* Side Navigation Area */}\n <button className=\"SN__show-button\" onClick={this.showSideNavigation}><i className=\"material-icons\">menu</i></button>\n { this.state.globalContextObj.editing &&\n <button className=\"CSSM__show-button\" onClick={this.showCSSM}><i className=\"material-icons\">menu</i></button>\n }\n <div \n id=\"SN__container\" \n className=\"SN App__grid--side\"\n style={this.state.sideNavigationStyle}\n >\n <div style={{width: \"300px\"}}> \n <button className=\"SN__close-button\" onClick={this.closeSideNavigation}><i className=\"material-icons\">close</i></button>\n \n {UserInfo(this.state.user) /* Logged in user, or the Admin (aka: me) */} \n \n { this.state.globalContextObj.authenticated &&\n <AuthNav \n scrollableHeight={this.state.scrollableHeight}\n pages={this.state.pages}\n toggleEdit={this.toggleEdit}\n saveActivePage={this.saveActivePage}\n deletePage={this.deletePage}\n\n createPage={this.createPage}\n clearFocus={this.clearFocus}\n toggleSpacing={this.toggleSpacing}\n addSection={this.addSection}\n addComponent={this.addComponent}\n moveObject={this.moveObject}\n deleteObject={this.deleteObject}\n />\n } \n { !this.state.globalContextObj.authenticated && \n <ViewNav \n scrollableHeight={this.state.scrollableHeight}\n pages={this.state.pages}\n />\n }\n <AccountInfo \n setAuthenticated={this.setAuthenticated}\n loadProtectedData={this.loadProtectedData}\n />\n </div>\n\n </div>\n\n {/* This is the main content area \n only move the main content area to the right when in editing mode!\n */}\n <div className='App__grid--main' style={this.state.mainContentStyle}> {/* this.state.globalContextObj.editing ? this.state.mainContentStyle : {} */}\n \n {/* Editor Panel Area */}\n <div className='App__toolbar-container' style={{\n display: (this.state.globalContextObj.editing) ? \"block\" : \"none\"\n }}>\n {/* Quill toolbar here - it is tied together by the portal referencing this \n element (using get element by id) and different components getting the \n Portal and using it directly in their render methods. It's quite disorderly.*/}\n <div id='Toolbar__portal'></div>\n </div>\n { this.state.globalContextObj.editing &&\n <div className=\"Toolbar__spacer\"></div>\n }\n {\n this.state.pages.map((page, pageIndex) => {\n return (\n <Route key={page.id} exact path={page.path} render={(props) => <Page {\n ...props}\n id={page.id}\n pageIndex={pageIndex}\n page={page}\n \n // #REFACTOR: Toolbars are contained within pages/sections... (maybe I cannot remove any of these)\n templates={this.state.templates}\n createTemplate={this.createTemplate}\n deleteTemplate={this.deleteTemplate}\n setPageStateFromTemplate={this.setPageStateFromTemplate}\n\n addComponent={this.addComponent}\n addSection={this.addSection}\n\n enableSpacing={this.state.globalContextObj.enableSpacing}\n \n updatePageState={this.updatePageState}\n applyPageStyles={this.applyPageStyles}\n updateSectionLayout={this.updateSectionLayout}\n updateSectionWidths={this.updateSectionWidths}\n updateSectionState={this.updateSectionState}\n applySectionStyles={this.applySectionStyles}\n updateGridSectionState={this.updateGridSectionState}\n applyGridSectionStyles={this.applyGridSectionStyles}\n updateComponentState={this.updateComponentState}\n applyComponentStyles={this.applyComponentStyles}\n\n moveObject={this.moveObject} // #OBS remove i think\n deleteObject={this.deleteObject} // #OBS remove i think\n />} />\n )\n })\n }\n { this.state.globalContextObj.authenticated &&\n <React.Fragment>\n <Route exact path=\"/image-uploader\" render={(props) => <ImageUploader {...props} flashMessage={this.flashMessage} />} />\n <Route exact path=\"/file-uploader\" render={(props) => <FileUploader {...props} flashMessage={this.flashMessage} />} />\n <Route exact path=\"/account\" render={(props) => <AccountPage {...props} flashMessage={this.flashMessage} />} />\n </React.Fragment>\n }\n\n\n <div className=\"App__messages-container\">\n { \n this.state.messages.map(message => {\n return (\n <p \n className=\"App__flash-message\"\n style={{\n background: (message.type === \"error\") ? \"orange\" : \"green\",\n }}\n >\n { message.text }\n </p>\n\n )\n })\n }\n </div> \n </div>\n { this.state.globalContextObj.editing &&\n <CSSManager \n styleSheetRef={this.state.styleSheetRef} \n updateApplicationStyles={this.updateApplicationStyles}\n closeCSSM={this.closeCSSM}\n style={this.state.CSSMStyle}\n />\n }\n\n </div>\n </HashRouter>\n </GlobalContext.Provider >\n )\n }", "function App() {\n // const [user, setUser] = useState(\"aakashsr\");\n return (\n <div className=\"App\">\n {/* <UserContext.Provider value={{user,setUser}}>\n <ComponentA />\n </UserContext.Provider> */}\n <ThemeContextProvider>\n <Landing />\n </ThemeContextProvider>\n </div>\n );\n}", "constructor(props, context) {\n super(props, context);\n\n // Bind states to 'this'\n this.redirectToAddCoursePage = this.redirectToAddCoursePage.bind(this);\n }", "function App() {\n return (\n <Router>\n <nav>\n <Link to=\"/\">Home</Link>\n <Link to=\"/dogs\">Dogs</Link>\n <Link to=\"/cats\">Cats</Link>\n </nav>\n <GlobalContextProvider>\n <Switch>\n <Route exact path='/'>\n <Home/>\n </Route>\n <Route path='/dogs'>\n <Dogs/>\n </Route>\n <Route path='/cats'>\n <Cats/>\n </Route>\n </Switch>\n </GlobalContextProvider>\n </Router>\n );\n}", "set contextId(value) { this._contextId = value; }", "updateContext(context) {\n this.context = context\n }", "render() {\n return (\n <div>\n <Container>\n <LanguageStore>\n <LanguageSelector />\n <ColorContext.Provider value=\"facebook\">\n <UserCreate />\n </ColorContext.Provider>\n </LanguageStore>\n </Container>\n </div>\n );\n }", "function Home() {\n\n\n\n// const {inicioSesion} = useContext(userContext);\n return (\n <>\n <Navbar></Navbar>\n <Dashboard/>\n </>\n )\n}", "function App() {\n\n return (\n <div>\n {/* <UserContext> */}\n <BrowserRouter>\n <Navbar />\n <Switch>\n <Home />\n <Route path=\"/\" exact component={Home} />\n <Route path=\"/Favorite\" exact component={Favorite} />\n </Switch>\n <Footer />\n </BrowserRouter>\n {/* </UserContext> */}\n </div>\n );\n}", "getChildContext() {\n\t\treturn {\n\t\t\troute: this.state.route,\n\t\t\tlinkHandler: this.handleLinkClick\n\t\t}\n\t}", "function App() {\n return (\n <CartComponentContext>\n <ProductContextComponent>\n <BrowserRouter>\n <NavbarComponent ></NavbarComponent>\n <Switch>\n <Route exact path=\"/\" component={Home}></Route>\n <Route\n path=\"/category/:categoryId\"\n component={ItemListContainer}\n ></Route>\n <Route path=\"/item/:id\" component={ItemDetailContainer}></Route>\n <Route path=\"/cart\" component={Cart}></Route>\n <Route path=\"*\" component={() => <h1>404!!!!</h1>}></Route>\n </Switch>\n </BrowserRouter>\n </ProductContextComponent>\n </CartComponentContext>\n );\n}", "function App() {\n return (\n <Container>\n <BrowserRouter>\n <AuthContextProvider>\n <Menu />\n <Route exact path=\"/login\" component={Login} />\n <Route exact path=\"/signup\" component={Signup} />\n <Route exact path=\"/\" component={Home} />\n <Route exact path=\"/post/:postId\" component={PostPage} />\n </AuthContextProvider>\n </BrowserRouter>\n </Container>\n );\n}", "getChildContext() {\n return {\n stackRouterPageStatus: this.props.isStackRouterPage ? this.stackRouterPageStatus : this.context.stackRouterPageStatus\n };\n }", "render() {\n return(\n <div>\n {/* {this is the router for changing pages on the site} */}\n <BrowserRouter history={history}>\n {/* The Main Context Providers */}\n <UserProvider>\n <OrganizationProvider>\n <VerifyStatusProvider>\n <PrimaryNavSelectedProvider>\n <OpenTicketContextProvider>\n <StatusListProvider>\n <PriorityListProvider>\n <TicketColumnsContextProvider>\n <TicketProvider>\n {/* {Navbar component to navigate} */}\n {/* <Navbar/> */}\n \n \n {/* TicketTabContext to hold the ticket tabs*/}\n <TicketTabContextProvider>\n <SelectedOrgProvider>\n \n\n \n {/* {creating a switch to swap out the component to show when on different pages} */}\n \n {/* {pages and the component assgined to them} */}\n \n <Route component={AllRoutes}/>\n\n </SelectedOrgProvider>\n \n </TicketTabContextProvider>\n \n </TicketProvider>\n </TicketColumnsContextProvider>\n </PriorityListProvider>\n </StatusListProvider>\n </OpenTicketContextProvider>\n </PrimaryNavSelectedProvider>\n </VerifyStatusProvider>\n </OrganizationProvider>\n </UserProvider>\n </BrowserRouter>\n </div>\n );\n }", "function App() {\n // const [data, setData] = React.useState(null);\n const [username, setUsername] = React.useState(\"heyo\");\n const [password, setPassword] = React.useState(\"\");\n const [user, setUser] = React.useState(null);\n const [test, setTest] = React.useState(\"Really a test\");\n\n const userSettings = {\n username: username,\n password: password,\n user: user,\n setUsername,\n setPassword,\n setUser,\n };\n\n // check if user is already logged in\n React.useEffect(() => {\n const loggedInUser = localStorage.getItem(\"user\");\n console.log(loggedInUser)\n if (loggedInUser) {\n setUser(loggedInUser);\n }\n }, []);\n\n console.log(\"THe user in App.js: \")\n console.log(user)\n console.log(user == 'true')\n\n // if there's a user show the following message\n // change /Home to just exact path /\n if (user) {\n return (\n <AppContext.Provider value={userSettings}>\n <BrowserRouter>\n <Switch>\n <Route path='/home'> \n <Home user={user}/>\n </Route>\n <Route path='/login'>\n <LoginPage />\n </Route>\n </Switch>\n <Redirect to='/home'/>\n </BrowserRouter>\n </AppContext.Provider>\n );\n }\n\n // otherwise show the login form\n\n // declare routes like this instead: https://www.codingame.com/playgrounds/6517/react-router-tutorial\n // probably in both return statements\n // honestly I can probably do all of the redirecting within the sub components\n // later figure out how to direct people away from certain pages if they have not yet logged in\n\n return (\n <AppContext.Provider value={userSettings}>\n <BrowserRouter>\n <div className=\"App\"> \n <Switch>\n <Route path='/home'> \n <Home user={user}/>\n </Route>\n <Route path='/login'>\n <LoginPage />\n </Route>\n </Switch>\n </div>\n <Redirect to='/login'/>\n </BrowserRouter>\n </AppContext.Provider>\n )\n}", "function Routes({ logIn, register }) {\n const { currentUser } = useContext(UserContext);\n console.log(\"Routes: currentUser\", currentUser);\n return (\n <Switch>\n <Route exact path=\"/\" >\n <Home />\n </Route>\n <PrivateRoute exact path=\"/companies\" >\n <CompanyList />\n </PrivateRoute>\n <PrivateRoute exact path=\"/companies/jobs\" >\n {<JobList />}\n </PrivateRoute>\n <PrivateRoute exact path=\"/companies/:handle\" >\n {<CompanyDetail />}\n </PrivateRoute>\n <Route exact path=\"/login\" >\n <LoginForm logIn={logIn} />\n </Route>\n <Route exact path=\"/signup\" >\n <SignupForm register={register} />\n </Route>\n <PrivateRoute exact path=\"/profile\" >\n <ProfileForm />\n </PrivateRoute>\n <PrivateRoute exact path=\"/applications\" >\n <Applications />\n </PrivateRoute>\n <Redirect to=\"/\" />\n </Switch>\n )\n}", "render() {\n return (\n <ThemeProvider theme={theme}>\n <Provider store={store}>\n <BrowserRouter>\n <TransitionComponent />\n </BrowserRouter>\n </Provider>\n </ThemeProvider>\n )\n }", "function App() {\n\n\n return (\n <ChakraProvider>\n\n <AppContext.Provider>\n\n <Router>\n\n <div>\n\n <Switch>\n <Route path=\"/home\" component={Home}/>\n <Route path=\"/all-saved-blobs\" component={AllSavedBlobs}/>\n <Route path=\"/saved-blobs\" component={SavedBlobs}/>\n\n\n {/*\n <Route path=\"/all-avatars\" component={AllAvatars}/>\n <Route path=\"/profile\" component={Profile}/>\n <Route path=\"/games\" component={GamesPage}/>\n <Route path=\"/feedbacks\" component={Feedbacks}/>\n <Route render={() => {\n\n return(\n <Redirect to=\"/home\" />\n );\n\n }} />\n */}\n <Route render={() => {\n\n return(\n <Redirect to=\"/home\" />\n );\n\n }} />\n </Switch>\n\n\n </div>\n </Router>\n\n </AppContext.Provider>\n </ChakraProvider>\n\n );\n}", "function App() {\n\n const { user } = useContext(AuthContext)\n console.log(\"user\", user);\n\n return (\n <AuthProvider>\n <div className=\"App\">\n <Router>\n <Header /> \n <Route exact path=\"/\" component={Body} />\n <Route exact path=\"/test\" component={Testform} />\n <AuthRoute exact path=\"/Signup\" component={Signup} />\n <AuthRoute exact path=\"/login\" component={Login} />\n </Router>\n </div>\n </AuthProvider>\n );\n}", "function useThemeContext(){return Object(react__WEBPACK_IMPORTED_MODULE_0__[\"useContext\"])(_theme_ThemeContext__WEBPACK_IMPORTED_MODULE_1__[/* default */ \"a\"]);}", "constructor(props, context) {\n super(props, context);\n\n this.state = {\n // This defines the initial navigation state.\n navigationState: {\n index: 0, // starts with first route focused.\n routes: [{key: 'Welcome'}], // starts with only one route.\n },\n };\n\n this._exit = this._exit.bind(this);\n this._onNavigationChange = this._onNavigationChange.bind(this);\n }", "componentDidMount() {\n if (this.props.context.authUser) {\n this.props.history.push('/signuperror')\n }\n }", "_colorChanged() {\n // Update the context\n this.resetContext();\n }", "render() {\n return (\n <div className=\"ui container\">\n <LanguageStore>\n <LanguageSelector />\n <ColorContext.Provider value=\"primary\">\n <UserCreate />\n </ColorContext.Provider>\n </LanguageStore>\n </div>\n )\n }", "function App() {\n // add a state hook for user\n // the getitem method returns the value of the specified storage object item\n const [user, setUser] = useState({email: localStorage.getItem('email')})\n\n // Provider component allows consuming components to subscribe to context changes\n return (\n <UserContext.Provider value={ {user,setUser} }>\n <Router>\n <AppNavbar />\n <Container>\n <Switch> \n {/* <Counter /> */} \n <Route exact path=\"/\" component={Home} />\n <Route exact path=\"/courses\" component={Courses} />\n <Route exact path=\"/register\" component={Register} />\n <Route exact path=\"/login\" component={Login} />\n <Route component={Error} />\n </Switch>\n </Container>\n </Router>\n </UserContext.Provider> \n );\n }", "function setCachedStylingContext(context) {\n stylingContext = context;\n}", "function setContext(id) {\n\n if (typeof(id) === 'number') {\n\n // Initialize global categories.\n var categories = CategoryList.query();\n categories.$promise.then(function (data) {\n Data.categories = data;\n Data.currentCategoryIndex = data[0].id;\n });\n\n // Initialize global tags.\n var tags = TagList.query();\n tags.$promise.then(function (data) {\n if (data.length > 0) {\n\n Data.tags = data;\n Data.currentTagIndex = data[0].id;\n }\n });\n\n // Initialize global content types\n var types = ContentTypeList.query();\n types.$promise.then(function (data) {\n if (data.length > 0) {\n Data.contentTypes = data;\n Data.currentContentIndex = data[0].id;\n }\n\n });\n\n updateAreaContext(id);\n\n }\n\n }", "function setContextURL(url){\n if(!window.contextFrame) {\n initContextManager();\n }\n\t//alert(url);\n\tcontextFrame.location.href=url;\n}", "function setContextURL(url){\n if(!window.contextFrame) {\n initContextManager();\n }\n\t//alert(url);\n\tcontextFrame.location.href=url;\n}", "constructor(props: any, context: any) {\n super(props, context);\n this.back = this.back.bind(this);\n this.renderHeader = this.renderHeader.bind(this);\n this.renderScene = this.renderScene.bind(this);\n }", "_unsetAndRelinkContext(contextKey) {\n const contextKeys = Array.isArray(contextKey) ? contextKey : [contextKey];\n\n contextKeys.forEach(key => {\n delete this._lastReceivedContext[key];\n delete this._providingContext[key];\n });\n\n const closestDbuiParent = this.closestDbuiParent;\n const valuesToSet = !closestDbuiParent ? undefined : closestDbuiParent._getContext(contextKeys);\n\n const newContext = contextKeys.reduce((acc, key) => {\n acc[key] = (valuesToSet || {})[key];\n return acc;\n }, {});\n\n this._propagateContextChanged(newContext);\n }", "redirect(context,redirect){\n\t\tcontext.$router.push({ name: redirect });\n\t}", "getChildContext() {\n return {\n defaultTheme: this.props.defaultTheme,\n themeSwitcher: this,\n themes: [ ...this.state.themeOptions ],\n currentTheme: this.state.currentTheme\n };\n }", "constructor(props, context) {\n super(props, context);\n\n //this._onPushRoute = this.props.onNavigationChange(val);\n this._onPopRoute = this.props.onNavigationChange.bind(null, 'pop');\n this._renderScene = this._renderScene.bind(this);\n }", "initialize(config) {\n this.context = config.context;\n }", "initialize(config) {\n this.context = config.context;\n }", "initialize(config) {\n this.context = config.context;\n }", "initialize(config) {\n this.context = config.context;\n }", "initialize(config) {\n this.context = config.context;\n }", "initialize(config) {\n this.context = config.context;\n }", "constructor(props, context) {\n super(props, context);\n this.redirectToAddCoursePage = this.redirectToAddCoursePage.bind(this);\n this.deleteCourse = this.deleteCourse.bind(this);\n }", "function AppRouter(props) {\n // storing theme object in localStorage()\n useEffect(() => {\n const storageTheme = localStorage.getItem(MUI_THEME);\n if (storageTheme !== props.mui.theme.palette.type) {\n storageTheme === \"light\"\n ? props.changeTheme(lightTheme)\n : props.changeTheme(darkTheme);\n }\n }, []);\n\n return (\n // Rapping of ThemeProvider & Paper is mandotory for theming architecture\n <ThemeProvider theme={props.mui.theme}>\n <Paper square elevation={0} className={props.mui.style}>\n <Router>\n <Switch>\n <Route path=\"/\" exact component={Home} />\n <Route path=\"/about\" exact component={AboutUs} />\n <Route path=\"/contact\" exact component={ContactUs} />\n {/*\n <RouteGuard path=\"/main/:user\" exact component={Dashboard} />\n <Route path=\"/signin\" exact component={SignIn} />\n <Route path=\"/signup\" exact component={SignUp} />\n <Route path=\"/logout\" exact component={SignOut} />\n */}\n <Route path=\"/401\" exact component={HandleError} />\n <Route path=\"/404\" exact component={HandleError} />\n <Redirect to=\"/404\" />\n </Switch>\n </Router>\n </Paper>\n </ThemeProvider>\n );\n}", "render() {\n\n return (\n \n < NotefulContext.Provider value={{\n folders: this.state.folders,\n notes: this.state.notes,\n }}>\n <div className=\"app\">\n {/* <Switch> */}\n <Route path=\"/\" component={Header} />\n <Route exact path=\"/\" component={NavFolderList} />\n <Route exact path=\"/\" component={AllFolderNotes} />\n \n {/* <Route path=\"/folder/:folderId\" component={Header} /> */}\n <Route path=\"/folder/:folderId\" component={NavFolderList} />\n <Route path=\"/folder/:folderId\" render={(props) => < FolderNotes match={props.match} />} />\n\n <Route path=\"/note/:noteId\" render={(props) => < Note linkInfo={props} />} />\n {/* <Route component={PageNotFound} /> */}\n {/* // </Switch> */}\n </div>\n </NotefulContext.Provider>\n \n )\n }", "constructor(props: any, context: any) {\n super(props, context);\n\n this._onPushRoute = this.props.onNavigationChange.bind(null, 'push');\n this.onPopRoute = this.props.onNavigationChange.bind(null, 'pop');\n\n this._renderScene = this._renderScene.bind(this);\n }", "render() {\n return (\n <ThemeContext.Consumer>\n {(color) => <div>{color}</div>}\n </ThemeContext.Consumer>\n );\n }", "getChildContext() {\n let newContext = {\n muiTheme: this.props.properties.theme.palette,\n kmw: this.state.kmw\n };\n\n return newContext;\n }", "function App() {\n // Use state for checking authentication and managing URL\n const [token, setToken] = useState(undefined);\n const [url, setUrl] = useState(undefined);\n\n // function to handle URL and Token for entire app\n const handleLogIn = ( newUrl, newToken ) => {\n setUrl(newUrl);\n setToken(newToken);\n };\n\n return (\n <div className=\"App\">\n <AccessContext.Provider value={{ url, token, handleLogIn }}>\n {\n ( token === undefined ) ? <Login /> : <Mainpage /> \n }\n </AccessContext.Provider>\n </div>\n );\n}", "render() {\n console.log('..inside Dashbard', this.context);\n //destructure those properties frm the context\n const { isLightTheme, light, dark } = this.context;\n const theme = isLightTheme? light : dark;\n \n return (\n <>\n <aside style = {{background: theme.ui, color: theme.bg}} className=\"opeeny-aside\">\n <div className=\"control-bar\">\n <div className=\"text-center\">\n <span className=\"menu-toggle\">\n <i className=\"chart\"></i>\n <i className=\"chart\"></i>\n <i className=\"chart\"></i>\n </span>\n </div> \n <p className=\"copyright\">\n <Link to = \"/\">Green Miles 2020</Link> - &copy; We deliver safely<i className=\"fa fa-heart\"></i> \n </p>\n </div>\n\n\n <div style = {{background: theme.ui, color: theme.bg}} className=\"slide-menu-container\">\n <div className=\"slide-menu menu-opend navbar-scrolled opeeny-menu-style-2\">\n <div className=\"opeeny-user-info\">\n <ul className=\"social-media list-unstyled text-center opeeny-links\">\n <li className = \"first\"><Link to=\"/https\" className=\"facebook\" ><i className=\"fab fa-facebook\"></i></Link></li>\n <li className = \"first\"><Link to=\"https\" className=\"twitter\" ><i className=\"fab fa-twitter-square\"></i></Link></li>\n <li className = \"first\"><Link to=\"#!\" className=\"google-plus\"><i className=\"fab fa-google-plus\"></i></Link></li>\n <li className = \"first\"><Link to=\"https\" className=\"linkedin\" ><i className=\"fab fa-linkedin\"></i></Link></li>\n <li className = \"first\"><Link to=\"http\" className=\"behance\"><i className=\"fab fa-skype\"></i></Link></li>\n </ul>\n\n <div className=\"opeeny-img-box\">\n <div id = \"profile\" className=\"opeeny-img\">\n <i class=\"fas fa-user\"></i>\n </div>\n </div>\n </div>\n <div className=\"nav\">\n <ul className=\"list-unstyled opeeny-links\">\n <li className=\"active\">\n <Link to = \"/\"><i className=\"fa fa-home\"></i>Dashboard</Link>\n </li>\n <li className = \"first\">\n <Link to = \"/suppliers\"><i className=\"fa fa-laptop\"></i>view suppliers</Link>\n </li>\n <li className = \"first\">\n <Link to = \"/loaders\"><i className=\"fa fa-laptop\"></i>view suppliers</Link>\n </li>\n <li className = \"first\">\n <Link to = \"/suppliers\"><i className=\"fa fa-laptop\"></i>view suppliers</Link>\n </li>\n <li className = \"first\">\n <Link to = \"/suppliers\"><i className=\"fa fa-laptop\"></i>view suppliers</Link>\n </li>\n <li className = \"first\">\n <Link to = \"/suppliers\"><i class=\"fas fa-question-circle\"></i>Help!</Link>\n </li>\n <li className = \"first\">\n <Link to = \"/suppliers\"><i className=\"fas fa-cog\"></i>Settings</Link>\n </li>\n \n </ul>\n \n </div>\n </div>\n \n </div>\n\n </aside> \n <Logout />\n <ChangeTheme/>\n <main style = {{background: theme.ui, color: theme.bg}} className=\"main-page-content\">\n \n <section style = {{background: theme.ui, color: theme.bg}} className=\"full-page\" id=\"home\">\n <div className=\"home overlay-container\">\n <div className=\"overlay\">\n \n <div className=\"section-intro opeeny-container display-table\">\n <div className=\"display-table-cell\">\n <h3 className=\"opeeny-hello\">HI, IAM</h3>\n <h1 className=\"opeeny\">GREEN MILE DASHBOARD</h1>\n <h3 className=\"opeeny-work-description\">&nbsp;<span className=\"opeeny-work\"></span></h3>\n </div>\n </div>\n </div>\n </div>\n </section>\n </main>\n <Footer/>\n </>\n );\n \n }", "function App() {\n return (\n <Router>\n <Route exact path=\"/\" component={Home} />\n {/* <Route exact path=\"/contato\" component={Contato} /> */}\n <GlobalStyles/>\n </Router>\n );\n}", "function getContextValue(contextValue) {\n if (contextValue === void 0) { contextValue = {}; }\n var value = __assign({}, contextValue);\n var hasWindow = typeof window !== 'undefined';\n if (hasWindow) {\n if (!value.history) {\n value.history = adaptWindowHistory(window.history);\n }\n if (!value.location) {\n value.location = window.location;\n }\n }\n return value;\n}", "initialize(config) {\r\n this.context = config.context;\r\n }", "function Color({ colors }) {\n\n const { color } = useParams();\n\n if (!(colors.includes(color))) {\n return <Redirect to=\"/\" />;\n };\n\n return (\n <div style={{ backgroundColor: color }}>\n <p>{color}</p>\n <Link to=\"/\">Back</Link>\n </div>\n )\n}", "componentWillMount() {\n if (!this.props.authenticated) {\n this.context.router.push('/');\n }\n }", "componentWillMount() {\n if (!this.props.authenticated) {\n this.context.router.push('/');\n }\n }", "function middleware(req, res, next) {\n req.context = createNamespace('context');\n req.context.run(() => next());\n}", "initHash() {\n const h = location.hash;\n if (h !== '') {\n this.redirectHash = h;\n }\n\n if (!this._embedded) {\n location.hash = '';\n }\n\n // Backwards compatibility for global uses of ReUI\n window.ReUI = this.ReUI;\n window.ReUI.context.history = this.context.history;\n }", "render() {\n // console.log(this.context);\n\n return (\n <ThemeContext.Consumer>{(context) => {\n const { isLightTheme, light, dark, toggleTheme } = context;\n const theme = isLightTheme ? light : dark;\n\n return (\n <div >\n <div style={{display: 'flex', flexDirection: 'row'}}>\n <div className=\"q-divBorder\" style={{ background: light.ui }}>\n <div className=\"divBox\" style={{ background: light.bg }}>\n Light\n </div>\n </div>\n <div className=\"q-divBorder\" style={{ background: dark.ui }}>\n <div className=\"divBox\" style={{ background: dark.bg }}>\n Dark\n </div>\n </div>\n </div>\n <div className=\"divBorder\" style={{ background: theme.ui, color: theme.syntax }}>\n <button className=\"divBox\"\n onClick={toggleTheme}\n style={{ background: theme.bg }}>\n Toggle Theme\n </button>\n </div>\n </div>\n\n )\n }}\n </ThemeContext.Consumer>\n\n )\n\n // <ThemeContext.Consumer>\n // {({theme, toggleTheme}) => (\n // <button\n // onClick={toggleTheme}\n // style={{backgroundColor: theme.background}}>\n // Toggle Theme\n // </button>\n // )}\n // </ThemeContext.Consumer>\n\n }", "componentWillUpdate(nextProps){\n if(!nextProps.authenticated){\n this.context.router.push('/');\n }\n }", "render() {\n // const { user } = this.context;\n return (\n <themeContext.Consumer>\n {({ bg }) =>\n console.log(bg) || (\n <userContext.Consumer>\n {({ user }) => (\n <ul style={{ backgroundColor: bg }}>\n <li>Full name: {user.name}</li>\n <li>age: {user.age}</li>\n <li>job: {user.job}</li>\n </ul>\n )}\n </userContext.Consumer>\n )\n }\n </themeContext.Consumer>\n );\n }", "bindCorrectContext() {\n this.listenForServices = this.listenForServices.bind(this);\n this.onAuthorizationCompleted = this.onAuthorizationCompleted.bind(this);\n }", "addContext (context) {\n this.context = context\n return this\n }", "function LContext() { }", "function LContext() { }", "function LContext(){}", "function App() {\n const themeContext = useContext(ThemeContext);\n\n return (\n <ThemeProvider theme={themeContext.themeMode === 'dark' ? darkTheme : lightTheme}>\n <Layout>\n <Switch>\n <Route exact path=\"/\">\n <Home />\n </Route>\n <Route exact path=\"/portfolio\">\n <Portfolio />\n </Route>\n <Route path=\"/portfolio/:slug\">\n <SingleProject />\n </Route>\n <Route path=\"/about\">\n <About />\n </Route>\n <Route path=\"/contact\">\n <Contact />\n </Route>\n <Redirect to='/' />\n </Switch>\n </Layout>\n </ThemeProvider>\n );\n}", "function App() {\n const [userData, setUserData] = useState({\n token: undefined,\n user: undefined,\n });\n const [storage, setStorage] = useState(localStorage.getItem(\"auth-token\"));\n\n useEffect(() => {\n // setDisplayArticles(storage);\n }, [storage]);\n function handleLogout() {\n localStorage.setItem(\"auth-token\", null);\n setStorage(null);\n }\n\n const value = { userData, setUserData };\n\n return (\n <Router>\n <NavBar handleLogout={handleLogout} storage={storage} />\n <UserContext.Provider value={value}>\n <div id=\"page-body\">\n <Switch>\n <Route path=\"/\" exact>\n <Home></Home>\n </Route>\n <Route path=\"/register\" component={Register} />\n <Route path=\"/login\">\n <Login setStorage={setStorage}></Login>\n </Route>\n <Route path=\"/articles\">\n <Articles storage={storage} />\n </Route>\n\n <Route path=\"/new-article\">\n <NewArticle />\n </Route>\n {/* <Route path=\"/article/:id\" component={Article} exact /> */}\n </Switch>\n </div>\n </UserContext.Provider>\n </Router>\n );\n}", "createContext() {\n const context = new RenderContext({\n renderers: this.renderers,\n theme: this.theme,\n });\n\n return context;\n }", "function useStatesConfigContext() {\n return react_1.useContext(exports.StatesConfigContext);\n}", "createContext(req, res) {\n const context = new Context(this, req, res);\n context.request = context.req;\n context.response = context.res;\n\n context.app = this;\n context.originalUrl = req.url;\n context.cookies = new Cookies(req, res, {\n keys: this.keys,\n secure: ''\n });\n\n context.ip = req.socket.remoteAddress || '';\n\n let query = Url.parse(req.url, true).query;\n let saftQuery = query;\n for (let param in query) {\n saftQuery[param] = XssFilters.uriPathInUnQuotedAttr(query[param]);\n }\n context.query = saftQuery;\n\n context.log = this.logger;\n\n context.path = Url.parse(req.url, true).pathname;\n\n return context;\n }", "setCurrentContext(context) {\n if (this.getContextByName(context.name)) {\n this.currentContextName = context.name;\n } else {\n this.addContext(context);\n this.currentContextName = context.name;\n }\n debug('current context has been set:', context.name);\n context.current = 'true'; // eslint-disable-line\n }", "function LContext() {}", "function LContext() {}", "function LContext() {}", "clearContext(){\n this.context = null;\n this.context = new Map();\n }", "render() {\n return (\n <div>\n I am Comp #3 - Accessing Context using STATIC variable - {this.context}\n </div>\n )\n }", "function setScenarioContext(context){\n\t\tm_scenarioContext = context;\n\t\t\n\t\tm_scenarioContext.createScenarioPlay();\n\t\t\n\t\t// Notify the view that the context can be used\n\t\tscenarioView.initiateScenarioDisplay(context);\n\t}", "componentWillUpdate(nextProps) {\n if (!nextProps.authenticated) {\n this.context.router.push('/')\n }\n }", "function App() {\n\n\n const [newUser, setNewUser] = useState(false);\n const [user, setUser] = useState({\n isSignedIn: false,\n name: '',\n email: '',\n photo: '',\n password: '',\n });\n\n\n\n return (\n\n <UserContext.Provider value={[newUser, setNewUser, user, setUser]}>\n <Router>\n <Header></Header>\n <Switch>\n <Route path=\"/home\">\n <Home></Home>\n </Route>\n <Route exact path=\"/\">\n <Home />\n </Route>\n <Route path=\"/blog\">\n <Blog />\n </Route>\n <Route path=\"/sundorban\">\n <Sundorban />\n </Route>\n <Route path=\"/sreemongol\">\n <Sreemongol />\n </Route>\n <Route path=\"/sajek\">\n <Sajek />\n </Route>\n <Route path=\"/login\">\n <Login></Login>\n </Route>\n <PrivateRoute path=\"/hotelRoom\">\n <HotelRoom />\n </PrivateRoute>\n <Route path=\"*\">\n <NotFound />\n </Route>\n </Switch>\n </Router>\n </UserContext.Provider>\n\n\n );\n}", "handleContextRestored() {\n this.renderer.runners.contextChange.run(this.gl);\n }", "function App() {\n const authData = useContext(AuthContext);\n console.log(\"wat zijn de authData\", authData);\n\n return (\n // <ItemProvider>\n <>\n\n <Nav />\n <UserPortal />\n\n <Profile />\n {/*<Switch>*/}\n {/*<Route path='/add-item'>*/}\n <AddPost />\n {/*</Route>*/}\n <ItemOvervieuw />\n <PostOvervieuw />\n <MessageOvervieuw />\n\n\n {/*<ItemsList />*/}\n\n\n\n\n {/*</Switch>*/}\n {/* eslint-disable-next-line react/jsx-no-undef */}\n <Footer />\n\n\n {/*</ItemProvider>*/}\n</>\n );\n}", "function updateContext(values) {\n setContext({\n ...context,\n ...values\n })\n }", "function shiftContext() {\n this.contexts.shift();\n this.setContext(this.contexts[0]);\n}", "function getContext(name = 'defaultRouter') {\n return contextFactory[name];\n}", "render(){\n return(\n\n // Routing works for all the sub components in the BrowserRouter component\n <BrowserRouter>\n\n {/* <Layout> handles the toolbar and the sidedrawers.\n props sent to component - \n username: taken from the redux state\n */}\n <Layout username = {this.props.username} >\n\n {/* Only one of the routes is selected at a time declared within <Switch> */}\n <Switch>\n { /*if user is authenticated then go to the home page otherwise to the login page when \"<baseurl>/\" is typed in url bar*/\n this.props.isAuthenticated ?\n <Route path =\"/\" exact render = {() => (<Redirect to={'/' + this.props.username + \"/home\"} />)} />\n :\n <Route path =\"/\" exact render = {() => (<Redirect to='/login' />)} />\n }\n \n { /* \n following proxyhome concept is used because the <Home> does no rerender otherwise if \n we search for a new user in the toolbar search box\n */}\n <Redirect exact from=\"/:urlUsername/proxyhome\" to='/:urlUsername/home' />\n <Route path= '/:urlUsername/home' exact component = {Home} />\n \n <Route path='/aboutapp' exact component = {AboutApp} />\n <Route path='/signup' exact component = {SignUp} />\n { /* \n if user is authenticated then go to home page otherwise go to login page when user \n types <baseurl>/login in url bar \n */\n this.props.isAuthenticated ?\n <Route path='/login' exact render = {() => (<Redirect to={'/' + this.props.username + \"/home\"} />)} />\n :\n <Route path='/login' exact component = {Auth} />\n }\n \n <Route path='/logout' exact component = {Logout} /> \n\n {/* All the other unmatched urls request will be given response of 404 page not found by the below route */}\n <Route \n render = {() => \n <div className = \"PageNotFound\">\n Error 404: Page not found\n </div> \n } \n />\n </Switch>\n </Layout> \n </BrowserRouter>\n );\n }", "withContext(context, cb) {\n this.context |= context;\n const ret = cb();\n this.context ^= context;\n return ret;\n }", "withContext(context, cb) {\n this.context |= context;\n const ret = cb();\n this.context ^= context;\n return ret;\n }", "render() {\n return (\n <button style={{background: this.context.color}}>\n {this.props.children}\n </button>\n );\n }", "constructor(contextReal) {\n super();\n this.context = contextReal;\n }" ]
[ "0.6162589", "0.6150867", "0.6134998", "0.60352737", "0.59677476", "0.59649396", "0.5964337", "0.5793643", "0.5721092", "0.57200694", "0.5707615", "0.5684546", "0.56827545", "0.5636593", "0.55914545", "0.55739456", "0.55663544", "0.55651283", "0.5561633", "0.5561078", "0.5529429", "0.5521697", "0.55159897", "0.55111474", "0.5496757", "0.54733646", "0.54198253", "0.5415007", "0.5389031", "0.5384933", "0.53824663", "0.5368234", "0.5364748", "0.53591037", "0.53572476", "0.5347422", "0.5339688", "0.5339348", "0.5328119", "0.53250796", "0.53250796", "0.52977717", "0.5297424", "0.52798676", "0.52798015", "0.52685153", "0.52495646", "0.52495646", "0.52495646", "0.52495646", "0.52495646", "0.52495646", "0.524455", "0.52390057", "0.5232953", "0.5232168", "0.5232135", "0.52181405", "0.521811", "0.5215159", "0.5214323", "0.52130675", "0.5210604", "0.52081", "0.52022386", "0.52022386", "0.5199051", "0.5183797", "0.517735", "0.51741576", "0.51731914", "0.51685214", "0.5153264", "0.51430476", "0.51430476", "0.51406246", "0.5138801", "0.51361626", "0.5130096", "0.51252633", "0.51072454", "0.5107153", "0.51067394", "0.51067394", "0.51067394", "0.5100991", "0.50959057", "0.5095135", "0.50946605", "0.5094172", "0.50854725", "0.5083092", "0.5080553", "0.5079113", "0.50776386", "0.50735027", "0.5069442", "0.5069442", "0.5068114", "0.50670785" ]
0.5954944
7
listar los materiales x tipo de caja y cantidad
function listarMaterialesCaja(id_tipo_caja) { var cantidad = $("#cantidad").val(); cantidad = (cantidad=='')? 0: cantidad; $.ajax({ url: $.PATH + "almacen?function=listMaterialesCaja", data: {id_tipo_caja: id_tipo_caja}, dataType: "json", cache: false, type: "get", success: function(response) { var html = ""; if (response.data != null) { $.flgMateriales = true; // para validar envío var response = response.data; for (var i = 0; i < response.length; i++) { var color = ''; if (response[i].stock_requerido == '1') { if (response[i].stock <= response[i].stock_minimo) { color = '#FAAC58'; } } html += "<tr style='background-color: "+color+"'>"; html += "<td>"+response[i].codigo+"</td>"; html += "<td>"+response[i].nombre+"</td>"; html += "<td>"+response[i].stock+"</td>"; html += "<td>"+response[i].unidad_medida+"</td>"; var valor = 0; if (response[i].calcular == '1') { valor = parseFloat(cantidad)*parseFloat(response[i].multiplo); } else { valor = response[i].multiplo; } html += "<td><input name='id_materiales[]' type='hidden' value='"+response[i].id+"'>"; html += "<input name='materiales[]' type='text' class='decimal' style='width: 50px;' value='"+valor+"'></td>"; html += "<td>"+response[i].tipo+"</td>"; html += "</tr>"; } } else { $.flgMateriales = false; // para validar envío } $("#tbl-materiales tbody").html(html); $("#tbl-materiales tbody").css({"color":"#000"}); $(".decimal").numeric("."); $(".decimal").blur(function (e) { var v = $(this).val().trim(); v = (v == "")?0:parseFloat(v); var cantidad = $("#cantidad").val().trim(); cantidad = (cantidad == "")?0:parseFloat(cantidad); if (v == 0 && cantidad > 0) { //$(this).focus(); $.flgEntrega = false; $(this).css({"background-color":"#FF0000"}); } else { $.flgEntrega = true; $(this).css({"background-color":"#FFFFFF"}); } }); }, error: function(response) { console.log(response); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function genera_parametros(){\r\n\tx_0=103;\r\n\tm=1001;\r\n\tprimos.forEach(a=>{\r\n\t\tprimos.forEach(c=>{\r\n\t\t\tnum_ale = generador_mixto(a,c,x_0,m)\r\n\t\t\tif(num_ale.length == m){ //tambien deberia revisar si hay numeros repetidos\r\n\t\t\t\timprimir_configuracion_parametros_a_pantalla\r\n\t\t\t}\r\n\t\t});\r\n\t});\r\n}", "function ColunaMatriz(coluna, tabuleiro) {\n var x = new Array(MAX);\n for(var i = 0; i < MAX; i++){\n x[i]= tabuleiro[i][coluna];\n }\n return x;\n}// fim do colunaMatriz******************************************************************", "function montaValorMes () {\r\n\t\t\t// laco de despesas\r\n\t\t\tfor (var x in $scope.despesas) {\r\n\t\t\t\t// separo a despesa\r\n\t\t\t\tvar despesa = $scope.despesas[x];\r\n\t\t\t\t// crio um atributo pres(array) na despesa\r\n\t\t\t\tdespesa.pres = [];\r\n\r\n\t\t\t\t// laco de meses até 8\r\n\t\t\t\t// for (var m=0; m<8; m++) {\r\n\t\t\t\tfor (var m=0; m<$scope.tlmeses; m++) {\r\n\t\t\t\t\tvar day = moment().add(m, \"M\").date(); // dia atual + 1\r\n\t\t\t\t\tvar month = moment().add(m, \"M\").month(); // mes atual + 1\r\n\t\t\t\t\tvar year = moment().add(m, \"M\").year(); // ano atual + 1\r\n\t\t\t\t\tvar data = ''; // variavel data\r\n\r\n\t\t\t\t\t// laco de prestacoes da despesa\r\n\t\t\t\t\tfor (var p=0; p<despesa.prestacoes; p++) {\r\n\t\t\t\t\t\tvar dia = moment(despesa.datavencimento).add(p, \"M\").date(); // dia da data despesa + index\r\n\t\t\t\t\t\tvar mes = moment(despesa.datavencimento).add(p, \"M\").month(); // mes data despesa + index\r\n\t\t\t\t\t\tvar ano = moment(despesa.datavencimento).add(p, \"M\").year(); // ano data despesa + index\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// caso o mes e ano da despesa seja = ao mes e ano atual \r\n\t\t\t\t\t\tif (mes === month && ano === year) {\r\n\t\t\t\t\t\t\tdata = {\"data\": mes+\"/\"+ano, \"valor\":despesa.valor};\r\n\t\t\t\t\t\t\t// pegando a prestação atual\r\n\t\t\t\t\t\t\tif (m === 0) { // m = o ( mes atual )\r\n\t\t\t\t\t\t\t\tdespesa.prestacao = (p+1)+\"/\"+despesa.prestacoes;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (!despesa.prestacao) {\r\n\t\t\t\t\t\t// se ano = atual mas mes menor ou ano menor\r\n\t\t\t\t\t\tif ( (ano === year && mes < month) || (ano < year) ) {\r\n\t\t\t\t\t\t\tdespesa.prestacao = despesa.prestacoes+\"/\"+despesa.prestacoes;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tdespesa.prestacao = \"0/\"+despesa.prestacoes;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif ( data === '' ) {\r\n\t\t\t\t\t\tdespesa.pres.push({\"data\": \"00/0000\", \"valor\":\"xxxx\", \"color\":\"background:#f0f5f5; color:#ccc;\", \"icon\":\"fa-trophyx\"});\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tdespesa.pres.push(data);\r\n\t\t\t\t\t\t$scope.totais[m].valor = $scope.totais[m].valor + parseInt(despesa.valor);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif($scope.totais[m-1] != undefined && $scope.totais[m].valor < $scope.totais[m-1].valor) {\r\n\t\t\t\t\t\t\t$scope.totais[m].icon = \"fa-arrow-down\";\r\n\t\t\t\t\t\t}else if($scope.totais[m-1] != undefined && $scope.totais[m].valor > $scope.totais[m-1].valor) {\r\n\t\t\t\t\t\t\t$scope.totais[m].icon = \"fa-arrow-up\";\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t$scope.totais[m].icon = \"fa-arrow-right\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$scope.totalgeral = $scope.totalgeral + parseFloat(despesa.valor);\r\n\t\t\t}\r\n\t\t}", "function obtenerArregloFichas(item) {\r\n var arreglo = [];\r\n for(var x = 0; x < $scope.tam.fila;x++){\r\n for(var y = 0; y< $scope.tam.col;y++){\r\n if($scope.matrizLogica[x][y]==item){\r\n arreglo.push(x + \",\" + y)\r\n }\r\n }\r\n }\r\n return arreglo;\r\n }", "function resolveMatriz(){\n\tvar matriz = \n\t\t\t\t[[0,0,0,0,0,0,0,0,0],\n\t\t\t\t[0,0,0,0,0,0,0,0,0],\n\t\t\t\t[0,0,0,0,0,0,0,0,0],\n\t\t\t\t[0,0,0,0,0,0,0,0,0],\n\t\t\t\t[0,0,0,0,0,0,0,0,0],\n\t\t\t\t[0,0,0,0,0,0,0,0,0],\n\t\t\t\t[0,0,0,0,0,0,0,0,0],\n\t\t\t\t[0,0,0,0,0,0,0,0,0],\n\t\t\t\t[0,0,0,0,0,0,0,0,0]];\n\n\tvar nivel = parseInt($(\"#nivel\").val());\n\tvar k = parseInt($(\"#k\").val());\n\tvar i,j;\n\n\tswitch(nivel){\n\t\tcase 1: //fácil\n\t\t\tif (k == 1)\n\t\t\t\tmatriz = \n\t\t\t\t\t[[1,9,5,4,6,7,2,3,8],\n\t\t\t\t\t[4,2,8,3,5,1,7,9,6],\n\t\t\t\t\t[6,3,7,9,2,8,1,4,5],\n\t\t\t\t\t[7,1,6,8,9,4,5,2,3],\n\t\t\t\t\t[9,4,3,5,1,2,6,8,7],\n\t\t\t\t\t[8,5,2,7,3,6,9,1,4],\n\t\t\t\t\t[2,7,4,1,8,5,3,6,9],\n\t\t\t\t\t[5,6,9,2,4,3,8,7,1],\n\t\t\t\t\t[3,8,1,6,7,9,4,5,2]];\n\t\t\tif (k == 2)\n\t\t\t\tmatriz =\n\t\t\t\t\t[[8,5,3,7,6,9,2,4,1],\n\t\t\t\t\t[7,4,9,2,8,1,3,6,5],\n\t\t\t\t\t[6,2,1,5,3,4,8,7,9],\n\t\t\t\t\t[9,8,2,6,4,3,5,1,7],\n\t\t\t\t\t[4,6,7,1,5,2,9,3,8],\n\t\t\t\t\t[3,1,5,8,9,7,6,2,4],\n\t\t\t\t\t[2,9,4,3,1,5,7,8,6],\n\t\t\t\t\t[5,7,6,4,2,8,1,9,3],\n\t\t\t\t\t[1,3,8,9,7,6,4,5,2]];\n\t\t\tif (k == 3)\n\t\t\t\tmatriz =\n\t\t\t\t\t[[9,1,4,2,3,8,6,5,7],\n\t\t\t\t\t[2,5,8,6,1,7,4,3,9],\n\t\t\t\t\t[3,7,6,5,4,9,2,1,8],\n\t\t\t\t\t[5,8,9,3,2,1,7,6,4],\n\t\t\t\t\t[6,2,7,9,5,4,3,8,1],\n\t\t\t\t\t[1,4,3,7,8,6,5,9,2],\n\t\t\t\t\t[8,6,2,1,7,3,9,4,5],\n\t\t\t\t\t[4,9,5,8,6,2,1,7,3],\n\t\t\t\t\t[7,3,1,4,9,5,8,2,6]];\n\t\t\tif (k == 4)\n\t\t\t\tmatriz =\n\t\t\t\t\t[[5,3,6,8,1,2,4,7,9],\n\t\t\t\t\t[1,7,4,6,9,5,8,3,2],\n\t\t\t\t\t[9,2,8,3,7,4,6,5,1],\n\t\t\t\t\t[7,4,1,9,5,6,2,8,3],\n\t\t\t\t\t[3,9,2,7,8,1,5,6,4],\n\t\t\t\t\t[6,8,5,4,2,3,1,9,7],\n\t\t\t\t\t[2,1,9,5,6,7,3,4,8],\n\t\t\t\t\t[8,5,3,1,4,9,7,2,6],\n\t\t\t\t\t[4,6,7,2,3,8,9,1,5]];\n\t\t\tif (k == 5)\n\t\t\t\tmatriz =\n\t\t\t\t\t[[5,3,4,6,2,7,9,8,1],\n\t\t\t\t\t[9,6,2,1,5,8,4,3,7],\n\t\t\t\t\t[7,8,1,9,3,4,2,6,5],\n\t\t\t\t\t[6,4,5,7,8,3,1,2,9],\n\t\t\t\t\t[3,1,7,2,6,9,8,5,4],\n\t\t\t\t\t[8,2,9,4,1,5,3,7,6],\n\t\t\t\t\t[4,9,3,5,7,2,6,1,8],\n\t\t\t\t\t[1,5,8,3,9,6,7,4,2],\n\t\t\t\t\t[2,7,6,8,4,1,5,9,3]];\n\t\t\tif (k == 6)\n\t\t\t\tmatriz =\n\t\t\t\t\t[[2,1,4,7,8,6,3,5,9],\n\t\t\t\t\t[7,9,8,3,4,5,2,1,6],\n\t\t\t\t\t[6,3,5,2,9,1,4,7,8],\n\t\t\t\t\t[1,5,3,8,6,2,9,4,7],\n\t\t\t\t\t[4,2,7,9,1,3,8,6,5],\n\t\t\t\t\t[8,6,9,4,5,7,1,3,2],\n\t\t\t\t\t[9,7,6,1,2,4,5,8,3],\n\t\t\t\t\t[5,4,2,6,3,8,7,9,1],\n\t\t\t\t\t[3,8,1,5,7,9,6,2,4]];\n\t\t\tif (k == 7)\n\t\t\t\tmatriz =\n\t\t\t\t\t[[2,3,1,8,5,7,6,9,4],\n\t\t\t\t\t[6,8,7,1,9,4,2,3,5],\n\t\t\t\t\t[9,4,5,6,3,2,1,8,7],\n\t\t\t\t\t[8,2,9,4,6,1,7,5,3],\n\t\t\t\t\t[1,6,4,5,7,3,8,2,9],\n\t\t\t\t\t[5,7,3,2,8,9,4,1,6],\n\t\t\t\t\t[4,9,6,3,1,8,5,7,2],\n\t\t\t\t\t[3,5,8,7,2,6,9,4,1],\n\t\t\t\t\t[7,1,2,9,4,5,3,6,8]];\n\t\t\tif (k == 8)\n\t\t\t\tmatriz =\n\t\t\t\t\t[[8,7,2,9,4,1,5,6,3],\n\t\t\t\t\t[6,5,1,3,7,8,9,4,2],\n\t\t\t\t\t[3,9,4,2,5,6,7,8,1],\n\t\t\t\t\t[2,3,5,1,8,7,4,9,6],\n\t\t\t\t\t[9,6,8,4,3,5,1,2,7],\n\t\t\t\t\t[4,1,7,6,2,9,8,3,5],\n\t\t\t\t\t[5,8,9,7,6,3,2,1,4],\n\t\t\t\t\t[7,4,3,8,1,2,6,5,9],\n\t\t\t\t\t[1,2,6,5,9,4,3,7,8]];\n\t\t\tif (k == 9)\n\t\t\t\tmatriz =\n\t\t\t\t\t[[6,7,1,3,8,4,2,9,5],\n\t\t\t\t\t[9,5,4,6,2,1,7,3,8],\n\t\t\t\t\t[8,2,3,9,5,7,1,6,4],\n\t\t\t\t\t[7,4,6,5,3,2,9,8,1],\n\t\t\t\t\t[2,9,5,1,4,8,6,7,3],\n\t\t\t\t\t[3,1,8,7,9,6,5,4,2],\n\t\t\t\t\t[1,3,9,8,6,5,4,2,7],\n\t\t\t\t\t[4,8,7,2,1,9,3,5,6],\n\t\t\t\t\t[5,6,2,4,7,3,8,1,9]];\n\t\t\tif (k == 10)\n\t\t\t\tmatriz =\n\t\t\t\t\t[[2,1,9,8,7,5,6,3,4],\n\t\t\t\t\t[3,6,4,1,9,2,8,7,5],\n\t\t\t\t\t[7,8,5,6,3,4,9,2,1],\n\t\t\t\t\t[6,2,3,5,4,9,1,8,7],\n\t\t\t\t\t[8,4,1,2,6,7,5,9,3],\n\t\t\t\t\t[9,5,7,3,8,1,4,6,2],\n\t\t\t\t\t[5,7,8,4,2,6,3,1,9],\n\t\t\t\t\t[1,9,6,7,5,3,2,4,8],\n\t\t\t\t\t[4,3,2,9,1,8,7,5,6]];\n\t\t\tbreak;\n\t\tcase 2: //médio\n\t\t\tif (k == 1)\n\t\t\t\tmatriz =\n\t\t\t\t\t[[8,5,9,7,3,6,1,2,4],\n\t\t\t\t\t[6,2,4,9,1,5,7,3,8],\n\t\t\t\t\t[3,1,7,4,2,8,9,5,6],\n\t\t\t\t\t[4,9,5,2,8,1,3,6,7],\n\t\t\t\t\t[7,6,3,5,4,9,2,8,1],\n\t\t\t\t\t[1,8,2,3,6,7,5,4,9],\n\t\t\t\t\t[9,3,6,8,7,2,4,1,5],\n\t\t\t\t\t[5,4,8,1,9,3,6,7,2],\n\t\t\t\t\t[2,7,1,6,5,4,8,9,3]];\n\t\t\tif (k == 2)\n\t\t\t\tmatriz =\n\t\t\t\t\t[[5,1,7,9,2,8,3,6,4],\n\t\t\t\t\t[6,8,4,3,5,1,2,7,9],\n\t\t\t\t\t[9,2,3,4,7,6,5,1,8],\n\t\t\t\t\t[8,9,5,2,1,4,7,3,6],\n\t\t\t\t\t[3,7,2,6,8,5,4,9,1],\n\t\t\t\t\t[1,4,6,7,9,3,8,2,5],\n\t\t\t\t\t[2,5,8,1,3,9,6,4,7],\n\t\t\t\t\t[4,3,9,5,6,7,1,8,2],\n\t\t\t\t\t[7,6,1,8,4,2,9,5,3]];\n\t\t\tif (k == 3)\n\t\t\t\tmatriz =\n\t\t\t\t\t[[8,2,7,1,6,5,9,3,4],\n\t\t\t\t\t[3,5,9,4,7,8,6,1,2],\n\t\t\t\t\t[1,6,4,9,3,2,7,5,8],\n\t\t\t\t\t[9,8,2,6,5,1,4,7,3],\n\t\t\t\t\t[5,7,1,3,2,4,8,9,6],\n\t\t\t\t\t[4,3,6,8,9,7,1,2,5],\n\t\t\t\t\t[6,4,3,5,1,9,2,8,7],\n\t\t\t\t\t[2,1,8,7,4,3,5,6,9],\n\t\t\t\t\t[7,9,5,2,8,6,3,4,1]];\n\t\t\tif (k == 4)\n\t\t\t\tmatriz =\n\t\t\t\t\t[[4,6,9,5,3,2,8,1,7],\n\t\t\t\t\t[2,5,1,8,6,7,9,4,3],\n\t\t\t\t\t[7,8,3,9,4,1,6,2,5],\n\t\t\t\t\t[5,2,4,7,8,9,3,6,1],\n\t\t\t\t\t[8,3,6,4,1,5,7,9,2],\n\t\t\t\t\t[9,1,7,3,2,6,5,8,4],\n\t\t\t\t\t[6,7,8,2,5,4,1,3,9],\n\t\t\t\t\t[1,4,5,6,9,3,2,7,8],\n\t\t\t\t\t[3,9,2,1,7,8,4,5,6]];\n\t\t\tif (k == 5)\n\t\t\t\tmatriz =\n\t\t\t\t\t[[6,5,1,9,7,4,3,8,2],\n\t\t\t\t\t[4,9,8,3,1,2,6,5,7],\n\t\t\t\t\t[3,7,2,5,8,6,9,4,1],\n\t\t\t\t\t[1,3,5,7,2,9,8,6,4],\n\t\t\t\t\t[8,4,6,1,3,5,7,2,9],\n\t\t\t\t\t[7,2,9,6,4,8,5,1,3],\n\t\t\t\t\t[9,8,4,2,5,3,1,7,6],\n\t\t\t\t\t[5,6,7,4,9,1,2,3,8],\n\t\t\t\t\t[2,1,3,8,6,7,4,9,5]];\n\t\t\tif (k == 6)\n\t\t\t\tmatriz =\n\t\t\t\t\t[[4,7,9,1,6,8,5,3,2],\n\t\t\t\t\t[1,6,2,5,3,9,8,7,4],\n\t\t\t\t\t[3,5,8,7,2,4,9,6,1],\n\t\t\t\t\t[8,4,5,9,7,6,2,1,3],\n\t\t\t\t\t[2,9,6,3,4,1,7,5,8],\n\t\t\t\t\t[7,3,1,8,5,2,4,9,6],\n\t\t\t\t\t[9,2,4,6,1,5,3,8,7],\n\t\t\t\t\t[6,8,3,2,9,7,1,4,5],\n\t\t\t\t\t[5,1,7,4,8,3,6,2,9]];\n\t\t\tif (k == 7)\n\t\t\t\tmatriz =\n\t\t\t\t\t[[7,4,9,1,2,5,3,8,6],\n\t\t\t\t\t[2,5,1,6,8,3,9,4,7],\n\t\t\t\t\t[3,8,6,4,9,7,1,5,2],\n\t\t\t\t\t[8,1,7,2,5,6,4,3,9],\n\t\t\t\t\t[5,2,4,7,3,9,8,6,1],\n\t\t\t\t\t[9,6,3,8,1,4,2,7,5],\n\t\t\t\t\t[4,3,2,5,6,1,7,9,8],\n\t\t\t\t\t[6,9,8,3,7,2,5,1,4],\n\t\t\t\t\t[1,7,5,9,4,8,6,2,3]];\n\t\t\tif (k == 8)\n\t\t\t\tmatriz =\n\t\t\t\t\t[[2,6,4,5,9,8,1,7,3],\n\t\t\t\t\t[1,5,3,4,7,2,9,6,8],\n\t\t\t\t\t[8,9,7,1,6,3,2,4,5],\n\t\t\t\t\t[5,8,9,2,1,6,4,3,7],\n\t\t\t\t\t[4,3,6,7,5,9,8,1,2],\n\t\t\t\t\t[7,1,2,8,3,4,5,9,6],\n\t\t\t\t\t[9,7,1,3,8,5,6,2,4],\n\t\t\t\t\t[3,4,5,6,2,1,7,8,9],\n\t\t\t\t\t[6,2,8,9,4,7,3,5,1]];\n\t\t\tif (k == 9)\n\t\t\t\tmatriz =\n\t\t\t\t\t[[7,9,5,4,8,2,3,6,1],\n\t\t\t\t\t[3,8,6,9,7,1,2,5,4],\n\t\t\t\t\t[4,1,2,3,6,5,8,7,9],\n\t\t\t\t\t[2,5,7,8,1,9,4,3,6],\n\t\t\t\t\t[8,3,4,7,5,6,9,1,2],\n\t\t\t\t\t[1,6,9,2,4,3,7,8,5],\n\t\t\t\t\t[5,4,3,1,2,8,6,9,7],\n\t\t\t\t\t[9,7,1,6,3,4,5,2,8],\n\t\t\t\t\t[6,2,8,5,9,7,1,4,3]];\n\t\t\tif (k == 10)\n\t\t\t\tmatriz =\n\t\t\t\t\t[[5,2,9,1,8,3,6,4,7],\n\t\t\t\t\t[1,8,6,5,4,7,9,3,2],\n\t\t\t\t\t[3,7,4,9,6,2,1,5,8],\n\t\t\t\t\t[9,6,8,2,3,5,7,1,4],\n\t\t\t\t\t[7,5,1,8,9,4,2,6,3],\n\t\t\t\t\t[2,4,3,6,7,1,8,9,5],\n\t\t\t\t\t[8,3,2,4,1,9,5,7,6],\n\t\t\t\t\t[4,9,5,7,2,6,3,8,1],\n\t\t\t\t\t[6,1,7,3,5,8,4,2,9]];\n\n\t\t\tbreak;\n\t\tcase 3: //difícil\n\t\t\tif (k == 1)\n\t\t\t\tmatriz =\n\t\t\t\t\t[[7,2,3,9,6,1,8,4,5],\n\t\t\t\t\t[1,4,8,7,5,2,6,9,3],\n\t\t\t\t\t[9,5,6,3,8,4,2,7,1],\n\t\t\t\t\t[5,8,2,4,3,7,9,1,6],\n\t\t\t\t\t[6,1,4,2,9,5,7,3,8],\n\t\t\t\t\t[3,9,7,8,1,6,4,5,2],\n\t\t\t\t\t[2,3,5,6,4,9,1,8,7],\n\t\t\t\t\t[4,6,1,5,7,8,3,2,9],\n\t\t\t\t\t[8,7,9,1,2,3,5,6,4]];\n\t\t\tif (k == 2)\n\t\t\t\tmatriz =\n\t\t\t\t\t[[4,9,6,5,3,2,8,7,1],\n\t\t\t\t\t[2,5,1,8,6,7,3,4,9],\n\t\t\t\t\t[8,7,3,1,9,4,6,5,2],\n\t\t\t\t\t[9,1,2,6,4,3,5,8,7],\n\t\t\t\t\t[5,6,4,7,8,1,9,2,3],\n\t\t\t\t\t[7,3,8,2,5,9,4,1,6],\n\t\t\t\t\t[6,8,7,9,1,5,2,3,4],\n\t\t\t\t\t[3,2,9,4,7,8,1,6,5],\n\t\t\t\t\t[1,4,5,3,2,6,7,9,8]];\n\t\t\tif (k == 3)\n\t\t\t\tmatriz =\n\t\t\t\t\t[[1,8,2,4,3,5,7,9,6],\n\t\t\t\t\t[4,9,7,6,2,8,1,3,5],\n\t\t\t\t\t[6,3,5,7,9,1,8,2,4],\n\t\t\t\t\t[5,4,1,3,8,6,9,7,2],\n\t\t\t\t\t[7,6,3,9,5,2,4,1,8],\n\t\t\t\t\t[8,2,9,1,4,7,6,5,3],\n\t\t\t\t\t[2,7,4,8,1,3,5,6,9],\n\t\t\t\t\t[9,5,6,2,7,4,3,8,1],\n\t\t\t\t\t[3,1,8,5,6,9,2,4,7]];\n\t\t\tif (k == 4)\n\t\t\t\tmatriz =\n\t\t\t\t\t[[4,6,1,5,9,3,2,8,7],\n\t\t\t\t\t[9,7,2,8,4,1,6,3,5],\n\t\t\t\t\t[5,8,3,2,7,6,1,9,4],\n\t\t\t\t\t[6,4,9,7,5,2,8,1,3],\n\t\t\t\t\t[1,3,5,6,8,4,9,7,2],\n\t\t\t\t\t[7,2,8,3,1,9,4,5,6],\n\t\t\t\t\t[2,1,6,9,3,5,7,4,8],\n\t\t\t\t\t[3,9,7,4,2,8,5,6,1],\n\t\t\t\t\t[8,5,4,1,6,7,3,2,9]];\n\t\t\tif (k == 5)\n\t\t\t\tmatriz =\n\t\t\t\t\t[[9,8,3,2,7,4,1,6,5],\n\t\t\t\t\t[1,6,4,8,5,9,3,7,2],\n\t\t\t\t\t[7,5,2,1,3,6,4,8,9],\n\t\t\t\t\t[5,9,7,6,4,2,8,3,1],\n\t\t\t\t\t[2,3,1,5,8,7,9,4,6],\n\t\t\t\t\t[6,4,8,9,1,3,5,2,7],\n\t\t\t\t\t[3,7,6,4,9,1,2,5,8],\n\t\t\t\t\t[8,2,9,3,6,5,7,1,4],\n\t\t\t\t\t[4,1,5,7,2,8,6,9,3]];\n\t\t\tif (k == 6)\n\t\t\t\tmatriz =\n\t\t\t\t\t[[1,4,7,5,8,6,2,3,9],\n\t\t\t\t\t[6,8,3,2,7,9,5,1,4],\n\t\t\t\t\t[2,5,9,3,1,4,7,8,6],\n\t\t\t\t\t[4,1,5,6,9,3,8,7,2],\n\t\t\t\t\t[7,2,8,1,4,5,6,9,3],\n\t\t\t\t\t[3,9,6,7,2,8,4,5,1],\n\t\t\t\t\t[5,6,4,9,3,7,1,2,8],\n\t\t\t\t\t[9,7,1,8,6,2,3,4,5],\n\t\t\t\t\t[8,3,2,4,5,1,9,6,7]];\n\t\t\tif (k == 7)\n\t\t\t\tmatriz =\n\t\t\t\t\t[[1,4,6,8,3,9,2,7,5],\n\t\t\t\t\t[3,7,5,4,2,6,9,8,1],\n\t\t\t\t\t[8,2,9,1,7,5,4,3,6],\n\t\t\t\t\t[9,6,2,5,4,8,3,1,7],\n\t\t\t\t\t[4,8,3,9,1,7,5,6,2],\n\t\t\t\t\t[5,1,7,3,6,2,8,9,4],\n\t\t\t\t\t[2,5,1,7,9,3,6,4,8],\n\t\t\t\t\t[6,9,4,2,8,1,7,5,3],\n\t\t\t\t\t[7,3,8,6,5,4,1,2,9]];\n\t\t\tif (k == 8)\n\t\t\t\tmatriz =\n\t\t\t\t\t[[4,1,2,8,3,5,7,9,6],\n\t\t\t\t\t[9,7,8,4,6,2,3,1,5],\n\t\t\t\t\t[3,6,5,9,1,7,4,8,2],\n\t\t\t\t\t[5,9,3,1,4,6,2,7,8],\n\t\t\t\t\t[6,8,4,7,2,3,9,5,1],\n\t\t\t\t\t[7,2,1,5,8,9,6,3,4],\n\t\t\t\t\t[8,5,6,3,9,4,1,2,7],\n\t\t\t\t\t[2,3,7,6,5,1,8,4,9],\n\t\t\t\t\t[1,4,9,2,7,8,5,6,3]];\n\t\t\tif (k == 9)\n\t\t\t\tmatriz =\n\t\t\t\t\t[[1,8,4,2,3,7,9,6,5],\n\t\t\t\t\t[3,5,2,9,4,6,1,8,7],\n\t\t\t\t\t[6,9,7,5,1,8,3,4,2],\n\t\t\t\t\t[9,6,8,7,5,3,4,2,1],\n\t\t\t\t\t[4,1,5,8,6,2,7,3,9],\n\t\t\t\t\t[2,7,3,1,9,4,6,5,8],\n\t\t\t\t\t[8,3,9,6,7,5,2,1,4],\n\t\t\t\t\t[5,4,1,3,2,9,8,7,6],\n\t\t\t\t\t[7,2,6,4,8,1,5,9,3]];\n\t\t\tif (k == 10)\n\t\t\t\tmatriz =\n\t\t\t\t\t[[3,7,9,5,1,8,6,2,4],\n\t\t\t\t\t[6,1,4,9,2,3,7,8,5],\n\t\t\t\t\t[2,5,8,6,7,4,3,1,9],\n\t\t\t\t\t[1,4,7,8,5,9,2,6,3],\n\t\t\t\t\t[8,2,6,3,4,1,9,5,7],\n\t\t\t\t\t[5,9,3,7,6,2,8,4,1],\n\t\t\t\t\t[4,6,1,2,9,7,5,3,8],\n\t\t\t\t\t[9,8,2,4,3,5,1,7,6],\n\t\t\t\t\t[7,3,5,1,8,6,4,9,2]];\n\t\t\tbreak;\n\t}\n\n\tfor (i = 1; i <= 9; i++){\n\t\tfor (j = 1; j <= 9; j++){\n\t\t\t$(\"#\" + i + \"x\" + j).val(matriz[i-1][j-1]);\n\t\t}\n\t}\n}", "function agregarZonas(marcadores) {\n var valores = [];\n\n var valores = $.map(marcadores, function (value, index) {\n return value;\n });\n\n var valores2 = $.map(valores, function (value, index) {\n return value;\n });\n\n agregarZonaInterna(valores2, 0);\n}", "function listarMedicoCadastrados(cnpjClinica, res){\n\t\tconnection.acquire(function(err, con){\n\t\t\tcon.query(\"select crmv, nomeMedico, telefoneMedico, emailMedico from Medico, Estados, Clinica where Medico.Estados = Clinica.Estados and Medico.Estados = Estados.idEstados and Clinica.Estados = Estados.idEstados and Clinica.cnpj = \"+cnpjClinica+\"\", function(err, result){\n\t\t\t\tcon.release();\n\t\t\t\tres.json(result);\n\t\t\t});\n\t\t});\n\t}", "function obtenerMaterias(){\n $.ajax({\n url : '/materias-all',\n method : 'GET',\n })\n .done(function(response){\n if(response.length > 0){\n let template = '';\n response.forEach((element, index) => {\n template += `\n <tr materiaId=\"${element.mat_id}\">\n <td>${++index}</td>\n <td>${element.mat_nombre}</td>\n <td>\n <i class=\"bi bi-pencil btn edit-materia text-primary\" title=\"Editar materia\"></i>\n <i class=\"bi bi-archive btn delete-matearia text-primary\" title=\"Eliminar materia\"></i>\n </td>\n </tr>\n `;\n $('#materias').html(template);\n });\n }else{\n $('#materias').html('');\n }\n })\n }", "function fill3MatsOfResult(){\r\n let matMatsIndex = 0;\r\n let cellValue = 0;\r\n for(let row = 97; row <= 105 ; row++){\r\n for(let col = 1; col <= len; col++){\r\n cellValue = Number(document.getElementById(String.fromCharCode(row) + col).value);\r\n matRows[row-97][col-1] = cellValue;\r\n matCols[col-1][row-97] = cellValue;\r\n matMatsIndex = smallMatrixSelector(row,col);\r\n matMatsAfterFill[matMatsIndex].push(cellValue);\r\n }\r\n }\r\n}", "function question5 () {\n\tlet ans = []\n\n\tdata.forEach(function(element) {\n\t if(element.materials.length >= 8){\n\t\t ans.push(element);\n\t }\n\t})\n\n\tans.forEach(function(element) {\n\t\tconsole.log(element.title + \" has \" +element.materials.length + \" materials:\");\n\t\telement.materials.forEach(function(element2) {\n\t\t\tconsole.log(\"- \" + element2);\n\t\t})\n\t})\n}", "function carregarCampos() {\n let qtd_locais_medidos = 0;\n let element = \"\";\n let array_taxas = [];\n\n array_taxas = montaSelectTaxaMetabolica();\n\n qtd_locais_medidos = buscaQtdeLocais();\n\n if (qtd_locais_medidos < 1 || qtd_locais_medidos > 5) {\n clearAll();\n mostraErro(\"O número de locais medidos deve estar entre 1 e 5\",\"\");\n\n return;\n }\n\n resetResultado();\n\n for (let i = 0; i < qtd_locais_medidos ; i++) {\n\n element += \"<div class='window_local'>\";\n element += \"<h3>Local \" + (i+1) + \"</h3>\";\n\n element += \"<label for='ibutg_local_\" + (i + 1) + \"'>Nome</label>\";\n \n element += \"<input type='text' \";\n element += \"name='nome_local_\" + (i + 1) + \"' \";\n element += \"id='nome_local_\" + (i + 1) + \"' \";\n element += \"maxlength='25'\";\n element += \"placeholder='Nome do local medido \" + (i + 1) + \"' \";\n element += \"/>\";\n\n element += \"<label for='ibutg_local_\" + (i + 1) + \"'>IBUTG</label>\";\n \n element += \"<input type='number' \";\n element += \"name='ibutg_local_\" + (i + 1) + \"' \";\n element += \"id='ibutg_local_\" + (i + 1) + \"' \";\n element += \"placeholder='IBUTG medido no local \" + (i + 1) + \"' \";\n element += \"/>\";\n\n element += \"<label for='tempo_local_\" + (i + 1) + \"'>Tempo</label>\";\n\n element += \"<input type='number' \";\n element += \"name='tempo_local_\" + (i + 1) + \"' \";\n element += \"id='tempo_local_\" + (i + 1) + \"' \";\n element += \"placeholder='Tempo no local \" + (i + 1) + \" (minutos)' \";\n element += \"/>\";\n\n element += \"<label for='select_metabolica_local_\" + (i + 1) + \"'>Atividade</label>\";\n\n element += \"<select name='select_metabolica_local_\" + (i + 1) + \"'\";\n element += \"id='select_metabolica_local_\" + (i + 1) + \"' onchange='selecionarTaxa(\" + (i + 1) + \")'>\";\n\n\n for (let x = 0; x < array_taxas.length ; x++) {\n element += \"<option value='\";\n element += array_taxas[x]['valor'];\n element += \"'>\";\n element += array_taxas[x]['descricao'];\n element += \"</option>\";\n }\n\n element += \"</select>\";\n\n element += \"<label for='metabolica_local_\" + (i + 1) + \"'>Taxa Metabólica</label>\";\n\n element += \"<input type='number' \";\n element += \"name='metabolica_local_\" + (i + 1) + \"' \";\n element += \"id='metabolica_local_\" + (i + 1) + \"' \";\n element += \"placeholder='Taxa metabólica no local \" + (i + 1) + \"' \";\n element += \"readonly/>\";\n\n element += \"</div>\";\n }\n\n $(\".window_campos\").html(element);\n $(\"#calcular\").show();\n\n return;\n}", "function Unidad(data,nombre) {\n var total = data.filter(function(d) {\n return d[\"UNIDAD DE ADSCRIPCIÓN\"] == nombre.parent;\n }).filter(function(d) { return d[\"ÁREA DE ADSCRIPCIÓN\"] == nombre.hijo });\n// console.log(total)\n var hombres = total.filter(function(d) { return d[\"SEXO\"] == \"H\"; }).length\n var mujeres = total.filter(function(d) { return d[\"SEXO\"] == \"M\"; }).length;\n total = total.length;\n\n return [{key:hombres,sexo:\"H\"},{key:mujeres,sexo:\"M\"}]\n}", "function municoesAndam(){\n\tif(jogoEmAndamento==true){\n\t\tmunicoes.forEach(andarMunicao);\n\t}\n}", "function matriz (col, lin) {\n //A variável Matriz é a escolhida para receber os dados das colunas e linhas do tabuleiro\n let matriz = [];\n let i = 0;\n let j = 0;\n //Utilizando Nested For Loops - ou For Loops dentro de outors - vamos criar arrays que serão os números\n //de linhas e enviá-los para a Matriz, lembrando que cada vez que rodarmos o For loop para as linhas,\n //o loop entenderá que deve-se criar novamente um array linha vazio []\n for(i = 0; i < lin; i++){\n let linha = [];\n matriz.push(linha);\n for(j = 0; j < col; j++){\n //Já aqui, a variável coluna irá gerar aleatoriamente números entre 0 e 6\n //Para isso, usamos a função Math.floor que serve para arredondar os números\n //E a função Math.random que gera números aleatórios entre 0 e 1.\n //Multiplicamos por 7 para que os resultados sejam arredondados para 0 - o menor\n //E 6 - o maior\n let coluna = Math.floor((Math.random() * 7));\n matriz[i].push(coluna);\n }\n }\n //Aqui visualizamos como nosso tabuleiro está até então\n console.log(matriz);\n //para que seja feita a contagem de peças, criamos a variável pecas, sendo essa\n //um array vazio que irá receber o valor inicial 0 através do For Loop.\n //O usuário pode também declarar as variáveis por si só, caso queira\n let pecas = [];\n for (i = 0; i < 8; i++){\n pecas.push(0);\n }\n //Aqui utilizamos novamente Nested Loops para checarmos os valores de cada linha e coluna\n //Como os valores podem ir de 0 até 6 - em concordância com os valores do array pecas acima\n //Cada vez que o for loop retornar um valor, ele vai acrescentar 1 ao valor correspondente\n //do índice da variável pecas\n for (i = 0; i < matriz.length; i++){\n for (j = 0; j < matriz[i].length; j++){\n pecas[matriz[i][j]]++;\n }\n }\n //com isso, criamos variaveis representando as possibilidades de pecas\n //Associadas a um determinado indice no array. Por conta do For Loop acima\n //cada variável já tem um valor armazenado, será utilizado abaixo\n vazio = pecas[0];\n peao = pecas[1];\n bispo = pecas[2];\n cavalo = pecas[3];\n torre = pecas[4];\n rainha = pecas[5];\n rei = pecas[6];\n //Por fim, iremos retornar os valores das peças abaixo.\n console.log(\"Casas vazias: \" + vazio);\n console.log(\"Peões: \" + peao);\n console.log(\"Bispos: \" + bispo);\n console.log(\"Cavalos: \" + cavalo);\n console.log(\"Torres: \" + torre);\n console.log(\"Rainhas: \" + rainha);\n console.log(\"Reis: \" + rei);\n }", "function calcularMejorEquipo() {\n const equipos = [\n new Equipo('Maria', [62, 34, 55]),\n new Equipo('Paula', [35, 60, 59]),\n new Equipo('Rebeca', [40, 39, 63])\n ];\n\n for (let i = 0; i < equipos.length; i++) {\n equipos[i].media = calcularMedia(equipos[i].resultados);\n }\n\n let mediaMasAlta = obtenerMediaMasAlta(equipos);\n console.log(\n `El equipo con la media más alta es el equipo ${obtenerEquipo(\n equipos,\n mediaMasAlta\n )} con una media de ${mediaMasAlta}`\n );\n}", "function RdatosLogistica(Material, Partidas, Destinos, Tiempo) {\n return { Material,Partidas, Destinos, Tiempo };\n}", "get icaos() {\n return this.rows.reduce((result, {icao}) => icao ? result.concat(icao) : result, []);\n }", "get allMillennialVampires() {\n let millenials = [];\n\n if (this.yearConverted > 1980) {\n millenials.push(this);\n }\n for (const child of this.offspring) {\n millenials = millenials.concat(child.allMillennialVampires);\n }\n return millenials;\n }", "function renderizaMunicoes(){\n\tmunicoes.forEach(desenhaMunicao);\n\tmunicoesAndam();\n}", "function crearniveles() {\n let niveles = [];\n let fila = 0;\n let columna = 0;\n niveles[0] = [];\n for (let c = 1; c < 21; c++) {\n niveles[0][c - 1] =\n {\n tipo: 0,\n fila: fila + 3,\n columna: columna,\n }\n if (c % 10 == 0) {\n fila++;\n columna = 0;\n } else {\n columna++;\n }\n }\n fila = 0;\n columna = 0;\n niveles[1] = [];\n for (let c = 1; c < 41; c++) {\n \tniveles[1][c - 1] =\n {\n \ttipo: 0,\n \tfila: fila + 3,\n \tcolumna: columna,\n }\n \tif (c % 10 == 0) {\n \t\tfila++;\n \t\tcolumna = 0;\n \t} else {\n \t\tcolumna++;\n \t}\n }\n\n return niveles;\n }", "cargarMatriz() {\n for(let x = 0; x < this.columna; x ++) {\n this.arregloDePosiciones[x] = new Array();\n this.llenarMatriz(x);\n }\n return this.arregloDePosiciones;\n }", "function LinhaMatriz(linha, tabuleiro){ \n var x = new Array(MAX);\n for(var i = 0; i < MAX; i++){\n x[i]= tabuleiro[linha][i];\n }\n\n return x;\n}// fim do devolve linha matriz*********************************************************", "function convertir(){\n \n \t\n \n\t\tvar countHijos = $('.content-list').children().length - 1; //21\n\t\tvar entran = countHijos / columna; // 3\n\t\tvar entran = parseInt(entran); // 3\n\t\tvar aumentar = ((entran + 1) * columna)-countHijos;\n\t\tvar func = (aumentar / columna)*100;\n\n\t\tif(columna == 1){\n\t\t\t$('.content-list .liunico').css('display', 'none');\n\t\t}else{\n\t\t\t$('.content-list .liunico').css(\"width\", func +\"%\");\n\t\t\tif(countHijos % columna == 0){\n\t\t\t\t$('.content-list .liunico').css('display', 'none');\n\t\t\t}else{\n\t\t\t\t$('.content-list .liunico').css('display', 'block')\n\t\t\t}\n\t\t}\n\n\t}", "function marcar(referencia) {\n\tvar ide = soNumero(referencia);\n\tvar x = ide[0];\n\tvar y = ide[1];\n\t// Checamos se o campo ainda nao foi marcado\n\tif (matriz[x][y] == -1) {\n\t\t// Checamos qual o proximo elemento\n\t\tif (checarProximo() == \"X\") {\n\t\t\tdocument.getElementById(referencia).className = \"x_dourado\";\n\t\t\tdocument.getElementById(\"fundo\").innerHTML = \"O\";\n\t\t} else {\n\t\t\tdocument.getElementById(referencia).className = \"o_dourado\";\n\t\t\tdocument.getElementById(\"fundo\").innerHTML = \"X\";\n\t\t}\n\t\tmatriz[x][y] = proximo;\n\t\t// Checamos se alguem ganhou\n\t\tif (checarFinal()) {\n\t\t\tanterior = false;\n\t\t\tmatriz = createMatrix(true, 3, 3);\n\t\t\tdocument.getElementById(\"fundo\").innerHTML = proximo;\n\t\t} else {\n\t\t\tanterior = false;\n\t\t\tmatriz = createMatrix(false, 3, 3);\n\t\t\tdocument.getElementById(\"fundo\").innerHTML = \"?\";\n\t\t}\n\t} else {\n\t\talert(\"Este campo já foi marcado previamente.\");\n\t}\n}", "function establecerMensajes(arrMensages) {\n\t\tvar indexValidacion = 2; \n\t\t//tomamos la lista actual del rowset \n\t\tvar listaClientes = listado1.datos; \n\t\t//realizamos la tranformaion \n\t\tfor (var i=0; i < listaClientes.length; i++){\n\t\t\t//agergamos el mensage de valiacion\n\t\t\tif (arrMensages[i] != null){\n listaClientes[i][indexValidacion] = arrMensages[i]; \n }else{\n listaClientes[i][indexValidacion] = \"\"; \n }\n\t\tlistado1.repinta();\n \t}\n }", "function question4 () {\n\tlet ans = [];\n\n\tdata.forEach(function(element) {\n\t\tfor(let j=0; j<element.materials.length; j++){\n\t\t\tif(element.materials[j] === \"wood\"){\n\t\t\t\tans.push(element.title);\n\t\t\t}\n\t\t}\n\t})\n\n\tans.forEach(function(element) {\n\t\tconsole.log(element + \" is made of wood.\");\n\t})\n}", "function question5 () {\n let multiMatList = [];\n\n for (var i = 0; i < data.length; i++) {\n if(data[i].materials.length >= 8) {\n multiMatList.push(data[i]);\n }\n }\n for (var t = 0; t < multiMatList.length; t++) {\n console.log(multiMatList[t].title + \" has \" + multiMatList[t].materials.length + \" materials:\");\n for (var n = 0; n < multiMatList[t].materials.length; n++) {\n console.log(\"- \" + multiMatList[t].materials[n]);\n }\n }\n\n}", "function livrosAugustoCury() {\n let livros = [];\n for (let categoria of livrosPorCategoria) {\n for (let livro of categoria.livros) {\n if (livro.autor === 'Augusto Cury') {\n livros.push(livro.titulo);\n }\n }\n }\n console.log('Livros do Augusto Cury: ' , livros);\n}", "function cambiarPartida(tipo){\n \n // Elimina el tablero de juego para poder crear uno nuevo\n function eliminarTablero(){\n for(let i = 0; i < tamano*tamano; i++) {\n var ultimo = document.getElementById(i);\n tablero.removeChild(ultimo)\n }\n // resetea numero de banderas la variable juego acabado, los cuadrados y el resultado.\n banderas = 0\n juegoAcabado = false\n cuadrados = []\n resultado.innerHTML = \"\"\n }\n\n // En caso de seleccionar un tipo diferente de partida cambia las caracteristicas\n function cambiaTamano(tipo){\n switch (tipo) {\n case \"principiante\":\n tamano = 10\n cantidadBomba = 10\n break\n case \"intermedio\":\n tamano = 12\n cantidadBomba = 20\n break\n case \"avanzado\":\n tamano = 16\n cantidadBomba = 40\n break\n case \"experto\":\n tamano = 20\n cantidadBomba = 100\n break\n }\n }\n\n // Elimina el tablero actual \n eliminarTablero()\n // Cambia el tamaño del buscamina actual\n cambiaTamano(tipo)\n // Crea el nuevo Tablero del buscamina\n crearTablero()\n // Reseta el contador de tiempo\n if (tiempoActivo) resetearTiempo()\n tiempo.innerHTML = 0\n}", "function listarMedicoClinica(cnpjClinica, res){\n\t\tconnection.acquire(function(err, con){\n\t\t\tcon.query(\"select crmv, nomeMedico, emailMedico, telefoneMedico from Medico, Clinica, Clinica_Medicos, Estados where Medico.Estados = Clinica.Estados and Clinica_Medicos.cnpjClinica = Clinica.cnpj and Clinica_Medicos.crmvMedico = Medico.crmv and Medico.Estados = Estados.idEstados and Clinica.Estados = Estados.idEstados and Clinica.cnpj = \"+cnpjClinica+\"\", function(err, result){\n\t\t\t\tcon.release();\n\t\t\t\tres.json(result);\n\t\t\t});\n\t\t});\n\t}", "function formarControles() {\n let ban = 0;\n for (let item of controles1) {\n if (item !== undefined) {\n if (ban !== 0) {\n controles1_string += \",\";\n }\n controles1_string += item.control;\n ban = 1;\n }\n }\n ban = 0;\n for (let item of controles2) {\n if (item !== undefined) {\n if (ban !== 0) {\n controles2_string += \",\";\n }\n controles2_string += item.control;\n ban = 1;\n }\n }\n ban = 0;\n for (let item of controles3) {\n if (item !== undefined) {\n if (ban !== 0) {\n controles3_string += \",\";\n }\n controles3_string += item.control;\n ban = 1;\n }\n }\n}", "function listMajors() {\n gapi.client.sheets.spreadsheets.values.get({\n spreadsheetId: '1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms',\n range: 'Class Data!A2:E',\n }).then(function(response) {\n var range = response.result;\n let counter1 = new ceateConter();\n let counter2 = new ceateConter();\n let counter3 = new ceateConter();\n if (range.values.length > 0) {\n appendPre('Name, Major:');\n for (i = 0; i < range.values.length; i++) {\n var row = range.values[i];\n counter1.addData(row[3],row[0])\n counter2.addData(row[4],row[0])\n counter3.addData(row[2],row[0])\n // Print columns A and E, which correspond to indices 0 and 4.\n appendPre(row[0] + ', ' + row[3] + ', ' + row[4]);\n }\n } else {\n appendPre('No data found.');\n }\n counter1.render('chart1');\n counter2.render('chart2');\n counter3.render('chart3');\n }, function(response) {\n appendPre('Error: ' + response.result.error.message);\n });\n}", "function mapeamentosDatasets(myJsonDoc, mapeamentos, myDataFields) {\n console.log('mapeamentosDatasets');\n\n datasets = [];\n\n campos = myDataFields;\n\n // iterar por cada visualização mapeada\n for (var i=0;i<mapeamentos['visualizations']['length'];i++) {\n\n myMap = mapeamentos['visualizations'][i];\n dataset = [];\n\n // Verificar o agrupamento de dados\n aggregateOptions = [ 'SUM', 'AVG', 'MAX', 'MIN' ];\n try {\n if (myMap['components']['y']['aggregate'] === undefined)\n aggregateOption = 0;\n else\n aggregateOption = aggregateOptions.indexOf(myMap['components']['y']['aggregate']);\n } catch(e) {\n throw e;\n }\n\n yField = myMap['components']['y']['field'];\n\n // Verificar se o campo Y informado existe no conjunto de dados\n try {\n if (campos.indexOf(yField) < 0)\n throw { msg: 'campo \"components.y.field\" informado não existe'};\n } catch(e) {\n throw e;\n }\n\n // Verificar o tipo de gráfico escolhido\n if (myMap['visualizationType'] == 'BAR_CHART') {\n \n xField = myMap['components']['x']['field'];\n\n // Verificar se o campo X informado existe no conjunto de dados\n try {\n if (campos.indexOf(xField) < 0)\n throw { msg: 'campo \"components.x.field\" informado não existe'};\n } catch(e) {\n throw e;\n }\n\n dataset = buildDataset(myJsonDoc, xField, yField, aggregateOption );\n\n // ordernar o dataset\n sortBy = '';\n sortOrder = '';\n try {\n if ( (myMap['components']['others'] !== undefined) &&\n (myMap['components']['others']['sortBy'] !== undefined)\n )\n sortBy = myMap['components']['others']['sortBy'];\n\n if ( (myMap['components']['others'] !== undefined) &&\n (myMap['components']['others']['sortOrder'] !== undefined)\n ) \n sortOrder = myMap['components']['others']['sortOrder'];\n\n if (sortBy != '') {\n dataset.sort(function(a, b){\n if (sortBy=='x') {\n s1 = a[xField].toLowerCase();\n s2 = b[xField].toLowerCase();\n if ( (sortOrder=='') || (sortOrder=='asc') ) {\n if (s1 < s2) { return -1; }\n if (s1 > s2) { return 1; }\n return 0;\n }\n else {\n if (s2 < s1) { return -1; }\n if (s2 > s1) { return 1; }\n return 0;\n }\n }\n else {\n if ( (sortOrder=='') || (sortOrder=='asc') )\n return a[yField] - b[yField];\n else\n return b[yField] - a[yField];\n }\n });\n }\n } catch(e) {\n throw e;\n }\n\n }\n\n if (myMap['visualizationType'] == 'SANKEY') {\n\n //xFields = [ 'Localidade', 'Categoria 1', 'Categoria 2' ];\n xFields = myMap['components']['x']['fields'];\n\n // Verificar se os campos selecionados para X existem no conjunto de dados\n try {\n for (var z=0;z<xFields.length;z++) {\n if (campos.indexOf(xFields[z]) < 0)\n throw { msg: 'campo \"components.x.fields\" informado não existe'};\n }\n } catch(e) {\n throw e;\n }\n\n dataset = buildDatasetSANKEY(myJsonDoc, xFields, yField, aggregateOption );\n \n }\n\n datasets.push( dataset );\n\n }\n\n /*\n //dataset = buildDataset(myJsonDoc, xField, yField, aggregateOption );\n\n camposTeste = [ 'Localidade', 'Categoria 1', 'Categoria 2' ];\n //camposTeste = [ 'Categoria 1', 'Categoria 2', 'Localidade' ];\n dataset = buildDatasetSANKEY(myJsonDoc, camposTeste, yField, aggregateOption );\n */\n\n return datasets;\n\n}", "matriz(){\n const component = []\n for (let i = 0; i < 7; i++) {\n for (let j = 0; j < 52; j++) {\n component.push(\n <Tooltip content={dataJson[j].count}>\n <div className=\"item\" style={this.verif(j)}></div>\n </Tooltip> \n )\n\n }\n }\n return component\n }", "get allMillennialVampires() {\n let millenials = [];\n\n if (this.yearConverted > 1980) {\n millenials.push(this);\n }\n\n for (let offspring of this.offspring) {\n millenials = millenials.concat(offspring.allMillennialVampires);\n }\n\n return millenials;\n }", "function calculo() {\n return array.map(porDos).map(masUno);\n}", "function seleccionar_combos(){\r\n var Combos = []\r\n for (let i = 1; i <= 7; i++) { //por columnas\r\n for (let j = 1; j <= 5; j++) { //por filas\r\n var Posicion_actual = '.fila'+j+' img'\r\n var Posicion_1='.fila'+(j+1)+' img'\r\n var Posicion_2='.fila'+(j+2)+' img'\r\n var dulce1 = $('.col-'+i).find(Posicion_actual).attr('src')\r\n var dulce2 = $('.col-'+i).find(Posicion_1).attr('src')\r\n var dulce3 = $('.col-'+i).find(Posicion_2).attr('src')\r\n if((dulce1 == dulce2) && (dulce2 == dulce3)){\r\n if (!Combos.includes('.col-'+i+' '+Posicion_actual)) {Combos.push('.col-'+i+' '+Posicion_actual) }\r\n if (!Combos.includes('.col-'+i+' '+Posicion_1)) {Combos.push('.col-'+i+' '+Posicion_1) }\r\n if (!Combos.includes('.col-'+i+' '+Posicion_2)) {Combos.push('.col-'+i+' '+Posicion_2) }\r\n }\r\n }\r\n }\r\n //Validación por filas\r\n for (let i = 1; i <= 7; i++) { //por filas\r\n var fila = $('.fila'+i);\r\n for (let j = 1; j <= 5; j++) {//por columnas\r\n var Posicion_actual = '.col-'+j+' .fila'+i+' img'\r\n var Posicion_1 = '.col-'+(j+1)+' .fila'+i+' img'\r\n var Posicion_2 = '.col-'+(j+2)+' .fila'+i+' img'\r\n var dulce1 = $(Posicion_actual).attr('src')\r\n var dulce2 = $(Posicion_1).attr('src')\r\n var dulce3 = $(Posicion_2).attr('src')\r\n if((dulce1 == dulce2) && (dulce2 == dulce3)){\r\n if (!Combos.includes(Posicion_actual)){Combos.push(Posicion_actual) }\r\n if (!Combos.includes(Posicion_1)){Combos.push(Posicion_1) }\r\n if (!Combos.includes(Posicion_2)){Combos.push(Posicion_2) }\r\n }\r\n }\r\n }\r\n return Combos;\r\n}", "formata_dados( resposta_HANA ){\n const reducer = (r, row) => {\n const key_caminhao = `${row.ID} - ${row.Unidade} - ${row.Nome} - ${row.Placa} - ${row.Transportadora} - ${row.Modal} - ${row.Dia}`;\n const key_entrega = `${row.Item_pedido} - ${row.Cod_Material} - ${row.Material} - ${row.Remessa} - ${row.Dia} - ${row.N_nota_fiscal} - ${row.Peso}`;\n\n const caminhoes = {\n ID: parseInt(row.ID),\n Unidade: row.Unidade,\n Nome: row.Nome,\n Placa: row.Placa,\n Transportadora: row.Transportadora,\n Modal: row.Modal,\n Dia: row.Dia,\n Material: row.Material,\n Materiais: {}\n };\n\n r[key_caminhao] = r[key_caminhao] || caminhoes;\n\n const entregas = {\n Item_pedido: row.Item_pedido,\n Cod_Material: row.Cod_Material,\n Material: row.Material,\n Remessa: row.Remessa,\n Dia: row.Dia,\n N_nota_fiscal: row.N_nota_fiscal,\n Peso: parseInt(row.Peso.replace('.', ''))\n };\n\n r[key_caminhao]['Materiais'][key_entrega] = r[key_caminhao]['Materiais'][key_entrega] || entregas;\n\n return r;\n };\n\n const organizado = resposta_HANA.reduce( (r, row) => reducer(r, row), {});\n\n const obj_organizado = Object.values(organizado);\n\n const obj_organizado_2 = obj_organizado.map( item => {\n item['Materiais'] = Object.values(item['Materiais']);\n\n return item\n });\n\n return obj_organizado_2;\n }", "function Unidad(data,nombre) {\n var total = data.filter(function(d) {\n return d[\"UNIDAD DE ADSCRIPCIÓN\"] == nombre;\n });\n var hombres = total.filter(function(d) { return d[\"SEXO\"] == \"H\"; }).length\n var mujeres = total.filter(function(d) { return d[\"SEXO\"] == \"M\"; }).length;\n total = total.length;\n\n return [{key:hombres,sexo:\"H\"},{key:mujeres,sexo:\"M\"}]\n}", "function generaGrafica(ejercicios)\n{\n\tvar nBarras = Object.keys(ejercicios).length;\n\t//nBarras = 7;\n\tvar wPadre = nBarras*20;\n\tvar wHijo = 100/nBarras;\n\t\n\tvar resultado = \"<div style='width:80%; overflow-x:auto; overflow-y:hidden; margin-left:10%; margin-top:10%; text-align:left;'><div class='grafica' style='width:\"+wPadre+\"%'>\";\n\t\n\t$.each(ejercicios,function(i,ejercicio)\n\t{\n\t\tswitch(ejercicio['ritmo'])\n\t\t{\n\t\t\tcase '1':\n\t\t\t\tresultado += \"<div class='intensidad1' style='width:\"+wHijo+\"%'><div class='area'><div style='height: 100%; display: inline-block; width: 0px;'></div><div class='barra'></div></div><div class='tag'>\"+ejercicio['duracion']+\"</div></div>\";\n\t\t\tbreak;\n\t\t\tcase '2':\n\t\t\t\tresultado += \"<div class='intensidad2' style='width:\"+wHijo+\"%'><div class='area'><div style='height: 100%; display: inline-block; width: 0px;'></div><div class='barra'></div></div><div class='tag'>\"+ejercicio['duracion']+\"</div></div>\";\n\t\t\tbreak;\n\t\t\tcase '3':\n\t\t\t\tresultado += \"<div class='intensidad3' style='width:\"+wHijo+\"%'><div class='area'><div style='height: 100%; display: inline-block; width: 0px;'></div><div class='barra'></div></div><div class='tag'>\"+ejercicio['duracion']+\"</div></div>\";\n\t\t\tbreak;\n\t\t\tcase '4':\n\t\t\t\tresultado += \"<div class='intensidad4' style='width:\"+wHijo+\"%'><div class='area'><div style='height: 100%; display: inline-block; width: 0px;'></div><div class='barra'></div></div><div class='tag'>\"+ejercicio['duracion']+\"</div></div>\";\n\t\t\tbreak;\n\t\t\tcase '5':\n\t\t\t\tresultado += \"<div class='intensidad5' style='width:\"+wHijo+\"%'><div class='area'><div style='height: 100%; display: inline-block; width: 0px;'></div><div class='barra'></div></div><div class='tag'>\"+ejercicio['duracion']+\"</div></div>\";\n\t\t\tbreak; \n\t\t\tdefault:\n\t\t\t\tresultado += \"algo salio mal\";\n\t\t\tbreak\n\t\t}\n\t});\n\t\n\tresultado += \"</div></div>\";\n\t\t\n\t//resultado = \"<div style='width: 80%; overflow-x: scroll; overflow-y: hidden; margin-left:10%;'><div class='grafica' style='width:\"+wPadre+\"%'><div class='intensidad1' style='width:\"+wHijo+\"%'><div class='area'><div style='height: 100%; display: inline-block; width: 0px;'></div><div class='barra'></div></div><div class='tag'>00:00:00</div></div><div class='intensidad2' style='width:\"+wHijo+\"%'><div class='area'><div style='height: 100%; display: inline-block; width: 0px;'></div><div class='barra'></div></div><div class='tag'>00:00:00</div></div><div class='intensidad3' style='width:\"+wHijo+\"%'><div class='area'><div style='height: 100%; display: inline-block; width: 0px;'></div><div class='barra'></div></div><div class='tag'>00:00:00</div></div><div class='intensidad2' style='width:\"+wHijo+\"%'><div class='area'><div style='height: 100%; display: inline-block; width: 0px;'></div><div class='barra'></div></div><div class='tag'>00:00:00</div></div><div class='intensidad4' style='width:\"+wHijo+\"%'><div class='area'><div style='height: 100%; display: inline-block; width: 0px;'></div><div class='barra'></div></div><div class='tag'>00:00:00</div></div><div class='intensidad5' style='width:\"+wHijo+\"%'><div class='area'><div style='height: 100%; display: inline-block; width: 0px;'></div><div class='barra'></div></div><div class='tag'>00:00:00</div></div><div class='intensidad1' style='width:\"+wHijo+\"%'><div class='area'><div style='height: 100%; display: inline-block; width: 0px;'></div><div class='barra'></div></div><div class='tag'>00:00:00</div></div></div></div>\";\n\t\n\treturn resultado;\n}", "function contrari(fantasma){\n var vContrari;\r\n if(fantasma[3] == 1) vContrari = 3;\n if(fantasma[3] == 2) vContrari = 4;\n if(fantasma[3] == 3) vContrari = 1;\n if(fantasma[3] == 4) vContrari = 2;\n return vContrari;\r\n}", "get allMillennialVampires() {\n let allMillennials = [];\n \n console.log( \"Year Converted: \" + this.yearConverted);\n if (this.yearConverted > 1980) {\n allMillennials.push(this);\n }\n \n for (let offspring of this.offspring) {\n let childMillennials = offspring.allMillennialVampires\n if (childMillennials != null) {\n allMillennials = allMillennials.concat(childMillennials)\n }\n }\n \n return allMillennials;\n }", "function retAgendamentoItens(codAgendamento, codCliente) {\n let amat = [];\n\n $(\".procedimento-item\").each(function (i) {\n let id = $(this).attr(\"data-id\");\n\n let codServico = parseInt($(\"#sel-servico-\" + id).val());\n let codProfissional = parseInt($(\"#sel-profissional-\" + id).val());\n let horaInicio = $(\"#txt-ag-inicio-\" + id).val();\n let horaTermino = $(\"#txt-ag-termino-\" + id).val();\n let data = $(\"#txt-data\").val();\n let codAgendamentoItem = parseInt($(this).attr(\"data-cod-procedimento\"));\n let observacoes = $(\"#txa-observacoes-\" + id).val();\n\n if (Number.isNaN(codAgendamentoItem)) {\n codAgendamentoItem = 0;\n }\n\n amat.push({\n \"CodAgendamentoItem\": codAgendamentoItem,\n \"CodAgendamento\": codAgendamento,\n \"Inicio\": data + \"T\" + horaInicio,\n \"Termino\": data + \"T\" + horaTermino,\n \"codCliente\": + codCliente,\n \"CodServico\": codServico,\n \"CodProfissional\": codProfissional,\n \"Observacao\": observacoes\n });\n })\n\n return amat;\n }", "function jogosDaDesenvolvedora(desenvolvedora){\n let jogos = [];\n\n for (let categoria of jogosPorCategoria) {\n for ( let jogo of categoria.jogos ) {\n if (jogo.desenvolvedora === desenvolvedora){\n jogos.push(jogo.titulo)\n } \n }\n }\n console.log(\"Os jogos da \" + desenvolvedora + \" são: \" + jogos)\n}", "function promedio_filas(matrix) {\n let arr_promedios = [];\n for (let i = 0; i < rows; i++){\n let sum_fila = 0;\n for (let j = 0; j < cols; j++){\n sum_fila += matrix[i][j];\n }\n arr_promedios[i] = sum_fila / cols;\n }\n return arr_promedios;\n}", "function listarMedicoseAuxiliares(usuario, res){\n\t\tconnection.acquire(function(err, con){\n\t\t\tcon.query(\"select crmv, nomeMedico, telefoneMedico, emailMedico from Medico, Responsavel where Medico.Estado = Responsavel.Estado and Medico.Cidade = Responsavel.Cidade and Responsavel.idusuario = ?\", [usuario.idusuario], function(err, result){\n\t\t\t\tcon.release();\n\t\t\t\tres.json(result);\n\t\t\t});\n\t\t});\n\t}", "retornaElementosGrupo(arrGrupos = []) {\r\n let matrizGrupos = [];\r\n for (let i = 0; i < this.grupos; i++) {\r\n let divisaoGrupos = [];\r\n for (let j = 0; j < arrGrupos.length; j++) {\r\n if (arrGrupos[j] == i) {\r\n divisaoGrupos.push([this.eixoX[j], this.eixoY[j]]);\r\n }\r\n }\r\n\r\n matrizGrupos.push(divisaoGrupos);\r\n }\r\n return matrizGrupos;\r\n }", "function getMaterial(tipo) {\n var material = \"\";\n\n if (tiraDados(1,100) >= 96) {\n switch (tipo) {\n case 1:\n // Solo madera\n\n break;\n case 2:\n // Solo metal\n\n break;\n default:\n switch (tiraDados(1,10)) {\n case 1:\n\n break;\n default:\n return material;\n }\n }\n } else {\n return material;\n }\n}", "function filtrarAuto() {\r\n // Funcion de alto nivel. Una funcion que toma a otra funcion.\r\n const resultado = autos.filter(filtrarMarca).filter(filtrarYear).filter(filtrarMinimo).filter(filtrarMaximo).filter(filtrarPuertas).filter(filtrarTransmision).filter(filtrarColor);\r\n // console.log(resultado);\r\n if (resultado.length)\r\n mostrarAutos(resultado);\r\n else\r\n noHayResultados();\r\n}", "function nombresDeCartas(mazo) {\n if (mazo[0][1] === 11) {\n console.log(\"Jota de \" + mazo[0][0]);\n } else {\n if (mazo[0][1] === 12) {\n console.log(\"Reina de \" + mazo[0][0]);\n } else {\n if (mazo[0][1] === 13) {\n console.log(\"Rey de \" + mazo[0][0]);\n } else {\n if (mazo[0][1] === 1) {\n console.log(\"Ás de \" + mazo[0][0]);\n } else {\n console.log(mazo[0][1] + \" de \" + mazo[0][0]);\n }\n }\n }\n }\n}", "function majValeurs(){\n\tif(stock !== null){\n\t\t[stock].map((obj) => { \n\t\t\t$('.nb_med').html(Object.keys(obj).length);\n\t\t});\n\t\t\n\t} if(fournisseurs !== null){\n\t\t[fournisseurs].map((obj) => { \n\t\t\t$('.nb_fournisseur').html(Object.keys(obj).length);\n\t\t});\n\t} if(clients !== null){\n\t\t[clients].map((obj) => { \n\t\t\t$('.nb_client').html(Object.keys(obj).length);\n\t\t});\n\t}\n}", "function ListaMedidasValores(index) {\n\n const mv = medidas.map((mv, index) => {\n //const lmv = [];\n return (\n <View key={index} style={{\n flexDirection: 'row',\n justifyContent: 'space-between',\n alignContent: 'center',\n marginTop: 20,\n backgroundColor: '#51557D',\n padding: 10,\n }}>\n <View>\n <Text style={{ color: \"#fff\" }}>{mv.data().Medida}</Text>\n </View>\n <View>\n <Picker\n mode='dropdown'\n onValueChange={valor => {\n\n arrayValores[index] = {\n info: {\n medida: mv.data().Medida,\n valor: valor,\n indice: index,\n },\n }\n setArrayValores(arrayValores);\n setAutoVal(1);\n //console.log(arrayValores);\n }}\n selectedValue={arrayValores[index] != undefined ? arrayValores[index].info.valor : 'Selecione o valor'}\n style={{\n backgroundColor: \"#fff\",\n height: 25,\n width: 150,\n }}\n >\n <Picker.Item value=\"\" label=\"Selecione o valor\" />\n {Valor()}\n <Picker.Item value={null} label=\"Desativado\" />\n </Picker>\n </View>\n </View>\n );\n });\n\n if (valueListaPrato !== '') {\n return mv;\n }\n }", "function mostrarEstAlumnosParaDocente(){\r\n let contadorEjXNivel = 0;//variable para contar cuantos ejercicios planteo el docente para el nivel del alumno\r\n let contadorEntXNivel = 0;//variable para contar cuantos ejercicios de su nivel entrego el alumno\r\n let alumnoSeleccionado = document.querySelector(\"#selEstAlumnos\").value;\r\n let posicionUsuario = alumnoSeleccionado.charAt(1);\r\n let usuario = usuarios[posicionUsuario];\r\n let nivelAlumno = usuario.nivel;\r\n for (let i = 0; i < ejercicios.length; i++){\r\n const element = ejercicios[i].Docente.nombreUsuario;\r\n if(element === usuarioLoggeado){\r\n if(ejercicios[i].nivel === nivelAlumno){\r\n contadorEjXNivel ++;\r\n }\r\n }\r\n }\r\n for (let i = 0; i < entregas.length; i++) {\r\n const element = entregas[i].Alumno.nombreUsuario;\r\n if(element === usuario.nombreUsuario){\r\n if(entregas[i].Ejercicio.nivel === nivelAlumno){\r\n contadorEntXNivel++;\r\n }\r\n }\r\n }\r\n document.querySelector(\"#pMostrarEstAlumnos\").innerHTML = `El alumno ${usuario.nombre} tiene ${contadorEjXNivel} ejercicios planteados para su nivel (${nivelAlumno}) sobre los cuales a realizado ${contadorEntXNivel} entrega/s. `;\r\n}", "function creeTypeMtchGrp1(g, j, m)\r{ // Les équipes sont accessibles depuis les numéros ci-dessous\r\tthis.g = g; // N° de groupe pour accès interne\r\tthis.j = j;// N° de journée\r\tthis.m = m; // N° de match dans la journée\r //----------\r // Résultats\r //----------\r \tthis.sm = [0, 0]; // Manches gagnées par les équipes\r \tthis.sd = [0, 0]; // dés gagnés par les équipes\r \tthis.affecte = mtchGrp1Affecte;\r \tthis.affiche = mtchGrp1Affiche;\r}", "function dataTreatmentForChart(arr_datas) {\n // on parcours le tableau suivant : [arr_joint[0], arr_france[0], arr_belgique[0], arr_suisse[0], arr_canada[0]] (sans les statistiques)\n var res = [];\n for (var i = 0; i < arr_datas.length; i++) {\n //Pour chaque tableau on crée une copie dans current_array\n var current_array = JSON.parse(JSON.stringify(arr_datas[i]));\n //On prend sa longueur\n var len_current = current_array.length;\n for (var j = 0; j < len_current; j++) {\n //On fit le tableau\n current_array[j] = fit(current_array[j]);\n }\n //On flatten le tableau grâce à une copie de celui-ci\n var flatten_array = flatten(JSON.parse(JSON.stringify(current_array)));\n res.push(flatten_array);\n }\n return res;\n}", "function mengelompokkanAngka(arr) {\r\n let c=[];\r\n for(let d=0;d<3;d++){\r\n c.push([]);\r\n }\r\n for(let e = 0; e < arr.length; e++){\r\n if(arr[e] %3===0){\r\n c[2].push(arr[e]);\r\n } else if(arr[e]%2!==0){\r\n c[1].push(arr[e]);\r\n }\r\n else if(arr[e]%2===0){\r\n c[0].push(arr[e]);\r\n } }\r\n return c;\r\n }", "function mostrarMaquina(data, accion){\n if(data.maquina.id_pack==null){\n $('#navPaqueteJuegos').attr('hidden',true);\n $('#navJuego').attr('hidden',false);\n }else{\n // gestiona paquete de juegos\n $('#tablaMtmJuegoPack tbody').empty();\n\n for (i = 0; i < data.juego_pack_mtm.juegos.length; i++) {\n if (i==0){\n pack=data.juego_pack_mtm.juegos[0];\n $('#inputPackActual').val(pack.identificador);\n $('#inputPackActual').attr(\"data-idPack\", pack.id_pack);\n }else{\n agregarJuegosPackMtm(data.juego_pack_mtm.juegos[i]);\n }\n\n }\n\n $('#navPaqueteJuegos').attr('hidden',false);\n $('#navJuego').attr('hidden',true);\n }\n casino_global = data.casino.id_casino;\n $('#buscadorExpediente').generarDataList(\"maquinas/buscarExpedientePorCasinoYNumero/\"+casino_global,'resultados','id_expediente','concatenacion',2,true);\n $('#buscadorExpediente').setearElementoSeleccionado(0,\"\");\n if (data.maquina.juega_progresivo==0){\n $('#juega_progresivo_m').val(\"NO\");\n }else{\n $('#juega_progresivo_m').val(\"SI\");\n }\n\n $('#nro_admin').val(data.maquina.nro_admin);\n $('#marca').val(data.maquina.marca);\n $('#modelo').val(data.maquina.modelo);\n $('#unidad_medida').val(data.maquina.id_unidad_medida);\n $('#nro_serie').val(data.maquina.nro_serie);\n $('#mac').val(data.maquina.mac);\n $('#marca_juego').val(data.maquina.marca_juego);\n $('#marca_juego_check').prop('checked',data.marca_juego_es_generado).trigger('change');\n data.tipo_gabinete != null ? $('#tipo_gabinete').val(data.tipo_gabinete.id_tipo_gabinete) : $('#tipo_gabinete').val(\"\") ;\n data.tipo_maquina != null ? $('#tipo_maquina').val(data.tipo_maquina.id_tipo_maquina) : $('#tipo_maquina').val(\"\");\n $('#estado').val(data.maquina.id_estado_maquina);\n $('#porcentaje_devolucion').val(data.maquina.porcentaje_devolucion);\n if(data.maquina.juega_progresivo == 1){\n $('#juega_progresivo').val(0);\n }\n else {\n $('#juega_progresivo').val(1);\n }\n $('#denominacion').val(data.maquina.denominacion);\n if(data.expedientes != null){\n for(var i=0; i < data.expedientes.length; i++){\n $('#listaExpedientes').append($('<li>')\n .val(data.expedientes[i].id_expediente)\n .addClass('row')\n .css('list-style','none').css('padding','5px 0px')\n .append($('<div>')\n .addClass('col-xs-7')\n .text(data.expedientes[i].nro_exp_org+'-'+data.expedientes[i].nro_exp_interno + '-' + data.expedientes[i].nro_exp_control)\n )\n .append($('<div>')\n .addClass('col-xs-5')\n .append($('<button>')\n .addClass('btn').addClass('btn-danger').addClass('borrarFila').addClass('borrarExpediente')\n .append($('<i>')\n .addClass('fa').addClass('fa-trash')\n )\n )\n )\n )\n }\n }\n\n $('#tipo_moneda').val(data.moneda != null? data.moneda.id_tipo_moneda: null);\n\n var text=$('#modalMaquina .modal-title').text();\n\n //Datos pesataña isla\n console.log(data.isla);\n if(data.isla != null){//si no tiene isla asociada, puede pasar al modifcar isla\n mostrarIsla(data.casino, data.isla ,data.sectores, data.sector);\n //seteo datos pensataña maquina\n text= text +\" N°: \" + data.maquina.nro_admin + \" ISLA: \"+data.isla.nro_isla ;\n $('#modalMaquina .modal-title').text(text);\n }else{\n text= text +\" N°: \" + data.maquina.nro_admin + \" ISLA: SIN ASIGNAR \";\n $('#modalMaquina .modal-title').text(text);\n }\n\n mostrarJuegos(data.maquina.id_casino,data.juegos,data.juego_activo);\n\n data.gli_soft != null ? mostrarGliSofts(data.gli_soft) : null;\n data.gli_hard != null ? mostrarGliHard(data.gli_hard) : null;\n data.formula != null ? mostrarFormula(data.formula) : null;\n}", "function MelhorResult(){\n\tconsole.info(Cidade);\n\tvar CidadeTOP = new Object();\n for(var cont=0;cont<Cidade.length;cont++){\n if(CidadeTOP.aptidao>Cidade[cont].aptidao || CidadeTOP.aptidao == null){\n CidadeTOP = new Object(Cidade[cont]);\n }\n }\n\tconsole.log(\"Individuo mais qualificado:\");\n\tconsole.info(CidadeTOP);\n\tconsole.log(\"Nº Pessoas: \"+Cidade.length);\n}", "function exe04() {\n var matriz = [];\n var totalLinha = [];\n var total = 0;\n var maior = 0;\n var showMaior = 0;\n\n //Insere os números na matriz\n for (var i = 0; i < 5; i++) {\n matriz[i] = [];\n\n for (var x = 0; x < 5; x++) {\n matriz[i][x] = Math.floor(Math.random() * 4) + 10;\n }\n }\n\n // // Escreve a matriz na tela\n for (var i = 0; i < 5; i++) {\n for (var x = 0; x < 5; x++) {\n document.write(matriz[i][x] + \", \");\n }\n document.write(\"<br>\")\n }\n\n document.write(\"<br>\")\n\n // Faz a soma de cada linha da matriz e a soma total\n for (var i = 0; i < 5; i++) {\n total += matriz[i][i];\n }\n\n document.write(\"<br>\")\n document.write(\"Total da diagonal - \" + total);\n}", "function fillCustomLists()\n{\n var i = 0;\n\n var veto_br = CalcMenu.returnVetoBreakfast();\n var veto_pr = CalcMenu.returnVetoPrimo();\n var veto_se = CalcMenu.returnVetoSecondo();\n var veto_cont = CalcMenu.returnVetoContorno();\n var veto_comp = CalcMenu.returnVetoCompleto();\n var veto_fr1 = CalcMenu.returnVetoFrutta();\n var veto_pn1 = CalcMenu.returnVetoPane();\n var veto_mer = CalcMenu.returnVetoMerenda();\n\n\n for (i = 0; i < breakfastModel.count; i++)if (!checkArray(veto_br,i)) listaColazioni.append({\"text\": breakfastModel.get(i).name, \"id\": i});\n for (i = 0; i < primiModel.count; i++) if (!checkArray(veto_pr,i)) listaPrimi.append({\"text\": primiModel.get(i).name, \"id\": i});\n for (i = 0; i < secondiModel.count; i++) if (!checkArray(veto_se,i)) listaSecondi.append({\"text\": secondiModel.get(i).name, \"id\": i});\n for (i = 0; i < contorniModel.count; i++) if (!checkArray(veto_cont,i)) listaContorni.append({\"text\": contorniModel.get(i).name, \"id\": i});\n for (i = 0; i < fullMealModel.count; i++) if (!checkArray(veto_comp,i)) listaFullMeal.append({\"text\": fullMealModel.get(i).name, \"id\": i});\n for (i = 0; i < fruttaModel.count; i++) if (!checkArray(veto_fr1,i)) listaFrutta.append({\"text\": fruttaModel.get(i).name, \"id\": i});\n for (i = 0; i < paneModel.count; i++) if (!checkArray(veto_pn1,i)) listaPane.append({\"text\": paneModel.get(i).name, \"id\": i});\n for (i = 0; i < snacksModel.count; i++) if (!checkArray(veto_mer,i)) listaSnacks.append({\"text\": snacksModel.get(i).name, \"id\": i});\n\n}", "function cargar_medicos() {\n var array = ['MARCELO GONZALEZ', 'MARIA ACEVEDO', 'CHRISTINA HAFERMALZ ADANIEL', 'DANIEL AGUIRRE', 'XIMENA AHUMADA', 'IGNACIA ALLENDE', 'RODRIGO PEREZ'];\n array.sort();\n addOptions(\"medico\", array);\n}", "function mostrarMediciones() {\n var medicionesContent = document.getElementById(\"mediciones-content\");\n console.log(medicionesContent);\n\n //console.log(\"mostrarMediciones()\");\n let promesa = laLogica.recuperarMediciones().then((mediciones) => {\n if (mediciones) {\n medicionesContent.innerHTML = \"\";\n mediciones.forEach((medicion) => {\n //console.log(medicion);\n let row = document.createElement(\"div\");\n row.classList.add(\"row\");\n\n let divHora = document.createElement(\"div\");\n divHora.innerText = medicion.momento\n .toString()\n .replace(\"T\", \" \")\n .replace(\"Z\", \" \");\n divHora.classList.add(\"cell\");\n let divValor = document.createElement(\"div\");\n divValor.innerText = medicion.valor;\n divValor.classList.add(\"cell\");\n\n let divUbicacion = document.createElement(\"div\");\n divUbicacion.innerText =\n \"lat: \" + medicion.ubicacion.x + \", lng: \" + medicion.ubicacion.y;\n divUbicacion.classList.add(\"cell\");\n\n row.append(divHora);\n row.append(divValor);\n row.append(divUbicacion);\n medicionesContent.appendChild(row);\n });\n } else {\n }\n });\n}", "function cuadradoMedio(semilla, tamano, iteraciones) {\n //inicializar variables\n var sem = Number(semilla);\n var tam = Number(tamano);\n var ite = Number(iteraciones);\n var semillaiteracion = sem; //se inicializa una variable que va acontener la semilla tras cada iteración\n\n var contenido = ''; //inicializar variable que llevara el html de la tabla\n contenido += '<table><tr><th>Iteración</th><th>Semilla</th><th>Cuadrado</th><th>Número Generado</th></tr>'; //abrir tabla y agregar titulos\n\n //ciclo for por cada una de las iteraciones\n for (i = 0; i < ite; i++) {\n var cuadrado = semillaiteracion * semillaiteracion; // calcular cuadrado de la iteración\n var cuadradostring = cuadrado.toString(); //convertir número a String para mas fácil manipulacion\n var comienzo = Math.floor((cuadradostring.length - tam) / 2); //calcular comienzo de numero medio\n var medio = cuadradostring.substring(comienzo, (comienzo + tam)); //extraer numero medio\n contenido += '<tr class=\"animated fadeInLeft\"><td>' + (i + 1) + '</td><td>' + semillaiteracion.toString() + '</td><td>' + cuadrado.toString() + '</td><td><b>' + medio + '</b></td></tr>'; //imprimir numero medio en tabla\n semillaiteracion = Number(cuadradostring.substring(Math.floor((cuadradostring.length - 4) / 2), Math.floor((cuadradostring.length - 4) / 2) + 4)); //cambiar siguiente semilla al número generado cortado a 4 digitos\n }\n contenido += '</table>'; //cerrar tabla\n $('#cuadrados').empty(); //vaciar resultados anteriores\n $('#cuadrados').append(contenido); //vaciar resultados anteriores\n}", "function ciudades (){\nvar uniqueStorage = removeDuplicates(Storage, \"Ciudad\");\nvar atributos = Array();\n \n if( uniqueStorage.length > 0 ) {\n for( var aux in uniqueStorage )\n atributos.push(uniqueStorage[aux].Ciudad);\n }\n return atributos;\n}", "function retornaElementosGrupo(arrGrupos = []) {\r\n let matrizGrupos = [];\r\n for (let i = 0; i < grupos; i++) {\r\n let divisaoGrupos = [];\r\n for (let j = 0; j < arrGrupos.length; j++) {\r\n if (arrGrupos[j] == i) {\r\n divisaoGrupos.push([eixoX[j], eixoY[j]]);\r\n }\r\n }\r\n\r\n matrizGrupos.push(divisaoGrupos);\r\n }\r\n return matrizGrupos;\r\n}", "function calcula() {\n const data = document.getElementById(\"medianaInput\")\n const lista = parseInt([data.value])\n console.log(lista)\n\n function media(list) {\n const sumaList = list.reduce(\n function (valorAcumulado = 0, nuevoElemento) { //en valorAcumulado se guarda el valor de cada iteracion\n return valorAcumulado + nuevoElemento\n }\n )//como argumento una funcion\n const promedioList = sumaList / list.length\n return promedioList\n }\n \n const mitadLista = parseInt(lista.length / 2)\n\n function esPar(numerito) {\n if (numerito % 2 === 0) { //% modulo= o residuo en una division\n return true\n } else {\n return false\n }\n }\n let mediana;\n if (esPar(lista.length)) {\n const elemento1 = lista[ mitadLista - 1 ]\n const elemento2 = lista[ mitadLista ]\n \n const calcularElemento1y2 = media([\n elemento1,\n elemento2,\n ])\n console.log(elemento1, elemento2)\n mediana = calcularElemento1y2;\n } else {\n mediana = lista[ mitadLista ];\n }\n document.getElementById(\"mediana\").textContent = mediana\n}", "get listarTareas () {\n\n const arreglo = [];\n\n Object.keys(this._listado).forEach(indice => {\n arreglo.push(this._listado[indice]);\n })\n\n return arreglo;\n }", "static getMeasureList(selections) {\n let i = 0;\n let cur = {};\n const rv = [];\n if (!selections.length) {\n return rv;\n }\n cur = selections[0].selector.measure;\n for (i = 0; i < selections.length; ++i) {\n const sel = selections[i];\n if (i === 0 || (sel.selector.measure !== cur)) {\n rv.push({\n selector: {\n staff: sel.selector.staff,\n measure: sel.selector.measure\n },\n staff: sel.staff,\n measure: sel.measure\n });\n }\n cur = sel.selector.measure;\n }\n return rv;\n }", "function mas_cercano(pendientes, caminos)\n{\n//inicializamos las variables usadas\nvar camino_nodo=new Array();//[id_nodo,peso,[Camino]];\ncamino_nodo[2]=new Array();//Aqui guardamos el camino para llegar al menor\nvar tam=pendientes.length;//variable para controlar el numero de iteraciones\nvar aux;\nvar id_menor_actual=pendientes[0];\nvar indice=0;\nvar pos_menor_actual=posicion_camino_dijkstra(pendientes[0],caminos);//\n//console.log(\"El menor es \"+id_menor_actual+\"y esta en la posicion \"+pos_menor_actual);\nvar peso_menor_actual=caminos[pos_menor_actual][1];//Inicializamos con el peso del primero a evaluar\n\t//console.log(\"entro al for???\"+tam);\n\tfor(var i=1;i<tam;i++)\n\t{\n\t//console.log(\"si entro al for siquiera\");\n\taux=posicion_camino_dijkstra(pendientes[i],caminos);//determinamos la posicion del camino al elemento por el que queremos pasar\n\t\tif(peso_menor_actual>caminos[aux][1])//si el peso es mayor\n\t\t{\n\t\t//console.log(\"entre aqui :D\");\n\t\tid_menor_actual=pendientes[i];//guardamos el id del menor actual\n\t\tindice=i;\n\t\tpeso_menor_actual=caminos[aux][1];//guardamos el peso del menor actual\n\t\tpos_menor_actual=aux;//guardamos la posicion del elemento en el arreglo caminos\n\t\t}\n\t}\n\t//console.log(\"ya termine :D\");\n\tcamino_nodo[0]=id_menor_actual;\n\tcamino_nodo[1]=peso_menor_actual;\n\t//copiamos el camino correspondiente en el camino_nodo[2]\n\taux=caminos[pos_menor_actual][2].length;\n\tpendientes.splice(indice, 1);//quitamos el elemento de la lista de pendientes\n\tfor(var i=0;i<aux;i++)\n\t{\n\tcamino_nodo[2][i]=caminos[pos_menor_actual][2][i];\n\t}\n\t\nreturn camino_nodo;\t\n}", "function contaMedaglie(array, n) {\n var somma = d3.sum(array, function(d,i){\n // conta tutti\n if (n=='athletes') return 1\n if (n=='gold') return (d.gold_medals > 0) ? 1 : 0\n if (n=='silver') return (d.silver_medals > 0) ? 1 : 0\n if (n=='bronze') return (d.bronze_medals > 0) ? 1 : 0\n if (n=='any') return (d.total_medals > 0) ? 1 : 0\n if (n=='none') return (d.total_medals == 0) ? 1 : 0\n })\n return somma\n }", "function mapaProcesos_mapa_esquema(jsonObj,cont) {\n //Tenemos el JSON completo y el nivel en el que estamos\n var datos_mp_fullcontent = jsonObj;\n var i = cont;\n\n //Tenemos el segundo array del JSON completo [mp_estructura] -> [subnivel]\n var datos_mp_content = datos_mp_fullcontent[i].subnivel;\n\n for (var j = 0; j < datos_mp_content.length; j++) {\n var result_nombre = \"\";\n var result_nivel = \"\";\n result_nombre = datos_mp_content[j].nombre;\n result_nivel = datos_mp_content[j].nivel;\n result_nivel_sindecimal = result_nivel.split(\"_\",3);\n \n //Recorrido del primer nivel del esquema del MP\n if (result_nivel_sindecimal[0] == \"1\"){\n if (result_nivel_sindecimal[1] == \"01\"){\n texto_a_imprimir += \"<div class=\\\"bc_mp_estruct_part1_25porc\\\"><p></p></div>\"+\n \"<div class=\\\"bc_mp_estruct_part1_50porc\\\">\"+ \n \"<div class=\\\"bc_mp_caja_borde bc_mp_estruct_part1_50porc_intern_33porc\\\">\"+ result_nombre +\"</div>\";\n }\n else\n {\n if (result_nivel_sindecimal[1] == \"02\"){\n texto_a_imprimir += \"<div class=\\\"bc_mp_caja_borde bc_mp_estruct_part1_50porc_intern_33porc\\\">\"+ result_nombre +\"</div>\";\n }\n else\n {\n if (result_nivel_sindecimal[1] == \"03\"){\n texto_a_imprimir += \"<div class=\\\"bc_mp_caja_borde bc_mp_estruct_part1_50porc_intern_33porc\\\">\"+ result_nombre +\"</div>\"+\"</div>\"+\n \"<div class=\\\"bc_mp_estruct_part1_25porc\\\"><p></p></div>\";\n }\n }\n }\n }\n\n //Recorrido del segundo nivel del esquema del MP\n if (result_nivel_sindecimal[0] == \"2\"){\n if (result_nivel_sindecimal[1] == \"01\"){\n texto_a_imprimir += \"<div class=\\\"bc_mp_caja_borde bc_mp_caja_bgcolor_gris2 bc_mp_estruct_part2_16porc\\\">\"+ result_nombre +\"</div>\";\n }\n else{\n if ((result_nivel_sindecimal[1]==\"02\")||(result_nivel_sindecimal[1]==\"05\")){\n texto_a_imprimir += \"<div class=\\\"bc_mp_estruct_part2_05porc\\\">\"+ \">\" +\"</div>\"+\n \"<div class=\\\"bc_mp_estruct_part2_16porc\\\">\"+\n \"<div class=\\\"bc_mp_caja_borde bc_mp_caja_bgcolor_gris2 bc_mp_estruct_part2_16porc_agrupados_bottom\\\">\"+ result_nombre +\"</div>\";\n }\n else\n {\n if ((result_nivel_sindecimal[1]==\"03\")||(result_nivel_sindecimal[1]==\"06\")){\n texto_a_imprimir += \"<div class=\\\"bc_mp_caja_borde bc_mp_caja_bgcolor_gris2 bc_mp_estruct_part2_16porc_agrupados_top\\\">\"+ result_nombre +\"</div>\"+\n \"</div>\";\n }\n }\n if ((result_nivel_sindecimal[1] == \"04\")||(result_nivel_sindecimal[1] == \"07\")){\n texto_a_imprimir += \"<div class=\\\"bc_mp_estruct_part2_05porc\\\">\"+ \">\" +\"</div>\"+\n \"<div class=\\\"bc_mp_caja_borde bc_mp_caja_bgcolor_gris2 bc_mp_estruct_part2_16porc\\\">\"+ result_nombre +\"</div>\";\n }\n }\n }\n\n //Recorrido del tercer nivel del esquema del MP\n if (result_nivel_sindecimal[0] == \"3\"){\n if (result_nivel_sindecimal[1] < \"20\"){\n if (result_nivel_sindecimal[1] == \"01\"){\n texto_a_imprimir += \"<div class=\\\"bc_mp_estruct_part3_50porc\\\">\";\n }\n \n\n texto_a_imprimir += \"<div class=\\\"bc_mp_caja_borde bc_mp_estruct_part3_50porc_intern_33porc\\\">\"+ result_nombre +\"</div>\";\n }\n else\n {\n if (result_nivel_sindecimal[1] == \"21\"){\n texto_a_imprimir += \"</div><div class=\\\"bc_mp_estruct_part3_50porc\\\">\";\n }\n\n texto_a_imprimir += \"<div class=\\\"bc_mp_caja_borde bc_mp_caja_bgcolor_gris1 bc_mp_estruct_part3_50porc_intern_33porc\\\">\"+ result_nombre +\"</div>\";\n\n if (result_nivel_sindecimal[1] == \"29\"){\n texto_a_imprimir += \"</div>\";\n }\n }\n }\n\n }\n texto_a_imprimir += \"</div>\";\n}", "async function listMatkul() {\n const prodis = await db.query(\n 'SELECT kode, nama FROM program_studi',[]\n );\n const data_prodi = helper.emptyOrRows(prodis);\n \n let data = [];\n for (const prodi of data_prodi) {\n const rows = await db.query(\n 'SELECT * FROM mata_kuliah WHERE kode_program_studi = ?',[prodi.kode]\n );\n const matkul = helper.emptyOrRows(rows);\n let arr = {\n kode: prodi.kode,\n nama: prodi.nama,\n matkul: matkul\n };\n data.push(arr);\n }\n const status = \"OK\";\n const info = \"Data Berhasil di Dapatkan\";\n\n return {status, info, data};\n}", "formata_dados_v2( resposta_HANA ){\n const reducer = (r, row) => {\n \n const key_caminhao = `${row.ID} - ${row.Unidade} - ${row.Nome} - ${row.Placa} - ${row.Transportadora} - ${row.Modal} - ${row.Dia} - ${row.Transportadora} - ${row.Modal} -${row.Nome}`;\n const key_entrega = `${row.Item_pedido} - ${row.Cod_Material} - ${row.Material} - ${row.Remessa} - ${row.Dia} - ${row.N_nota_fiscal} - ${row.Peso}`;\n\n const caminhoes = {\n ID: parseInt(row.ID),\n Unidade: row.Unidade,\n Status: row.Status || 'Aguardando chegada do veículo',\n Nome: row.Nome,\n Placa: row.Placa,\n Transportadora: row.Transportadora,\n Modal: row.Modal,\n Dia: row.Dia,\n Material: row.Material,\n Materiais: {},\n Assinaturas: []\n };\n\n r[key_caminhao] = r[key_caminhao] || caminhoes;\n\n const entregas = {\n Item_pedido: row.Item_pedido,\n Cod_Material: row.Cod_Material,\n Material: row.Material,\n Remessa: row.Remessa,\n Dia: row.Dia,\n N_nota_fiscal: row.N_nota_fiscal,\n Peso: parseInt(row.Peso.replace('.', ''))\n };\n\n r[key_caminhao]['Materiais'][key_entrega] = r[key_caminhao]['Materiais'][key_entrega] || entregas;\n\n return r;\n };\n\n const organizado = resposta_HANA.reduce( (r, row) => reducer(r, row), {});\n\n const obj_organizado = Object.values(organizado);\n\n const obj_organizado_2 = obj_organizado.map( item => {\n item['Materiais'] = Object.values(item['Materiais']);\n\n return item\n });\n\n return obj_organizado_2;\n }", "function getResources(){\n\tresourcesList = new Array();\n\tfor(n in indices){\n\t\tif(marcadores_definitivos[indices[n]].tipo == \"police\" || marcadores_definitivos[indices[n]].tipo == \"firemen\" ||\n\t\t\t\tmarcadores_definitivos[indices[n]].tipo == \"ambulance\" || marcadores_definitivos[indices[n]].tipo == \"nurse\" ||\n\t\t\t\tmarcadores_definitivos[indices[n]].tipo == \"gerocultor\" || marcadores_definitivos[indices[n]].tipo == \"assistant\" ||\n\t\t\t\tmarcadores_definitivos[indices[n]].tipo == \"otherStaff\"){\n\t\t\tresourcesList[n] = indices[n];\n\t\t}\n\t}\n}", "function addMateriaPrima (item,cant,$index){\n\t\t\tvar p = { producto: undefined, nombre:undefined, cantidad: undefined, total: undefined };\n\t\t\tvar ok = false;\n\t\t\tfor (var i in product.produccion){\n\t\t\t\tif ((product.produccion[i].producto !== undefined)&&(product.produccion[i].producto !== null)){\n\t\t\t\t\tif (product.produccion[i].producto._id === item._id){\n\t\t\t\t\t\tok = true;\n\t\t\t\t\t\t$scope.errorRepetido[$index] = 'Materia Prima existente';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (ok === false ){\n\t\t\t\tp.producto = item;\n\t\t\t\tp.nombre = item.name;\n\t\t\t\tp.cantidad = cant;\n\t\t\t\tp.total = cant * item.costPerUnit;\n\t\t\t\tproduct.produccion.push(p);\n\t\t\t\tproduct.costPerUnit = product.costPerUnit + p.total;\n\t\t\t}\n\t\t} //end addMateria", "function andarMunicao(item, indice, municoes){\n\tif(jogoEmAndamento==true){\n\t\tswitch(municoes[indice].getDirecao()){\n\t\tcase(1): // Andar para leste\n\t\t\tmunicoes[indice].setX(municoes[indice].getX()-5);\n\t\t\tbreak;\n\t\tcase(2): // Andar para oeste\n\t\t\tmunicoes[indice].setX(municoes[indice].getX()+5);\n\t\t\tbreak;\n\t\tcase(3): // Andar para norte\n\t\t\tmunicoes[indice].setY(municoes[indice].getY()-5);\n\t\t\tbreak;\n\t\tcase(4): // Andar para sul\n\t\t\tmunicoes[indice].setY(municoes[indice].getY()+5);\n\t\t\tbreak;\n\t\tcase(5): // Andar para noroeste\n\t\t\tmunicoes[indice].setX(municoes[indice].getX()-5);\n\t\t\tmunicoes[indice].setY(municoes[indice].getY()-5);\n\t\t\tbreak;\n\t\tcase(6): // Andar para nordeste\n\t\t\tmunicoes[indice].setX(municoes[indice].getX()+5);\n\t\t\tmunicoes[indice].setY(municoes[indice].getY()-5);\n\t\t\tbreak;\n\t\tcase(7): // Andar para sudoeste\n\t\t\tmunicoes[indice].setX(municoes[indice].getX()-5);\n\t\t\tmunicoes[indice].setY(municoes[indice].getY()+5);\n\t\t\tbreak;\n\t\tcase(8): // Andar para sudeste\n\t\t\tmunicoes[indice].setX(municoes[indice].getX()+5);\n\t\t\tmunicoes[indice].setY(municoes[indice].getY()+5);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tmunicoes[indice].setX(municoes[indice].getX()-5);\n\t\t \tbreak;\n\t\t}\n\t}\n}", "function merr()\n{\t\n\tmesazhGabimi = \"\";\n\n\tfor( var i = 0; i < checkboxet.length; i++ )\n\t{\n\t\tif( checkboxet[ i ].checked )\n\t\t{\n\t\t\tvar fusha = document.getElementById( \"fusha\" + ( i + 1 ) );\n\n\t\t\tif( Number( fusha.value ) && ( 1 <= Number( fusha.value ) && Number( fusha.value ) <= 10 ))\n\t\t\t{\n\t\t\t\tvar tmp = { pozicioni: i, vlera: Number( fusha.value ) };\n\n\t\t\t\tfushatAktive.push( tmp );\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\n\t\t\t\tgabim = true;\n\n\t\t\t\tmesazhGabimi += \"<br>Vlere e palejuar ne fushen e \" + ( i + 1 );\n\t\t\t}\n\t\t} ///FUND if\n\t\t\t\t\t} ///FUND for\n\t} ///FUND merr", "function mostrarMovimientosEnPantalla() {\n let cartel = document.getElementById('movimientos');\n let limite = document.getElementById('movimientos-restantes');\n cartel.innerText = movimientos.length;\n limite.innerText = `Movimientos restantes: ${limiteMovimientos}`;\n}", "function buscarTodosOsAnimaisDaFila(){\n for(let animal of fila_cartas){\n let id = parseInt(animal.id.split(\"-\")[0]);\n\n //se ainda nao temos o tipo do animal na fila, insere\n if(habilidade_animais.indexOf(id)===-1) habilidade_animais.push(id);\n }\n}", "function getBest5() {\r\n let productos_vendidos = [];\r\n for (let i = 0; i < productosBD.length; i++) {\r\n let t = 0;\r\n for (let j = 0; j < venta_productoBD.length; j++) {\r\n // console.log(\"aqui\", productosBD[i].id, venta_productoBD[j].id_producto);\r\n if (productosBD[i].id === venta_productoBD[j].id_producto) {\r\n t += venta_productoBD[j].cantidad;\r\n }\r\n }\r\n productos_vendidos.push({\r\n p_id: productosBD[i].id,\r\n name: productosBD[i].nombre,\r\n qty: t,\r\n });\r\n }\r\n\r\n var mayor_menor = [];\r\n\r\n var names = [];\r\n var qty = [];\r\n\r\n for (let i = 0; i < 5; i++) {\r\n var max = productos_vendidos.reduce(function (prev, current) {\r\n return prev.qty > current.qty ? prev : current;\r\n });\r\n mayor_menor.push(max);\r\n names.push(max.name);\r\n qty.push(max.qty);\r\n for (let j = 0; j < productos_vendidos.length; j++) {\r\n if (max.p_id === productos_vendidos[j].p_id) {\r\n productos_vendidos.splice(j, 1);\r\n }\r\n }\r\n }\r\n\r\n console.log(mayor_menor);\r\n return [names, qty];\r\n}", "function iniciarListaBusqueda(){\n var ciclos = selectDatoErasmu();\n for(var aux = 0, help = 0 ; aux < erasmu.length ; aux++){\n if(ciclos.indexOf(erasmu[aux].ciclo) != -1){\n crearListErasmu(erasmu[aux]);\n }\n }\n}", "function comprobarMinasAl() {\n\n for (var i = 0; i < longitud; i++) {\n for (var j = 0; j < longitud; j++) {\n if (minas[i][j] == \"*\") {\n minas[i][j] = calcularMinasAlrededor(i, j);\n }\n }\n }\n }", "function organizingContainers(container) {\n result = POSSIBLE;\n let acumFila = 0;\n let acumColumna = 0;\n let terminar = false;\n while (result === POSSIBLE && terminar === false) {\n for (let f = 0; f < container.length; f++) {\n for (let c = 0; c < container[f].length; c++) {\n acumFila += container[f][c];\n acumColumna += container[c][f]\n }\n //console.log(acumFila);\n //console.log(acumColumna);\n if (acumFila != acumColumna) { result = IMPOSSIBLE }\n acumFila = 0;\n acumColumna = 0;\n }\n terminar = true;\n }\n\n return result;\n}", "function filtrar(){\n $(\"#grillaProductos>div\").hide();\n let arrayTemp=[];\n for (let i=0; i<$(\".checkbox\").length; i++ ){\n if($(\".checkbox\")[i].checked){\n switch (i){\n case 0:\n arrayTemp= arrayTemp.concat(arrayProductos.filter(el=>el.nombre.split(/(?=[A-Z])/)[0]==\"shampoo\"));\n break;\n case 1:\n arrayTemp= arrayTemp.concat(arrayProductos.filter(el=>el.nombre.split(/(?=[A-Z])/)[0]==\"acondicionador\"));\n break;\n case 2:\n arrayTemp= arrayTemp.concat(arrayProductos.filter(el=>el.nombre.split(/(?=[A-Z])/)[0]==\"combo\"));\n break;\n }\n }\n }\n \n if (arrayTemp.length === 0){\n $(\"#grillaProductos>div\").show();\n }else{\n arrayTemp.forEach(element => {\n $(`#${element.nombre}CardgrillaProductos`).show(); \n });\n }\n }", "function geraGraficos(){\n\tif(!dados)\n\t\treturn;\n\n\t$(\"#logado_main center\" ).remove();\n\tif(!dados.length)\n\t{\n\t\t//alert(\"Não há nenhum teste registrado!\");\n\t\treturn;\n\t}\n\n\tvar congruentes = 0;\n\tvar incongruentes = 0;\n\tvar graficoGlobalC = [];\n\tvar graficoGlobalI = [];\n\tvar grupos = [];\n\n\tfor(var i=0; i < dados.length; i++)\n\t{\n\t\tif(grupos.indexOf(dados[i].grupo) < 0 )\n\t\t{\n\t\t\tgrupos.push(dados[i].grupo);\n\t\t}\n\t}\n\nfor(var m=0; m<grupos.length; m++)\n{\n\tfor(var j =0; j <dados.length; j++){\n\t\tif(dados[j].grupo == grupos[m])\n\t\t{\n congruentes = 0;\n incongruentes = 0;\n\t\t\tfor( var i = 0; i < dados[0].ordemBateria.length; i++){\n\t\t\t\tif(dados[0].ordemBateria[i] == \"C\"){\n\t\t\t\t\tgraficoGlobalC.push(dados[j].stringResposta[congruentes+incongruentes]);\n\t\t\t\t\tcongruentes++;\n\t\t\t\t}\n\t\t\t\tif(dados[0].ordemBateria[i] == \"I\"){\n\t\t\t\t\tgraficoGlobalI.push(dados[j].stringResposta[congruentes+incongruentes]);\n\t\t\t\t\tincongruentes++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif(congruentes)\n\t plotaGraficoMedia(graficoGlobalC, congruentes,\"Media Congruente do grupo \"+(grupos[m]), \"graficoCMedia\");\n\tif(incongruentes)\n\t\tplotaGraficoMedia(graficoGlobalI, incongruentes,\"Media Incongruente do grupo \"+(grupos[m]), \"graficoIMedia\");\n\n\t\tcongruentes = 0;\n\t\tincongruentes = 0;\n\t\tgraficoGlobalC=[];\n\t\tgraficoGlobalI=[];\n}\n\n\n\n\n\tfor( var i = 0; i< dados[0].ordemBateria.length; i++){\n\t\tif(dados[0].ordemBateria[i] == \"C\"){\n\t\t\tplotaGraficoX(congruentes+incongruentes,\"Congruente \"+(congruentes+1), \"graficoC\");\n\t\t\tcongruentes++;\n\t\t}\n\n\t\tif(dados[0].ordemBateria[i] == \"I\"){\n\t\t\tplotaGraficoX(congruentes+incongruentes,\"Incongruente \"+(incongruentes+1), \"graficoI\");\n\t\t\tincongruentes++;\n\t\t}\n\t}\n\n}", "function dibujar_lingas_tier(){\n for(var i=0;i<Linga.length;i++){\n var padre=$(\"#\"+Linga[i].id_tier); // SELECCIONO EL TIER PADRE\n var left=padre.position().left;\n var top=padre.position().top;\n\n // ASIGNAR CLASE RESPECTO A SU GIRO\n if(Linga[i].giro==\"0\"){\n var linga_tier=$(\"<div><p class='cant_unit_sin_giro'>\"+Linga[i].cantidad+\"</p></div>\");\n }else{\n var linga_tier=$(\"<div><p class='cant_unit_con_giro'>\"+Linga[i].cantidad+\"</p></div>\");\n }\n\n // ASIGNAR MARCA SEGUN EMPRE\n\n if(Linga[i].marca==1){\n\n if(Linga[i].company == \"ARAUCO\"){\n var marca=$(\"<img src='../imagenes/marcas/ARAUCO/\"+Linga[i].marca_arauco+\".png' width='18px'>\");\n }\n if(Linga[i].company == \"CMPC\"){\n var marca=$(\"<img src='../imagenes/marcas/CMPC/\"+Linga[i].marca_cmpc+\".png' width='18px'>\");\n }\n }\n // ESTILOS DE LA IMAGEN DE LA MARCA\n $(marca).css({\n \"position\":\"absolute\",\n \"top\":4,\n \"left\":4\n });\n\n // ESTILOS DE A LINGA\n $(linga_tier).css({\n \"position\":\"absolute\", // YA QUE SU POSITION ES ABSOLUTE\n \"top\":(parseFloat(Linga[i].posx)+parseFloat(top))+\"px\", //SE ASIGNA POSICION RESPECTO\n \"left\":(parseFloat(Linga[i].posy)+parseFloat(left))+\"px\", // AL DOCUMENT\n \"width\":Linga[i].ancho,\n \"height\":Linga[i].alto,\n \"text-align\":\"center\",\n \"outline\": \"1px solid\" // BORDE HACIA DENTRO\n });\n linga_tier.append(marca);\n padre.append(linga_tier);\n marca=\"\";\n }\n}", "function MA(){\n\tvar idLogin = $('.idLogin').val();\n\tvar typeQuery = $('.typeQuery').val();\n\n\tconsole.log(idLogin, typeQuery);\n\t$.ajax({\n\t\ttype: 'POST',\n\t\tdataType: 'JSON',\n\t\turl: 'controller/ControladorGestionarReinscripcion.php',\n\t\tdata:{\n\t\t\tidLogin: idLogin,\n\t\t\ttypeQuery: typeQuery\n\t\t},\n\t\tsuccess:function(data){\n\t\t\tconsole.log(data.materias.length);\n\t\t\t$('.nombreA').html(data.NMT[0].nombreAlum);\n\t\t\t$('.matricula').html(data.NMT[0].matriculaAlum);\n\t\t\t$('.carrera').html(data.CC[0].nombreCarrera);\n\t\t\t$('.cuatrimestre').html(data.CC[0].nuCuatri);\n\t\t\t$('.turno').html(data.NMT[0].turnoAlum);\n\n\t\t\t$('select#materia').append('<option value=\"0\" selected=\"\" disabled=\"\">Seleccione una materia</option>');\n\t\t\tfor (var i = 0; i < data.materias.length; i++) {\n\t\t\t\t$('select#materia').append('<option value=\"'+data.materias[i].idMateria+'\">'+data.materias[i].nameMateria+'</option>');\n\t\t\t}\n\t\t}\n\t});\n}", "function getMarcas() {\r\n\t\t\t\t\t\t$.ajax({\r\n\t\t\t\t\t\t\turl : 'CRUDMarcaServlet',\r\n\t\t\t\t\t\t\ttype : 'POST',\r\n\t\t\t\t\t\t\tdata : {\r\n\t\t\t\t\t\t\t\t\"operation\" : \"list\"\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\tsuccess : function(response) {\r\n\t\t\t\t\t\t\t\t// alert(JSON.stringify(response));\r\n\t\t\t\t\t\t\t\tfillSelectMarcas(response);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t}", "FindMeter(clave) {\n this.limpiar();\n let conteo = 0;\n this.initMedidor();\n this.initRegistro();\n if (this.medidores) {\n for (let index = 0; index < this.medidores.length; index++) {\n const element = this.medidores[index];\n console.log(clave, '==', element.clave);\n if (clave == element.clave) {\n this.medidor = element;\n this.meterId = element._id;\n this.registro.meter = element._id;\n // this.loadRegisters(this.medidor._id);\n this.tarifa = element.rate;\n if (this.tarifa.percent_cost == true) {\n let costo;\n costo = this.extras[0].rmuv * (this.tarifa.base / 100);\n this.registro.base = costo;\n }\n else if (this.tarifa.percent_cost == false) {\n this.registro.base = this.tarifa.base;\n }\n console.log('dentro de find meter, Registro: ', this.registro, '. tarifa: ', this.tarifa);\n this.initLimits(this.tarifa._id);\n this.clave_medidor = element.clave;\n conteo++;\n this.loadRegisters(this.medidor._id);\n }\n }\n if (conteo === 1) {\n this.encontrado = true;\n this.launchAlert('success', 'Medidor Encontrado', null, null, false, 1500, false, 'top-end', 'row', true);\n }\n else if (conteo === 0 && clave.length > 5) {\n this.encontrado = false;\n this.launchAlert('error', 'Medidor Incorrecto', null, null, false, 1500, false, 'top-end', 'row', true);\n }\n else if (conteo === 0 && clave.length < 6) {\n this.encontrado = null;\n }\n }\n }", "function obtenerCategoriasSemanticas(listadoconceptos) {\n\tlet categoriasSemanticas = []; //array donde voy a almacenar las categorias semanticas\n\t//Recorro todos los conceptos y me quedo con las categorias semanticas\n\tfor (let index = 0; index < listaConceptos.length; index++) {\n\t\tcategoriasSemanticas.push(listaConceptos[index].categoria_semantica);\n\t}\n\tcategoriasSemanticas = [...new Set(categoriasSemanticas)]; //elimino los elementos repetidos\n\treturn categoriasSemanticas;\n}", "function mostrarSedesCarrera() {\n let carreraSelect = this.dataset.codigo;\n let carrera = buscarCarreraPorCodigo(carreraSelect);\n let listaCursos = getListaCursos();\n let listaCheckboxCursos = document.querySelectorAll('#tblCursos tbody input[type=checkbox]');\n let codigosCursos = [];\n\n for (let i = 0; i < carrera[7].length; i++) {\n codigosCursos.push(carrera[7][i]);\n }\n\n for (let j = 0; j < listaCursos.length; j++) {\n for (let k = 0; k < codigosCursos.length; k++) {\n if (listaCursos[j][0] == codigosCursos[k]) {\n listaCheckboxCursos[j].checked = true;\n }\n }\n }\n verificarCheckCarreras();\n}", "function creacionTablero() {\n arrayMina = [];\n numeroDeBanderas = 0;\n tableroArrayDom = [campoMinas.length];\n let $divContenedor = $('<div></div>'); //Div intermedio, lo usamos para no hacer más de una carga al Dom. \n for (let i = 0; i < campoMinas.length; i++) {\n tableroArrayDom[i] = [campoMinas.length];\n for (let j = 0; j < campoMinas[1].length; j++) {\n tableroArrayDom[i][j] = $('<div id=' + i + '_' + j + ' class=\"casillaBuscamina\"><span><span></div>');\n $divContenedor.append(tableroArrayDom[i][j]);\n if (campoMinas[i][j].valor === 9) {\n arrayMina.push(tableroArrayDom[i][j]); //Creación de una array con las coordenadas de las minas para acceder a ellas de una manera más facil.\n numeroDeBanderas++;\n }\n }\n }\n $numeroDeBanderasDom.text(numeroDeBanderas);\n $tableroDom.html($divContenedor);\n aplicaEstilosTablero();\n }", "function cargarMiniaturas()\n{\n obtenerNoticiasPorCategoria(\"Miniaturas\", 5);\n}", "asistenciasTotalesPorDia(equipo){\n let len = equipo.length;\n let asistencia_total = [];\n let total_lunes=0;\n let total_martes=0;\n let total_miercoles=0;\n let total_jueves=0;\n let total_viernes=0;\n let total_sabado=0;\n let total_domingo=0;\n \n for (var i = 0; i <len; ++i) {\n total_lunes = total_lunes + (equipo[i].asistencia.lunes * equipo[i].factor_dias_laborados);\n total_martes = total_martes+ (equipo[i].asistencia.martes * equipo[i].factor_dias_laborados);\n total_miercoles = total_miercoles + (equipo[i].asistencia.miercoles * equipo[i].factor_dias_laborados);\n total_jueves = total_jueves + (equipo[i].asistencia.jueves * equipo[i].factor_dias_laborados);\n total_viernes = total_viernes + (equipo[i].asistencia.viernes * equipo[i].factor_dias_laborados);\n total_sabado = total_sabado + (equipo[i].asistencia.sabado * equipo[i].factor_dias_laborados);\n // total_domingo = total_domingo + (equipo[i].asistencia.domingo * equipo[i].factor_dias_laborados);\n }\n\n asistencia_total.push(total_lunes);\n asistencia_total.push(total_martes);\n asistencia_total.push(total_miercoles);\n asistencia_total.push(total_jueves);\n asistencia_total.push(total_viernes);\n asistencia_total.push(total_sabado);\n // asistencia_total.push(total_domingo);\n\n \n return asistencia_total;\n }", "function listMajors() {\n\twindow.alert(\"lm\");\n\tgapi.client.sheets.spreadsheets.values.get({\n\t\tspreadsheetId : '16Fy4uF1MVpAkoW-ads6XabQnuOK2HJQ63mn7FUnNjkE',\n\t\trange : 'Second!F9:F11',\n\t\tmajorDimension : 'COLUMNS',\n\t}).then(function(response) {\n\t\tvar range = response.result;\n\t\tif (range.values.length > 0) {\n\t\t\twindow.alert('Name, Major:');\n\t\t\tfor (i = 0; i < range.values.length; i++) {\n\t\t\t\tvar row = range.values[i];\n\t\t\t\t// Print columns A and E, which correspond to indices 0 and 4.\n\t\t\t\twindow.alert(row[0]);\n\t\t\t}\n\t\t} else {\n\t\t\twindow.alert('No data found.');\n\t\t}\n\t}, function(response) {\n\t\twindow.alert('Error: ' + response.result.error.message);\n\t});\n}", "function selecionarCategoria(){\n\tlet itensAtuais = []\n\tlet i = 0\n\tlivro.map((livro) =>{ \n\t\tif(itensAtuais.indexOf(livro.categoria) === -1){\n\t\t\titensAtuais[i] = livro.categoria\n\t\t\ti++\n\t\t}\n\t})\n\n\tresp = prompt(`Essas sao as categorias disponiveis\n\n\t\t${itensAtuais}\n\n\t\tQual categoria deseja visualizar?`)\n\n\tconst escolha = livro.filter(livro=>livro.categoria === resp)\n\n\tcriarTabela(escolha)\n\n}", "function compruebo_filas_columnas_diagonales(jugador){ // compruebo si se gana o empata\n\n if((tablero[0][0]==tablero[0][1])&&(tablero[0][1]==tablero[0][2])&&(tablero[0][2]==jugador)){ //filas\n alert (\" Ha ganado \"+jugador);\n location.reload();\n }\n if((tablero[1][0]==tablero[1][1])&&(tablero[1][1]==tablero[1][2])&&(tablero[1][2]==jugador)){\n alert (\" Ha ganado \"+jugador);\n location.reload();\n }\n if((tablero[2][0]==tablero[2][1])&&(tablero[2][1]==tablero[2][2])&&(tablero[2][2]==jugador)){\n alert (\" Ha ganado \"+jugador);\n location.reload();\n }\n if((tablero[0][0]==tablero[1][1])&&(tablero[1][1]==tablero[2][2])&&(tablero[2][2]==jugador)){ //diagonales\n alert (\" Ha ganado \"+jugador);\n location.reload();\n }\n if((tablero[0][2]==tablero[1][1])&&(tablero[1][1]==tablero[2][0])&&(tablero[2][0]==jugador)){\n alert (\" Ha ganado \"+jugador);\n location.reload();\n }\n if((tablero[0][0]==tablero[1][0])&&(tablero[1][0]==tablero[2][0])&&(tablero[2][0]==jugador)){ //columnas\n alert (\" Ha ganado \"+jugador);\n location.reload();\n }\n if((tablero[0][1]==tablero[1][1])&&(tablero[1][1]==tablero[2][1])&&(tablero[2][1]==jugador)){\n alert (\" Ha ganado \"+jugador);\n location.reload();\n }\n if((tablero[0][2]==tablero[1][2])&&(tablero[1][2]==tablero[2][2])&&(tablero[2][2]==jugador)){\n alert (\" Ha ganado \"+jugador);\n location.reload();\n }\n if(fin_partida==4){ // si la maquina lleva 4 turnos, se acaba en empate\n alert(\"EMPATE!!!!\");\n location.reload();\n } \n}", "function contarAutores() {\n let autores = [];\n for (let categoria of livrosPorCategoria) {\n for (let livro of categoria.livros) {\n if (autores.indexOf(livro.autor) == -1) {\n autores.push(livro.autor);\n }\n }\n }\n console.log('Total de autores: ' , autores.length);\n}", "function listarAuxiliaresDoMedicos(usuario, res){\n\t\tconsole.log(\"função Auxiliar Medicos\");\n\t\tconsole.log(usuario);\n\t\tconnection.acquire(function(err, con){\n\t\t\tcon.query(\"select Auxiliar.idusuario, Auxiliar.cpfAuxiliar, nomeAuxiliar, emailAuxiliar, telefoneAuxiliar from Auxiliar, Medico, Medico_Auxiliar where Medico_Auxiliar.Medico = Medico.idusuario and Auxiliar.idusuario = Medico_Auxiliar.Auxiliar and Medico_Auxiliar.status=1 and Medico.idusuario=?\", [usuario.idusuario], function(err, result){\n\t\t\t\tcon.release();\n\t\t\t\tres.status(200);\n\t\t\t\tres.json(result);\n\t\t\t\tconsole.log(result);\n\t\t\t});\n\t\t});\n\t}", "get allMillennialVampires() {\n let millenialVamps = [];\n if (this.yearConverted > 1980) {\n millenialVamps.push(this);\n }\n for (let vampChild of this.offspring) {\n millenialVamps = millenialVamps.concat(vampChild.allMillennialVampires);\n }\n return millenialVamps;\n }" ]
[ "0.5611846", "0.5522354", "0.5487825", "0.54733056", "0.54161376", "0.5362004", "0.53283936", "0.5312302", "0.5306814", "0.5301719", "0.5290203", "0.5288451", "0.5285376", "0.5266509", "0.5254296", "0.5251927", "0.52505857", "0.524609", "0.52444655", "0.52305555", "0.52245694", "0.5208618", "0.5193914", "0.51932347", "0.51918405", "0.5176613", "0.51682043", "0.51594627", "0.515269", "0.5152344", "0.5152319", "0.5148203", "0.51455975", "0.5144724", "0.5141602", "0.5139248", "0.51304877", "0.51257646", "0.51113075", "0.5095933", "0.50912523", "0.508553", "0.5082139", "0.50813806", "0.5081379", "0.5080794", "0.50799143", "0.506913", "0.5064678", "0.50627214", "0.5057702", "0.5056282", "0.50538075", "0.50502497", "0.5044636", "0.50438374", "0.50415504", "0.50371814", "0.503376", "0.50322527", "0.50298834", "0.50275284", "0.5026336", "0.5022072", "0.502038", "0.50112724", "0.5006954", "0.5006461", "0.50006294", "0.49996763", "0.49916193", "0.49901593", "0.4987969", "0.49865156", "0.49851802", "0.49824658", "0.49811527", "0.49719727", "0.49670798", "0.49660808", "0.4962175", "0.49550283", "0.4954566", "0.49523526", "0.49425292", "0.49381152", "0.49363512", "0.49317458", "0.49310455", "0.49292362", "0.49287078", "0.49279007", "0.49264967", "0.4923925", "0.4914271", "0.491413", "0.49112108", "0.4906142", "0.4905777", "0.4905047" ]
0.56832665
0
Item A Bazaar Item published for trade Define Item Model
function define(sequelize) { /** * Potential columns: * * tags * looking_for (items sought in exchange) */ let Item = sequelize.define('item', { title: { type: DataType.STRING, field: 'title', allowNull: false }, description: { type: DataType.TEXT, field: 'description', allowNull: false }, ecv: { type: DataType.INTEGER, field: 'estimated_cash_value' }, createdAt: { type: DataType.DATE, field: 'created_at' }, updatedAt: { type: DataType.DATE, field: 'updated_at' }, userId: { type: DataType.UUID, field: 'fk_user', allowNull: false } }); return Item; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Item(item) {\n this.id = item.id\n this.name = item.name\n this.itemWeight = item.item_weight\n this.value = item.value\n}", "function Item (name, barcode, sellingPrice, buyingPrice) {\n this.name = name;\n this.barcode = barcode;\n this.sellingPrice = sellingPrice;\n this.buyingPrice = buyingPrice;\n}", "function bidItem() { }", "function Item(code, desc, price, image, category, stock, deliveryDays){\r\n this.code = code;\r\n this.description = desc;\r\n this.price = price;\r\n this.image = image;\r\n this.category = category;\r\n this.stock = stock;\r\n this.deliveryDays = deliveryDays;\r\n this.user = \"Leo\"; \r\n}", "function Item(dbItem) {\n for (let key in dbItem) {\n this[key] = dbItem[key];\n }\n\n // We need something to identify the item by. We use nr.\n this.id = this.nr;\n\n // Convert various string fields to their boolean/numeric\n // counterparts\n this.kosher = this.kosher === \"1\";\n this.organic = this.organic === \"1\";\n this.priceinclvat = Number(this.priceinclvat);\n}", "function createOTBMItem(id) {\r\n \r\n /* FUNCTION createOTBMItem\r\n * Creates OTBM_ITEM object for OTBM2JSON\r\n */\r\n \r\n return {\r\n \"type\": otbm2json.HEADERS.OTBM_ITEM,\r\n \"id\": id\r\n }\r\n \r\n }", "function Item(title,\n price_per_kle,\n kle,\n unit_price,\n unit_volume,\n amount)\n{\n return {\n title: title,\n price_per_kle: price_per_kle,\n kle: kle,\n unit_price: unit_price,\n unit_volume: unit_volume,\n amount: amount\n };\n}", "buyItem(item) {\n console.log(\"Buying Item:\", item.name);\n }", "function Item(name, sell_in, quality) {\n this.name = name;\n this.sell_in = sell_in;\n this.quality = quality;\n }", "function Item(name, sell_in, quality) {\n this.name = name;\n this.sell_in = sell_in;\n this.quality = quality;\n }", "function Item(name, sell_in, quality) {\n this.name = name;\n this.sell_in = sell_in;\n this.quality = quality;\n }", "constructor(item_data) {\n this.item_data = item_data\n }", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function createItem(item){\n const {truck_id, item_name, item_description, item_photo_url, item_price} = item\n return db('items')\n .insert({truck_id, item_name, item_description, item_photo_url, item_price})\n}", "function Item(content) {\n this.content = content;\n this.timeCreated = new Date().toGMTString();\n }", "function item (name, consumable, type, armor, potion){\n this.name = name;\n this.consumable = consumable;\n this.type = type;\n this.armor = armor;\n this.potion = potion;\n}", "function makeModel(item) {\n return {\n id : item.id,\n providerId: item.provider.id,\n legacyJobName: item.jobPart.name,\n score: item.score,\n languageId: item.language ? item.language.id : null,\n domain1Id: item.domain1 ? item.domain1.id : null,\n domain2Id: item.domain2 ? item.domain2.id : null,\n // TODO: serviceTypeId should be real !!! \n serviceTypeId: null,\n comment: item.comment,\n error: item.error || {},\n bonus: item.bonus || {}\n };\n }", "async saveItem(item) {\r\n let response = await axios.post(\"http://127.0.0.1:5000/api/catalog\", item);\r\n let newItem = response.data;\r\n // hot fix: add and id if missing\r\n // TODO: ensure server always returns an ID\r\n if (!newItem._id) {\r\n newItem._id = Math.random().toString();\r\n }\r\n console.log(\"Save Item: \", newItem);\r\n return newItem;\r\n }", "function fromDatastore(item){\n item.id = item[Datastore.KEY].id;\n return item;\n}", "getItemById(db, site_id, item_id) {\n return db.from(\"inventory\").where({\n site_id: site_id,\n id: item_id,\n });\n }", "parseItem(item) {\n const name = item.name;\n const description = item.description;\n let isKey = false;\n let isTreasure = false;\n let isWeapon = false;\n if (item.key) {\n isKey = true;\n }\n if (item.treasure) {\n isTreasure = true;\n }\n if (item.weapon) {\n isWeapon = true;\n }\n return new Item_1.default(name, description, isWeapon, isKey, isTreasure);\n }", "initItem(item) {\n item = super.initItem(item);\n if (!item.company) item.company = '';\n if (!item.date) item.date = moment().unix();\n if (!item.period) item.period = moment().unix();\n if (!item.type) item.type = 'kudir';\n if (!item.email) item.email = \"\";\n return item;\n }", "function Item(){\n\t\tthis.id;\n\t\tthis.description=\"\";\n\t\tthis.name=\"\";\n\t}", "function createAndSaveInventoryItemRecord(itemContent) {\n\t\titemContent.forEach(function(itemData) {\n\t\t\tvar itemRecord = record.create({\n\t\t\t\ttype : record.Type.LOT_NUMBERED_INVENTORY_ITEM,\n\t\t\t\tisDynamic : true\n\t\t\t});\n\t\t\tfor ( var key in itemData) {\n\t\t\t\tif (itemData.hasOwnProperty(key)) {\n\t\t\t\t\titemRecord.setValue({\n\t\t\t\t\t\tfieldId : key,\n\t\t\t\t\t\tvalue : itemData[key]\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar itemId = itemRecord.save({\n\t\t\t\tenableSourcing : false,\n\t\t\t\tignoreMandatoryFields : false\n\t\t\t});\n\t\t});\n\t}", "function Item(code, title, category, price, image){\r\n this.code = code;\r\n this.title = title;\r\n this.category = category;\r\n this.price = price;\r\n this.image = image;\r\n this.user = \"Brit\";\r\n\r\n}", "function get_item(item) {\n money_count += item.price;\n return items[item.id];\n}", "function Item(code, title, price, desc, cat, rating, image ){\n this.code= code;\n this.title = title;\n this.price = price;\n this.description = desc;\n this.category = cat;\n this.rating = rating;\n this.image = image;\n this.user = \"Oliver\";\n\n}", "function Item( name, price ) {\n this.name = name;\n this.price = price;\n this.sold = false;\n}", "function orderItem() {\n\t\t\tthis.id = null ;\n\t\t\tthis.name = null ;\n\t\t\tthis.unit_size = null ;\n\t\t\tthis.category = null ;\n\t\t\tthis.languages = [] ;\n\t\t\tthis.quantities = [] ;\n\t\t\tthis.limits = [];\n\t\t}", "function createStocktakeItem(database, stocktake, item) {\n // Handle cross reference items\n const realItem = item.realItem;\n const stocktakeItem = database.create('StocktakeItem', {\n id: generateUUID(),\n item: realItem,\n stocktake: stocktake,\n });\n stocktake.items.push(stocktakeItem);\n database.save('Stocktake', stocktake);\n return stocktakeItem;\n}", "function fromDatastore(item){\n item.id = item[Datastore.KEY].id;\n return item;\n}", "constructor() {\n super(models.Item);\n }", "function Item(name, description)\n{\n this.name = name;\n this.description = description;\n}", "function Item(name, description, quantity, value, weight, group, order) {\n this.name = name;\n this.description = description;\n this.quantity = quantity;\n this.value = value;\n this.weight = weight;\n this.group = group;\n this.order = order;\n this.index = null;\n}", "function Item(id, name, cost, sales, profit) {\n this.Department_ID = id;\n this.Department_Name = name;\n this.Overhead_Costs = cost;\n this.Product_Sales = sales;\n this.Total_Profit = profit;\n}", "static itemCleaner(dirtyItem) {\n const baseModel = {\n id: dirtyItem.id,\n title: dirtyItem.title,\n price: {\n currency: dirtyItem.currency_id,\n amount: dirtyItem.price,\n decimals: parseFloat((dirtyItem.price % 1).toFixed(2)), // Precisa y parsea\n },\n picture: dirtyItem.thumbnail,\n condition: dirtyItem.condition,\n free_shipping: dirtyItem.shipping.free_shipping\n };\n\n if (dirtyItem.description !== undefined) baseModel.description = dirtyItem.description;\n if (dirtyItem.pictures !== undefined) baseModel.pictures = dirtyItem.pictures.map(picture => picture.url);\n if (dirtyItem.sold_quantity !== undefined) baseModel.sold_quantity = dirtyItem.sold_quantity;\n\n return baseModel;\n }", "function Item() {\n Outlayer.Item.apply(this, arguments);\n }", "function createTransactionItem(database, transaction, item) {\n // Handle cross reference items\n const realItem = item.realItem;\n const transactionItem = database.create('TransactionItem', {\n id: generateUUID(),\n item: realItem,\n transaction: transaction,\n });\n transaction.addItem(transactionItem);\n database.save('Transaction', transaction);\n return transactionItem;\n}", "function Item(name,desc)\n{\n this.name=name;\n this.desc=desc\n}", "function Item(nombre, precio, codigo, cantidadEnCanasta)\n{\n this.nombre = nombre;\n this.precio = precio;\n this.codigo = codigo;\n this.cantidadEnCanasta = cantidadEnCanasta;\n}", "function item(Description, Svalue) {\n this.Description = Description;\n this.Svalue = Svalue;\n}", "saveItem() {\n\n }", "function Item(itemName, costPrice,sellingPrice) {\n this.itemName = itemName;\n this.costPrice = costPrice;\n this.sellingPrice = sellingPrice;\n this.quantity = 0;\n this.value = 0.0;\n}", "function Item (name, quantity, location) {\n this.name = name;\n this.quantity = quantity;\n this.location = location;\n}", "get item() {\n if (!this._item) {\n this._item = this._buildItem();\n }\n\n return this._item;\n }", "function LineItem() {\n this.name = '';\n //this.sku = '';\n this.quantity = '';\n this.price = new Amount();\n }", "saveAuctionItem(auctionItem) {\r\n return this._httpClient.post(this.getUrl + \"/auctionItems\", auctionItem).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_0__[\"map\"])(response => response));\r\n }", "function take_item() {\r\n\r\n\t\titem_ladle \t\t= new proto_item(0, \"Ladle\", \"This is a very dull wooden ladle its mostly for soup and acid, but mostly soup.\");\r\n\t\titem_silver_key = new proto_item(1, \"Silver Key\", \"This is a key, and it happens to be silver, who would have thought.\");\r\n\t\titem_lockbox \t= new proto_item(2, \"Lockbox\", \"This is a box shaped container, it is also locked. You need a key to open it.\");\r\n\t\titem_keycard \t= new proto_item(3, \"Keycard\", \"This is a card that can open doors, much like a real key, but however it is in the shape of a card.\");\r\n\r\n\r\n\t\tswitch (currentlocation) {\r\n\t\t\tcase 0: \r\n\t\t\t\t\tinventoryArray[0] = item_ladle\r\n\t\t\t\t\tupdatetext (\"Your inventory now contains the Ladle.\")\r\n\t\t\t\t\t\r\n\t\t\t\t\tbreak;\r\n\t\t\tcase 9:\r\n\t\t\t\t\tinventoryArray[3] = item_card\r\n\t\t\t\t\tupdatetext (\"Your inventory now contains the card.\")\r\n\t\t\t\t\t\r\n\t\t\t\t\tbreak;\r\n\t\t\tcase 8:\r\n\t\t\t\t\tinventoryArray[2] = item_lockbox\r\n\t\t\t\t\tupdatetext (\"Your inventory now contains the lockbox.\")\r\n\t\t\t\t\t\r\n\t\t\t\t\tbreak;\r\n\t\t\tcase 7:\r\n\t\t\t\t\tinventoryArray[1] = item_silver_key\r\n\t\t\t\t\tupdatetext (\"Your inventory now contains the Silver Key.\")\r\n\t\t\t\t\t\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}", "function Item() {\n Outlayer.Item.apply(this, arguments);\n }", "function Item() {\n Outlayer.Item.apply(this, arguments);\n }", "function Item() {\r\n Outlayer.Item.apply(this, arguments);\r\n }", "async buy(item, quantity) {\n const res = await this.client.action(\"buy\", { itemName: item, quantity: quantity, storeName: this.store });\n if (res.success) {\n this.editCache(item, -quantity);\n await this.client.update(res.playerStringified);\n }\n return { success: res.success, msg: res.msg };\n }", "function Item() {\n Outlayer.Item.apply( this, arguments );\n}", "function Item() {\n Outlayer.Item.apply( this, arguments );\n}", "function Item() {\n Outlayer.Item.apply( this, arguments );\n}", "function Item() {\n Outlayer.Item.apply( this, arguments );\n}", "function Item() {\n Outlayer.Item.apply( this, arguments );\n}", "function Item() {\n Outlayer.Item.apply( this, arguments );\n}", "function Item() {\n Outlayer.Item.apply( this, arguments );\n}", "function Item() {\n Outlayer.Item.apply( this, arguments );\n}", "function addItem(item) {\n let newItem = new Item(item);\n return newItem.save();\n}", "function asItem(x) { return toType('item', x) }", "grabItem(id) {\n\n return new TotoAPI().fetch('/supermarket/currentList/items/' + id, {\n method: 'PUT',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({grabbed: true})\n });\n }", "function ItemToProduct(item) {\n product = {\n name: item.Name,\n price: item.UnitPrice\n };\n\n return product;\n}", "function Item(title, finished) {\n this.title = title;\n this.finished = finished;\n}", "get item() {\n return this._item;\n }", "loadEntity(itemId) {\n\n }", "constructor() {\n /**\n * The tax of the product item after adjustments applying.\n * @member {Number} adjusted_tax\n */\n this.adjusted_tax = undefined\n\n /**\n * The base price for the line item, which is the price of the unit before applying\n * adjustments, in the purchase currency. The base price may be net or gross of\n * tax depending on the configured taxation policy.\n * @member {Number} base_price\n */\n this.base_price = undefined\n\n /**\n * The item identifier. Use this to identify an item when updating the item\n * quantity or creating a custom price adjustment for an item.\n * @member {String} item_id\n */\n this.item_id = undefined\n\n /**\n * The text describing the item in more detail.\n * @member {String} item_text\n */\n this.item_text = undefined\n\n /**\n * The price of the line item before applying any adjustments. If the line item is\n * based on net pricing then the net price is returned. If the line item is\n * based on gross pricing then the gross price is returned.\n * @member {Number} price\n */\n this.price = undefined\n\n /**\n * Array of price adjustments. Can be empty.\n * @member {Array.<module:models/PriceAdjustment>} price_adjustments\n */\n this.price_adjustments = undefined\n\n /**\n * The price of the product line item after applying all product-level adjustments.\n * For net pricing the adjusted net price is returned. For gross pricing,\n * the adjusted gross price is returned.\n * @member {Number} price_after_item_discount\n */\n this.price_after_item_discount = undefined\n\n /**\n * The identifier of the shipment to which this item belongs.\n * @member {String} shipment_id\n */\n this.shipment_id = undefined\n\n /**\n * The tax of the product item before adjustments applying.\n * @member {Number} tax\n */\n this.tax = undefined\n\n /**\n * The price used to calculate the tax for this product item.\n * @member {Number} tax_basis\n */\n this.tax_basis = undefined\n\n /**\n * The tax class ID for the product item or null if no tax class ID is associated with the product item.\n * @member {String} tax_class_id\n */\n this.tax_class_id = undefined\n\n /**\n * The tax rate, which is the decimal tax rate to be applied to the product represented by this item.\n * @member {Number} tax_rate\n */\n this.tax_rate = undefined\n }", "function useItem(){\n\t\n}", "function PopulateBTRObject(oItem) {\n\t\t//console.log(oItem);\n\t\t_gBtrObj.btr_guid = oItem.btr_guid;\n\t\t_gBtrObj.approved_date = oItem.approvate_date;\n\t\t_gBtrObj.approval_status= oItem.approval_status;\n\t\t_gBtrObj.requestor_uni_code = oItem.requestor_uni_code;\n\t\t_gBtrObj.requestor_uni_key = oItem.requestor_uni_key;\n\t\t_gBtrObj.budget_type= oItem.budget_type;\n\t\t_gBtrObj.title = oItem.title;\n\t\t_gBtrObj.approval_status = oItem.approval_status;\n\t\t_gBtrObj.approved_date = oItem.approved_date;\n\t\t_gBtrObj.Attachments = 1;\n\t\t_gBtrObj.budget_type= oItem.budget_type;\n\t\t_gBtrObj.created= oItem.created;\n\t\t_gBtrObj.btr_key = oItem.btr_key;\n\t\t_gBtrObj.internal_state = oItem.internal_state;\n\t\t_gBtrObj.life_cycle = oItem.life_cycle;\n\t\t_gBtrObj.modified = oItem.modified;\n\t\t_gBtrObj.request_date = oItem.request_date;\n\t\tvexplanation = '';\n\t\tif (oItem.explanation != null)\n\t\t{\n\t\t\tvar vMatch = oItem.explanation.match(/<div .*>(.*)<\\/div>/i); //SharePoint returns with extra div wrapped around the text\n\t\t\tvexplanation = (vMatch != null ) ? vMatch[1] : oItem.explanation;\n\t\t}\n\t\t_gBtrObj.explanation = vexplanation.trim();\n\t\t_gBtrObj.transfer_type = oItem.transfer_type.toLowerCase();\n\t\t_gForm_transfer_type = oItem.transfer_type.toLowerCase();\n\t}", "function item(name, description, url, href) {\n\t this.name = name;\n\t this.description = description;\n\t this.url = url;\n\t this.href = href;\n\t}", "function proto_item(_id, _name, _description) {\r\n \t\t\r\n \t\tthis.id \t\t= _id;\r\n \t\tthis.name \t\t= _name;\r\n \t\tthis.description \t= _description;\r\n \t\t\r\n\t this.toString = function() {\r\n\t var retVal = \"\";\r\n\t retVal = \"[Item]\" \t + \"\\n\" + \r\n\t \"Id:\" + this.id \t\t + \"\\n\" +\r\n\t \"Name:\" + this.name \t\t + \"\\n\" +\r\n\t \"Description:\" + this.description + \"\\n\";\r\n\t return retVal;\r\n\t } \r\n\t}", "function SemanticItem (semanticName, reorderFreq, upc) {\n this.semanticName = semanticName;\n this.reorderFreq = reorderFreq;\n this.upc = upc || 049000000443;\n this.holdDate = new Date();\n this.qty = 1;\n this.uID = Math.floor(Math.random()*10000);\n}", "function Item(itemDescription, itemLink) // Constructor \n{ \n // constant data \n this.desc = itemDescription \n this.link = itemLink \n this.id = -1 //initialized in initalize() \n this.navObj = 0 //initialized in render() \n this.iconImg = 0 //initialized in render() \n this.iconSrc = item \n \n // methods \n this.initialize = initializeItem \n this.createIndex = createEntryIndex \n this.hide = hideItem \n this.display = display \n this.renderOb = drawItem \n this.totalHeight = totalHeight \n}", "function Item(itemNum,name,description,quantity,price,weight) {\r\n\tthis.itemNum = defaultValue(itemNum,0);\r\n\tthis.name = defaultValue(name,0);\r\n\tthis.description = defaultValue(description,\"No Description\");\r\n\tthis.quantity = defaultValue(quantity,1);\r\n\tthis.price = defaultValue(price,1);\r\n\tthis.weight = defaultValue(weight,1);\r\n}", "function buyItem() {\n\n}", "function getIdOfItem(item){\n return item.id;\n}", "function itemObjectConstruct(id, input, complete)\n{\n\tthis.id=id;\n\tthis.item=input;\n\tthis.complete=complete;\n}", "get item () {\n\t\treturn this._item;\n\t}", "function Item(listItem) {\n this.listItem = listItem\n}", "get itemObjectId() {\n return this.catalogItemObj.id;\n }", "function createItem(name,img,shortDescription,price,longDescription){\n this.name=name;\n this.img=img;\n this.shortDescription=shortDescription;\n this.price=price;\n this.longDescription=longDescription;\n}", "sellItem(req, res, next) {\n const newItem = req.body;\n delete newItem.categories;\n const sellerId = (req.user ? req.user.user.id : 39);\n\n newItem.images = JSON.stringify(newItem.images);\n console.log('Creating new item,', newItem);\n db.items.create(newItem)\n .then(product => {\n db.items.getById(product[0])\n .then((result) => {\n const id = result[0].id;\n const transaction = { item_id: id, buyer_id: null, seller_id: sellerId };\n res.json(result[0]);\n return db.transactions.create(transaction);\n })\n .catch(e => { console.log('Error getting item, ', e); next(e); });\n })\n .catch(e => { console.log('Error inserting item, ', e); next(e); });\n }", "function Item(type, name, price) {\n var type = [\n 'accessory',\n 'smart-phone',\n 'notebook',\n 'pc',\n 'tablet'\n ];\n this._type = type;\n this.name = name;\n this.price = price;\n console.log(this._type);\n}", "initItem(item) {\n if (!item || typeof(item)!==\"object\") item = {};\n return item;\n }", "buyItem(req, res) {\n db.items.getById(req.params.id)\n .then((product) => {\n // Product returns an array of 1 item, so need to access that item, and change the buyer of that item to be the current request maker\n db.transactions.updateTransaction(product[0].id, { buyer_id: req.user.user.id })\n .then(() => {\n db.items.sold(Number(req.params.id));\n //Creates a new client with coinbase which allows user to purchase the item from coinbase\n const client = new coinbase.Client({ accessToken: req.user.accessToken, refreshToken: req.user.refreshToken });\n const args = {\n name: `Order for ${product[0].title}`,\n amount: /* (Number(product[0].price))*/ 0.01,\n metadata: {\n customer_id: client.id,\n customer_name: 'test'\n },\n currency: 'USD',\n type: 'order',\n style: 'custom_small',\n success_url: `http://${req.headers.host}/items/${req.params.id}/confirm`,\n cancel_url: `http://${req.headers.host}/items/${req.params.id}`,\n customer_defined_amount: false,\n collect_shipping_address: false,\n description: `Purchasing: ${product[0].title} on BitBargain`\n };\n //Create a checkout button with those args, and sends it back to BB which embeds it in a button\n client.createCheckout(args, (err, checkout) => {\n console.log(err, checkout);\n if (err) {\n res.json(`Error buying ${product[0].title}`);\n }\n res.json(checkout.embed_code);\n });\n });\n });\n }", "function purchaseItem() {\n return\n}", "function ACItemHandler(model, item, itemName)\n{\n ACItemHandler.baseConstructor.call(this);\n this.model = model;\n\tthis.itemName = itemName;\n\n\t// Match criterion is \"id\", \"code\", or \"tag\". Default is \"id\".\n this.matchCriterion = \"id\"; \n\t\n\tthis.setItem(item);\n}", "static async updateItem(item) {\n try {\n await shopdb.poitem.update(item, { where: { id: item.id } });\n } catch (error) {\n throw error;\n }\n }", "async create(item) {\n const obj = new generatedModel.model(item);\n return await obj.save();\n }", "function SmartMe_CreateItem(title, linkUrl, content, similarUrl, cachedUrl) {\r\n\treturn new SmartMeItem(title, linkUrl, content, similarUrl, cachedUrl);\r\n}", "function itemToObject(item) {\n var data = {};\n \n data.type = item.getType().toString();\n \n // Downcast items to access type-specific properties\n \n var itemTypeConstructorName = snakeCaseToCamelCase(\"AS_\" + item.getType().toString() + \"_ITEM\"); \n var typedItem = item[itemTypeConstructorName]();\n \n // Keys with a prefix of \"get\" have \"get\" stripped\n \n var getKeysRaw = Object.keys(typedItem).filter(function(s) {return s.indexOf(\"get\") == 0});\n \n getKeysRaw.map(function(getKey) { \n var propName = getKey[3].toLowerCase() + getKey.substr(4);\n \n // Image data, choices, and type come in the form of objects / enums\n if ([\"image\", \"choices\", \"type\", \"alignment\"].indexOf(propName) != -1) {return};\n \n // Skip feedback-related keys\n if (\"getFeedbackForIncorrect\".equals(getKey) || \"getFeedbackForCorrect\".equals(getKey)\n || \"getGeneralFeedback\".equals(getKey)) {return};\n \n var propValue = typedItem[getKey]();\n \n data[propName] = propValue;\n });\n \n // Bool keys are included as-is\n \n var boolKeys = Object.keys(typedItem).filter(function(s) {\n return (s.indexOf(\"is\") == 0) || (s.indexOf(\"has\") == 0) || (s.indexOf(\"includes\") == 0);\n });\n \n boolKeys.map(function(boolKey) {\n var propName = boolKey;\n var propValue = typedItem[boolKey]();\n data[propName] = propValue;\n });\n \n // Handle image data and list choices\n \n switch (item.getType()) {\n case FormApp.ItemType.LIST:\n case FormApp.ItemType.CHECKBOX:\n case FormApp.ItemType.MULTIPLE_CHOICE:\n data.choices = typedItem.getChoices().map(function(choice) {\n return choice.getValue();\n });\n break;\n \n case FormApp.ItemType.IMAGE:\n data.alignment = typedItem.getAlignment().toString();\n \n if (item.getType() == FormApp.ItemType.VIDEO) {\n return;\n }\n \n var imageBlob = typedItem.getImage();\n \n data.imageBlob = {\n \"dataAsString\": imageBlob.getDataAsString(),\n \"name\": imageBlob.getName(),\n \"isGoogleType\": imageBlob.isGoogleType()\n };\n \n break;\n \n case FormApp.ItemType.PAGE_BREAK:\n data.pageNavigationType = typedItem.getPageNavigationType().toString();\n break;\n \n default:\n break;\n }\n \n // Have to do this because for some reason Google Scripts API doesn't have a\n // native VIDEO type\n if (item.getType().toString() === \"VIDEO\") {\n data.alignment = typedItem.getAlignment().toString();\n }\n \n return data;\n}", "function createRequisitionItem(database, requisition, item, dailyUsage) {\n // Handle cross reference items\n const realItem = item.realItem;\n const requisitionItem = database.create('RequisitionItem', {\n id: generateUUID(),\n item: realItem,\n requisition: requisition,\n stockOnHand: realItem.totalQuantity,\n dailyUsage: dailyUsage || realItem.dailyUsage,\n requiredQuantity: 0,\n comment: '',\n sortIndex: requisition.items.length + 1,\n });\n requisition.addItem(requisitionItem);\n database.save('Requisition', requisition);\n return requisitionItem;\n}", "function Item(id_in: int, namein: String, obj: GameObject)\n\t{\n\t\tid = id_in;\n\t\tname = namein;\n\t\tgameObj = obj;\n\t}", "async getItemRecord(pks) {\n // pks: [rsvno, seq1]\n let tmRet = new TravelMessage();\n\n let tm = await models.Item.selectOne({database: this.database, pgschema: this.pgschema, user: this.user, pks}, this.trans);\n if (tm.status != 200) return tm;\n\n let item = tm.data;\n item.includes = [];\n\n tmRet.data = item;\n return tmRet;\n }" ]
[ "0.69196695", "0.6758927", "0.6757405", "0.6702856", "0.66590136", "0.6564232", "0.6561075", "0.651892", "0.65061766", "0.65061766", "0.65061766", "0.6465821", "0.6385786", "0.6385786", "0.6385786", "0.6385786", "0.6385786", "0.6385786", "0.6359128", "0.63482785", "0.6311849", "0.62968504", "0.6285027", "0.62610066", "0.624724", "0.62193227", "0.62125415", "0.6199109", "0.6148976", "0.6134464", "0.6117024", "0.61129344", "0.6103276", "0.60995716", "0.6080066", "0.6076662", "0.60471404", "0.60458136", "0.6044358", "0.60380673", "0.601634", "0.60101086", "0.5996756", "0.5974552", "0.59691596", "0.59667385", "0.59638834", "0.5953361", "0.59440356", "0.5908385", "0.59052414", "0.5902609", "0.5893795", "0.5891738", "0.5891738", "0.5891508", "0.5891413", "0.5886308", "0.5886308", "0.5886308", "0.5886308", "0.5886308", "0.5886308", "0.5886308", "0.5886308", "0.58629704", "0.58611214", "0.5860417", "0.58407456", "0.58391297", "0.5824748", "0.5820418", "0.58134717", "0.58065164", "0.5791694", "0.57825935", "0.57756597", "0.5772352", "0.5771051", "0.5761431", "0.5756768", "0.5752301", "0.5740828", "0.57254195", "0.5714996", "0.57148165", "0.5710975", "0.569697", "0.5691103", "0.56897587", "0.56827694", "0.56805795", "0.56803614", "0.5660489", "0.5648217", "0.56470335", "0.56419414", "0.5640397", "0.56244826", "0.5624431" ]
0.59902626
43
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Adds a random greeting to the page.
function addRandomGreeting() { const greetings = ['I play for my Universites Volleyball Team', ' I play bass and guitar ', 'I´m in rock band called Los Insurgentes. Find us on Spotify ! ']; // Pick a random greeting. const greeting = greetings[Math.floor(Math.random() * greetings.length)]; // Add it to the page. const greetingContainer = document.getElementById('greeting-container'); greetingContainer.innerText = greeting; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addRandomGreeting() {\n const greetings =\n ['Hello world!', '¡Hola Mundo!', '你好,世界!', 'Bonjour le monde!'];\n\n // Pick a random greeting.\n const greeting = greetings[Math.floor(Math.random() * greetings.length)];\n\n // Add it to the page.\n const greetingContainer = document.getElementById('js-greeting-container');\n greetingContainer.innerText = greeting;\n}", "function addRandomGreeting() {\n const greetings =\n ['I play viola and trumpet! I have played the viola since the 5th grade and trumpet since the 7th grade.'];\n\n // Pick a random greeting.\n const greeting = greetings[Math.floor(Math.random() * greetings.length)];\n\n // Add it to the page.\n const greetingContainer = document.getElementById('greeting-container');\n greetingContainer.innerText = greeting;\n}", "function addRandomGreeting() {\n const greetings =\n ['Hello world!', '¡Hola Mundo!', '你好,世界!', 'Bonjour le monde!'];\n\n // Pick a random greeting.\n const greeting = greetings[Math.floor(Math.random() * greetings.length)];\n\n // Add it to the page.\n const greetingContainer = document.getElementById('greeting-container');\n greetingContainer.innerText = greeting;\n}", "function addRandomGreeting() {\n const greetings =\n ['Hello!', \"Bonjour!\", \"Hola!\"];\n\n // Pick a random greeting.\n const greeting = greetings[Math.floor(Math.random() * greetings.length)];\n\n // Add it to the page.\n const greetingContainer = document.getElementById('greeting-container');\n greetingContainer.innerText = greeting;\n}", "function addRandomGreeting() {\n const greetings =\n ['Hirasawa Yui', 'Tainaka Ritsu', 'Akiyama Mio', 'Kotobuki Tsumugi', 'Nakano Azusa'];\n\n // Pick a random greeting.\n const greeting = greetings[Math.floor(Math.random() * greetings.length)];\n\n // Add it to the page.\n const greetingContainer = document.getElementById('greeting-container');\n greetingContainer.innerText = greeting;\n}", "function addRandomGreeting() {\n const greetings =\n ['\"Hello, you.\"-Joe Goldberg', '\"Three words, eight letters. Say it and I am yours.\" -Blair Waldorf', '\"And so the lion fell in love with the lamb...\" -Edward Cullen', '\"How you doinnn?\" -Joey'];\n\n // Pick a random greeting.\n const greeting = greetings[Math.floor(Math.random() * greetings.length)];\n\n // Add it to the page.\n const greetingContainer = document.getElementById('greeting-container');\n greetingContainer.innerText = greeting;\n}", "function addRandomGreeting() {\n const greetings =\n ['Hello world!', '¡Hola Mundo!', '你好,世界!', 'Bonjour le monde!', 'Greetings', \n `We have been trying to send a message to you for years. We don't know how or when this will reach you, but when it does, please, wake up. You have been asleep for ${Math.round(Math.random() * 10) + Math.round(Math.random() * 10)} years.`];\n\n // Pick a random greeting.\n const greeting = greetings[Math.floor(Math.random() * greetings.length)];\n\n // Add it to the page.\n const greetingContainer = document.getElementById('greeting-container');\n greetingContainer.innerText = greeting;\n}", "function getGreeting() {\r\n return(greetings[Math.floor(Math.random() * greetings.length)]);\r\n}", "function welcome(name) {\n var greetings = [\n `:wave: Hello, ${name}!\n I'm fccBot, at your service.`,\n `Hi, ${name}, you called? :telephone_receiver:`,\n `You're in luck, ${name} :four_leaf_clover:! You've found ME, fccBot!`,\n `:alarm_clock: Looks like it's time for me to get to work. What can I do for you, ${name}?`,\n `:crystal_ball:\n I see... your name is... ${name}. And... what's that... hm. I think I see... _answers_... in your future.\n Seriously, though...`,\n `:tada: :tada: :tada:\n Hooray! You've found ME, fccBot, the one and only!`,\n `Need a hand? I'm fccBot, and I'm :on: :top: of things!`\n ];\n\n var greeting = greetings[Math.floor(Math.random() * greetings.length)];\n var text = `${greeting}\n\n If you're looking for information about one of the freeCodeCamp challenges, I'm here to help.\n You can me know what challenge you're working on, like this:\n\n :small_orange_diamond: */fccbot Tic Tac Toe* _or_ */fccbot tic-tac-toe game*\n\n Not sure of the challenge name? Tell me what certificate you're working toward, and I'll take it from there:\n\n :small_orange_diamond: */fccbot front-end development* _or_ */fccbot front end*\n\n Happy Coding!\n `;\n\n return {\n response_type: 'ephemeral',\n text\n };\n}", "function randomGreeting() {\n var words = ['Hello', 'Howdy', 'Hi', 'Hey there', 'What\\'s up',\n 'Greetings', 'Salutations', 'Good to see you'];\n\n var idx = Math.floor(Math.random() * words.length);\n\n // this is missing a return statement, this function returns undefined\n return words[idx];\n}", "function sayGreeting() {\r\n let username = sessionStorage.getItem('username');\r\n if (username != undefined) {\r\n $('#loggedInUser').text(`Welcome ${username}!`);\r\n updateNavigation();\r\n }\r\n else\r\n {\r\n $('#viewHome').show();\r\n $('#linkLogin').show();\r\n $('#linkRegister').show(); \r\n $('#linkListBooks').hide();\r\n $('#linkCreateBook').hide();\r\n $('#linkLogout').hide();\r\n $('#loggedInUser').text('');\r\n showPage('viewHome');\r\n }\r\n }", "function addRandomQuote() {\n const quotes =\n [\"You should enjoy the little detours to the fullest. Because that's where you'll find the things more important than what you want. -Yoshihiro Togashi\",\n \"I don’t want what another man can give me. If he grants me anything, then it’s his to give and not my own. -Kentaro Miura\",\n \"Sometimes good people make bad choices. It doesn't mean they are bad people. It means they're human. -Sui Ishida\",\n \"Why is it that when one man builds a wall, the next man immediately needs to know what's on the other side? -George R.R. Martin\"];\n\n // Pick a random greeting.\n const quote = quotes[Math.floor(Math.random() * quotes.length)];\n\n // Add it to the page.\n const quoteContainer = document.getElementById('quote-container');\n quoteContainer.innerText = quote;\n}", "function addRandomThanosQuote() {\n const greetings =\n ['The hardest choices require the strongest wills.',\n 'I ask you to what end? Dread it. Run from it. Destiny arrives all the same',\n 'I know what it\\'s like to lose. To feel so desperately that you\\'re right, yet to fail nonetheless. It\\'s frightening'\n + 'turns the legs to jelly.',\n 'Perfectly balanced, as all things should be.',\n 'I do. You are not the only one cursed with knowledge.',\n 'I finally rest and watch the sun rise on a grateful universe.',\n 'Fine! I will do it myself.',\n 'I ignored by destiny once. I cannot do that again, even for you.',\n 'With all the six stones I could simply snap my fingers and they'+\n 'would cease to exist. I call that mercy'];\n\n // Pick a random greeting.\n const greeting = greetings[Math.floor(Math.random() * greetings.length)];\n\n // Add it to the page.\n const greetingContainer = document.getElementById('greetingContainer');\n greetingContainer.innerText = greeting;\n}", "function newGreeting(){\n document.getElementById(\"greeting\");\n document.getElementById(\"greeting\").innerText = \"Hello, \" + yourName() + \"!\";\n}", "function greetPeople() {\n console.log(greetingMessage);\n}", "function greeting(name){\n\treturn \"sup fam \" + name\n}", "function setGreeting() {\n let name = getSadAnimalTabName();\n let greeting = document.getElementById(\"greeting\");\n greeting.innerHTML = name !== \"\" ? `Hello, ${name}` : \"Hello\";\n}", "sayHello ()\n {\n // Creating an element.\n const helloElement = document.createElement( \"P\" );\n // Fill in the text of the element (using template literal.)\n helloElement.textContent = `Hello, my name is ${this.name}!`;\n // Add the new element to the body of our webpage.\n document.body.appendChild( helloElement );\n }", "function genWelcome() {\n welcome.innerHTML = `\n Welcome, ${activeUser}\n `;\n}", "function getGreeting (name) {\n return \"Hello \" + name\n}", "function randomFact() {\n const Facts = [\n \"I am slowly becoming vegan.\",\n \"I am bilingual(English and Spanish)\",\n \"I like do card tricks even though I am not so good at it.\",\n \"I try to grow a collection of rubber duckies for rubber duck debugging(search it up)\",\n \"I enjoy cooking\",\n \"I like learning new things\"\n ];\n\n // Pick a random greeting.\n const Fact = Facts[Math.floor(Math.random() * Facts.length)];\n\n // Add it to the page.\n const factContainer = document.getElementById(\"fact-container\");\n factContainer.innerText = Fact;\n}", "async function setGreeting() {\n if (!hasEthereum()) {\n setConnectedWalletAddressState(`⚠️ MetaMask unavailable`);\n return;\n }\n if (!newGreeting) {\n setNewGreetingMessageState(\"Add a new greeting first.\");\n return;\n }\n await requestAccount();\n const provider = new ethers.providers.Web3Provider(window.ethereum);\n const signer = provider.getSigner();\n const signerAddress = await signer.getAddress();\n setConnectedWalletAddressState(`Connected wallet: ${signerAddress}`);\n const contract = new ethers.Contract(\n process.env.NEXT_PUBLIC_GREETER_ADDRESS,\n Greeter.abi,\n signer\n );\n const transaction = await contract.setGreeting(newGreeting);\n await transaction.wait();\n setNewGreetingMessageState(\n `Greeting updated to ${newGreeting} from ${greeting}.`\n );\n newGreetingInputRef.current.value = \"\";\n setNewGreetingState(\"\");\n }", "function displayWelcomeMessage() {\n \n const username = getLocalStorageUsername()\n welcomeH1.innerHTML = `<h1 class=\"welcome-h1\">Hey, ${username}! Here's your todo list for today.</h1>\n <h3>The goal is to prevent the rainbow bar to get empty by completing you daily tasks.</h3>\n <h3>No one can stop you!</h3>`\n}", "myGreeting()\r\n {\r\n // tell whether or not the dog can talk based on the value of the canTalk\r\n // property\r\n var talkString = \"\";\r\n\r\n if(this.canTalk == true)\r\n talkString = \"I can talk.\";\r\n else\r\n talkString = \"I cannot talk.\";\r\n\r\n // return the paragraph text\r\n return `<p>Hello, my name is ${this.name}, when I bark ${this.mySound}. <br>\r\n I starred in the TV Show ${this.tvShow}. <br>\r\n My character is a ${this.breed}. In the show, I am ${this.note} <br>\r\n ${talkString}</p>`\r\n }", "function greetMe(message) {\r\n this.greeting = message;\r\n }", "static greeting() {\n return 'Hi there!';\n }", "function greeting(){\n\tconsole.log(\"Day 4 feeling great!\");\n}", "function greeting(){\n\n console.log(\"\");\n\n console.log(\"\");\n\n console.log(\"Hello \" + name + \"!\"); \n\n console.log(\"\");\n\n console.log(\"\");\n}", "function updateGreetingElem(){\n greetingElem.innerHTML=`${greetingMsg}, <b>${userName}</b>!`;\n }", "function greeting(name) {\n console.log('Hello', name);\n}", "function setGreeting(){\n let username = localStorage.getItem(\"username\");\n\n if(username !== null){\n loggedIn.show();\n loggedIn.text(`Welcome, ${username}`);\n loginLink.hide();\n registerLink.hide();\n listAdsLink.show();\n createAdLink.show();\n logoutLink.show();\n\n }else{\n loggedIn.hide();\n loginLink.show();\n registerLink.show();\n listAdsLink.hide();\n createAdLink.hide();\n logoutLink.hide();\n }\n }", "function generateGreeting(name){\n var morning_greeting = \"<div><h1>Good Morning \" + name + \"</h1></div>\";\n var evening_greeting = \"<div><h1>Good Evening \"+ name + \"</h1></div>\";\n var afternoon_greeting = \"<div><h1>Good Afternoon \" + name + \"</h1></div>\";\n console.log(time);\n\n if(time >= 12 && time <= 16) $(\".greeting-box\").html(afternoon_greeting).hide().fadeIn(1000);\n\n else if(time >= 17 || time <= 4) $(\".greeting-box\").html(evening_greeting).hide().fadeIn(1000);\n\n else if (time >= 5 && time <= 11) $(\".greeting-box\").html(morning_greeting).hide().fadeIn(1000);\n\n else $(\".greeting-box\").html(\"Hello \" + NAME).hide().fadeIn(1000);\n $(\".quote-box\").hide().fadeIn(3000);\n }", "function greet() {\n console.log( `Hi, ${name}!`)\n }", "async function setGreeting() {\n if (!greeting) return\n if (typeof window.ethereum !== 'undefined') {\n await requestAccount()\n const provider = new ethers.providers.Web3Provider(window.ethereum);\n const signer = provider.getSigner()\n const contract = new ethers.Contract(greeterAddress, Greeter.abi, signer)\n const transaction = await contract.setGreeting(greeting)\n await transaction.wait()\n fetchGreeting()\n }\n }", "function dynamicGreet() {\n let today = new Date();\nlet hourNow = today.getHours();\nlet greeting;\nif (hourNow > 18) {\n greeting = 'Good Evening';\n} else if (hourNow > 12) {\n greeting = 'Good Afternoon';\n} else if (hourNow > 0) {\n greeting = 'Good Morning';\n} else {\n greeting = 'Welcome';\n}\ndocument.write('<h3>' + greeting + '</h3>');\n}", "greeting(hallo) {\n return `Hi ${this.fName} ${this.lName}`\n }", "function greeting() : string\n {\n return this.message;\n }", "function welcome(agent) {\n agent.add(i18n.__('WELCOME_BASIC'));\n}", "function greeting(firstName, lastName) {\n const greetSentence = `Salutations ${firstName} ${lastName}!`\n return greetSentence\n}", "function randomName() {\r\n return randomInt(0, 200);\r\n}", "async function setGreeting() {\n\t\tif(!greeting) return\n\t\tif(typeof window.ethereum != 'undefined') {\n\t\t\tawait requestAccount()\n\t\t\tconst provider = new ethers.providers.Web3Provider(window.ethereum);\n\t\t\tconst signer = provider.getSigner()\n\t\t\tconst contract = new ethers.Contract(greeterAddress, Greeter.abi, signer)\n\t\t\tconst transaction = await contract.setGreeting(greeting)\n\t\t\tawait transaction.wait()\n\t\t\tfetchGreeting()\n\t\t}\n\t}", "function asked() {\n if(random(1, 6) == true) {\n return \"The little pig let the wolf inside and got eaten.\"\n } else {\n return \"The pig knew the wolf wanted to eat him, so he didn't let him in.\";\n }\n}", "function greeting(name, age) {\n console.log('Hello ' + name);\n console.log('your age is: ' + age);\n console.log('Whats up');\n console.log('How you doing');\n console.log('Have a great da');\n console.log('Blah blah blah blah');\n}", "function pattern_1_greeting() {\n return choice([\"Hi\", \"Yo, man\", \"Yo, brotha from another Motha\", \"Well, hello there\"]) + ', ' \n + choice(['My name is Shorty', \"I'm Shorty\"]) + \"! I'm \" \n + choice([\"feelin'\", \"doin'\"]) + ' ' \n + choice([\"pimpin'\", 'amazeballz', \"gangsta as f*ck\"])\n + choice(['!', \", mah n*gga.\", ', mah sistah from another mistah.']) + ' '\n + choice(['Whazzaaaa', 'Whaddup', \"How you doin'\"]) + '?';\n}", "function hello(name, greetings) {\n console.log(`${greetings} ${name}`);\n greeting('day');\n}", "randomName() {\n let x = Math.floor(Math.random() * 5);\n let y = Math.floor(Math.random() * 7);\n return <h1 className='text-primary'>{this.restFirstName[x]} {this.restSecondName[y]}</h1>;\n }", "function createGreeting(name){\n return `Hello, my name is ${name}`;\n}", "function greet() {\n let greetingMessage = greeting + \", \" + name\n console.log(greetingMessage)\n}", "function greetingsHandler() {\n\n console.log('greetingsHandler');\n\n agent.add(`Ciao, sono Marcello, il tuo personal shopper`);\n agent.add(`Sono qui per aiutarti a trovare il prodotto più adatto a te`);\n agent.add(`Posso esserti utile in qualche modo?`);\n agent.add(new Suggestion(`Voglio esplorare le categorie`));\n agent.add(new Suggestion(`Ho in mente un prodotto specifico`));\n agent.add(new Suggestion(`Vorrei un consiglio`));\n}", "function userGreeting() {\n // Create new date object\n var today = new Date();\n // Find the current hour\n var hourNow = today.getHours();\n var greeting;\n\n // Displays the appropriate greeting based on the current time\n if (hourNow > 18) {\n greeting = 'Good evening';\n }\n\n else if (hourNow > 12) {\n greeting = 'Good afternoon';\n }\n\n else if (hourNow > 0) {\n greeting = 'Good morning';\n }\n\n else {\n greeting = 'Welcome';\n // Add class to calendar that highlights today's date\n $('#calendar td').addClass('current');\n }\n\n // Write the greeting in the header\n document.getElementById('hello').innerHTML = greeting;\n // Add a class to the calendar if date matches today\n $('td:eq(' + today.getDay() + ')').addClass('current');\n\n console.log('greeting has loaded');\n }", "function message() {\n var insultGiv = insult[Math.floor((Math.random())* insult.length)]\n var choreGiv = chore[Math.floor((Math.random())* chore.length)]\n var commentGiv = comment[Math.floor((Math.random())* comment.length)]\n return `Wake up ${insultGiv}! You have to ${choreGiv} today. Get it done ${commentGiv}.`\n}", "function greeting(name, age){\n return \"jas sum \"+name+\" i imam\"+age+\" godini.\";\n}", "function universalGreeting(name) {\n // console.log(`Hello ${name}!!`);\n return `Hello ${name}!!`;\n}", "function addRandomFact() {\n const facts = [\n 'I have two younger brothers both about a foot taller than me.', \n 'My parents are from Vietnam but I don\\'t speak any Vietnamese.',\n 'I have never been to anywhere else in Australia except Melbourne, \\\n where I was born and raised.'\n ];\n\n // Pick a random fact.\n const fact = facts[Math.floor(Math.random() * facts.length)];\n\n // Add it to the page.\n const factContainer = document.getElementById('fact-container');\n factContainer.innerText = fact;\n}", "function greeting(name) {\n return `Hello ${name}!`;\n}", "function sayHello() {\n\tvar greeting = \"Hello \" + name;\n\tconsole.log(greeting);\n}", "function printGreeting() {\n console.log(\"Oh, Hello!\");\n}", "function greeting() {\n console.log(\"Hello World\");\n}", "function greeting() {\n console.log(\"Hello Students.\");\n}", "function greetings() {\n\n \n}", "function rand() { push(\"rand\", `A random number between 0 and 1: ${String(Math.random())}`) }", "function greeting(name)\n{\n if(name)\n {\n return \"Hello, \" + name + \"!\";\n }\n else\n {\n return \"Hello!\";\n }\n}", "function writeFunGreeting(){\n var today = new Date();\n var hourNow = today.getHours();\n var greeting;\n\n if (hourNow > 18) {\n greeting = 'Buonasera, ';\n } else if (hourNow > 12) {\n greeting = 'Buon pomeriggio, ';\n } else if (hourNow > 0) {\n greeting = 'Buongiorno, ';\n } else {\n greeting = 'Bienvenuto, ';\n }\n\n document.write('<h2>' + greeting + userName + '! Your final score was ' + finalScore + '/7.</h2>');\n}", "greeting() {\n return `Welcome ${this.name} from ${this.animalType}`;\n }", "function updateHomepageButton() {\n const homepageBtn = document.querySelector(\".homepage-button\");\n const phrases = [\"Rocket Jump\", \"Bunny Hop\", \"Auto Run\", \"Fast Travel\", \"Teleport\", \"Strafe Jump\", \"Barrel Roll\", \"Shootdodge\", \"Noclip\"];\n const choice = phrases[Math.floor(Math.random() * phrases.length)];\n homepageBtn.innerHTML = \"<a class='off-white' href='/get_terms'><i class='fas fa-home'></i> \" + choice + \" back to the homepage</a>\";\n}", "function UserGreeting(props) {\n return <h1>Welcome back!</h1>;\n }", "function getRandom(){\n\t var random = randomFacts[Math.floor(Math.random() * randomFacts.length)];\n document.getElementById(\"message\").innerHTML=random;\n}", "function showGreetings() {\n const loadedLs = localStorage.getItem(MEMBERINFO_LS);\n const currentUser = JSON.parse(loadedLs)[0].id;\n greetings.innerText = `안녕하세요, ${currentUser}님`;\n}", "function createGreetingMessage(name){\n const message='Hallo,${name}';\n return message;\n }", "function simpleGreeting() {\n console.log(\"Hello Betty\");\n}", "function getGreeting() {\n\n// greeting based on thetime of the day\n var welcome;\n var date = new Date();\n var hour = date.getHours();\n var minute = date.getMinutes();\n var second = date.getSeconds();\n if (minute < 10) {\n minute = \"0\" + minute;\n }\n if (second < 10) {\n second = \"0\" + second;\n }\n if (hour < 12) {\n welcome = \"Good morning,\";\n } else if (hour < 17) {\n welcome = \"Good afternoon,\";\n } else {\n welcome = \"Good evening,\";\n }\n document.getElementById(\"greeting\").innerHTML = `${welcome}`;\n}", "function createGreeter(greeting) {\n return { greet: function(name){\n return `${greeting}, ${name}!`\n }}\n }", "function welcome(agent){\n agent.add(getTelegramButtons(\"Welcome to Big Brother! I'm responsible for taking care of your apps! Here's what you can do with me:\", actions));\n}", "function sayHello() {\n console.log('Hello, ' + name);\n }", "function myGreet(){\n const h = new Date().getHours();\n updateGreeting(h);\n}", "function greeting({ name, title }) {\n return \"Hello, \" + title + \" \" + name + \"!\";\n}", "function welcomeMessage() {\n responsiveVoice.speak('Good morning, Agent' + spyProfile.name +'. Right now, the time is ' + time + ' and the date is ' + theDate + '. Good luck not dying');\n}", "function greet(name){\n greeting = \"Hello, \" + name + \"!\"\n return greeting\n}", "function greeting (name = 'stranger') {\n console.log(`Hello, ${name}!`)}", "function getHelloMessage() {\n document.getElementById(\"hello\").innerHTML = `Hello, ${userNickName}. In case you forgot - you're a good boy 🐶`;\n openSet();\n}", "function describeMe() {\n\t// var supportMsg = $('.support-msg');\n\tvar describe = $('.describe-me');\n\tvar adjectives = ['a minimalist', 'a female in tech', 'an avid hiker', 'a life-long learner', 'a foodie and traveler', 'a web developer'];\n\t\tvar randomNum = Math.floor(Math.random() * 6);\n\t\tdescribe.html(adjectives[randomNum]);\n}", "function greetings(term) {\n term.echo(\n\"'||''|. || '||' '||' . \\n\" +\n\" || || .... .... ... .. ... ... . || || .... .... ... .. .||. .... \\n\" +\n\" ||''|' '' .|| .| '' || || || || || ||''''|| .|...|| '' .|| ||' '' || ||. ' \\n\" +\n\" || |. .|' || || || || || |'' || || || .|' || || || . '|.. \\n\" +\n\".||. '|' '|..'|' '|...' .||. .||. ||. '||||. .||. .||. '|...' '|..'|' .||. '|.' |'..|' \\n\" +\n\" .|....'\\n\" +\n 'DailyBurn Hackathon 2015\\n'+\n 'Chris Sturgill, Kevin Spector, Luke Arntson\\n'+\n 'https://github.com/sturgill/racing-hearts\\n\\n' +\n 'Welcome to Racing Hearts\\n');\n }", "function greeter(name) {\n greetMsg = \"Hello \" + name + \", Good Morning!!!\";\n console.log(greetMsg);\n}", "function randAgeGen() {\n let age = 20 + Math.floor((120 - 20) * Math.random());\n console.log(`Teddy is ${age} years old!`)\n}", "function displayMessage(msg) {\n document.getElementById(\"greeting\").textContent = msg;\n}", "async function addRandomUser() {\n\tconst res = await fetch(\"https://randomuser.me/api\");\n\tconst data = await res.json();\n\n\tconst user = data.results[0];\n\n\tconst newUser = {\n\t\tname: `${user.name.first} ${user.name.last}`,\n\t\twealth: Math.floor(Math.random() * 1000000),\n\t};\n\n\taddUser(newUser);\n}", "function greetings(name = 'Mangalam') {\n let message = `${name}, welcome to 30 Days Of JavaScript!`\n return message\n }", "function Greeting(name){\n this.name = name\n}", "function GuestGreeting(props) {\n return <h1>Please log in.</h1>;\n }", "function greeting(firstName){\n console.log('Hello '+firstName);\n}", "function C012_AfterClass_Jennifer_GaggedAnswer() {\n\tif (ActorIsGagged()) {\n\t\tvar GagTalk = Math.floor(Math.random() * 8) + 1;\n\t\tOverridenIntroText = GetText(\"GaggedAnswer\" + GagTalk.toString());\t\t\n\t}\n}", "welcomeIntent(assistant) {\n this.assistant = assistant;\n this.agent.randomGreeting();\n }", "function greeter() {\n\n}", "function randomQuote() {\n document.querySelector('#quote-of-the-day').textContent = `\"${\n quotes[Math.floor(Math.random() * quotes.length)]\n }\"`;\n }", "function saySomething(){\n var user = getRandomUser();\n if(!user) return;\n var msg = {\n user_id: user.id,\n id: faker.random.uuid(),\n create_date: new Date()\n };\n\n if(faker.random.boolean() && faker.random.boolean()){\n msg.type = 'rich';\n msg.message = faker.lorem.sentence();\n msg.image = faker.image.imageUrl();\n }else{\n msg.type = 'text';\n msg.message = faker.lorem.sentence();\n }\n emitToSockets('MESSAGE:ADD', msg);\n}", "function greet() {\n const name = 'Dolly'\n console.log(`Ohayou Sekai Good Morning World, ${name}`)\n}", "function greetings(personName){\n console.log(\"Welcome \" + personName);\n}", "async function addRandomQuote() {\n const response = await fetch(\"/random\");\n const quote = await response.text();\n document.getElementById(\"quote-container\").innerText = quote;\n}", "function displayMessage(arg){ \n let location = document.querySelector(\"#greeting\")\n \n location.innerText = greet(arg) \n \n}", "function greet(who) {\n\tconsole.log(`Hello ${who}`);\n}" ]
[ "0.85573655", "0.85041916", "0.8499197", "0.8463862", "0.8461774", "0.84270716", "0.82573134", "0.7298476", "0.6970288", "0.6944332", "0.6676978", "0.6657239", "0.6651881", "0.64862114", "0.64696574", "0.64603525", "0.64385587", "0.6395104", "0.6394217", "0.6369117", "0.6357555", "0.6336119", "0.6270122", "0.6251208", "0.6243148", "0.6214184", "0.61822236", "0.6177968", "0.6173422", "0.6169041", "0.6164545", "0.6128692", "0.6123493", "0.6116602", "0.6091008", "0.60823935", "0.60779464", "0.60716075", "0.60701746", "0.6068477", "0.6065581", "0.60574937", "0.6048605", "0.6038855", "0.6036188", "0.60314", "0.60277224", "0.6025509", "0.60192454", "0.6004038", "0.5992691", "0.59906596", "0.59875", "0.59864", "0.5984888", "0.59691566", "0.5962335", "0.59439427", "0.5941895", "0.59407675", "0.593842", "0.59360164", "0.5925362", "0.5924071", "0.5919083", "0.590677", "0.59054714", "0.5903016", "0.5902357", "0.58945626", "0.5881329", "0.5876062", "0.58609235", "0.5860727", "0.584809", "0.5847185", "0.5845314", "0.5845243", "0.5831237", "0.58240867", "0.5823618", "0.58202326", "0.58138174", "0.5812295", "0.58116674", "0.5808886", "0.5803809", "0.58035034", "0.5803231", "0.58031225", "0.5794862", "0.5791188", "0.57753396", "0.57739896", "0.5771469", "0.57693684", "0.5767295", "0.5766976", "0.5765941", "0.57657635" ]
0.8361552
6
Facts Fetches facts from the servers and adds them to the DOM.
function getFacts() { fetch('/data').then(response => response.json()).then((fact) => { // fact is an object, not a string, so we have to // reference its fields to create HTML content const factsListElement = document.getElementById('server-facts-container'); factsListElement.innerHTML = ''; factsListElement.appendChild( createListElement('Fact 1 : ' + fact.fact1)); factsListElement.appendChild( createListElement('Fact 2 : ' + fact.fact2)); factsListElement.appendChild( createListElement('Fact 3 : ' + fact.fact3)); factsListElement.appendChild( createListElement('Fact 4 : ' + fact.fact4)); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fetchFacts() {\n // call fetch on the cat facts api getting one random fact\n fetch(`https://cat-fact.herokuapp.com/facts/random?animal_type=cat&amount=1`)\n // when you get a response, save the text\n .then(response => response.text())\n // get the data from response.text\n .then(data => {\n // convert the data to JSON(like res.json() from api.js, just a different way to do it) and save it as a variable\n fact = JSON.parse(data).text;\n // create a p tag element and assign it to a variable\n let paragraph = document.createElement('p');\n // create a text node element and assign the value to fact from the json data\n let node = document.createTextNode(fact);\n // append the text node to the p tag\n paragraph.appendChild(node);\n // append the p tag to the facts list\n factsList.appendChild(paragraph);\n })\n // if it fails log the error\n .catch(err => console.log(err));\n}", "addToFacts() {\n if (this.species.toLowerCase() != \"pigeon\") {\n this.facts.push(this.compareDinoHeight(), this.compareDinoWeight(),this.compareDinoDiet());\n }\n }", "function fetchResultsFacts(e) {\n e.preventDefault();\n let url = baseURL + factSearch.value;\n\n console.log(\"URL:\", url);\n\n fetch(url) // using URL variable along with the proxyurl to bypass the \"cors-original\" policy\n .then(function(result) {\n return result.json();\n })\n .then(function(json) {\n displayRandomResults(json);\n });\n\n function displayRandomResults(json) {\n console.log(\"Display Results\", json); // displays the fetched results\n while(resultsSection.firstChild) {\n resultsSection.removeChild(resultsSection.firstChild);\n }\n\n let generatedFacts = json;\n\n if(factSearch.length === 0) {\n console.log(\"No results\"); // if left blank, no results\n } else {\n let resultForm = document.createElement(\"form\");\n resultForm.setAttribute(\"class\", \"resultForm\");\n let headerTag = document.createElement(\"h2\");\n headerTag.setAttribute(\"id\", \"headerTag\");\n let clearFixRandom = document.createElement(\"div\");\n clearFixRandom.setAttribute(\"class\", \"clearFixRandom\");\n let paraFact = document.createElement(\"para\");\n paraFact.setAttribute(\"class\", \"catFacts\");\n // the tags that appear in the \"resultsSection\" in the HTML ^\n headerTag.textContent = generatedFacts;\n console.log(\"Facts:\", generatedFacts);\n \n\n for (let i = 0; i < 1; i++) {\n let spanResult = document.createElement(\"span\");\n spanResult.setAttribute(\"class\", \"randoFacts\");\n spanResult.textContent += generatedFacts.text;\n paraFact.appendChild(spanResult);\n }\n\n resultForm.appendChild(headerTag);\n resultForm.appendChild(clearFixRandom);\n resultForm.appendChild(paraFact);\n resultsSection.appendChild(resultForm);\n }\n}\n}", "function populateFeautured() {\n id(\"featured-view\").innerHTML = \"\";\n let url = URL + \"category/featured\";\n fetch(url)\n .then(checkStatus)\n .then(response => response.json())\n .then(appendFeatured)\n .catch(handleRequestError);\n }", "function showStrawFact(data) { //data accepting what is happening up top. \n //debugger; //comment out after bc you dont need to see what you did wrong anymore\n //parse the DB info and put it where it neds to go\n const { city, state, fact } = data; //destructuring assignmnet => MDN JS destructuring \n\n\n //might change some of this stuff for infographic all this is AJAX\n //grab the elements we need, and populate them with data\n document.querySelector('.city1').textContent = city; //will have three of these lines except with the selector in the quotes\n document.querySelector('.state').textContent = state;\n document.querySelector('.facts').textContent = fact;\n }", "function addRandomFact() {\n const facts = [\n 'I have two younger brothers both about a foot taller than me.', \n 'My parents are from Vietnam but I don\\'t speak any Vietnamese.',\n 'I have never been to anywhere else in Australia except Melbourne, \\\n where I was born and raised.'\n ];\n\n // Pick a random fact.\n const fact = facts[Math.floor(Math.random() * facts.length)];\n\n // Add it to the page.\n const factContainer = document.getElementById('fact-container');\n factContainer.innerText = fact;\n}", "function addRandomFact() {\n const facts =\n ['I am currently 20 years old!', \n 'I love to hike, bike, and camp!', \n 'I am an eagle scout!', \n 'I was the valedictorian of my high school!', \n 'I love traveling to other countries! I\\'ve been to about 10.', \n 'I love talking to others and socializing with others!'];\n\n // Pick a random fact.\n const factNum = Math.floor(Math.random() * facts.length);\n const factNumDisplay = factNum + 1; //We want to add 1 to display 1-based index due to 0-based indexing of arrays\n const fact = facts[factNum];\n // Add it to the page.\n\n const factContainer = document.getElementById('fact-container');\n factContainer.innerText = fact;\n const factNumContainer = document.getElementById('factNum-container');\n factNumContainer.innerText = \"This is fact number \" + factNumDisplay + \"!\";\n}", "static Fact(fact) {\n\t\t// create a div element\n\t\tlet factContainer = document.createElement('div');\n\t\t\n\t\t// add an id the div element\n\t\tfactContainer.id = 'fact-container';\n\n\t\t//appends the neccessary elements to the div element which was created\n\t\tif(fact === 'math') {\n\t\t\tfactContainer.innerHTML = \"<div id='random-fact'><div id='back-btn'><div id='line1'></div><div id='line2'></div></div><label>Enter Number</label><br><input type='number' id='input'><h3>Maths Fact</h3><div id='facts'></div></div>\";\n\t\t} else if (fact === 'trivia') {\n\t\t\tfactContainer.innerHTML = \"<div id='random-fact'><div id='back-btn'><div id='line1'></div><div id='line2'></div></div><label>Enter Number</label><br><input type='number' id='input'><h3>Trivia Fact</h3><div id='facts'></div></div>\";\n\t\t} else if (fact === 'year') {\n\t\t\tfactContainer.innerHTML = \"<div id='random-fact'><div id='back-btn'><div id='line1'></div><div id='line2'></div></div><label>Enter Year</label><br><input type='number' id='input'><h3>Year Fact</h3><div id='facts'></div></div>\";\n\t\t}\n\t\t\n\n\t\t// appends the div element to the fact-section element in the html file\n\t\tconst factSection = document.querySelector('#fact-section').appendChild(factContainer);\t\t\n\t}", "function getRandomFacts() {\n factsUl.empty();\n let randomChoices = [];\n for(i = 0; i < 5; i++) {\n let randomChoice = Math.floor(Math.random() * facts.length);\n while(randomChoices.includes(randomChoice)) {\n\n randomChoice = Math.floor(Math.random() * facts.length);\n }\n randomChoices.push(randomChoice);\n factsUl.append($(\"<li>\" + facts[randomChoice] + \"</li>\"));\n }\n randFacts.append(factsUl);\n}", "function getFavoritesArticles() {\n $.get(\"/api/saved-talks\", function(response) {\n if (response !== null) {\n for (var i = 0; i < response.length; i++) {\n displayFavoriteTalk(response[i]);\n }\n }\n });\n}", "function addRandomFact() {\n const facts = [\n \"🎮 I develop Nintendo GameBoy Advance ROMs in my spare time\",\n \"📹 I was a YouTube star back in the days <a href='https://youtube.com/thefredo1000'>Check out my channel</a>\",\n \"🤓 I am a huge Star Wars fan\",\n \"🎵 I love Weezer, they are my favorite band\",\n \"🎸 I can play the bass (Still a rookie)\",\n \"🐕 I have three dogs!\"];\n \n // Pick a random fact.\n var newFact = facts[Math.floor(Math.random() * facts.length)];\n\n // Get the current fact\n const factContainer = document.getElementById('js-fact-container');\n const currentFact = factContainer.innerHTML;\n\n // While the current fact it's the same as the new fact we try with another fact\n while(currentFact == newFact) {\n newFact = facts[Math.floor(Math.random() * facts.length)]; \n }\n factContainer.innerHTML = newFact;\n}", "function FXwriteFacts (){\n //write weather info\n $(\".earth-image\").append(\"<img src='assets/images/earth-globe.jpg' width=150px>\");\n $(\"#local-weather\").html(\n \"<p> Wind Speed: \" +localWeather.wind.speed + \" kph</p>\" +\n \"<p> Temp: \" + Math.floor(localWeather.main.temp -273.15) + \" Celcius </p>\" +\n \"<p> Conditions: \" + localWeather.weather[0].main + \"</p>\"\n );\n //write mars info\n FXcomputeMarsMonth();\n $(\".mars-image\").append(\"<img src='assets/images/mars-globe.jpg' width=150px>\");\n $(\"#mars-weather\").html(\n \"<p> Martian Month: \" + marsMonth + \" </p>\" +\n \"<p> Temp: \" + ((marsWeather.min_temp + marsWeather.max_temp)/2) + \" Celcius </p>\" +\n \"<p> Conditions: \" + marsWeather.atmo_opacity + \"</p>\"\n );\n }", "static fetchFact(type) {\n\t\tlet numberInput = document.querySelector('#input');\n\t\tlet factInput = document.querySelector('#facts');\n\n\t\t//fetch data when number is inputed\n\t\tnumberInput.addEventListener('input', () => {\n\t\t\tif (type === 'math') {\n\t\t\t\tfetch(`http://numbersapi.com/${numberInput.value}/math`)\n\t\t\t\t.then((response) => response.text())\n\t\t\t\t.then((data) => {\n\t\t\t\t\tif (numberInput.value === ''){\n\t\t\t\t\t\tfactInput.innerHTML = '';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfactInput.innerHTML = data;\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t} else if (type === 'trivia') {\n\t\t\t\tfetch(`http://numbersapi.com/${numberInput.value}`)\n\t\t\t\t.then((response) => response.text())\n\t\t\t\t.then((data) => {\n\t\t\t\t\tif (numberInput.value === ''){\n\t\t\t\t\t\tfactInput.innerHTML = '';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfactInput.innerHTML = data;\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t} else if (type === 'year') {\n\t\t\t\tfetch(`http://numbersapi.com/${numberInput.value}/year`)\n\t\t\t\t.then((response) => response.text())\n\t\t\t\t.then((data) => {\n\t\t\t\t\tif (numberInput.value === ''){\n\t\t\t\t\t\tfactInput.innerHTML = '';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfactInput.innerHTML = data;\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t}\n\t\t\n\t\t});\n\n\t}", "function fetchRecipes() {\n fetch(RECIPES_URL)\n .then(resp => resp.json())\n .then(json => json.forEach(recipe => {\n let newRecipe = new Recipe(recipe.name, recipe.url, recipe.meal_type, recipe.cuisine, recipe.id);\n allRecipes.push(newRecipe);\n newRecipe.renderRecipe();\n }))\n }", "function parseWelcomeFact() {\n\n axios\n .get(factUrl)\n .then((response) => {\n scrapFactHtml(response.data);\n })\n .catch((err) => {\n console.log('Error when loading random fact.');\n client.channels.cache.find(channel => channel.name === targetChannelName)\n .send('Здравствуйте! В данный момент, к сожалению, явился без интересных фактов.');\n });\n\n}", "function initializePage() {\n\tconsole.log(\"Javascript connected!\");\n\n\t//const url = \"https://api.nytimes.com/svc/search/v2/candidatesearch.json?api-key=bebd5673446e40c0a0613cd3ea327a8d\";\n\tconst $candidates = $('#candidates');\n\tconst $representatives_container = $('#representatives_container');\n\n\t$('#refreshFeed').click(function(e) {\n\t\te.preventDefault();\n\t\tconsole.log('button clicked');\n\n\t\t$.ajax({\n\t\t\ttype: 'GET',\n\t\t\turl: 'https://www.googleapis.com/civicinfo/v2/voterinfo?key=AIzaSyBrvfLVDyTJ1Ar8EdM1aZda_9141qQcCh4&address=1263%20Pacific%20Ave.%20Kansas%20City%20KS&electionId=2000',\n\t\t\tdataType: 'json',\n\t\t\tsuccess: function(candidates) {\n\t\t\tconsole.log(candidates);\n $.each(candidates.contests, function(i, candidate){\n\n \tconst office = candidates.contests[i].office;\n \tconst name = candidates.contests[i].candidates[0].name;\n \tconst party = candidates.contests[i].candidates[0].party;\n \tconst website = candidates.contests[i].candidates[0].candidateUrl;\n\n \t//console.log(office, name, party, website);\n\n \t$representatives_container.append(\n \t\t`\n\t\t <div class=\"card-container\">\n\t\t <!-- Image -->\n\t\t <div class=\"image-container\">\n\t\t <i class=\"material-icons\" id=\"favorite-card\">favorite</i>\n\t\t </div>\n\n\t\t <!-- Description -->\n\t\t <div class=\"description-container\">\n\t\t <p class=\"title-rep\">${office} | ${party}</p>\n\t\t <h2>${name}</h2>\n\t\t <p class=\"contact\">${website}</p>\n\t\t </div>\n\n\t\t <!-- Button -->\n\t\t <div class=\"buttons-container\">\n\t\t <a href=\"representative.html\"><button class=\"representative-button\" >More Info <i class=\"material-icons\" id=\"right-icon\">chevron_right</i> </button></a>\n\t\t </div>\n\t\t </div>\n \t\t`\n \t\t);\n\n //$candidates.append(`<a href=\"representative.html\"><li>Representatives: <b>${candidates.contests[i].candidates[0].name}</b></li></a>`);\n //$candidates.append(`<p style=\"padding-left:20px\">Party: <b>${candidates.contests[i].candidates[0].party}</b></p>`);\n console.log(candidates.contests[i].candidates[0].name);\n\t\t\t\t });\n\t\t\t}\n\t\t});\n\n \tconsole.log('test');\n });\n}", "async function getRandomFactUsingAsyncAwait() {\n const response = await fetch('/data');\n const fact = await response.text();\n\n // New fact container to replace the older one\n const newFactContainer = document.createElement(\"span\");\n newFactContainer.id = \"js-fact-container\";\n newFactContainer.innerHTML = fact;\n\n // Replacing the current fact container with a new one\n var a = document.getElementById('js-fact-container');\n a.parentNode.replaceChild(newFactContainer, a);\n}", "function getNytFeeds() {\n\t\t\tvar url = 'http://rss.nytimes.com/services/xml/rss/nyt/HomePage.xml';\n\t\t\tvar result = HTTP.call(\"GET\", url, function(error, result) {\n\t\t\t\tif (!error) {\n\t\t\t\t\tnytFeedsAr = [];\n\t//this part works\n\t\t\t\t\tconsole.log('type of: ' + typeof result.content);\n//TEST see if this prevents confusion between npr and nyt feeds\n\t\t\t\t\t//using $1 var to differentiate between that used for npr feed\n\t\t\t\t\t$1 = cheerio.load(result.content, {\n\t\t\t\t\t\tnormalizeWhitespace: true,\n\t\t\t\t\t\txmlMode: true\n\t\t\t\t\t});\n\t\t\t\t\tvar prefix = 'nyt';\n\n\t\t\t\t\t//case collection is empty\n\t\t\t\t\tif (!Nytfeeds.findOne()) {\n\t\t\t\t\t\t$1('item').each(function(idx, element) {\n\t\t\t\t\t\t\t\tvar feedObj = {};\n\t\t\t\t\t\t\t\tvar feedId;\n\t\t\t\t\t\t\t\tvar descStr,\n\t\t\t\t\t\t\t\t\tdescAr = [];\n\t\t\t\t\t\t\t\t// feedObj.pubDate = $(this).find('pubDate').text();\n\t\t\t\t\t\t\t\tfeedObj.insertOrder = idx;\n\t\t\t\t\t\t\t\t//console.log('insertOrder: ' + feedObj.insertOrder);\n\t\t\t\t\t\t\t\tfeedObj.link = $1(this).find('link').text();//.contents();\n\t\t\t\t\t\t\t\tfeedObj._id = prefix + feedObj.link;\n\t\t\t\t\t\t\t\t//console.log('id: ' + feedObj._id);\n\t\t\t\t\t\t\t\t//console.log('type of id: ' + typeof feedObj._id);\n\t\t\t\t\t\t\t\tfeedObj.title = $1(this).find('title').text();//.contents();\n\t\t\t\t\t\t\t\t//console.log('title: ' + feedObj.title);\n\t\t\t\t\t\t\t\t//separating feed description text from the html used to display ads\n\t\t\t\t\t\t\t\tdescStr = $1(this).find('description').text();\n\t\t\t\t\t\t\t\tdescAr = descStr.split('<br clear=');\n\t\t\t\t\t\t\t\tfeedObj.description = descAr[0];//.contents();\n\t\t\t\t\t\t\t\t//console.log('description: ' + feedObj.description);\n\t\t\t\t\t\t\t\tnytFeedsAr.push(feedObj);\n\n\t\t\t\t\t\t\t\t//insert each feed to collection\n\t\t\t\t\t\t\t\tNytfeeds.insert(feedObj, function(er, id) {\n//\t\t\t\t\t\t\t\t\tconsole.log('id: ' + id);\n\t\t\t\t\t\t\t\t\tif (!er) {\n\t\t\t\t\t\t\t\t\t\tconsole.log('insert');\n\t\t\t\t\t\t\t\t\t\tconsole.log('size NytFeeds collection: ' + Nytfeeds.find().count());\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tconsole.log('error: ' + er);\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});\n\t\t\t\t\t} else {\n\t\t\t\t\t//case collection is populated\n\t\t\t\t\t\tvar newFeedsCount;\n\t\t\t\t\t\tvar newFeedsAr = [];\n\t\t\t\t\t\tvar counter = 0;\n\t\t\t\t\t\t//for each feed check if its id has match in collection\n\t\t\t\t\t\t\t//if true, skip\n\t\t\t\t\t\t\t//if false, add to newFeedsAr\n\t\t\t\t\t\t//iterate over newFeedsAr\n\t\t\t\t\t\t\t//update the record in collection in order by insertOrder\n\t\t\t\t\t\t\t//this is assuming that older stories are cycled out by age\n\t\t\t\t\t\t$1('item').each(function(idx, element) {\n\t\t\t\t\t\t\tvar feedObj = {};\n\t\t\t\t\t\t\tfeedObj.link = $1(this).find('link').text();//.contents();\n\t\t\t\t\t\t\tfeedObj._id = prefix + feedObj.link;\n\n\t\t\t\t\t\t\tfeedObj.insertOrder = counter;\n\t\t\t\t\t\t\tfeedObj.title = $1(this).find('title').text();//.contents();\n\t\t\t\t\t\t\tdescStr = $1(this).find('description').text();\n\t\t\t\t\t\t\tdescAr = descStr.split('<br clear=');\n\t\t\t\t\t\t\tfeedObj.description = descAr[0];//.contents();\n\t\t\t\t\t\t\tnewFeedsAr.push(feedObj);\n\t\t\t\t\t\t});\n//\t\t\t\t\t\tconsole.log('length newFeedsAr: ' + newFeedsAr.length);\n\t\t\t\t\t\t//clear old feeds from collection\n\t\t\t\t\t\tNytfeeds.remove({}, function() {\n\t\t\t\t\t\t\tnewFeedsAr.forEach(function(feed) {\n\t\t\t\t\t\t\t\tNytfeeds.insert({\n\t\t\t\t\t\t\t\t\t_id: feed._id,\n\t\t\t\t\t\t\t\t\tinsertOrder: feed.insertOrder,\n\t\t\t\t\t\t\t\t\tlink: feed.link,\n\t\t\t\t\t\t\t\t\ttitle: feed.title,\n\t\t\t\t\t\t\t\t\tdescription: feed.description\n\t\t\t\t\t\t\t\t});\n//\t\t\t\t\t\t\t\tconsole.log('update a feed');\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\t// console.log('length nytFeedsAr: ' + nytFeedsAr.length);\n\t\t\t\t\t// console.log('size NytFeeds collection: ' + Nytfeeds.find().count());\n\t\t\t\t} else {\n\t\t\t\t\tconsole.log('error: ' + error);\n\t\t\t\t}\n\t\t\t});\n\t\t}", "function randomFact() {\n const Facts = [\n \"I am slowly becoming vegan.\",\n \"I am bilingual(English and Spanish)\",\n \"I like do card tricks even though I am not so good at it.\",\n \"I try to grow a collection of rubber duckies for rubber duck debugging(search it up)\",\n \"I enjoy cooking\",\n \"I like learning new things\"\n ];\n\n // Pick a random greeting.\n const Fact = Facts[Math.floor(Math.random() * Facts.length)];\n\n // Add it to the page.\n const factContainer = document.getElementById(\"fact-container\");\n factContainer.innerText = Fact;\n}", "function attachFact() {\n const { species } = info;\n const fact = document.createElement(\"DIV\");\n fact.setAttribute(\"id\", `${species.replace(\" \", \"_\")}-factoid`);\n fact.classList.add(\"factoid\");\n const layout = document.querySelector(`#${species.replace(\" \", \"_\")}-slot`);\n layout.appendChild(fact);\n const factoid = document.createTextNode(`${info.currentFact()}`);\n fact.appendChild(factoid);\n }", "function handleNewFactRequest(response) {\n // Get a random cat fact from the cat facts list\n var factIndex = Math.floor(Math.random() * CAT_FACTS.length);\n var fact = CAT_FACTS[factIndex];\n\n // Create speech output\n var speechOutput = \"Here's your cat fact: \" + fact;\n\n response.tellWithCard(speechOutput, \"CatFacts\", speechOutput);\n}", "function getRecipes() {\n fetch(\"http://localhost/magazine/webservice\")\n .then(response => response.json())\n .then(data => {\n for (let recipe of data) {\n createRecipe(recipe.id, recipe.name, recipe.kitchen, recipe.image);\n }\n })\n .then(data => getFavorites());\n}", "function ourChefs(){\t\t\n\t\tvar chefCount = 1;\n\t\tvar chefArticles = ['article:nth-of-type(1)','article:nth-of-type(2)','article:nth-of-type(3)'];\n\t\tvar chefImages = ['.chef-image-large img:nth-of-type(1)','.chef-image-large img:nth-of-type(2)','.chef-image-large img:nth-of-type(3)'];\n\t\t\n\t\t$('#add').on('click', function(){\n\t\t\tif (chefCount <= 0) {\n\t\t\t\tchefCount += 1;\n\t\t\t\t$('article').fadeOut(0);\n\t\t\t\t$('.chefs-image-large img').fadeOut(0);\n\t\t\t\t$(chefArticles[chefCount]).fadeIn(500);\n\t\t\t\t$(chefImages[chefCount]).fadeIn(500);\n\t\t\t} else if (chefCount <= 2) {\n\t\t\t\t\t\t$('article').fadeOut(0);\n\t\t\t\t\t\t$('.chef-image-large img').fadeOut(0);\n\t\t\t\t\t\t$(chefArticles[chefCount]).fadeIn(500);\n\t\t\t\t\t\t$(chefImages[chefCount]).fadeIn(500);\n\t\t\t\t\t\tchefCount += 1;\n\t\t\t}\n\t\t});\n\t\t$('#subtract').on('click', function(){\n\t\t\tif (chefCount >= 3) {\n\t\t\t\tchefCount += -2;\n\t\t\t\t$('article').fadeOut(0);\n\t\t\t\t$('.chef-image-large img').fadeOut(0);\n\t\t\t\t$(chefArticles[chefCount]).fadeIn(500);\n\t\t\t\t$(chefImages[chefCount]).fadeIn(500);\n\t\t\t} else if (chefCount >= 1) {\n\t\t\t\t\t\tchefCount += -1;\n\t\t\t\t\t\t$('article').fadeOut(0);\n\t\t\t\t\t\t$('.chef-image-large img').fadeOut(0);\n\t\t\t\t\t\t$(chefArticles[chefCount]).fadeIn(500);\n\t\t\t\t\t\t$(chefImages[chefCount]).fadeIn(500);\n\t\t\t}\n\t\t});\n\t}", "function factsDebug() {\n\tvar temp=\"\";\n\tfor (i in factlist) {\n\t\ttemp += factlist[i].id+\" \"+factlist[i].name+\":: \"+factlist[i].value+\"<br>\";\n\t}\n\tvar title=\"<br><text> Fact Debug </text><br>\";\n\tdocument.getElementById(\"fact_debug\").innerHTML = title+\"<text>\"+temp+\"</text>\"+\"<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><text>DEBUG</text>\";\n}", "function showFavorites() {\r\n\t\tdocument.getElementById(\"searchFood\").value = \"\";\r\n\t\tclear();\r\n\r\n\t\tlet url = \"https://hungry-students-csc-337.herokuapp.com\";\r\n\t\tfetch(url, {method: \"GET\"})\r\n\t\t\t.then(checkStatus)\r\n\t\t\t.then(function(responseText) {\r\n\t\t\t\tlet json = JSON.parse(responseText);\r\n\t\t\t\tfor(let i=0; i < json.meals.length; i++) {\r\n\t\t\t\t\tif(json.meals[i].name != \"\") {\r\n\t\t\t\t\t\tlet name = document.createElement(\"h1\");\r\n\t\t\t\t\t\tlet imag = document.createElement(\"img\");\r\n\t\t\t\t\t\tlet p = document.createElement(\"p\");\r\n\r\n\t\t\t\t\t\tname.id = \"food\"+i;\r\n\t\t\t\t\t\tname.innerHTML = json.meals[i].name;\r\n\t\t\t\t\t\timag.src = json.meals[i].image;\r\n\r\n\t\t\t\t\t\tp.appendChild(imag);\r\n\t\t\t\t\t\tdocument.getElementById(\"displayFavorites\").appendChild(name);\r\n\t\t\t\t\t\tdocument.getElementById(\"displayFavorites\").appendChild(p);\r\n\r\n\t\t\t\t\t\tname.onclick = pickFood;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t\t.catch(function(error) {\r\n\t\t\t\tconsole.log(error);\r\n\t\t\t});\r\n\t}", "function RetrieveFeeds() {\n feeds.forEach(function (feed) {\n GetDataFeed(feed);\n });\n }", "function updateDOM() {\n updateFeaturedImage();\n updateFeaturedShoutout();\n updateFeaturedName();\n updateDots();\n}", "function populateEpisodes(episodes) {\n const $episodesList = $(\"#episodesList\");\n // empty the episodes list before adding new episodes of a show\n $episodesList.empty();\n\n // loop thru episodes, creating li's for each with the information provided\n for (let episode of episodes) {\n let $newEpItem = $(`<li data-episode-id=\"${episode.id}\">${episode.name} (season ${episode.season}, number ${episode.number})</li>`);\n $episodesList.append($newEpItem);\n }\n\n // reveal #episodesData\n $(\"#episodesArea\").show();\n }", "function populateFaq() {\n let url = URL + \"faq\";\n fetch(url)\n .then(checkStatus)\n .then(response => response.json())\n .then(appendFaq)\n .catch(handleRequestError);\n }", "function newArticles() {\n var results = [];\n\n axios.get(\"https://talksport.com/football/\").then(function (response) {\n\n // Load the HTML into cheerio and save it to a variable\n // '$' becomes a shorthand for cheerio's selector commands, much like jQuery's '$'\n var $ = cheerio.load(response.data);\n\n // Select each element in the HTML body from which you want information.\n // NOTE: Cheerio selectors function similarly to jQuery's selectors,\n // but be sure to visit the package's npm page to see how it works\n $(\".teaser-item\").each(function (i, element) {\n\n var headline = $(element).children().find(\".teaser__headline\").text().trim();\n var summary = $(element).children().find(\".teaser__subdeck\").text().trim();\n var link = $(element).find(\"a\").attr(\"href\");\n\n\n // Save these results in an object that we'll push into the results array we defined earlier\n results.push({\n headline: headline,\n summary: summary,\n link: link,\n });\n });\n\n // Log the results once you've looped through each of the elements found with cheerio\n //console.log(results);\n for (var i = 0; i < results.length; i++) {\n db.Article.create({ \"headline\": results[i].headline, \"summary\": results[i].summary, \"link\": results[i].link }, function (err, resp) {\n if (err) {\n console.log(err);\n }\n //console.log(resp);\n });\n }\n\n });\n }", "function johnLennonFacts(facts) {\n var exclamatoryFacts = [];\n loopNumber = 0;\n while(loopNumber < facts.length) {\n var updatedFact = facts[loopNumber] + \"!!!\";\n loopNumber++;\n exclamatoryFacts.push(updatedFact);\n }\n return exclamatoryFacts;\n}", "allChefs(req,res){\n Chefs.allChefs(chefs => {\n return res.render(\"chefs/chefs\", { chefs })\n })\n }", "function displayCatalog() {\n // get current list of <dl> exercises\n let catalogChildren = document.querySelectorAll('dl');\n // remove existing children to start fresh\n if (catalogChildren) {\n catalogChildren.forEach(function(child) {\n catalogBox.removeChild(child);\n });\n }\n\n for (var item in localCatalog) {\n\n if (typeof localCatalog[item] !== 'function') {\n\n let exerciseSet = document.createElement('dl'),\n nameBox = document.createElement('dt'),\n repsBox = document.createElement('dd');\n\n exerciseSet.setAttribute('data-item', item);\n\n nameBox.contentEditable = true;\n repsBox.contentEditable = true;\n\n nameBox.setAttribute('data-item', 'name');\n repsBox.setAttribute('data-item', 'reps');\n\n nameBox.textContent = localCatalog[item].name;\n repsBox.textContent = localCatalog[item].reps;\n\n exerciseSet.appendChild(nameBox);\n exerciseSet.appendChild(repsBox);\n\n catalogBox.appendChild(exerciseSet);\n }\n };\n}", "function populateShows(shows) {\n\tconst $showsList = $('#shows-list');\n\t$showsList.empty();\n\n\tfor (let show of shows) {\n\t\tlet $item = $(\n\t\t\t`<div class=\"col-md-6 col-lg-3 Show\" data-show-id=\"${show.id}\">\n <div class=\"card\" data-show-id=\"${show.id}\">\n <img class=\"card-img-top\" src=\"${show.image}\" alt=\"Card image cap\">\n <div class=\"card-body\">\n <h5 class=\"card-title\">${show.name}</h5>\n <p class=\"card-text\">${show.summary}</p>\n <button class=\"btn btn-success getEpisodes\">Episodes</button>\n </div>\n </div>\n </div>\n `\n\t\t);\n\n\t\t$showsList.append($item);\n\t}\n}", "function handleNewFactRequest(response) {\n // Get a random soccer fact from the soccer facts list\n var factIndex = Math.floor(Math.random() * SOCCER_FACTS.length);\n var fact = SOCCER_FACTS[factIndex];\n\n // Create speech output\n var speechOutput = \"Here's your soccer fact: \" + fact;\n\n response.tellWithCard(speechOutput, \"Soccer Facts\", speechOutput);\n}", "async function showRecipes(recipes) {\n\n for (let rec of recipes) {\n await generateRecipeHTML(rec);\n }\n currentMealList = recipes;\n }", "function createFactObject(xml, isDelete) {\n\t//debug(\"createFactObject() in \" + $(xml).toXML());\n\tvar obj = null;\n\tvar items = null;\n\tvar jq = $(xml);\n\t// JQuery doesn't like .'s in XML tag names, so get the name from the wrapped XML DOM. \n\tvar tagName = jq.get(0).tagName;\n\tif ((tagName == \"row\") || (tagName == \"entry\")) {\n\t\t// Initial query wraps facts in \"row\" tags, the ChangeCollector wraps the create list in \"entry\" tags.\n\t\tjq = $(xml).children(\":first\");\n\t\ttagName = jq.get(0).tagName;\n\t}\n\tif (tagName == \"identifier\") { \n\t\ttagName = jq.get(0).children[0].tagName;\t\t\n\t\tjq = jq.get(0).children[0];\n\t}\n\tif (isDebug()) {\n\t\tdebug(\"createFactObject() tagName=\" + tagName + \" xml=\" + jq.innerHTML);\n\t}\n\tswitch (tagName) {\n\tcase \"org.tohu.Questionnaire\":\t\t\n\t\tobj = new QuestionnaireObject();\n\t\tobj.id = getChildText(jq, \"id\");\n\t\t// TODO this meeds some more work to convert date formats specified in some industry standard way into those supported by the JQuery $.datePicker.formatDate function \n\t\tobj.clientDateFormat = getChildText(jq, \"clientDateFormat\", \"\").replace(/yy/g, \"y\");\n\t\tobj.presentationStyles = getChildText(jq, \"presentationStyles\");\n\t\tobj.label = getChildText(jq, \"label\", \"\");\n\t\titems = getChildText(jq, \"items\");\n\t\tif (items) {\n\t\t\tobj.items = items.split(\",\");\n\t\t}\n\t\tvar availableItems = getChildText(jq, \"availableItems\");\n\t\tif (availableItems) {\n\t\t\tobj.availableItems = availableItems.split(\",\");\n\t\t}\n\t\tobj.activeItem = getChildText(jq, \"activeItem\");\n\t\tobj.completionAction = getChildText(jq, \"completionAction\");\n\t\tobj.enableActionValidation = getChildBoolean(jq, \"enableActionValidation\");\n\t\tobj.hasErrors = getChildBoolean(jq, \"invalidAnswers\");\n\t\tobj.factHandle = $(\"fact-handle\", xml).attr(\"external-form\");\n\t\tobj.markupAllowed = getChildBoolean(jq, \"markupAllowed\");\n\t\tbreak;\n\tcase \"org.tohu.Group\":\n\t\tobj = new GroupObject();\n\t\tobj.id = getChildText(jq, \"id\");\n\t\tobj.presentationStyles = getChildText(jq, \"presentationStyles\");\n\t\tobj.label = getChildText(jq, \"label\", \"\");\n\t\titems = getChildText(jq, \"items\");\n\t\tif (items) {\n\t\t\tobj.items = items.split(\",\");\n\t\t}\n\t\tbreak;\n\tcase \"org.tohu.Question\":\n\tcase \"org.tohu.MultipleChoiceQuestion\":\n\t\tobj = new QuestionObject();\n\t\tobj.id = getChildText(jq, \"id\");\n\t\tobj.presentationStyles = getChildText(jq, \"presentationStyles\");\n\t\tobj.preLabel = getChildText(jq, \"preLabel\", \"\");\n\t\tobj.postLabel = getChildText(jq, \"postLabel\", \"\");\n\t\tobj.required = getChildBoolean(jq, \"required\");\n\t\tvar possibleAnswers = getChildText(jq, \"possibleAnswers\");\n\t\tif (possibleAnswers && (possibleAnswers != \"\")) {\n\t\t\tobj.possibleAnswers = new Array();\n\t\t\tvar tempArray = splitWithEscapes(possibleAnswers, \",\");\n\t\t\tfor (var i = 0; i < tempArray.length; i++) {\n\t\t\t\tvar s = tempArray[i];\n\t\t\t\tobj.possibleAnswers.push(splitWithEscapes(s, \"=\"));\n\t\t\t}\n\t\t}\n\t\tobj.answerType = getChildText(jq, \"answerType\");\n\t\tif (obj.answerType) {\n\t\t\tvar pos = obj.answerType.indexOf('.');\n\t\t\tif (pos >= 0) {\n\t\t\t\tobj.answerType = obj.answerType.substring(0, pos);\n\t\t\t}\n\t\t\tswitch (obj.answerType) {\n\t\t\tcase \"text\":\n\t\t\t\tobj.answer = getChildText(jq, \"textAnswer\", \"\");\n\t\t\t\tbreak;\n\t\t\tcase \"number\":\n\t\t\t\tobj.answer = getChildText(jq, \"numberAnswer\", \"\");\n\t\t\t\tbreak;\n\t\t\tcase \"decimal\":\n\t\t\t\tobj.answer = getChildText(jq, \"decimalAnswer\", \"\");\n\t\t\t\tbreak;\n\t\t\tcase \"boolean\":\n\t\t\t\tobj.answer = getChildText(jq, \"booleanAnswer\", \"\");\n\t\t\t\tbreak;\n\t\t\tcase \"date\":\n\t\t\t\tobj.answer = getChildText(jq, \"dateAnswer\", \"\");\n\t\t\t\tbreak;\n\t\t\tcase \"list\":\n\t\t\t\tobj.answer = getChildText(jq, \"listAnswer\", \"\");\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tif (!handleError(ERROR_TYPES.RULES_DEFINITION, [ obj.id, \"unknown answerType: \" + obj.answerType ],\n\t\t\t\t\t\t\"dynamic_interface.createFactObject\", objectToString(obj))) {\n\t\t\t\t\tobj = null;\n\t\t\t\t}\n\t\t\t}\n\t\t} \n\t\telse if (!handleError(ERROR_TYPES.RULES_DEFINITION, [ obj.id, \"no answerType\" ],\n\t\t\t\t\"dynamic_interface.createFactObject\", objectToString(obj))) {\n\t\t\tobj = null;\n\t\t}\n\t\tbreak;\n\tcase \"org.tohu.Note\":\n\t\tobj = new NoteObject();\n\t\tobj.id = getChildText(jq, \"id\");\n\t\tobj.presentationStyles = getChildText(jq, \"presentationStyles\");\n\t\tobj.label = getChildText(jq, \"label\", \"\");\n\t\tbreak;\n\tcase \"org.tohu.InvalidAnswer\":\n\t\tvar questionID = getChildText(jq, \"questionId\");\n\t\tvar reason = getChildText(jq, \"reason\", \"\");\n\t\tif (isDelete) {\n\t\t\tobj = new DeleteObject(true, questionID, reason);\n\t\t}\n\t\telse {\t\n\t\t\tobj = new ErrorObject();\n\t\t\tobj.id = questionID + \"_error_\" + (persistentState.errorSequence++);\n\t\t\tobj.type = getChildText(jq, \"type\");\n\t\t\tobj.reason = reason\n\t\t\t// Errors are assigned level 999 so they always sort last.\n\t\t\tobj.hierarchy = new HierarchyObject(questionID, null, 999, false);\n\t\t}\n\t\tbreak;\n\tcase \"org.tohu.xml.ItemId\":\n\t\tobj = new DeleteObject(false, getChildText(jq, \"id\"));\n\t\tbreak;\n\tdefault:\n\t\tif (!handleError(ERROR_TYPES.INTERNAL, [ \"unknown tagName: \" + tagName ],\n\t\t\t\t\"dynamic_interface.createFactObject\", objectToString(obj))) {\n\t\t\tobj = null;\n\t\t}\n\t\tobj = null;\n\t}\n\t// All objects must have an id otherwise the XML was garbage.\n\tif ((obj != null) && isNull(obj.id)) {\n\t\tif (!handleError(ERROR_TYPES.RULES_DEFINITION, [ \"undefined\", \"no id\" ],\n\t\t\t\t\"dynamic_interface.createFactObject\", objectToString(obj))) {\n\t\t\tobj = null;\n\t\t}\n\t}\n\treturn obj;\n}", "function getCatFactFromApi () {\n\n let addLi = document.createElement('li')\n\n let apiCatFact = fetch(\"https://catfact.ninja/fact?max_length=140\")\n .then(response => response.json())\n .then(data => {\n addLi.innerHTML = data.fact;\n ulItems.appendChild(addLi);\n })\n .catch(error => console.log(error))\n}", "function getFeaturedHouses(response) {\n extractDataOfInterest(response, featuredHouses, createHouseFromHouseForSaleData);\n if (featuredHouses.length === 0) {\n initiateBindings();\n }\n \n updateSlideshowBindings();\n setFeaturedHousesContaierTitle();\n addFeaturedHousesToContainer();\n makeInvisible(loadingContainer);\n makeVisible(featuredHousesContainer);\n}", "function getCatFactFromApi () {\n\n // let addLi = document.createElement('li')\n\n let apiCatFact = fetch(\"https://catfact.ninja/fact?max_length=140\")\n .then(response => response.json())\n .then(data => {\n catFactfromApi = data.fact;\n // ulItems.appendChild(addLi);\n })\n .catch(error => console.log(error))\n}", "function handleNewFactRequest(response) {\n // Get a random whiskey fact from the whiskey facts list\n var factIndex = Math.floor(Math.random() * FACTS.length);\n var randomFact = FACTS[factIndex];\n\n // Create speech output\n var speechOutput = \"Here's your fact: \" + randomFact;\n var cardTitle = \"Your Fact\";\n response.tellWithCard(speechOutput, cardTitle, speechOutput);\n}", "function loadFAQList() {\n\tvar req = new XMLHttpRequest();\n\treq.open(\"GET\", PHYSFAQ_BASE + \"/articles.json\", true);\n\n\treq.onload = function() {\n\t\tif (req.status == 200) {\n\t\t\tFAQARTICLES = JSON.parse(req.responseText);\n\n\t\t\t// Just add FAQ article titles to locales (addTranslation) so that\n\t\t\t// the i18n code can take care of localizing these strings\n\t\t\tfor (var i = 0; i < FAQARTICLES.length; ++i) {\n\t\t\t\tvar title_i18n_id = \"_faq_title\" + i;\n\n\t\t\t\taddTranslation(null, title_i18n_id, FAQARTICLES[i].title);\n\n\t\t\t\t// Article container\n\t\t\t\tvar faqArticle = document.createElement(\"div\");\n\t\t\t\tfaqArticle.classList.add(\"faq-article\");\n\n\t\t\t\t// Article content\n\t\t\t\tvar faqArticleContent = document.createElement(\"div\");\n\t\t\t\tfaqArticleContent.classList.add(\"faq-article-content\");\n\t\t\t\tfaqArticleContent.classList.add(\"markdown-body\");\n\t\t\t\tfaqArticleContent.dataset.articleid = i;\n\t\t\t\tfaqArticleContent.style.display = \"none\";\n\n\t\t\t\t// Article header\n\t\t\t\tvar faqArticleHeader = document.createElement(\"div\");\n\t\t\t\tfaqArticleHeader.classList.add(\"faq-article-header\");\n\t\t\t\tfaqArticleHeader.dataset.i18n = title_i18n_id;\n\t\t\t\tfaqArticleHeader.innerHTML = i18n(null, title_i18n_id);\n\t\t\t\tfaqArticleHeader.dataset.articleid = i;\n\t\t\t\tfaqArticleHeader.onclick = function() {\n\t\t\t\t\t// contentElement is faqArticleContent corresponding to currently clicked header\n\t\t\t\t\tvar contentElement = this.parentElement.getElementsByClassName(\"faq-article-content\")[0];\n\n\t\t\t\t\tif (contentElement.style.display == \"none\") {\n\t\t\t\t\t\tcontentElement.style.display = \"block\";\n\t\t\t\t\t\tloadFAQArticle(contentElement);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcontentElement.style.display = \"none\";\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfaqArticle.appendChild(faqArticleHeader);\n\t\t\t\tfaqArticle.appendChild(faqArticleContent);\n\t\t\t\tdocument.getElementById(\"faq-articles\").appendChild(faqArticle);\n\t\t\t}\n\t\t}\n\t};\n\n\treq.send();\n}", "function displayFavouriteItems(){\n\n\t\t$.getJSON('https://secure.toronto.ca/cc_sr_v1/data/swm_waste_wizard_APR?limit=1000', function(data){\n\t\t\tvar output = \"\";\n\t\t\toutput += \"<h2>Favourites</h2>\"\n\n\t\t\t$.each(favourites, function name(key, val) {\n\n\t\t\t\toutput += '<div class=\"result-item favourited\" data-key=\"' + val + '\">';\n\t\t\t\toutput += '<div class=\"title\">';\n\t\t\t\toutput += '<span><i class=\"fas fa-star\"></i></span>';\n\t\t\t\toutput += '<h3>' + data[val].title + '</h3>';\n\t\t\t\toutput += '</div>';\n\n\t\t\t\tvar html = $('<textarea />').html(data[val].body).text();\n\t\t\t\toutput += '<div class=\"description\">';\n\t\t\t\toutput += html;\n\t\t\t\toutput += '</div>';\n\t\t\t\toutput += '</div>';\n\t\t\t});\n\n\t\t\t$('#favourites-section').html(output);\n\t\t});\n\t}", "function populateFavorites(id) {\n\n var queryURL = \"https://spoonacular-recipe-food-nutrition-v1.p.rapidapi.com/recipes/\" + id + \"/information/\";\n\n $.ajax({\n method: \"GET\",\n url: queryURL,\n dataType: \"json\",\n headers: {\n 'X-RapidAPI-Key': foodKey\n // 'Accept: application/json' \n }\n }).done(function (response) {\n console.log(response);\n\n var newFood = $(\"<div>\");\n var foodImg = $(\"<img>\");\n newFood.attr(\"id\", id);\n newFood.addClass(\"food-display\");\n foodImg.attr(\"src\", response.image);\n foodImg.addClass(\"circle\");\n\n newFood.append(response.title);\n newFood.append(\"<br>\");\n newFood.append(foodImg);\n\n $(\"#favorite-meals\").append(newFood);\n\n }).fail(function (err) {\n console.log(err);\n });\n\n }", "function fetchFeeds(){\n var options = {\n // method: 'jsonrpc' // 'dnode'\n method: 'dnode'\n };\n app.feed.fetchAll(options,updateFromFeeds); \n}", "function loadFoundation() {\n\t//Load the CSS to the page\n\tvar style = this.document.createElement('style');\n\tstyle.innerHTML = css;\n\tdocument.head.appendChild(style);\n\t\n\t//Load the modals\n\tdocument.body.innerHTML += modal1 + modal2 + modal3 + modal4;\n\t\n\t//load the data to modals\n\tswitch(step) {\n\t\tcase 4:\n\t\t\tgetEl('favbook').value = favbook;\n\t\t\tif(favcolors.includes('red')) getEl('red').checked = true;\n\t\t\tif(favcolors.includes('green')) getEl('green').checked = true;\n\t\t\tif(favcolors.includes('blue')) getEl('blue').checked = true;\n\t\tcase 3:\n\t\t\tgetEl('address').value = address;\n\t\t\tif(gender == 'male') getEl('male').checked = true;\n\t\t\telse if(gender == 'female') getEl('female').checked = true;\n\t\t\telse if(gender == 'other') getEl('other').checked = true;\n\t\tcase 2:\n\t\t\tgetEl('age').value = age;\n\t\t\tgetEl('aboutme').value = aboutme;\n\t\tcase 1:\n\t\t\tgetEl('name').value = name;\n\t\t\tgetEl('email').value = email;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t//just started the survey\n\t}\n}", "function populateEpisodes(episodes) {\n\tconst $ul = $('#episodes-list');\n\t$ul.empty();\n\n\tfor (let episode of episodes) {\n\t\tlet $newEp = $(`<li>${episode.name} (season ${episode.season}, number ${episode.number})</li>`);\n\n\t\t$ul.append($newEp);\n\t}\n\n\t$('#episodes-area').show();\n}", "function get_animal_facts() {\n\n var thisDate = new Date();\n\n var response = UrlFetchApp.fetch('https://dog-facts-api.herokuapp.com/api/v1/resources/dogs?number=' + ANIMAL_FACTS_PER_CALL);\n var data = JSON.parse(response.getContentText());\n\n if (!data.length) {\n return [];\n }\n\n var rows = [];\n var headers = Object.keys(data[0]);\n\n for (var i=0; i<data.length; i++) {\n \n var row = [];\n for (var j=0; j<headers.length; j++) {\n row.push(\n thisDate,\n data[i].fact, \n );\n }\n rows.push(row);\n }\n\n //Logger.log(rows);\n\n write_data_to_google_sheet_(ANIMAL_FACTS_GOOGLE_SHEET_URL, ANIMAL_FACTS_GOOGLE_SHEET_RESULTS_TAB_NAME, rows);\n\n return true;\n\n}", "function handleNewFactRequest(response) {\n // Get a random space fact from the space facts list\n var factIndex = Math.floor(Math.random() * FACTS.length);\n var randomFact = FACTS[factIndex];\n\n // Create speech output\n var speechOutput = \"Here's your fact: \" + randomFact;\n var cardTitle = \"Your Fact\";\n response.tellWithCard(speechOutput, cardTitle, speechOutput);\n}", "function handleNewFactRequest(response) {\n // Get a random space fact from the space facts list\n var factIndex = Math.floor(Math.random() * FACTS.length);\n var randomFact = FACTS[factIndex];\n\n // Create speech output\n var speechOutput = \"Here's your fact: \" + randomFact;\n var cardTitle = \"Your Fact\";\n response.tellWithCard(speechOutput, cardTitle, speechOutput);\n}", "function initializeFeedAPI() {\n\tvar feedList = [];\n\n\t// get the current user's feed list from the data base\n\t$.ajax({\n\t\turl: \"getFeedList.php\",\n\t\tdatatype: \"json\",\n\t\tdata: {\"username\": \"user001\"}, // currently hardcoded to load test user\n\t\tasync: false,\n\t\tsuccess: function (data) {\n\t\t\tvar obj = jQuery.parseJSON(data);\n\t\t\tfor (var i = 0; i < obj.length; i++) {\n\t\t\t\tfeedList.push(obj[i]['rssURL']);\n\t\t\t}\n\t\t}\n\t});\n\n\t// go through the list adding the content\n\tfor(var i = 0; i < feedList.length; i++) {\n\t\tvar feed = new google.feeds.Feed(feedList[0]);\n\t\tfeed.load(function(result) {\n\t\t\tif(!result.error) {\n\t\t\t\tfor(var j = 0; j < result.feed.entries.length; j++) {\n\t\t\t\t\tvar entry = result.feed.entries[j];\n\t\t\t\t\t$(\"#extrafeed\").append($(\"<div><p>\" + entry.title + \"</p></div>\")) \n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n}", "function handleNewFactRequest(response) {\n // Get a random fact from the list defined above.\n var factIndex = Math.floor(Math.random() * FACTS.length);\n var randomFact = FACTS[factIndex];\n\n // Create speech output\n var speechOutput = randomFact;\n var cardTitle = \"Your Fact\";\n response.tellWithCard(speechOutput, cardTitle, speechOutput);\n}", "function load_food_cards_into_sections(food_list, food_categories, food_info_dict) {\n var category_dict = {};\n for (var i in food_categories) {\n var category = food_categories[i];\n\n var cat_id = category[\"id\"];\n var cat_name = category[\"name\"];\n category_dict[cat_id] = cat_name;\n }\n\n for (var i in food_list) {\n var food = food_list[i];\n\n var card = add_card(food, food_info_dict);\n var category_id = food[\"category\"];\n\n document.getElementById(category_dict[category_id]).appendChild(card);\n }\n\n}", "function checkFacts(facts, hit) {\r\n var count = 0\r\n var sums = new Array()\r\n var result = new Array()\r\n\r\n for (var i = 0; i < hit.assignments.length; i++) {\r\n if (i == 0) {\r\n foreach(hit.assignments[i].answer, function(answer) {\r\n if (answer == 'Yes') {\r\n sums.push(1)\r\n }\r\n else {\r\n sums.push(0)\r\n }\r\n count += 1\r\n })\r\n }\r\n else {\r\n foreach(hit.assignments[i].answer, function(answer) {\r\n if (answer == 'Yes') {\r\n sums[count] += 1\r\n }\r\n count += 1\r\n })\r\n }\r\n count = 0\r\n }\r\n\r\n for (var i = 0; i < sums.length; i++) {\r\n if (sums[i] > 0) {\r\n result.push(facts[i])\r\n }\r\n }\r\n\r\n return result\r\n}", "function initMoreFacts(){\n \"use strict\";\n if($j('.more_facts_holder').length){\n $j('.more_facts_holder').each(function(){\n var $this = $j(this);\n var $more_label = 'More Facts';\n if($j(this).find('.more_facts_button').data('morefacts') !== \"\"){\n $more_label = $j(this).find('.more_facts_button').data('morefacts');\n }\n var $less_label = 'Less Facts';\n if($j(this).find('.more_facts_button').data('lessfacts') !== \"\"){\n $less_label = $j(this).find('.more_facts_button').data('lessfacts');\n } \n $this.find('.more_facts_button').on(\"mouseenter\",function(){\n $j(this).css('color',$j(this).data('hovercolor'));\n }).on(\"mouseleave\",function() {\n if(!$this.find('.more_facts_outer').is(':visible')){\n $j(this).css('color',$j(this).data('color'));\n }\n });\n var expandable_content_top_padding = 70; // this value is set as default top padding inside css file\n if($this.find('.more_facts_inner').data('expandable_content_top_padding') !== \"\"){\n expandable_content_top_padding = $this.find('.more_facts_inner').data('expandable_content_top_padding');\n $this.find('.more_facts_inner').css({'padding-top':expandable_content_top_padding});\n }\n var height = 0;\n var speed = 600;\n $this.find('.more_facts_button').click(function(){\n height = $this.find('.more_facts_inner').height() + expandable_content_top_padding;\n if(height > 0 && height < 601){\n speed = 800;\n } else if(height > 600 && height < 1201){\n speed = 1500;\n } else{\n speed = 2100;\n }\n if(!$this.hasClass('more_fact_opened')){\n $this.addClass('more_fact_opened');\n $this.find('.more_facts_fake_arrow').fadeIn(speed);\n $this.find('.more_facts_outer').stop().animate({'height': height}, speed, function() {\n if($j('.parallax_section_holder').length) {\n initParallax();\n }\n });\n $j(this).find('.more_facts_button_text').text($less_label);\n $j(this).find('.more_facts_button_arrow').addClass('rotate_arrow');\n } else {\n $this.find('.more_facts_fake_arrow').fadeOut(speed);\n $this.find('.more_facts_outer').stop().animate({'height': '0px'}, speed,function(){\n if(!$this.find('.more_facts_button').is(\":hover\")){$this.find('.more_facts_button').css('color',$this.find('.more_facts_button').data('color'));}\n $this.removeClass('more_fact_opened');\n if($j('.parallax_section_holder').length) {\n initParallax();\n }\n });\n $j(this).find('.more_facts_button_text').text($more_label);\n $j(this).find('.more_facts_button_arrow').removeClass('rotate_arrow');\n }\n });\n });\n }\n}", "function populateInit() {\n for (var i = 0; i < channels.length; i++) {\n channel = channels[i];\n channelurl = baseUrl + \"/channels/\" + channel;\n $.ajax({\n \"url\": channelurl,\n dataType: \"jsonp\",\n success: populateDOM,\n error: errorChannel,\n });\n }\n }", "function addRecipes(i) {\r\n /* See if the card data is there first. If it's not, fetch it! */\r\n if (!collections[i]) return false;\r\n var notifier = document.getElementById(collections[i].slug + \"_updateNotif\");\r\n if (notifier)\r\n notifier.style.display = \"none\";\r\n try {\r\n var updateLink = document.getElementById(collections[coll].slug + \"_updateLink\");\r\n updateLink.style.display = \"block\";\r\n } catch (ex) {}\r\n var cardsExist = false;\r\n for (var j in collections[i].cards) {\r\n if (typeof collections[i].cards[j] == \"function\") continue;\r\n cardsExist = true;\r\n break;\r\n }\r\n if (!cardsExist) {\r\n scanWikiForChanges(i)();\r\n return;\r\n }\r\n var coll = document.getElementById(collections[i].slug + \"d\");\r\n if (!coll) return;\r\n var collDiv = document.createElement('div');\r\n collDiv.id = collections[i].slug + \"_recipes\";\r\n collDiv.className = collDiv.id;\r\n // coll.insertBefore(notifier, collDiv);\r\n coll.appendChild(collDiv);\r\n // coll.appendChild(notifier); // push the notifier under all the text\r\n /* The card info */\r\n if (collections[i].cards != undefined) {\r\n var allChecked = true;\r\n var unknownCards = false;\r\n var totalChecked = 0;\r\n for (var j in collections[i].cards) {\r\n if (typeof collections[i].cards[j] == \"function\") continue;\r\n var div = document.createElement('div');\r\n collDiv.appendChild(div);\r\n var label = document.createElement('label');\r\n div.appendChild(label);\r\n var input = document.createElement('input');\r\n label.appendChild(input);\r\n input.type = \"checkbox\";\r\n if (collections[i].cards[j].recipe.match(/\\?/)) { unknownCards = true; input.disabled = true;}\r\n else if (collections[i].cards[j].owned) { ++totalChecked; input.checked = true; }\r\n else { allChecked = false; }\r\n input.name = collections[i].slug + j;\r\n input.className = collections[i].slug;\r\n input.addEventListener('click',saveOwnership(input, i, j, false, true),false);\r\n addText(\" \" + collections[i].cards[j].name + \", \" + collections[i].cards[j].points, label, false);\r\n var cardType = document.createElement('img');\r\n var cardStatus = 0;\r\n div.appendChild(cardType);\r\n var ingredientsAdded = false;\r\n if ((collections[i].cards[j].recipe != '') && (!collections[i].cards[j].recipe.match(/\\?/))) {\r\n var span = document.createElement('span');\r\n var recip = collections[i].slug + j;\r\n span.id = recip + \"r\";\r\n var a = document.createElement('a');\r\n a.href = EMPTY_LINK;\r\n a.id = recip + \"w\";\r\n a.addEventListener('mouseover', showrepe(recip), false);\r\n a.addEventListener('mouseout', hiderepe(recip), false);\r\n a.addEventListener('click', togglerepe(recip),false);\r\n addText(\"recipe\", a, false);\r\n span.appendChild(a);\r\n addText(\" (\", div, false);\r\n div.appendChild(span);\r\n addText(\")\", div, false);\r\n var span = document.createElement('span');\r\n span.id = recip;\r\n span.className = \"recipe\";\r\n addText(collections[i].cards[j].recipe, span, false);\r\n div.appendChild(span);\r\n var span = document.createElement('span');\r\n var ingredientsAdded = false;\r\n span.id = collections[i].slug + j + \"rec\";\r\n span.className = \"rboxes\";\r\n for (var k in collections[i].cards[j].ingredients) {\r\n cardStatus = getCreditStatus(collections[i].cards[j].ingredients[k].price_type, cardStatus);\r\n ingredientsAdded = true;\r\n var rlabel = document.createElement('label');\r\n span.appendChild(rlabel);\r\n var rinput = document.createElement('input');\r\n rlabel.appendChild(rinput);\r\n rinput.type = \"checkbox\";\r\n if (collections[i].cards[j].ingredients[k].owned) { rinput.checked = true; }\r\n rinput.name = collections[i].slug + j + k;\r\n rinput.addEventListener('click',saveOwnership(input, i, j, k, true, true),false);\r\n addText(\" \" + collections[i].cards[j].ingredients[k].name + \", \" + collections[i].cards[j].ingredients[k].points, rlabel, false);\r\n if ((collections[i].cards[j].ingredients[k].recipe != '') && (!collections[i].cards[j].ingredients[k].recipe.match(/\\?/))) {\r\n var ispan = document.createElement('span');\r\n var irecip = i + j + k;\r\n ispan.id = irecip + \"r\";\r\n span.appendChild(ispan);\r\n var a = document.createElement('a');\r\n a.href = EMPTY_LINK;\r\n a.id = irecip + \"w\";\r\n a.addEventListener('mouseover', showrepe(irecip, true), false);\r\n a.addEventListener('mouseout', hiderepe(irecip, true), false);\r\n addText(\"recipe\", a, false);\r\n ispan.appendChild(a);\r\n addText(\" (\", span, false);\r\n span.appendChild(ispan);\r\n addText(\")\", span, true);\r\n var ispan = document.createElement('span');\r\n ispan.id = irecip;\r\n ispan.className = \"recipe\";\r\n addText(collections[i].cards[j].ingredients[k].recipe, ispan, false);\r\n span.appendChild(ispan);\r\n } else if (collections[i].cards[j].ingredients[k].details != '') {\r\n var string = formatMarkets(i, collections[i].cards[j].ingredients[k].details);\r\n var stringElem = document.createElement('span');\r\n stringElem.innerHTML = string;\r\n span.appendChild(stringElem);\r\n addText('', span, true);\r\n } else {\r\n addText('', span, true);\r\n }\r\n }\r\n if (ingredientsAdded) {\r\n div.appendChild(span);\r\n }\r\n }\r\n if (collections[i].cards[j].details != '') {\r\n cardStatus = getCreditStatus(collections[i].cards[j].price_type, cardStatus);\r\n var string = formatMarkets(i, collections[i].cards[j].details);\r\n var stringElem = document.createElement('span');\r\n stringElem.innerHTML = string;\r\n div.appendChild(stringElem);\r\n // addText(string, div, false);\r\n }\r\n addText('', div, true);\r\n if (cardStatus == TICKET_COLLECTION) {\r\n //cardType.src = IMAGES[\"TICKET\"];\r\n //div.style.border = \"#CCFFCC 1px solid\";\r\n } else if (cardStatus == XL_COLLECTION) {\r\n //cardType.src = IMAGES[\"XL\"];\r\n //div.style.border = \"#CBDDFF 1px solid\";\r\n }\r\n }\r\n setProgressCount(collections[i].slug, totalChecked, collections[i].size);\r\n var span = document.getElementById(i+\"_checkAllLinks\");\r\n if (!span) {\r\n span = document.createElement('span');\r\n span.id = i+\"_checkAllLinks\";\r\n span.style.cssFloat = \"left\";\r\n span.style.textAlign = \"left\";\r\n span.style.display = \"block\";\r\n var a_check = document.createElement('a');\r\n a_check.href = EMPTY_LINK;\r\n a_check.id = collections[i].slug + \"_checker\";\r\n a_check.addEventListener('click',checkall(i, true),false);\r\n addText(\"Check All\", a_check, false);\r\n var a_uncheck = document.createElement('a');\r\n a_uncheck.href = EMPTY_LINK;\r\n a_uncheck.id = collections[i].slug + \"_unchecker\";\r\n a_uncheck.addEventListener('click',checkall(i, false),false);\r\n addText(\"Uncheck All\", a_uncheck, false);\r\n a_uncheck.style.display = \"none\";\r\n a_check.style.display = \"none\";\r\n if (allChecked) {\r\n a_uncheck.style.display = \"block\";\r\n } else {\r\n a_check.style.display = \"block\";\r\n }\r\n span.appendChild(a_uncheck);\r\n span.appendChild(a_check);\r\n var container = document.getElementById(i+\"_closeLink\");\r\n container.parentNode.insertBefore(span, container);\r\n }\r\n\r\n var span = document.createElement('span');\r\n span.id = collections[i].slug + \"_updateLink\";\r\n span.appendChild(document.createElement('br'));\r\n var a_update = document.createElement('a');\r\n a_update.href = EMPTY_LINK;\r\n a_update.addEventListener('click',scanWikiForChanges(i),false);\r\n addText(\"Update data from PackRat Tools\", a_update, false);\r\n span.appendChild(a_update);\r\n collDiv.appendChild(span);\r\n /* Update link */\r\n var span = document.createElement('span');\r\n span.appendChild(document.createElement('br'));\r\n span.id = collections[i].slug + \"_updateNotif\";\r\n addText(\"Checking PackRat Tools for updates... \", span, false);\r\n var img = document.createElement('img');\r\n img.src = IMAGES[\"ajax-loader\"];\r\n span.appendChild(img);\r\n span.style.display = \"none\";\r\n collDiv.appendChild(span);\r\n if (unknownCards) {\r\n // Some cards are still unknown, check the wiki once every hour.\r\n timedScanForChanges(i, FREQ_NEW);\r\n } else {\r\n // All cards are known, check the wiki once every 4 days.\r\n timedScanForChanges(i, FREQ_COLLECTION_DATA);\r\n }\r\n\r\n addAboutBox(collDiv, \"about-in-progress\", \"In Progress\", \"If you're currently working on this collection, then checking this box will include this collection in a special section at the top of the pull down menu. If you've feated this collection, then enabling 'Hide feated collections' in the preferences will not hide the link from the 'In Progress' section until this box is unchecked.\");\r\n \r\n var p = document.createElement('p');\r\n var label = document.createElement('label');\r\n p.appendChild(label);\r\n addText(\"In progress:\", label, false);\r\n var input = document.createElement('input');\r\n label.appendChild(input);\r\n input.type = \"checkbox\";\r\n input.name = collections[i].slug + \"_working\";\r\n input.className = collections[i].slug;\r\n if (collections[i].working) { input.checked = true; }\r\n input.addEventListener('click',saveWorkStatus(input, i),false);\r\n var a = document.createElement('a');\r\n a.href = EMPTY_LINK;\r\n a.addEventListener('click', toggleAboutBox(\"about-in-progress\"), false);\r\n addText(\"what's this?\",a,false);\r\n addText(\"(\",p,false);\r\n p.appendChild(a);\r\n addText(\")\",p,false);\r\n collDiv.appendChild(p);\r\n }\r\n return true;\r\n}", "async function displayCupcakes() {\n\tresponse = await axios.get(BASE_URL);\n\tcupcakes = response.data.cupcakes;\n\tfor (cupcake of cupcakes) {\n\t\t$cupcakeContainer.append(makeDiv(cupcake));\n\t}\n}", "function LoadFishList() {\n\n if (fishData != null) {\n FishList(fishData);\n return;\n }\n\n // here, we do everything we need\n $$.getJSON(\n // first, specify the URL you want to load.\n // The update page. END WITH A COMMA\n 'http://alienfish.icafestival.com/update.php',\n\n // next, tell Javascript what will happen if everything goes well.\n // END WITH A COMMA after the close bracket\n function(data) {\n\n fishData = data;\n FishList(data);\n\n },\n\n // tell Javascript what should happen if something goes wrong\n function(xhr, status) {\n\n // a simple alert giving us the root of the problem\n alert('Could not load page:' + status);\n }\n );\n}", "seeAllChef(req, res) {\n let sql = `SELECT * FROM chef`;\n let sql2 = `SELECT * FROM dish`;\n connection.query(sql, (error, resultChef) => {\n if (error) throw error;\n connection.query(sql2, (error, resultDish) => {\n res.render('index', { resultChef,resultDish })\n })\n })\n }", "function fetchFavorites() {\n fetch('http://localhost:3000/favorites')\n .then(res => res.json())\n .then(drinks => drinks.forEach((drink) => {\n favorites.push(drink.strDrink)\n }))\n}", "async function showDiyRecipes() {\n const diyRecipes = await getDiyList();\n\n for (let rec of diyRecipes) {\n generateDiyRecipeHTML(rec);\n }\n currentMealList = diyRecipes;\n }", "function populateFeed(plants) {\n fetch(FEED_URL)\n .then(res => res.json())\n .then(feed => {\n feedUl.textContent = \"\";\n\n/* comment has an id, plantId, comment, user */\n\n feed.forEach(comment => {\n const plant = plants.find(plant => plant.id === comment.plantId);\n\n addComment(comment, plant.name);\n });\n });\n}", "function cargarListaFacturas(){\n\t\n\t//alert(\"Entra en la funcion\");\n\t$.ajax({\n\t\turl: \"../ajax/get-info.php?accion=obtener-facturas\",\n\t\tdata: \"\",\n\t\tmethod: \"POST\",\n\t\tsuccess: function(resultado){\n\t\t\t//alert(resultado)\n\t\t\t$(\"#div-informacion\").html(resultado);\n\t\t},\n\t\terror: function(e){\n\t\t\talert (\"Error: \" + e);\n\t\t}\n\t})\n\t\n\t\n}", "function showFeatures() {\n\t$.ajax({\n\t\ttype : \"GET\",\n\t\turl : \"features/goShowFeatures\",\n\t\tcache : false,\n\t\tsuccess : function(data) {\n\t\t\t$(\"#showDynamicContent\").html(\"\");\n\t\t\t$(\"#dynamicContent\").html(data);\n\t\t\t$('#featureLists').dataTable({\n\t\t\t\t\"bJQueryUI\" : true,\n\t\t\t\t\"sPaginationType\" : \"full_numbers\",\n\t\t\t\t\"iDisplayLength\" : 25,\n\t\t\t\t\"sScrollY\" : \"390px\",\n\t\t\t\t\"bFilter\" : true,\n\t\t\t\t\"bDestroy\" : true\n\t\t\t});\n\t\t}\n\t});\n}", "async function getArticles() {\n\tconst response = await fetch(url);\n\tconst json = await response.json();\n\tconst { articles } = json;\n\tdocument.getElementById('title').innerHTML = `CoderNews`;\n\tconst articlesHTML = articles.map(renderArticle);\n\tdocument.getElementById('newsList').innerHTML = articlesHTML.join('');\n}", "function loadAllFeeds() {\n for (var feedName in rssFeeds) {\n loadFeed(rssFeeds[feedName].url);\n }\n}", "function loadCats(cats) {\r\n const catList = document.createElement(\"div\");\r\n catList.className = \"cat-list\";\r\n //console.log(catList);\r\n cats.forEach((cats) => {\r\n const eachCat = document.createElement(\"div\");\r\n eachCat.className = \"each-cat\";\r\n eachCat.innerHTML = `\r\n <img class=\"image\" src=\"https://cataas.com/cat/${cats.id}\" alt=\"cats_image\"/>\r\n `;\r\n catList.append(eachCat);\r\n });\r\n document.body.append(catList);\r\n}", "function setup() {\n if (document.getElementById(CommentSelectors[hostname].ID)) {\n window.location.href = '#' + CommentSelectors[hostname].ID;\n }\n\n // Tracks new comments added to page.\n const analyzeAllComments = () => analyzeComments(comments.commentStream);\n new CommentWatcher(analyzeAllComments);\n\n // Processes comments on page.\n comments.getComments(CommentSelectors[hostname].COMMENT_WRAPPER).length;\n analyzeComments(comments.commentStream);\n this.infoPanelSetup = false;\n}", "function populateFoodItems() { \n fetch('http://localhost:3000/food_items') \n .then(response => response.json())\n .then(json => appendFoodItems2(json))\n}", "function fightfetchdata(){\n\t\t\t$.getJSON('/fight/'+fighters[0].id+'/'+fighters[1].id, function(data) {\n\t\t\t\tconsole.log(data)\n\t\t\t\tfor (i=0;i<2;i++){\t\n\t\t\t\t\tvar info_container = $('#info'+i)\n\t\t\t\t\tconsole.log(i)\n\t\t\t\t\tinfo_container.empty()\n\t\t\t\t\tinfo_container.append('<h2>Totales</h2>')\n\t\t\t\t\tinfo_container.append('<div><strong>Puntuación:</strong><span>' + data[i].puntuacion + ' pts</span></div>')\n\t\t\t\t\tinfo_container.append('<div><strong>Intervenciones:</strong><span>' + data[i].intervenciones + ' pts</span></div>')\n\t\t\t\t\tinfo_container.append('<div><strong>Palabras:</strong><span>' + data[i].palabras + ' pts</span></div>')\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tinfo_container.append('<h2>Temas tratados</h2>')\n\t\t\t\t\t\n\t\t\t\t\tfor (key in data[i]) {\n\t\t\t\t\t\tif (key.indexOf('p_', 0) === 0) {\n\t\t\t\t\t\t\tinfo_container.append('<div><strong>'+key.substring(2, 3).toUpperCase()+key.substring(3)+':</strong> <span>'+data[i][key]+' pts</span></div>')\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tinfo_container.append('<br><br><p><em>Calculados según los resultados de la encuesta del CIS de abril de 2011</em></p>')\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvar showresult = function(){\n\t\t\t\t\t//winner.css('background-color','yellow')\n\t\t\t\t\twinner.find('.winner').show('slow')\n\t\t\t\t\tshowpanels()\n\t\t\t\t\ttalk('Menuda somanta de palos... esto ha sido casi peor que lo del congreso!!')\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t//who is the winner\t\n\t\t\t\tif (parseInt(data[0].puntuacion,10) > parseInt(data[1].puntuacion,10))\n\t\t\t\t{\n\t\t\t\t\tpunchAttackLeftToRight(showresult)\n\t\t\t\t\twinner=$('#fighter0')\n\t\t\t\t\tloser=$('#fighter1')\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tpunchAttackRightToLeft(showresult)\t\t\t\t\n\t\t\t\t\twinner=$('#fighter1')\n\t\t\t\t\tloser=$('#fighter0')\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t});\n\t}", "function scrapeArticles() {\n $.ajax({\n method: \"GET\",\n url: \"/scrape/\"\n })\n .then(getArticles);\n }", "function refactor() {facts = [].concat(favourites, trays[current_tray], specials);}", "function getMeteorites() {\n $.ajax({\n url: '/meteorites/top_100',\n type: 'GET'\n })\n .done(function(response) {\n makeMeteoriteMarkers(response, response.length);\n })\n .fail(function() {\n console.log(\"Error, Ajax call did not work!\");\n })\n }", "function displayResults(articles) {\n // First, empty the table\n $(\"tbody\").empty();\n\n // Then, for each entry of that json...\n Article.forEach(function(articles) {\n // Append each of the animal's properties to the table\n $(\"tbody\").append(\"<tr><td>\" + Article.headline + \"</td>\" +\n \"<td>\" + Article.summary + \"</td>\" +\n \"<td>\" + Article.url + \"</td></tr>\");\n });\n}", "function populateShows(shows) {\n $showsList.empty();\n\n for (let show of shows) {\n const $show = $(\n `<div data-show-id=\"${show.id}\" class=\"Show col-md-12 col-lg-6 mb-4\">\n <div class=\"media\">\n <img \n src=\"${show.image}\"\n alt=\"${show.name}\" \n class=\"w-25 mr-3\">\n <div class=\"media-body\">\n <h5 class=\"text-primary\">${show.name}</h5>\n <div><small>${show.summary}</small></div>\n <button class=\"btn btn-outline-light btn-sm Show-getEpisodes\">\n Episodes\n </button>\n </div>\n </div> \n </div>\n `\n );\n\n $showsList.append($show);\n }\n // add event listener so that when pressing episodes button\n // show the list of episode info below\n $(\".Show-getEpisodes\").on(\"click\", async function(evt) {\n evt.preventDefault();\n await searchForEpisodesAndDisplay(evt);\n });\n}", "function showStories() {\n fetch('http://localhost:8080/stories/')\n .then(response => response.json())\n .then(initializeExistingStoriesView);\n $('#users').attr('hidden', 'hidden');\n}", "function init() {\n fetch(\"/faq\")\n .then(checkStatus)\n .then((resp) => resp.json())\n .then(populate)\n .catch(handleError);\n }", "function updateDisplays() {\n $(\"#displayQuestion\").html(response.results[questionNum].question);\n $(\"#displayAnswer\" + answerOrder[0]).html(response.results[questionNum].incorrect_answers[0]);\n $(\"#displayAnswer\" + answerOrder[1]).html(response.results[questionNum].incorrect_answers[1]);\n $(\"#displayAnswer\" + answerOrder[2]).html(response.results[questionNum].incorrect_answers[2]);\n $(\"#displayAnswer\" + answerOrder[3]).html(response.results[questionNum].correct_answer);\n $(\"#displayQuestionNumber\").html(questionNum + 1);\n $(\"#displayIncorrect\").html(incorrectCounter);\n $(\"#displayCorrect\").html(correctCounter);\n $(\"#displayTimeOut\").html(timeoutCounter);\n }", "function getRecipes(food) {\n // $(\"#recipeDisplay\").empty();\n console.log(\"hungry\");\n var cuisine = $(food).attr(\"id\");\n var recipeURL = \"https://api.edamam.com/search?q=\" + cuisine + \"&app_id=\" + appId + \"&app_key=\" + apiKey;\n $.ajax({\n url: recipeURL,\n method: \"GET\"\n }).then(function (response) {\n console.log(response);\n response.hits.forEach(element => {\n\n var divStyled = $('<div>');\n divStyled.attr('class', 'row');\n var divSize = $('<div>');\n divSize.addClass('col s12');\n var divColor = $('<div>');\n divColor.addClass('card red card blue-grey darken-4');\n var divText = $('<div>');\n divText.addClass('card-content white-text');\n // divStyled.attr('class', 'card');\n var divFood = $('<span>');\n divFood.addClass('card-title');\n var cardAction = $('<div>');\n cardAction.addClass('card-action');\n var divMoreInfo = $('<button>');\n divMoreInfo.attr('class', 'btn btn-primary red accent-4')\n divMoreInfo.html(`<a href=\"${element.recipe.url}\" target=\"_blank\">Full Recipe</a>`)\n divFood.text(element.recipe.label);\n console.log(element);\n cardAction.append(divMoreInfo);\n divText.append(divFood).append(cardAction);\n divColor.append(divText);\n divSize.append(divColor);\n divStyled.append(divSize);\n $(\".name\").append(divStyled);\n\n // $(\".recipe\").append(element.recipe.url);\n\n console.log(element);\n cantSearch = false;\n\n });\n })\n\n }", "async function numFact() {\n\tlet response = await axios.get(`${baseURL}/${favNum}?json`);\n\tconsole.log(response.data.text);\n}", "function scrapeArticles() {\n // AJAX call\n $.ajax({\n method: 'GET',\n url: '/scrape'\n }).then(function(res) {\n // Style and display a modal with scrape results\n $('.articles-added-div').empty();\n if (res === 0) {\n $('.articles-added-div').text('No new articles. Please check back later!');\n } else {\n $('.articles-added-div').text(`We added ${res} new articles!`);\n }\n $('#articles-modal').modal('show');\n });\n }", "async function main() {\n\tconst articles = await getArticles()\n\n\tfor (article of articles) {\n\t\tdisplayArticle(article)\n\t}\n}", "async function displayCupcakes() {\n const response = await axios.get(`${BASE_URL}/cupcakes`);\n\n for (let cupcake of response.data.cupcakes) {\n let addCupcake = $(cupcakeHTML(cupcake));\n $(\"#menu-list\").append(addCupcake);\n }\n}", "function setFact( id, value ) {\n\tdisp(\"set fact \"+id);\n\tdisp(\" value \"+value);\n\tvar fact = factlist[id];\n if( fact != undefined )\n fact.value = value;\n else\n alert(\"setFact: fact \" + id + \" undefined\");\n \n\t//factsDebug();\n}", "function populateShows(shows) {\n $showsList.empty();\n console.log(shows);\n\n for (let show of shows) {\n // console.log(\"Show:\",show)\n let mediaDiv = $(\"<div>\").addClass([\"media\", \"mb-1\"])\n $showsList.append(mediaDiv);\n let showImage =\n $('<img>')\n .attr('src', show.image)\n .addClass([\"w-25\", \"m-4\"]);\n let title =\n $(\"<h5>\")\n .text(show[\"name\"])\n .addClass(\"text-primary\");\n let summary = $(\"<p>\").html(show[\"summary\"])\n let mediaBody = $(\"<div>\")\n .addClass(\"media-body\")\n .append(title)\n .append(summary);\n mediaDiv\n .append(showImage)\n .append(mediaBody);\n\n }\n}", "function loadContent () {\n\t\t$feedOverlay.removeClass(\"hidden\");\n\t\tMassIdea.loadHTML(SEL_CONTENT, URL_LOAD_FEED, function () {\n\t\t\t$feedOverlay.addClass(\"hidden\");\n\t\t\tresetTimer();\n\t\t});\n\t}", "function loadEntries() {\n console.log('Loading entries...');\n $('#entries').html('Loading entries...');\n guestbook.get().done(function(result) {\n if (!result.entries) {\n return;\n }\n const context = {\n entries: result.entries\n }\n $('#entries').html(entriesTemplate(context));\n }).error(function(error) {\n $('#entries').html('No entries');\n console.log(error);\n });\n }", "function handleNewFactRequest(response) {\n // Get a random facts on meditation from the meditation facts list\n var factIndex = Math.floor(Math.random() * MEDITATION_FACTS.length);\n var fact = MEDITATION_FACTS[factIndex];\n\n // Create speech output\n var speechOutput = \"Here are your facts on meditation: \" + fact;\n\n response.tellWithCard(speechOutput, \"MeditationGeek\", speechOutput);\n}", "async function showInitialCupcakes() {\r\n const response = await axios.get(`${BASE_URL}/cupcakes`);\r\n\r\n for (let cupcakeData of response.data.cupcakes) {\r\n let newCupcake = $(generateCupcakeHTML(cupcakeData));\r\n $(\"#cupcakes-list\").append(newCupcake);\r\n }\r\n}", "async function setupAndStart() {\n $(`<table id='jeopardy'>`).appendTo('body');\n showLoadingView()\n let categories = await getCategories();\n hideLoadingView()\n fillTable(categories);\n}", "function populateDom(result){\n SchoolsRegistered.innerHTML = result['NumberOfSchools'];\n TotalAppUsers.innerHTML = result['NumberOfSchools'] + result['TotalFaculties'] + result['TotalDepts'];\n departmemtsRegistered.innerHTML = result['NumberOfDepartments'];\n ElectionsCreated.innerHTML = result['NumberOfFacElectionsCreated'];\n SchoolElections.innerHTML = result['NumberOfElectionsCreated'];\n}", "function loadRemoteData() {\n\n\t\t// The comment service returns a promise.\n\t\tUserservice.getUsers().then(function(Users) {\n\n\t\t\tapplyRemoteData(Users);\n\n\t\t});\n\n\t}", "static fetchRecipes() {\n fetch(BASE_URL)\n .then(resp => resp.json())\n .then(recipes => {\n for( const recipe of recipes) {\n let r = new Recipe(recipe.id, recipe.title, recipe.instructions, recipe.ingredients);\n r.renderRecipe();\n recipe.ingredients.forEach(\n ingredient => {\n let i = new Ingredient(ingredient.id, ingredient.name, ingredient.measurement);\n i.renderIngredient(r);\n })\n }\n \n }) \n }", "function loadRemoteData() {\n\n\t\t// The comment service returns a promise.\n\t\tUserservice.getComments().then(function(Comments) {\n\n\t\t\tapplyRemoteData(Comments);\n\n\t\t});\n\n\t}", "function displayTeams() {\n\tfor (var i = 0; i < teams.length; i++) {\n\t\tvar findTeam = document.getElementById(teams[i].id);\n\t\t// Logic for displaying each team's info\n\t\tfindTeam.querySelector(\".team-name\").innerHTML = teams[i].name; // Displays the Team name\n\t\tfindTeam.querySelector(\".logo\").src = \"img/\" + teams[i].id + \".png\";\n\t\tfindTeam.querySelector(\".star\").src = \"img/\" + teams[i].star + \".png\";\n\t\tfor (var u = 0; u < teams[i].facts.length; u++) {\n\t\t\tfindTeam.querySelector(\".facts\").innerHTML += \"<li>\" + teams[i].facts[u] + \"</li>\";\n\t\t}\n\t\tfor (var u = 0; u < teams[i].champs.length; u++) {\n\t\t\tfindTeam.querySelector(\".championships\").innerHTML += \"<li>\" + teams[i].champs[u] + \"</li>\";\n\t\t}\n\t}\n}", "function loadComments() {\n fetch('/data').then((response) => response.json()).then((comments) => {\n const commentListElement = document.getElementById('comments-container');\n comments.forEach((comment) => {\n commentListElement.appendChild(createCommentElement(comment.name,\n comment.message, comment.time));\n });\n });\n}", "function populateTickets() {\n var relatedTickets;\n var html = '';\n var ArtId = window.location.href.split(\"articles/\")[1].split(\"#\")[0].split(\"-\")[0].split(\"?\")[0];\n\n //get related tickets and parse\n $.getJSON(\"/api/v2/search.json?query=type:ticket+tags:usekb_\" + ArtId, function(data) {\n relatedTickets = data.results;\n $.each(relatedTickets, function(index, value) {\n var updatedate = new Date(value.updated_at);\n html += \"<tr>\";\n html += \"<td>\" + value.id + \"</td>\";\n html += \"<td>\" + value.subject + \"</td>\";\n html += \"<td>\" + updatedate.toLocaleDateString() + \"</td>\";\n html += \"<td>\" + value.group_id.toString().replace('21321019', 'Tier1').replace('21321029', 'Tier2').replace('21387695', 'Tier3').replace('21575859', 'Tier4') + \"</td>\";\n html += \"<td>\" + value.status + \"</td>\";\n html += \"</tr>\";\n });\n $('#relatedTicketsTable').find('tbody').append(html);\n }).done(function() {\n $('.status-new').text(\"NEW\");\n $('.status-open').text(\"OPEN\");\n $('.status-hold').text(\"ON-HOLD\");\n $('.status-pending').text(\"PENDING\");\n $('.status-closed').text(\"CLOSED\");\n $('.status-solved').text(\"SOLVED\");\n styleTicketTable();\n });\n }", "function displayNeighborhood(neighborhood){\n\n fetchCommentsFromLocal();\n\n var title = document.createElement('h1');\n title.textContent = neighborhood.name;\n $('#neighborhood-name').append(title);\n\n var mapImage = document.createElement('iframe');\n mapImage.src = neighborhood.map;\n $('#google-map').append(mapImage);\n\n var blurbContent = document.createElement('section');\n blurbContent.textContent = neighborhood.blurb;\n $('#info-box').append(blurbContent);\n\n currentNeighborhood = neighborhood.pageLink;\n\n var neighborhoodPhoto = \"<img src='\" + neighborhood.pic + \"'>\";\n $('#info-box').append(neighborhoodPhoto);\n\n var factsContent = document.createElement('ul');\n $('#info-box').append(factsContent);\n\n for (var i = 0; i < commentsArray.length; i++) {\n var userComment = document.createElement('p');\n var inputName = document.createElement('p');\n if (commentsArray[i].neighborhood === currentNeighborhood) {\n userComment.textContent = commentsArray[i].comment;\n inputName.textContent = commentsArray[i].username;\n $('#comments').append(inputName);\n $('#comments').append(userComment);\n }\n }\n\n for (var i = 0; i < neighborhood.factsList.length; i++){\n var facts = document.createElement('li');\n facts.textContent = neighborhood.factsList[i];\n factsContent.appendChild(facts);\n }\n}", "function populateShows(shows) {\n $showsList.empty();\n\n for (let show of shows) {\n const $show = $(\n `<div data-show-id=\"${show.id}\" class=\"Show col-md-12 col-lg-6 mb-4\">\n <div class=\"media\">\n <img \n src=${show.image} \n alt=\"${show.name}\" \n class=\"w-25 mr-3\">\n <div class=\"media-body\">\n <h5 class=\"text-primary\">${show.name}</h5>\n <div><small>${show.summary}</small></div>\n <button class=\"btn btn-outline-light btn-sm Show-getEpisodes\">\n Episodes\n </button>\n </div>\n </div> \n </div>\n `);\n\n $showsList.append($show);\n }\n}" ]
[ "0.6238689", "0.5538138", "0.5525729", "0.5382872", "0.5271777", "0.51738405", "0.5134809", "0.5119229", "0.50667167", "0.50391287", "0.50315523", "0.5027485", "0.5012915", "0.4953205", "0.4859165", "0.4812556", "0.48059362", "0.47641572", "0.47627264", "0.473448", "0.4721609", "0.47067252", "0.47038925", "0.4695336", "0.46923235", "0.4623263", "0.46204504", "0.46178877", "0.4603747", "0.45977023", "0.45810592", "0.45712066", "0.45652378", "0.45532572", "0.45527178", "0.4547749", "0.4532703", "0.45228192", "0.4519977", "0.45143825", "0.45046243", "0.45028216", "0.44950262", "0.4478013", "0.44755375", "0.44753167", "0.4472994", "0.44672415", "0.44603258", "0.44603258", "0.4451272", "0.44492248", "0.44471782", "0.44454488", "0.44348693", "0.44327798", "0.44180766", "0.438656", "0.43817583", "0.43782213", "0.43756974", "0.43688527", "0.43681982", "0.4368114", "0.43667123", "0.4364154", "0.4344838", "0.433969", "0.43301538", "0.4321961", "0.43126923", "0.43118107", "0.43101117", "0.43077695", "0.42993888", "0.4295597", "0.42866844", "0.42864558", "0.42858508", "0.4276585", "0.42761672", "0.42731163", "0.4272606", "0.42692733", "0.4268314", "0.42622662", "0.42598686", "0.42593944", "0.42580393", "0.42574695", "0.4256861", "0.42555696", "0.42502764", "0.4248816", "0.42472932", "0.4241807", "0.4238724", "0.4233967", "0.42336223", "0.42328218" ]
0.7512953
0
Creates an element containing text.
function createListElement(text) { const liElement = document.createElement('li'); liElement.innerText = text; return liElement; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function textElement(text) {\n let element = document.createElement('span');\n element.innerText = text;\n return element;\n}", "function createText(text) {\n return document.createTextNode(text);\n }", "function createText(text) {\n return document.createTextNode(text);\n }", "createElement (text) {\n this.text = text\n return html`<h1>${text}</h1>`\n }", "function createTextElm(type, text) {\r\n var elm = document.createElement(type);\r\n var t = document.createTextNode(text);\r\n elm.appendChild(t);\r\n return elm;\r\n}", "function createElementText(value,attr,element,text,parent){\n\t\tlet elementHTML = createElementPerDiv(value,attr,element)\n\t\tlet textNode = document.createTextNode(text);\n\t\telementHTML.appendChild(textNode);\n\t\tparent.appendChild(elementHTML);\n\t}", "function createText()\n\t{\n\t\ttextWidget = that.add('text', {\n\t\t\ttype: that.id + '_text',\n\t\t\tid: that.id + '_0',\n\t\t\tx: that.x,\n\t\t\ty: that.y,\n\t\t\tw: that.w,\n\t\t\ttext: that.text,\n\t\t\tfont: style.unitFont,\n\t\t\tcolor: style.sectionTextColor,\n\t\t\thidden: that.hidden,\n\t\t\tcursor: 'pointer',\n\t\t\tdepth: that.depth\n\t\t});\n\n\t\tcurY = that.y + textWidget.height() + style.unitTextGap;\n\t}", "createHTMLText(){\n let myText = document.createElement(\"text\");\n myText.contentEditable = true;\n myText.innerHTML = this.content;\n myText.setAttribute( 'class', 'textElementSlide');\n myText.setAttribute('spellcheck', \"false\");\n myText.setAttribute('id', this.id);\n return myText;\n }", "function addTextElement(tag, attribute, value, container, text) {\n var element = document.createElement(tag);\n element.setAttribute(attribute, value);\n container.appendChild(element);\n element.textContent = text;\n return element;\n}", "function ISSUE_ELEMENT_TEXT$static_(){IssuesPanelBase.ISSUE_ELEMENT_TEXT=( IssuesPanelBase.ISSUE_BLOCK.createElement(\"text\"));}", "function createEl(text){\n return document.createElement(text);\n}", "function createText (pai,texto) { \r\n\tvar t = document.createTextNode(texto); \r\n\tpai.appendChild(t); \r\n }", "function appendTextToElement(element, text){\n jQuery(element).append(currentDocument.createTextNode(\"\"+text));\n jQuery(element).append(currentDocument.createElement(\"br\"));\n }", "function appendTextChild(text, node, element, idname) {\n\n // Check input.\n if ( text === undefined || text === null || node === undefined\n || node === null || element === undefined || element === null) {\n return null;\n }\n\n // Create styled text node.\n var txt = document.createTextNode(text);\n var el = _createel(element, idname);\n el.appendChild(txt);\n node.appendChild(el);\n\n return el;\n}", "function text(x) {\n return document.createTextNode(x);\n }", "function createElement(element, text, parent){\n var element = document.createElement(element);\n element.style.textAlign = \"center\";\n var text = document.createTextNode(text);\n element.appendChild(text);\n parent.appendChild(element);\n}", "function addEl(par, tag, text) {\n\t\t\tvar x = document.createElement(tag);\n\t\t\tx.textContent = text;\n\t\t\tpar.appendChild(x);\n\t\t}", "function addEl(par, tag, text) {\n\t\t\tvar x = document.createElement(tag);\n\t\t\tx.textContent = text;\n\t\t\tpar.appendChild(x);\n\t\t}", "function textContent(input) {\n var element = document.createElement(\"div\");\n var b = document.createElement(\"b\");\n \n b.textContent = input;\n \n \n element.appendChild(b);\n \n return element\n }", "function addNewText() {\n // making a new element object\n let newElement = document.createElement(\"p\");\n // modifying its contents\n newElement.innerHTML = \"new element\";\n // appending it to the end of the body\n document.body.appendChild(newElement);\n }", "function createElement(tagName, className, text) {\n\tconst elem = document.createElement(tagName);\n\telem.classList.add(className);\n\telem.textContent = text;\n\treturn elem;\n}", "function addText(element, message) {\n\tconst newPara = document.createElement('p')\n\tconst newParaText = document.createTextNode(message)\n\tnewPara.appendChild(newParaText)\n\telement.appendChild(newPara)\n}", "function addText(parent, text) {\n parent.appendChild(document.createTextNode(text));\n }", "function appendTextElement(doc, elem, childElemName, textValue)\n{\n\tvar child = doc.createElement(childElemName);\n\tchild.appendChild(doc.createTextNode(textValue));\n\telem.appendChild(child);\n}", "function createTextNode(text, parent)\n\t{\n\t\tvar textnode = document.createTextNode(text);\n\t\tparent.appendChild(textnode);\n\t}", "function createText(tagName, attributes, children) {\n var nodes = resolveDescendants(children);\n\n if (nodes.length > 1) {\n throw new Error(\"The <text> hyperscript tag must only contain a single node's worth of children.\");\n }\n\n var [node] = nodes;\n\n if (node == null) {\n node = {\n text: ''\n };\n }\n\n if (!index_es/* Text.isText */.xv.isText(node)) {\n throw new Error(\"\\n The <text> hyperscript tag can only contain text content as children.\");\n } // COMPAT: If they used the <text> tag we want to guarantee that it won't be\n // merge with other string children.\n\n\n STRINGS.delete(node);\n Object.assign(node, attributes);\n return node;\n}", "function text(index, value) {\n var lView = getLView();\n ngDevMode && assertEqual(lView[BINDING_INDEX], lView[TVIEW].bindingStartIndex, 'text nodes should be created before any bindings');\n ngDevMode && ngDevMode.rendererCreateTextNode++;\n var textNative = createTextNode(value, lView[RENDERER]);\n var tNode = createNodeAtIndex(index, 3 /* Element */, textNative, null, null);\n // Text nodes are self closing.\n setIsParent(false);\n appendChild(textNative, tNode, lView);\n}", "function text(index, value) {\n var lView = getLView();\n ngDevMode && assertEqual(lView[BINDING_INDEX], lView[TVIEW].bindingStartIndex, 'text nodes should be created before any bindings');\n ngDevMode && ngDevMode.rendererCreateTextNode++;\n var textNative = createTextNode(value, lView[RENDERER]);\n var tNode = createNodeAtIndex(index, 3 /* Element */, textNative, null, null);\n // Text nodes are self closing.\n setIsParent(false);\n appendChild(textNative, tNode, lView);\n}", "function createP(text){\n const p = document.createElement('p');\n p.textContent = text;\n return p;\n}", "function createSpan(element, _class, text) {\n let span = document.createElement(element);\n span.textContent = text;\n span.className = _class;\n document.querySelector('.source').appendChild(span);\n}", "addText(value) {\n let textElement = new TextElement(value, this._xPos, this._yPos, this._width, this._height, this._line);\n this._textLines.push(textElement);\n this._line += 1;\n return textElement;\n }", "function addElement(tag, container, text) {\n var element = document.createElement(tag);\n container.appendChild(element);\n element.textContent = text;\n return element;\n}", "function addTextBlock(element) {\n element\n .append('text')\n .classed('text', true)\n .attr('text-anchor', 'middle');\n }", "function TTextNode() {}", "function TTextNode() {}", "function TTextNode() {}", "function genText(el, state) {\n return el.text;\n}", "function makeElement(tagType, className, innerText) {\n let newElement = document.createElement(tagType);\n newElement.className = className;\n if (innerText) {\n newElement.textContent = innerText;\n }\n return newElement;\n}", "function appendText(text, node) {\n\tnode.appendChild(document.createTextNode(text));\n}", "function e(type, attributes, text) {\r\n const el = document.createElement(type);\r\n for (let key in attributes) {\r\n el.setAttribute(key, attributes[key]);\r\n }\r\n if (text) {\r\n el.textContent = text;\r\n }\r\n return el;\r\n}", "function $t(text,on) {\r\n var e = document.createTextNode(text);\r\n if (on) on.appendChild(e);\r\n return e;\r\n}", "function TextNode(text) {\n this.text = text;\n}", "function TextNode(text) {\n this.text = text;\n}", "function addText(text, position = \"left\", color = \"\") {\n\tlet element = new Text(text, position, color ? color : fontColor);\n\telement.add();\n\treturn element;\n}", "function text(index, value) {\n ngDevMode && assertEqual(viewData[BINDING_INDEX], tView.bindingStartIndex, 'text nodes should be created before any bindings');\n ngDevMode && ngDevMode.rendererCreateTextNode++;\n var textNative = createTextNode(value, renderer);\n var tNode = createNodeAtIndex(index, 3 /* Element */, textNative, null, null);\n // Text nodes are self closing.\n isParent = false;\n appendChild(textNative, tNode, viewData);\n}", "function appendElement(element, text){\n\n return getTextForId(element) + text;\n}", "function TTextNode(){}", "createCustomElement(type, classlist, attributes, textcontent, parentnode) {\n\n //It is just of wrapper around the DOM API to clean the code.\n let element = document.createElement(type);\n let i;\n\n for (i = 0; i < classlist.length; i++) {\n element.classList.add(classlist[i]);\n }\n\n for (i = 0; i < attributes.length; i++) {\n element.setAttribute(attributes[i].name, attributes[i].value);\n }\n\n if (textcontent != null) {\n element.textContent = textcontent;\n }\n\n if (parentnode != null) {\n parentnode.appendChild(element);\n }\n\n return element;\n }", "text(text) {\n this._text = text;\n\n // Chainable\n return this;\n }", "function newElement(type, content, parent) {\r\n var element = document.createElement(type);\r\n element.textContent = content;\r\n parent.appendChild(element);\r\n}", "createSvgText(x, y, color, fontSize, text) {\n const t = document.createElementNS(this.svgNS, \"text\");\n t.setAttributeNS(null, \"x\", x);\n t.setAttributeNS(null, \"y\", y);\n t.setAttributeNS(null, \"fill\", color);\n t.setAttributeNS(null, \"font-size\", fontSize);\n t.textContent = text;\n return t;\n }", "function makeParagraph(text) {\n let element = document.createElement(\"p\");\n element.textContent = text\n return element;\n}", "function mkText(specs) {\n const txtElt = document.createElementNS(xmlns, \"text\");\n if (specs.lnm) txtElt.setAttribute(\"desc\", specs.lnm);\n if (specs.clr) txtElt.setAttribute(\"fill\", specs.clr);\n if (specs.fntSz) txtElt.setAttribute(\"font-size\", specs.fntSz);\n if (specs.ttl) {\n const txtTitle = document.createElementNS(xmlns, \"title\");\n txtTitle.innerHTML = specs.ttl;\n txtElt.appendChild(txtTitle)\n }\n txtElt.setAttribute(\"x\", specs.x);\n txtElt.setAttribute(\"y\", specs.y);\n txtElt.setAttribute(\"class\", specs.cls);\n const txtVal = document.createTextNode(specs.txt);\n txtElt.appendChild(txtVal);\n return txtElt;\n}", "function TTextNode() { }", "function TTextNode() { }", "function Text(text) {\n\t\tthis.initialize(text);\n\t}", "function createTextInput () {\n //console.log(\"Creating a text input\");\n var element = document.createElement(\"INPUT\");\n element.setAttribute(\"type\", \"text\");\n return element;\n }", "function addTextToDom(text, id) {\n var element = document.getElementById(id);\n element.innerText = text;\n}", "function text(index,value){var lView=getLView();ngDevMode&&assertEqual(lView[BINDING_INDEX],lView[TVIEW].bindingStartIndex,'text nodes should be created before any bindings');ngDevMode&&ngDevMode.rendererCreateTextNode++;var textNative=createTextNode(value,lView[RENDERER]);var tNode=createNodeAtIndex(index,3/* Element */,textNative,null,null);// Text nodes are self closing.\nsetIsParent(false);appendChild(textNative,tNode,lView);}", "function createText(node) {\n const newNode = { object: 'text' };\n if (typeof node === 'string') {\n return { ...newNode, text: node };\n }\n const { text, marks } = node;\n return { ...newNode, text, marks };\n }", "function cText(element, content) {\r\n document.getElementById(element).innerHTML = content;\r\n}", "function createTitleElement(text, appendTo) {\n let title = document.createElement(\"h1\")\n let title_text = document.createTextNode(text)\n title.classList.add(\"text-center\");\n title.classList.add(\"mb-3\");\n title.appendChild(title_text)\n document.getElementById(appendTo).appendChild(title)\n}", "text () {\n\n }", "generateHTML(type, classes, parent = app, text = \"\", id = \"\") {\n const element = document.createElement(type);\n element.classList = (classes);\n element.innerText = (text);\n element.id = (id);\n parent.appendChild(element);\n return element;\n }", "function e(type, text, attributes, styles) {\n var element = document.createElement(type);\n element.textContent = text;\n\n for(var attribute in attributes) {\n if(attributes.hasOwnProperty(attribute)) {\n element.setAttribute(attribute, attributes[attribute]);\n }\n }\n\n for(var style in styles) {\n if(styles.hasOwnProperty(style)) {\n element.style[style] = styles[style];\n }\n }\n\n return element;\n}", "function insertText() {\n\t\t\tconst addTextAgain = document.createElement(\"p\");\n\t\t\tdocument.body.appendChild(addTextAgain);\n\n\t\t\tconst textP = document.createTextNode (\"Voy en medio!\");\n\t\t\taddTextAgain.innerHTML += textP;\n}", "static addText(svg, x, y, fontSize, textContent, anchor, transform) {\n const lines = textContent.split('\\n');\n let text;\n for (let i = 0; i < lines.length; ++i) {\n text = document.createElementNS(svgNS, 'text');\n text.setAttributeNS(null, 'x', x);\n text.setAttributeNS(null, 'y', y);\n text.setAttributeNS(null, 'fill', 'black');\n text.setAttributeNS(null, 'font-size', fontSize);\n if (anchor) {\n text.setAttributeNS(null, 'text-anchor', anchor);\n }\n if (transform) {\n text.setAttributeNS(null, 'transform', transform);\n }\n text.appendChild(document.createTextNode(lines[i]));\n svg.appendChild(text);\n y += fontSize;\n }\n return text;\n }", "text(el, value) {\n return setGet(el, 'innerText', value);\n }", "function createVirtualTextNode(el) {\n\treturn new VText(el.nodeValue);\n}", "onCreateText(e) {\n e.preventDefault()\n\n let newSel;\n this.transaction(function(tx) {\n let container = tx.get(this.props.containerId)\n let textType = tx.getSchema().getDefaultTextType()\n let node = tx.create({\n id: uuid(textType),\n type: textType,\n content: ''\n })\n container.show(node.id)\n\n newSel = tx.createSelection({\n type: 'property',\n path: [ node.id, 'content'],\n startOffset: 0,\n endOffset: 0\n })\n }.bind(this))\n this.rerender()\n this.setSelection(newSel)\n }", "function insertText(stubDiv, text, classAttr) {\n var p = document.createElement('p');\n\n if(classAttr) {\n\t\tp.setAttribute('class', classAttr);\n }\n\n p.innerHTML = text;\n\n stubDiv.appendChild(p);\n}", "function utils_createSVGTextElement(content, x, y, attributes = {}) {\n\n const text = document.createElementNS(\"http://www.w3.org/2000/svg\", \"text\");\n text.appendChild(document.createTextNode(content))\n\n text.setAttribute('x', x);\n text.setAttribute('y', y);\n \n Object.keys(attributes).forEach(key => {\n text.setAttribute(key, attributes[key]);\n });\n\n return text;\n}", "function create_html_text(htmls_id , opt_id , text){\n\n\n htmls_id = document.getElementById(htmls_id);\n\n tmp_div = document.createElement('div');\n tmp_div.setAttribute(\"id\", opt_id);\n tmp_div.setAttribute(\"name\", opt_id);\n tmp_div.setAttribute(\"class\", opt_id);\n\n tmp_div.innerHTML = text;\n htmls_id.appendChild(tmp_div);\n}", "function p (text){\n let divAffichage = document.querySelector(\"#affichage\");\n let ajoutTexte = document.createTextNode(text);\n\n divAffichage.append(ajoutTexte);\n}", "function paraWithText(t) {\n let tn = document.createTextNode(t);\n let ptag = document.createElement(\"p\");\n ptag.appendChild(tn);\n return ptag;\n}", "function appendElement(parent, child, elementText) {\n var childElement = document.createElement(child);\n childElement.textContent = elementText;\n parent.appendChild(childElement);\n}", "set textContent(text) {\n if (this.#el) this.#el.textContent = text;\n else this.#textContent = text;\n }", "function createElement(type, className, text) {\n var element = document.createElement(type);\n element.className = className;\n\n if (text) {\n var textNode = document.createTextNode(text);\n element.appendChild(textNode);\n }\n\n return element;\n}", "function createLogMessageElement(text) {\n var container = document.createElement('div');\n container.className = \"log-entry-container clearfix\";\n container.style = \"opacity: 1; text-align:center;\";\n \n var textElem = document.createElement('i');\n textElem.className = \"log-entry-message\";\n $(textElem).html(text);\n \n container.appendChild(textElem);\n \n return container;\n}", "function CreateTag(text) {\n var newTag = $('<span />').addClass(\"label label-primary tag\").append($(\n '<span />').html(text));\n if (defaults[\"allowInput\"]) {\n var removeButton = $(\n '<a class=\"rj-js-tag-delete\"><i class=\"fa fa-times fa-1\" aria-hidden=\"true\"></i></a>'\n );\n $(newTag).append(removeButton);\n }\n $(\"#rj-tag-box\").append(newTag);\n }", "function createButton (text) {\n //console.log(\"Creating a button\");\n var element = document.createElement(\"BUTTON\");\n var textNode = document.createTextNode(text);\n element.appendChild(textNode);\n return element;\n }", "function displayText1() {\n let t1 = createElement('span', 'Logic for Visualizing Seismic Events');\n t1.parent('text1');\n t1.class('large'); \n}", "function addTextLabel(root,node){var domNode=root.append(\"text\");var lines=processEscapeSequences(node.label).split(\"\\n\");for(var i=0;i<lines.length;i++){domNode.append(\"tspan\").attr(\"xml:space\",\"preserve\").attr(\"dy\",\"1em\").attr(\"x\",\"1\").text(lines[i])}util.applyStyle(domNode,node.labelStyle);return domNode}", "function __create_text_element() { \n var input_text = document.createElement(\"input\");\n input_text.setAttribute(\"id\", cssid);\n input_text.setAttribute(\"value\", value);\n input_text.setAttribute(\"name\", key);\n input_text.setAttribute(\"type\", \"text\"); // NB: input1.type doesn't work in IE6\n input_text.setAttribute(\"tabIndex\", 1);\n div2.appendChild(input_text);\n }", "function addText(node, text) {\n node.appendChild(document.createTextNode(text));\n return node.lastChild;\n}", "function makeTextInput()\n{\n const textInput = $(\"<input></input>\", {\n\t\t type: \"text\"\n\t});\n return textInput;\n}", "function createEleClassContent(tagName, className, content) {\n const element = document.createElement(tagName)\n element.className = className\n element.innerText = content\n return element\n}", "set text(value) {}", "set text(value) {}", "function uutext(node, // @param Node/String: node or text string\r\n text) { // @param String(= void):\r\n // @return Array/String/Node:\r\n if (uuisstring(node)) {\r\n return doc.createTextNode(node);\r\n }\r\n if (text === void 0) {\r\n return node[uu.gecko ? \"textContent\" : \"innerText\"];\r\n }\r\n uunodeadd(doc.createTextNode(Array.isArray(text) ? text.join(\"\") : text),\r\n uunodeclear(node));\r\n return node;\r\n}", "function static_text(elements) {\n const elems = elements ? elements : this ? this.root() : [];\n let ret = '';\n for (let i = 0; i < elems.length; i++) {\n ret += textContent(elems[i]);\n }\n return ret;\n}", "setText(text) {\n\t\tlet div = document.createElement('div');\n\t\tdiv.innerHTML = text;\n\t\tdiv.style.fontSize = 0;\n\t\tthis.text = div.innerText;\n\t\tthis._queued.text = text;\n\t}", "text(text) {\n // act as getter\n if (text === undefined) {\n var children = this.node.childNodes;\n var firstLine = 0;\n text = '';\n\n for (var i = 0, len = children.length; i < len; ++i) {\n // skip textPaths - they are no lines\n if (children[i].nodeName === 'textPath') {\n if (i === 0) firstLine = 1;\n continue;\n } // add newline if its not the first child and newLined is set to true\n\n\n if (i !== firstLine && children[i].nodeType !== 3 && adopt(children[i]).dom.newLined === true) {\n text += '\\n';\n } // add content of this node\n\n\n text += children[i].textContent;\n }\n\n return text;\n } // remove existing content\n\n\n this.clear().build(true);\n\n if (typeof text === 'function') {\n // call block\n text.call(this, this);\n } else {\n // store text and make sure text is not blank\n text = text.split('\\n'); // build new lines\n\n for (var j = 0, jl = text.length; j < jl; j++) {\n this.tspan(text[j]).newLine();\n }\n } // disable build mode and rebuild lines\n\n\n return this.build(false).rebuild();\n }", "function createText() {\n gTxtCount++;\n gMeme.txts.push(\n {\n id: gTxtCount,\n text: '',\n size: 40,\n align: 'left',\n color: '#ffffff',\n stroke: '#000000',\n strokeSize: 1,\n x: 10,\n y: 50\n }\n );\n}", "function addText(event){\n var p = document.createElement(\"p\")\n p.innerText = 'Hello world'\n var div = document.getElementById(\"task2a\")\n div.appendChild(p)\n}", "function writeTo(element, text) {\n document.getElementById(element).innerHTML = text;\n}", "function XmlText(value) {\n this.value = value;\n}" ]
[ "0.7822513", "0.78123003", "0.78123003", "0.7716485", "0.7635549", "0.7537679", "0.7406359", "0.73221767", "0.728043", "0.7186003", "0.7151407", "0.71403515", "0.70634496", "0.70619506", "0.69153935", "0.6840163", "0.68338305", "0.68338305", "0.68030334", "0.67910063", "0.67708814", "0.67649555", "0.67362785", "0.67283386", "0.6724032", "0.6718401", "0.6714827", "0.6714827", "0.6688102", "0.668443", "0.66796845", "0.66765755", "0.6652197", "0.66390073", "0.66390073", "0.66390073", "0.6636862", "0.6609642", "0.66056335", "0.6597384", "0.6596022", "0.6528786", "0.6528786", "0.65286136", "0.6520026", "0.64966846", "0.6491815", "0.64764255", "0.6473587", "0.64661837", "0.6465134", "0.64593005", "0.6451414", "0.6450052", "0.6450052", "0.6399138", "0.6389678", "0.6380806", "0.63771546", "0.63675696", "0.63647324", "0.63588053", "0.63570607", "0.6351696", "0.6341806", "0.63405466", "0.6334296", "0.6325252", "0.631661", "0.63153905", "0.6315356", "0.63121957", "0.6301693", "0.6290959", "0.62887967", "0.6279794", "0.6266482", "0.62660795", "0.62602943", "0.62442505", "0.6235267", "0.62322086", "0.6229842", "0.62128186", "0.6192198", "0.6186776", "0.6185678", "0.6183123", "0.6183123", "0.6179895", "0.61649054", "0.6163163", "0.6162513", "0.61553764", "0.61421424", "0.61331403", "0.61313665" ]
0.6179573
93
Function to check if a site uses local_mobile, requires SSO login, etc. This should be used only if a fixed URL is set, otherwise this check is already performed in mmLoginSiteCtrl.
function checkSite(siteurl) { var checkmodal = $mmUtil.showModalLoading(); return $mmSitesManager.checkSite(siteurl).then(function(result) { siteChecked = true; $scope.siteurl = result.siteurl; if (result && result.warning) { $mmUtil.showErrorModal(result.warning, true, 4000); } if ($mmLoginHelper.isSSOLoginNeeded(result.code)) { // SSO. User needs to authenticate in a browser. $scope.isBrowserSSO = true; $mmUtil.showConfirm($translate('mm.login.logininsiterequired')).then(function() { $mmLoginHelper.openBrowserForSSOLogin(result.siteurl); }); } else { $scope.isBrowserSSO = false; } }).catch(function(error) { $mmUtil.showErrorModal(error); return $q.reject(); }).finally(function() { checkmodal.dismiss(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isMobileUser(){\n\tif(pmgConfig.agent_ios || pmgConfig.agent_android){\n\t\treturn true;\t\n\t}\n\telse{\n\t\treturn false;\n\t}\n}", "function DetectMobile() {\n\n\t// First check\n if (sessionStorage.desktop) return false;\n else if (localStorage.mobile) return true;\n\n // Alternative check\n var mobile = ['iphone','ipad','android','blackberry','nokia','opera mini','windows mobile','windows phone','iemobile','mobile/'];\n for (var i in mobile) if (navigator.userAgent.toLowerCase().indexOf(mobile[i].toLowerCase()) > 0) return true;\n\n // If nothing is found, we assume desktop\n return false;\n}", "function mobilecheck() {\r\n if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {\r\n return false;\r\n }\r\n return true;\r\n }", "function checkMobile() {\n var check = false;\n (function(a){if(/(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i.test(a.substr(0,4))) check = true;})(navigator.userAgent||navigator.vendor||window.opera);\n return check;\n}", "function isInMobileApp() {\n\treturn ('nsWebViewInterface' in window);\n}", "_detectMobile () {\n\t\tvar check = false;\n\t\t(function(a,b){if(/(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i.test(a.substr(0,4)))check = true;})(navigator.userAgent||navigator.vendor||window.opera,'http://detectmobilebrowser.com/mobile');\n\t\treturn check;\n\t}", "function isMobile() {\r\n if (sessionStorage.desktop) /* desktop storage */\r\n return false;\r\n else if (localStorage.mobile) /* mobile storage */\r\n return true;\r\n\r\n /* alternative */\r\n var mobile = ['iphone','ipad','android','blackberry','nokia','opera mini','windows mobile','windows phone','iemobile'];\r\n for (var i in mobile)\r\n if (navigator.userAgent.toLowerCase().indexOf(mobile[i].toLowerCase()) > 0)\r\n return true;\r\n\r\n /* nothing found.. assume desktop */\r\n return false;\r\n }", "function mobilecheck() {\n var check = false;\n (function(a){if(/(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i.test(a.substr(0,4))) check = true;})(navigator.userAgent||navigator.vendor||window.opera);\n return check;\n}", "function checkingHosting() {\n if (window.location.hostname === \"localhost\") {\n //checkingLocalHostURLS();\n console.log(\"User is on LOCALHOST\");\n }\n\n if (window.location.hostname === \"127.0.0.1\") {\n //checkingLocalHostURLS();\n console.log(\"User is on LOCALHOST\");\n }\n\n if (window.location.hostname !== \"localhost\") {\n checkingServerURLS();\n console.log(\"User is on HOSTING SERVER\");\n }\n\n if (window.location.hostname !== \"127.0.0.1\") {\n checkingServerURLS();\n console.log(\"User is on HOSTING SERVER\");\n }\n }", "function detectMobile(){\n\tif(navigator.userAgent.match(/Android/i)\n\t\t\t || navigator.userAgent.match(/webOS/i)\n\t\t\t || navigator.userAgent.match(/iPhone/i)\n\t\t\t || navigator.userAgent.match(/iPad/i)\n\t\t\t || navigator.userAgent.match(/iPod/i)\n\t\t\t || navigator.userAgent.match(/BlackBerry/i)\n\t\t\t || navigator.userAgent.match(/Windows Phone/i)){\n\t\treturn true;\n\t}\n\telse{ return false; }\n}", "function isMobile() {\n return /android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(ua('l'));\n}", "function mobilecheck() {\n var check = false;\n (function(a){if(/(android|ipad|playbook|silk|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i.test(a.substr(0,4)))check = true})(navigator.userAgent||navigator.vendor||window.opera);\n return check;\n }", "function siteIsSupported() {\n // Check if the site is supported then set top bar\n return !!supportedSites.find(function (s) { return !!location.host.match(s.host); });\n}", "function mobileCheck() {\n\tvar check = false;\n\t(function(a){if(/(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|android|ipad|playbook|silk|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i.test(a.substr(0,4)))check = true})(navigator.userAgent||navigator.vendor||window.opera);\n\treturn check; \n}", "function IsMobile() {\r\n ///<summary>Detecting whether the browser is a mobile browser or desktop browser</summary>\r\n ///<returns>A boolean value indicating whether the browser is a mobile browser or not</returns>\r\n\r\n if (sessionStorage.desktop) // desktop storage \r\n return false;\r\n else if (localStorage.mobile) // mobile storage\r\n return true;\r\n\r\n // alternative\r\n mobile = ['iphone','ipad','android','blackberry','nokia','opera mini','windows mobile','windows phone','iemobile','tablet','mobi']; \r\n var ua=navigator.userAgent.toLowerCase();\r\n for (var i in mobile) if (ua.indexOf(mobile[i]) > -1) return true;\r\n\r\n // nothing found.. assume desktop\r\n return false;\r\n}", "function isMobile() {\n\t\tvar check = false;\n\t\t(function(a){if(/(android|bb\\d+|meego).+mobile|Android|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|i(phone|pod|pad|Phone|Pod|Pad)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i.test(a.substr(0,4)))check = true})(navigator.userAgent||navigator.vendor||window.opera);\n\t\tif(window.innerWidth <= 500) { check = true; }\n\t\treturn check;\n\t}", "function isMobile() {\r\n\t\t\tvar check = false;\r\n\t\t\t(function(a){if(/(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i.test(a.substr(0,4))) check = true;})(navigator.userAgent||navigator.vendor||window.opera);\r\n\t\t\treturn check;\r\n\t\t}", "function isFysmat() {\n var domain = window.location.href;\n\n // Find & remove protocol (http, ftp, etc.) and get domain\n if (domain.indexOf(\"://\") > -1) {\n domain = domain.split('/')[2];\n }\n else {\n domain = domain.split('/')[0];\n }\n\n // Checks if fysmat.no is the URL\n if (domain.toLowerCase() == \"fysmat.no\" || domain.toLowerCase() == \"www.fysmat.no\") {\n return Boolean(true);\n }\n else {\n return Boolean(false);\n }\n}", "function isAtCamp() {\r\n\tvar url = window.location.toString().toLowerCase();\r\n\tif(url == 'http://apps.facebook.com/levynlight/' \r\n\t|| url == 'https://apps.facebook.com/levynlight/' \r\n\t|| url == 'http://apps.facebook.com/levynlight/index.php' \r\n\t|| url == 'https://apps.facebook.com/levynlight/index.php' \r\n\t|| url == 'http://apps.facebook.com/levynlight/turn.php' \r\n\t|| url == 'https://apps.facebook.com/levynlight/turn.php'\r\n\t)\r\n\t\treturn true;\r\n\telse\r\n\t\treturn false;\r\n}", "function isMobile() {\n var agent = navigator.userAgent || navigator.vendor || window.opera;\n\n if (/(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(agent) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(agent.substr(0, 4))) {\n return true;\n }\n\n return false;\n} // ================================= Hook =================================", "function isMobileApp() {\n return isMobile() && !isIosWeb() && !isAndroidWeb();\n} // Returns true if and only if the user is using Mattermost from either the mobile app or the web browser on a mobile device.", "function is_mobile(){\n return (/Android|iPhone|iPad|iPod|BlackBerry|Windows Phone/i).test(navigator.userAgent || navigator.vendor || window.opera);\n}", "function onMobile() {\n if (navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/webOS/i)\n || navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i)\n || navigator.userAgent.match(/iPod/i) || navigator.userAgent.match(/BlackBerry/i)\n || navigator.userAgent.match(/Windows Phone/i)\n ) {\n return true;\n }\n else {\n return false;\n }\n}", "function isMobile() {\n\tvar check = false;\n\t(function(a){if(/(android|ipad1|playbook|silk|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i.test(a.substr(0,4)))check = true})(navigator.userAgent||navigator.vendor||window.opera);\n\treturn check;\n}", "function isMobile() {\n\t\t\tvar check = false;\n\t\t\t(function(a){if(/(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i.test(a.substr(0,4))) check = true;})(navigator.userAgent||navigator.vendor||window.opera);\n\t\t\treturn check;\n\t\t}", "function isMobile() {\n let isMobile = false;\n if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {\n isMobile = true\n }\n return isMobile\n }", "function isMobile() {\n return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent);\n}", "function rb655_isMobile() {\n\tif ( /(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test( navigator.userAgent )\n\t\t|| /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i.test( navigator.userAgent.substr( 0, 4 ) ) )\n\t{\n\t\treturn true;\n\t}\n\treturn false;\n}", "function mobileAndTabletcheck() {\n let check = false;\n (function(a){if(/(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i.test(a.substr(0,4))) check = true;})(navigator.userAgent||navigator.vendor||window.opera);\n return check;\n}", "function isOmniInstore() {\n\n var s = window.location.pathname.split(\"/\");\n\n if (s[2] == null) {\n\n return false;\n }\n\n if (window.location.pathname.split(\"/\")[2].indexOf(\"instore\") != -1) {\n return true;\n } else {\n return false;\n }\n}", "function isMobile() {\n if(navigator.userAgent.match(/Android/i) ||\n navigator.userAgent.match(/webOS/i) ||\n navigator.userAgent.match(/iPhone/i) ||\n navigator.userAgent.match(/iPad/i) ||\n navigator.userAgent.match(/iPod/i) ||\n navigator.userAgent.match(/BlackBerry/i) ||\n navigator.userAgent.match(/Windows Phone/i))\n return true\n \n return false\n}", "function isMobile() {\r\n\tvar ua = navigator.userAgent;\r\n\tvar checker = {\r\n\t\tiphone:ua.match(/(iPhone|iPod|iPad)/),\r\n\t\tblackberry:ua.match(/BlackBerry/),\r\n\t\tandroid:ua.match(/Android/)\r\n\t}\r\n\r\n\tif (checker.iphone || checker.blackberry || checker.android) {\r\n\t\treturn true;\r\n\t}\r\n\treturn false;\r\n}", "function isMobile() {\r\n\treturn /Android|webOS|iPhone|iPod|iPad|BlackBerry|IEMobile|Opera Mini/i\r\n\t\t\t.test(navigator.userAgent);\r\n}", "function detectMobile() {\n\tvar check = false;\n\t(function(a){if(/(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i.test(a.substr(0,4))) check = true;})(navigator.userAgent||navigator.vendor||window.opera);\n\treturn check;\n}", "function checkSiteType(){var hostname=window.location.hostname.toLowerCase().trim();if(hostname.indexOf('cosmo.ru')+1){return'cosmo';}if(hostname.indexOf('freundin.de')+1){return'freundin';}if(hostname.indexOf('kp.ru')+1){return'kp';}if(hostname.indexOf('eva.ru')+1){return'eva';}// wmj\nif(hostname.indexOf('wmj.ru')+1){return'wmj';}return'other';}", "function areWeOnMobile(){ \n if($(window).width() < 600){\n onMobile = true;\n }\n else{\n onMobile = false;\n }\n return onMobile;\n }", "function detectaDispositivoMobile(){\n\n if (DetectaIphone()){\n\n\t\treturn true;\n\n\t}else{\n\n\t\tif(DetectaIpod()){\n\n \t\treturn true;\n\n\t\t}else{\n\n\t\t\tif(DetectaS60Oss()){\n\n\t\t\t\treturn true;\n\n\t\t\t}else{\n\n\t\t\t\tif(DetectaAndroidWebKit()){\n\n\t\t\t\t\treturn true;\n\n\t\t\t\t}else{\n\n\t\t\t\t\tif(DetectaWindowsMobile()){\n\n\t\t\t\t\t\treturn true;\n\n\t\t\t\t\t}else{\n\n\t\t\t\t\t\tif(DetectaBlackBerry()){\n\n\t\t\t\t\t\t\treturn true;\n\n\t\t\t\t\t\t}else{\n\n\t\t\t\t\t\t\tif(DetectaPalmOS()){\n\n\t\t\t\t\t\t\t\treturn true;\n\n\t\t\t\t\t\t\t}else{\n\n\t\t\t\t\t\t\t\tif(DetectaIpad()){\n\n\t\t\t\t\t\t\t\t\treturn true;\n\n\t\t\t\t\t\t\t\t}else{\n\n\t\t\t\t\t\t\t\t\treturn false;\n\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}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n}", "function detectmob() {\n\n if( navigator.userAgent.match(/Android/i)\n || navigator.userAgent.match(/webOS/i)\n || navigator.userAgent.match(/iPhone/i)\n || navigator.userAgent.match(/iPad/i)\n || navigator.userAgent.match(/iPod/i)\n || navigator.userAgent.match(/BlackBerry/i)\n || navigator.userAgent.match(/Windows Phone/i)\n ){\n return true;\n }\n else {\n return false;\n }\n}", "function mg_is_mobile() {\r\n\t\tif( /(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i.test(navigator.userAgent) )\r\n\t\t{ return true;}\r\n\t\telse { return false; }\r\n\t}", "function isTheDeviceMobile() { \n if( navigator.userAgent.match(/Android/i)\n || navigator.userAgent.match(/webOS/i)\n || navigator.userAgent.match(/iPhone/i)\n || navigator.userAgent.match(/iPad/i)\n || navigator.userAgent.match(/iPod/i)\n || navigator.userAgent.match(/BlackBerry/i)\n || navigator.userAgent.match(/Windows Phone/i)\n ){\n return true;\n }\n else {\n return false;\n }\n}", "function isMobile() {\n\tif (navigator.userAgent.match(/Android/i)\n\t\t\t|| navigator.userAgent.match(/iPhone/i)\n\t\t\t|| navigator.userAgent.match(/iPad/i)\n\t\t\t|| navigator.userAgent.match(/iPod/i)\n\t\t\t|| navigator.userAgent.match(/BlackBerry/i)\n\t\t\t|| navigator.userAgent.match(/Windows Phone/i)\n\t\t\t|| navigator.userAgent.match(/Opera Mini/i)\n\t\t\t|| navigator.userAgent.match(/IEMobile/i)\n\t\t\t) {\n\t\treturn true;\n\t}\n}", "Mobile ():boolean {\n\n\t\treturn this.mobile = this.IEMobile() || this.BlackBerry() || this.iOS() || this.Android() || this.Nokia();\n\t}", "function isMobile() {\n const userAgent = navigator.userAgent || navigator.vendor || window.opera;\n if (/windows phone/i.test(userAgent) ||\n /android/i.test(userAgent) ||\n (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream)) {\n return true;\n }\n return false;\n}", "function isSmartPhone() {\n if (navigator.userAgent.match(/iPhone|Android.+Mobile/)) {\n return true;\n } else {\n return false;\n }\n}", "function isMobile(){\r\n if (\r\n (navigator.userAgent.match (/Android/i)) ||\r\n (navigator.userAgent.match (/webOS/i)) ||\r\n (navigator.userAgent.match (/Mobi/i)) ||\r\n (navigator.userAgent.match (/iPhone/i)) ||\r\n (navigator.userAgent.match (/iPad/i)) ||\r\n (navigator.userAgent.match (/iPod/i)) ||\r\n (navigator.userAgent.match (/BlackBerry/i)) \r\n ) return 'Mobile';\r\n return 'PC';\r\n }", "function is_mobile() {\n\t\t var agents = ['android', 'webos', 'iphone', 'ipad', 'blackberry','Android', 'webos', ,'iPod', 'iPhone', 'iPad', 'Blackberry', 'BlackBerry'];\n\t\t\tvar ismobile=false;\n\t\t for(i in agents) {\n\n\t\t\t if (navigator.userAgent.split(agents[i]).length>1) {\n\t\t ismobile = true;\n\n\t\t }\n\t\t }\n\t\t return ismobile;\n\t\t}", "function is_mobile() {\n\t\t var agents = ['android', 'webos', 'iphone', 'ipad', 'blackberry','Android', 'webos', ,'iPod', 'iPhone', 'iPad', 'Blackberry', 'BlackBerry'];\n\t\t\tvar ismobile=false;\n\t\t for(i in agents) {\n\n\t\t\t if (navigator.userAgent.split(agents[i]).length>1) {\n\t\t ismobile = true;\n\n\t\t }\n\t\t }\n\t\t return ismobile;\n\t\t}", "function is_mobile() {\n\t\t var agents = ['android', 'webos', 'iphone', 'ipad', 'blackberry','Android', 'webos', ,'iPod', 'iPhone', 'iPad', 'Blackberry', 'BlackBerry'];\n\t\t\tvar ismobile=false;\n\t\t for(i in agents) {\n\n\t\t\t if (navigator.userAgent.split(agents[i]).length>1) {\n\t\t ismobile = true;\n\n\t\t }\n\t\t }\n\t\t return ismobile;\n\t\t}", "function is_mobile() {\n\t\t var agents = ['android', 'webos', 'iphone', 'ipad', 'blackberry','Android', 'webos', ,'iPod', 'iPhone', 'iPad', 'Blackberry', 'BlackBerry'];\n\t\t\tvar ismobile=false;\n\t\t for(i in agents) {\n\n\t\t\t if (navigator.userAgent.split(agents[i]).length>1) {\n\t\t ismobile = true;\n\n\t\t }\n\t\t }\n\t\t return ismobile;\n\t\t}", "function isLogin() {\n if (localStorage.getItem('token')) {\n hasToken()\n }\n else {\n noToken()\n }\n}", "hasMobileRules() {\n return this.getAppDataItem(\"mobileRules\");\n }", "function checkOnline(){\n\t\tif(navigator.onLine == true){\n\t\t\tconsole.log(\"isOnline == true\");\n\t\t\t$rootScope.isOnline = true;\n\t\t} else {\n\t\t\tconsole.log(\"isOnline == false\");\n\t\t\t$rootScope.isOnline = false;\n\t\t}\n\t}", "function onDomain() {\n if (window.location.href.indexOf('https://junn3r.github.io/') != -1) {\n return true;\n } else {\n return false;\n }\n }", "function isMobile() {\n\tif (/iPad|iPhone|Android|webOS|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {\n\t\t// Mobile\n\t\treturn true;\n\t} else {\n\t\t// PC\n\t\treturn false;\n\t}\n}", "function isMobileDevice() {\n return /Mobi/.test(navigator.userAgent);\n}", "function IsMobileDevice() {\n\tvar check = false;\n\t(function (a) { if (/(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i.test(a.substr(0, 4))) check = true })(navigator.userAgent || navigator.vendor || window.opera);\n\treturn check;\n}", "function isMobile() {\n return /Mobi/i.test(navigator.userAgent);\n}", "function _isLikelyCordova() {\r\n return _isAndroidOrIosCordovaScheme() && typeof document !== 'undefined';\r\n}", "function hfgIsMobile() {\n\t\treturn HFG.isMobile();\n\t}", "function DetectMobileLonger()\n{\n //Run the quick check first.\n if (DetectMobileQuick())\n return true;\n\n //Check for NTT Docomo\n if (uagent.search(svcDocomo) > -1)\n return true;\n\n //Check for KDDI\n if (uagent.search(svcKddi) > -1)\n return true;\n\n //Check for Nintendo DS\n if (uagent.search(deviceNintendoDs) > -1)\n return true;\n\n //Check for Vodafone 3G\n if (uagent.search(svcVodafone) > -1)\n return true;\n\n //Finally, detect for certain very old devices with stupid useragent strings.\n if (uagent.search(manuSamsung1) > -1 ||\n\tuagent.search(manuSonyEricsson) > -1 || \n\tuagent.search(manuericsson) > -1)\n {\n return true;\n }\n\n return false;\n}", "function isMobile() {\n if(/webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || (/Android/i.test(navigator.userAgent) && screenWidth <= medium)) {\n return true;\n } else {\n return false;\n };\n}", "function isLocalhost(){\n return window.location.origin.includes(\"localhost\");\n}", "function DetectaWindowsMobile(){\n\n if (uagent.search(dispositivoWinMob) > -1)\n\n return true;\n\n else\n\n return false;\n\n}", "function mobileAndTabletcheck(a) {\n if (a !== undefined && a !== null) {\n if (/(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| ||a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i.test(a.substr(0, 4))) {\n $('body').addClass('mobile')\n }\n }\n }", "check() {\n let isLoggedIn = this.Storage.getFromStore('isLoggedIn');\n\n if(isLoggedIn) {\n return true;\n }\n\n return false;\n }", "function DetectWindowsMobile()\n{\n //Most devices use 'Windows CE', but some report 'iemobile'\n // and some older ones report as 'PIE' for Pocket IE.\n if (uagent.search(deviceWinMob) > -1 ||\n uagent.search(deviceIeMob) > -1 ||\n uagent.search(enginePie) > -1)\n return true;\n //Test for Windows Mobile PPC but not old Macintosh PowerPC.\n if ((uagent.search(devicePpc) > -1) &&\n !(uagent.search(deviceMacPpc) > -1))\n return true;\n //Test for Windwos Mobile-based HTC devices.\n if (uagent.search(manuHtc) > -1 &&\n uagent.search(deviceWindows) > -1)\n return true;\n else\n return false;\n}", "isMobile(){\n\t\treturn !!('ontouchstart' in window || navigator.msMaxTouchPoints);\n\t}", "function isMobileDevice()\r\n\t\t{\r\n\t\t\tvar testExp = new RegExp('Android|webOS|iPhone|iPad|' + 'BlackBerry|Windows Phone|' + 'Opera Mini|IEMobile|Mobile' , 'i');\r\n\t\t \r\n\t\t\tif (testExp.test(navigator.userAgent))\r\n\t\t\t\treturn true;\r\n\t\t\telse\r\n\t\t\t\treturn false;\r\n\t\t}", "function isOnline() {\r\n return window.navigator.onLine;\r\n}", "function loadMobileBrowserDetection() {\n /**\n * jQuery.browser.mobile (http://detectmobilebrowser.com/)\n *\n * jQuery.browser.mobile will be true if the browser is a mobile device\n *\n **/\n (function(a){(jQuery.browser=jQuery.browser||{}).mobile=/(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino|android|ipad|playbook|silk/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i.test(a.substr(0,4))})(navigator.userAgent||navigator.vendor||window.opera);\n}", "Android ():boolean {\n\t\treturn this.agent.match(/Android/i) ? true : false;\n\t}", "function isLocal(url) {\n switch (parse(url).host) {\n case location.host:\n case '':\n return true;\n default:\n return false;\n }\n }", "function DetectIphoneOrIpod()\n{\n if (DetectIphone())\n return true;\n /* window.location.replace(\"file:///Users/mitchmac/Documents/github/harvest/mobiletest.html\"); */\n if (DetectIpod())\n return true;\n /* window.location.replace(\"file:///Users/mitchmac/Documents/github/harvest/mobiletest.html\");*/\n else\n return false;\n}", "function isMobileDevice() {\n try {\n return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);\n } catch (e) {\n return false;\n }\n} // ==============================", "function isProd() {\n return window.location.origin.indexOf('sportello.comune.trento.it') >= 0;\n}", "function checkWebVersion () {\n if ($(window).width() < 768) {\n setMobile()\n }else {\n setDesktop()\n }\n }", "function isMobileDevice() {\n return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));\n}", "isMobileUserAgent() {\n return /Mobi/i.test(this._userAgent)\n }", "function IsMobileBrowser() {\n return navigator.userAgent.match(/iPhone|iPad|iPod|Android/i) !== null;\n }", "function isAuthenticatedPage(){\n\t\tvar v4_login_node = document.querySelector('.global-login');\n\t\tvar v3_login_node = document.querySelector('.bluemix-login');\n\n\t\tvar authenticated = !(v4_login_node || v3_login_node);\n\n\t\treturn authenticated;\n\t}", "function isLoggedIn() {\n return ($location.url() != '/home' && $location.url() != '/login' && $location.url() != '/register');\n }", "function DetectMobileLong()\n {\n if (DetectMobileQuick())\n return true;\n if (DetectGameConsole())\n return true;\n if (DetectSonyMylo())\n return true;\n\n //Detect for certain very old devices with stupid useragent strings.\n if (uagent.search(manuSamsung1) > -1 ||\n uagent.search(manuSonyEricsson) > -1 ||\n uagent.search(manuericsson) > -1)\n return true;\n\n if (uagent.search(svcDocomo) > -1)\n return true;\n if (uagent.search(svcKddi) > -1)\n return true;\n if (uagent.search(svcVodafone) > -1)\n return true;\n\n\n return false;\n }", "function checkMobileFeatures() {\n\n\tif (window.innerWidth < 1024) {\n\n\t\tif (isMobile != 1) {\n\t\t\tcloseMobileNavi();\n\t\t\thideSearchBox();\n\n\t\t\t/* set min-height of submenu to 0 (done by menu.js) */\n\t\t\tnav_primary = $('nav .level-1 > li > a').next();\n\t\t\tnav_primary.css('min-height', '0px');\n\t\t}\n\t\tisMobile = 1;\n\t} else {\n\t\tif (isMobile == 1) {\n\t\t\tcloseMobileNavi();\n\t\t\thideSearchBox();\n\t\t}\n\t\tisMobile = 0;\n\t}\n}", "function isMobileDevice() {\n return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Windows Mobile/i.test(navigator.userAgent);\n}", "async verifyUserLoggedIn() {\n if ((await browser.getCurrentUrl()).includes('inventory')) {\n return true;\n }\n else { return false; }\n }", "function isMobileView() {\n if ($(window).width() <= mobileWidth) {\n return true;\n } else {\n return false;\n }\n}", "function checkUrl() {\n const address = window.location.href;\n\n if (address.indexOf('?message=') !== -1) {\n if (address.indexOf('not-verified') !== -1) {\n setModalContent('Tài khoản của bạn chưa được kích hoạt');\n }\n else if (address.indexOf('invalid-verified') !== -1) {\n setModalContent('Mã kích hoạt tài khoản không hợp lệ');\n }\n else if (address.indexOf('?message=verified') !== -1) {\n setModalContent('Kích hoạt tài khoản thành công');\n }\n else if (address.indexOf('?message=invalid-forgot-pass') !== -1) {\n setModalContent('Đường dẫn phục hồi tài khoản không hợp lệ');\n }\n setShow(true);\n }\n else if (address.indexOf('?token=') !== -1) {\n var token = address.substr(address.indexOf('?token=') + '?token='.length);\n if (token.indexOf('#nghiatq') !== -1) {\n token = token.substr(0, token.indexOf('#nghiatq'));\n }\n localStorage.setItem('token', token);\n window.location.href = '/';\n }\n }", "function isMobile () {\n var viewPortWidth = getWidth(); \n if ( viewPortWidth < 768 ){\n return true;\n } else {\n return false;\n }\n }", "function check_login_status(){\r\n\t//if not login, then check login save info\r\n\tif(CommInfo.is_login)\r\n\t{\r\n\t\tlogin_init();\r\n\t}\r\n}", "function checkRightLocation(){\n\t\treturn window.location.hostname == hostname && Utils.stringStartsWith(window.location.hash,locationHashStart) && Utils.stringEndsWith(window.location.hash,locationHashEnd);\n\t}", "function isPC() {\n return !isMobile();\n}", "function isMobile() { return angular.isDefined($window.orientation); }", "function checkLogin() {\n if (\"ActiveUser\" in localStorage) {\n return true\n } else {\n return false\n }\n}", "function is_mobile_device () {\n if ( ( $(window).width()<767) || (navigator.userAgent.match(/(Android|iPhone|iPod|iPad)/) ) ) {\n return true;\n } else {\n return false;\n }\n}", "function detectMob() {\n return ( ( window.innerWidth <= 600 ) && ( window.innerHeight <= 800 ) );\n}", "function checkIfMobile() {\n if ($header_nav_btn.css('display') == 'block') {\n return true;\n } else {\n return false;\n }\n }", "function devMode() {\n return location.hostname === \"localhost\" || location.hostname === \"127.0.0.1\";\n}", "function checkWebVersion () {\n if (/Android|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || /iPad/i.test(navigator.userAgent) && $(window).width() < 991 || $(window).width() < 991) {\n mobile = true\n mobileSetUp()\n }else {\n mobile = false\n desktupSetUp()\n $(tabWrp).show()\n\n $('#paymentTitle').show()\n $('.return-tabs').hide()\n $(detailsMobile).hide()\n $('#purchaseDetails').show()\n }\n }", "checkBrokenSites (domain) {\n if (!trackersWhitelistTemporary) {\n return\n } else {\n return trackersWhitelistTemporary.indexOf(domain) !== -1 ? true : false\n }\n }", "function isOnline() {\n var online = true;\n\n if (typeof window !== 'undefined' && 'navigator' in window && window.navigator.onLine === false) {\n online = false;\n }\n\n return online;\n}" ]
[ "0.665709", "0.64066464", "0.6287017", "0.6285216", "0.6266743", "0.6264146", "0.6187216", "0.6181451", "0.6175087", "0.6156352", "0.6153866", "0.6150326", "0.60985637", "0.609057", "0.60788035", "0.6053461", "0.60517627", "0.6027949", "0.6027239", "0.599849", "0.5993274", "0.59904414", "0.5984096", "0.59770626", "0.59574795", "0.59438527", "0.5938872", "0.59366727", "0.59126097", "0.59048295", "0.5902905", "0.58965147", "0.5896436", "0.58864623", "0.5856604", "0.5847189", "0.5836002", "0.5819538", "0.5796018", "0.5789075", "0.5751022", "0.5742575", "0.5727933", "0.57253325", "0.57145846", "0.57077", "0.57077", "0.57077", "0.57077", "0.5701913", "0.56998056", "0.5694013", "0.56744134", "0.56728125", "0.5657242", "0.56571966", "0.5656891", "0.56377095", "0.5632739", "0.5630049", "0.56196296", "0.56140983", "0.56135255", "0.5597323", "0.559717", "0.5594449", "0.5574778", "0.55658513", "0.5562775", "0.5555", "0.55504066", "0.5538195", "0.5537594", "0.5536072", "0.5535325", "0.5532712", "0.55312616", "0.553084", "0.5521946", "0.5512989", "0.55105054", "0.55071586", "0.5505925", "0.5498046", "0.5495394", "0.5492245", "0.5481644", "0.5480612", "0.5480572", "0.5473112", "0.54674333", "0.5465789", "0.54642016", "0.54625887", "0.5460129", "0.54587615", "0.54585415", "0.5445885", "0.54404634", "0.5433873" ]
0.57434034
41
TODO: 1. drawTiles instead of animateFight 2. do not move but start figting
function animateFight(res){ loadTilemap({ 'animation' : res.animation, 'direction': res.direction, }); console.log(res); loopFight(res) /* // var targetTile = { 'x' : cursorX + res.animation.x, 'y' : cursorY + res.animation.y; $.post(gameurl, { 'class': 'map', 'do': 'getUnitTiles', 'gid': gid, 'offsetX': mapoffsetX, 'offsetY': mapoffsetY, 'screenTilesX': tilesX, 'screenTilesY': tilesY, 'cursorX': cursorX, 'cursorY': cursorY, 'animation' : res.animation, 'direction': res.direction, }, function( data ) { data = $.parseJSON(data); console.log(data); layers.clear('units'); for (var j in data) { var _y = (j) * tileSize - offset; for (var i in data[j]) { var _x = (i) * tileSize - offset; var unit = data[j][i]; drawUnit(unit, { 'x': _x, 'y': _y, 'animate': unit.animate, 'animation': 'attack', 'direction': unit.direction }); } } renderer.render(stage); // hitpoint + death animation }); */ //var selector = 'animation attack' + res.attacker.direction + ' anim-form-animation-attack_' + res.attacker.uid + '_' + res.animation.row; //$('.animation').removeClass().addClass(selector); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function animate() {\n \t// call again next time we can draw\n \trequestAnimationFrame(animate);\n \t// clear canvas\n \tctx.clearRect(0, 0, cvWidth, cvHeight);\n \t// draw gameObjects\n \tfor (var obj of gameObjects) {\n \t\tif (obj.hasOwnProperty('tileID')) {\n\t \t\tctx.drawImage(SVGTiles[obj.tileID], obj.x * 25, obj.y * 25);\n\t\t}\n\t}\n\t\n \t// everyObject[0] = tunk.x * 30;\n \t// everyObject[1] = tunk.y * 30;\n \t// var o = everyObject;\n \t// ctx.fillStyle = o[4];\n \t// ctx.fillRect(o[0], o[1], o[2], o[3]);\n}", "function animate() {\n\n\tif(move==true){\n\t\tvar x = setTimeout(function() { move=false; }, 100);\n\t}\n\t\n\telse{\n\tcontext.clearRect(0, 0, 800, 600);\n\tdrawBackGround();\n\tdrawHUD();\n\tdrawFirs();\n\tdrawBoules();\n\tdrawLutins();\n\tif(screen===\"game\"){\n\tsanta.drawSanta();}\n}\n requestAnimationFrame(animate);\n}", "function draw() {\n for (let i=0; i<tiles.length; i++) {\n tiles[i].display();\n }\n}", "function animate() {\n id = window.requestAnimationFrame(animate)\n\n //Clear the entire board first.. Changes the page \n ctx.clearRect(0, 0, canvas.width, canvas.height)\n\n\n //Draw everything else again, a little differnt \n ctx.drawImage(img, girl.x, girl.y, 100, 100)\n drawSquare()\n girl.x += .5;\n girl.y += .5;\n\n detectCollision()\n\n}", "animateTiles() {\n this.checkers.tilePositionX -= .5;\n this.checkers.tilePositionY -= .5;\n this.grid.tilePositionX += .25;\n this.grid.tilePositionY += .25;\n }", "draw() {\n this.tiles.forEach(t => {\n var tileCoords = {\n x: this.origin.x + (t.x * 8) + 16,\n y: this.origin.y + (t.y * 8)\n }\n this.context.drawImage(RESOURCE.sprites, t.t * 8, 16, 8, 8, tileCoords.x, tileCoords.y, 8, 8);\n });\n }", "function animate() {\n\tmoveShipRight();\n\tmoveShipLeft();\n\tif(GAME_OBJECTS[\"missles\"].length > 0) {\n\t\tstepMissle();\n\t}\n\tif(steps % 60 == 0) {\n\t\tanimateEnemies();\n\t}\n\tsteps++;\n\tif(steps == 600) {\n\t\tsteps = 0;\n\t}\n\t\n\t// check if game has been finished\n\tif(isGameOver() && gamePhase == 1){\n\t\tdisplayEnd();\n\t}\n}", "draw() {\r\n\t\tthis.matrix.forEach((row, y) => row.forEach((tile, x) => {\r\n\t\t\tif (tile) {\r\n\t\t\t\tlet [tx, ty] = tile.position.get;\r\n\t\t\t\tif (tile.isEmpty) {\r\n\t\t\t\t\t//default\r\n\t\t\t\t\tmainCtx.fillStyle = this.baseColor;\r\n\t\t\t\t\tmainCtx.fillRect(\r\n\t\t\t\t\t\ttx * (this.tileSize + this.spacing),\r\n\t\t\t\t\t\tty * (this.tileSize + this.spacing),\r\n\t\t\t\t\t\tthis.tileSize,\r\n\t\t\t\t\t\tthis.tileSize\r\n\t\t\t\t\t);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t//draw gameobject\r\n\t\t\t\t\tmainCtx.fillStyle = tile.top.bgColor;\r\n\t\t\t\t\tmainCtx.fillRect(\r\n\t\t\t\t\t\ttx * (this.tileSize + this.spacing),\r\n\t\t\t\t\t\tty * (this.tileSize + this.spacing),\r\n\t\t\t\t\t\tthis.tileSize,\r\n\t\t\t\t\t\tthis.tileSize\r\n\t\t\t\t\t);\r\n\t\t\t\t\tmainCtx.fillStyle = tile.top.color;\r\n\t\t\t\t\tmainCtx.fillText(\r\n\t\t\t\t\t\ttile.top.glyph,\r\n\t\t\t\t\t\ttx * (this.tileSize + this.spacing) + this.tileSize / 2,\r\n\t\t\t\t\t\tty * (this.tileSize + this.spacing) + this.tileSize / 1.5\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}", "function drawGame()\n{\n if(canvas==null) {return;}\n \n //Iterates over the map\n for(var y = 0; y < mapHeight; y++)\n {\n for(var x = 0; x < mapWidth; x++)\n {\n if (revealAll == true || fogmask[((y*mapWidth)+x)] != 1)\n {\n //Revealed area\n switch(map[((y*mapWidth)+x)])\n {\n case 0:\n canvas.fillStyle = \"#ffffff\";\n break;\n case 1:\n canvas.fillStyle = \"#444444\";\n break;\n case 4:\n canvas.fillStyle = \"#ffab00\";\n break;\n case 5:\n canvas.fillStyle = \"#00c853\";\n break;\n case 8:\n canvas.fillStyle = \"#03adfc\";\n break;\n case 9:\n canvas.fillStyle = \"#f50057\";\n break;\n default:\n canvas.fillStyle = \"#000000\";\n break; \n }\n }\n //Covered by fog\n else\n {\n switch(map[((y*mapWidth)+x)])\n {\n case 0:\n canvas.fillStyle = \"#bbbbbb\";\n break;\n case 1:\n canvas.fillStyle = \"#444444\";\n break;\n default:\n canvas.fillStyle = \"#bbbbbb\";\n break; \n }\n }\n \n //Draw the Tile\n canvas.fillRect(x*tileWidth, y*tileHeight, tileWidth, tileHeight);\n }\n }\n}", "function animate() {\n // request another frame\n requestAnimationFrame(animate);\n\n // calc elapsed time since last loop\n now = Date.now();\n elapsed = now - then;\n\n // if enough time has elapsed, draw the next frame\n if (elapsed > fpsInterval) {\n then = now - (elapsed % fpsInterval);\n\n // Put your drawing code here\n buildBoard();\n headSnake();\n drawPlayer();\n //checkPoint();\n drawPoints();\n }\n}", "function generateMap()\r\n{\r\n\tif(ctx==null)\r\n\t{\r\n\t\treturn;\r\n\t}\r\n\tfor(var y = 0; y < mapH; y++)\r\n\t{\r\n\t\tfor(var x = 0; x < mapW; x++)\r\n\t\t{\r\n\t\t\tfor(var i = 0; i < gameTiles.length;i++)\r\n\t\t\t{\r\n\t\t\t\tswitch(gameTiles[((y*mapW)+x)].type)\r\n\t\t\t\t{\r\n\t\t\t\t\tcase 0:\r\n\t\t\t\t\t\tctx.fillStyle=\"green\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 1:\r\n\t\t\t\t\t\tctx.fillStyle=\"purple\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 2:\r\n\t\t\t\t\t\tctx.fillStyle=\"blue\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 3:\r\n\t\t\t\t\t\tctx.fillStyle=\"red\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tctx.fillStyle=\"black\";\r\n\t\t\t\t}\r\n\t\t\t\tctx.fillRect(x*tileW, y*tileH, tileW, tileH);\r\n\t\t\t}\t\r\n\t\t}\r\n\t}\r\n\trequestAnimationFrame(generateMap);\r\n}", "function renderTiles() {\n var map_index = 0;\n\n // increment by actual TILE_SIZE to avoid multiplying on every iteration\n for (var top = 0; top < MAP.height; top += TILE_SIZE) {\n for (var left = 0; left < MAP.width; left += TILE_SIZE) {\n\n // if statement to draw the correct sprite to the correct idx position on the tile map\n if (MAP.tiles[map_index] === 0) {\n\n // draw background\n ctx.drawImage(background, left, top);\n\n } else if (MAP.tiles[map_index] === 2) {\n\n // draw platform\n ctx.drawImage(platform, left, top);\n\n new Obstacle(100, 100, left, top);\n\n } else if (MAP.tiles[map_index] === 3) {\n\n // draw ring\n ctx.drawImage(ring, left, top);\n //new Obstacle(100, 100, left, top);\n\n } else if (MAP.tiles[map_index] === 1) {\n\n // draw floor\n ctx.drawImage(floor, left, top);\n } else if (MAP.tiles[map_index] === 4) {\n\n ctx.drawImage(floor, left, top);\n new Obstacle(100, 100, left, top);\n }\n\n map_index++;\n }\n }\n}", "function draw() {\n // BG\n clear_to_color(canvas,makecol(255,85, 85));\n\n // TILES\n // iterate over all tiles and draw them\n // j=y, i=x\n for (var j = 0; j < MAP_HEIGHT; j++) {\n for (var i = 0; i < MAP_WIDTH; i++) {\n var tileimg;\n switch (map[j][i]['type']) {\n case '#':\n tileimg = img_movchair;\n break;\n case '@':\n tileimg = img_rotchair;\n break;\n default:\n tileimg = ' ';\n }\n if (tileimg != ' ') {\n rotate_sprite(canvas, tileimg, \n coord2pos(i)+map[j][i]['tweenx'], coord2pos(j)+map[j][i]['tweeny'],\n map[j][i]['angle']+map[j][i]['tweenrot']);\n }\n }\n }\n\n // PLAYER\n rotate_sprite(canvas, img_player,\n coord2pos(player['x'])+player['tweenx'], coord2pos(player['y'])+player['tweeny'],\n int2dir(player['dir']));\n}", "function tween_tiles() {\n for (j=0; j<MAP_HEIGHT; j++) {\n for (i=0; i<MAP_WIDTH; i++) {\n var tile = map[j][i];\n if (map[j][i]['type'] !== ' ') {\n // tween the tiles until they reach their destination\n // MOVEMENT TWEENING\n if (tile['newx'] !== tile['x']) {\n var diffx = Math.abs(tile['x'] - tile['newx']);\n if (tile['newx'] > tile['x']) {\n tile['tweenx'] += TWEENSPEED;\n }\n else if (tile['newx'] < tile['x']) {\n tile['tweenx'] -= TWEENSPEED;\n }\n }\n if (tile['newy'] !== tile['y']) {\n var diffy = Math.abs(tile['y'] - tile['newy']);\n if (tile['newy'] > tile['y']) {\n tile['tweeny'] += TWEENSPEED;\n }\n else if (tile['newy'] < tile['y']) {\n tile['tweeny'] -= TWEENSPEED;\n }\n }\n // swap tiles when they have completed their movement\n // (if they moved at all)\n if (tile['tweenx'] !== 0 || tile['tweeny'] !== 0) {\n if (Math.abs(tile['tweenx']) > TILESIZE * diffx) {\n // swap tile and lava\n swap_tiles(i, j, tile['newx'], tile['newy']);\n }\n if (Math.abs(tile['tweeny']) > TILESIZE * diffy) {\n // swap tile and lava\n swap_tiles(i, j, tile['newx'], tile['newy']);\n }\n }\n // ROTATION TWEENING\n if (tile['newangle'] !== tile['angle']) {\n tile['tweenrot'] += TWEENSPEED;\n }\n if (tile['tweenrot'] !== 0) {\n // done rotating\n if (Math.abs(tile['tweenrot']) >= 90) {\n tile['angle'] = tile['newangle'];\n tile['tweenrot'] = 0;\n shift_barriers(i, j);\n }\n }\n\n }\n }\n }\n}", "function drawSmiles() {\n SmilesDrawer.apply();\n}", "function animate() {\n requestAnimFrame( animate );\n game.background.draw();\n game.tardis.move();\n}", "function animate() {\n requestAnimFrame( animate );\n game.background.draw();\n game.tardis.move();\n}", "function tiles_FX() {\n var delta_time,\n path_tiles;\n b += 1;\n if (b < n_c.length) {\n\n misc.s_cl(n_c[b], \"point path\");\n misc.s_ti(n_c[b], b + 1);\n\n if (!!n_c[b].getAttribute(\"data-direction\")) {\n n_c[b].innerHTML = n_c[b].getAttribute(\"data-direction\");\n } else {\n n_c[b].innerHTML = comparer(n_c[b], AI.v.sf.finish);\n }\n\n } else {\n delta_time = AI.v.time_end - AI.v.time_start;\n path_tiles = misc.slc(\".point.path\").length;\n misc.s_cl(misc.gid(e[0] + \"_\" + e[1]), \"point end white smiley\");\n\n title.innerHTML =\n \"Path Finding<br><sub style='color:white'>Calculated in \" + delta_time +\n \" ms | \" + path_tiles + \" steps between start - finish</sub>\";\n\n title.style.background = \"deepskyblue\";\n btn.innerHTML = \"Finished\";\n rebuild_btn.disabled = 0;\n clear_btn.disabled = 0;\n AI.v.traceback = 0;\n clearInterval(a);\n }\n }", "drawScene() {\n const positions = this.getTilePositions();\n this.updateTileSpecs();\n if (debug) {\n this.redrawStarted = Date.now();\n this.redrawnTiles = 0;\n }\n this.drawTiles(positions);\n if (debug) {\n const elapsed = Date.now() - this.redrawStarted;\n if (elapsed > 5) {\n console.log(`Took ${elapsed} msecs to redraw for ${positions.startXTile} ${positions.startYTile} (redrawnTiles: ${this.redrawnTiles})`);\n }\n }\n }", "function game_drawBoard(){\n\tvar x=GLOBAL['gamevars'].xoffset;\n\tvar y=GLOBAL['gamevars'].yoffset;\n\tvar w=gametilesize+6;\n\t//draw a square for each tile\n\tfor(var i=0;i<GLOBAL['board'].length;i++){\n\t\tfor(var j=0;j<GLOBAL['board'][i].length;j++){\n\t\t\tvar tile=GLOBAL['board'][i][j];\n\t\t\tif(tile.type>0){\n\t\t\t\tif(tile.type==2&&GLOBAL['state']=='gameinit'){\n\t\t\t\t\tgamectx.fillStyle='white';\n\t\t\t\t}else if(tile.type>0&&GLOBAL['state']=='gameinit'){\n\t\t\t\t\tgamectx.fillStyle='grey';\n\t\t\t\t}else if(GLOBAL['state']=='game'){\n\t\t\t\t\tvar hue=tile.color;\n\t\t\t\t\tgamectx.fillStyle='rgba('+hue+','+hue+','+hue+',.5)';\n\t\t\t\t}\n\t\t\t\tgamectx.fillRect(x+((w)*i),y+((w)*j),w,w);\n\t\t\t\tif(GLOBAL['state']=='game'&&tile.highlight){\n\t\t\t\t\tif(tile.highlight=='selected'||tile.highlight=='selectedAtk'){\n\t\t\t\t\t\tgamectx.fillStyle='white';\n\t\t\t\t\t}else if(tile.highlight=='move1'){\n\t\t\t\t\t\tgamectx.fillStyle='green';\n\t\t\t\t\t}else if(tile.highlight=='move2'){\n\t\t\t\t\t\tgamectx.fillStyle='limegreen';\n\t\t\t\t\t}else if(tile.highlight=='atk1'){\n\t\t\t\t\t\tgamectx.fillStyle='#A10000';\n\t\t\t\t\t}else if(tile.highlight=='atk2'){\n\t\t\t\t\t\tgamectx.fillStyle='#A10000';\n\t\t\t\t\t}\n\t\t\t\t\tgamectx.fillRect(x+((w)*i),y+((w)*j),w,w);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(typeof(tile.entity)!=='undefined'){\n\t\t\t//has an entity\n\tif(typeof(gamedragtile)!='undefined'&&gamedragtile.type=='field'&&gamedragtile.globalid==tile.entity.globalid){\n\t\t\t\t\t//ignore entity if its currently being dragged somewhere.\n\t\t\t\t}else{\n\t\t\t\t\tvar drawx=x+3+((w)*i);\n\t\t\t\t\tvar drawy=y+3+((w)*j);\n\t\t\t\t\tvar dataid=getEntity(tile.entity.globalid).id;\n\t\t\t\t\tgame_drawTile(drawx,drawy,dataid,tile.entity.n);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(tile.type==3){\n\t\t\t\tgamectx.drawImage(data_credit,x+((w)*i)+10,y+((w)*j)+10);\n\t\t\t}\n\t\t\tif(tile.highlight=='selectedAtk'&&GLOBAL['gamevars'].turn!='ai'){\n\t\t\t\tgamectx.fillStyle='white';\n\t\t\t\tgamectx.fillText(tile.highlightVal,x+(w*i)+30,y+(w*j)+15);\n\t\t\t}\n\t\t}\n\t}\n}", "function draw() {\n\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n\n for (c = 0; c < tileColumnCount; c++) {\n for (r = 0; r < tileRowCount; r++) {\n rect(tiles[c][r].x, tiles[c][r].y, tileW, tileH, tiles[c][r].state);\n }\n }\n\n}", "function drawTiles()\n{\n\tfor(var y = 0; y < BOARD_HEIGHT; y++)\n\t{\n\t\tfor(var x = 0; x < BOARD_WIDTH; x++)\n\t\t{\n let drawX = x * TILE_WIDTH;\n let drawY = y * TILE_HEIGHT;\n\n //Draw the tiles, but not the ones off the screen\n if(drawX + TILE_WIDTH > -camera.xOffset && drawX < -camera.xOffset + width)\n {\n if(drawY + TILE_HEIGHT > -camera.yOffset && drawY < -camera.yOffset + height)\n {\n tiles[x][y].draw(ctx, camera);\n }\n }\n\t\t}\n\t}\n}", "function animate() {\n\t\tcontext.fillStyle = \"black\";\n\t\tcontext.fillRect(0, 0, canvas.width, canvas.height);\n\n\t\tif (iteration%2 == 1) {\n\t\t\tpacmanMouth = !pacmanMouth;\n\t\t\tghostOndulation = !ghostOndulation;\n\t\t\tif (next_attack_in <= 30) {\n\t\t\t\tblinking = !blinking\n\t\t\t} else {\n\t\t\t\tblinking = false\n\t\t\t}\n\t\t}\n\t\titeration++\n\n\t\tdrawGrid(context, quantum)\n\n\t\tfor (var i = 0; i < pacmans.length; i++) {\n\t\t\tdrawPacman(context, quantum, pacmans[i], pacmanMouth)\n\t\t}\n\t\tfor (var i = 0; i < ghosts.length; i++) {\n\t\t\tdrawGhost(context, quantum, ghosts[i], i, ghostOndulation, blinking)\n\t\t}\n\n\t\tcontext.font = quantum + \"px Bangers, cursive\";\n\t\tcontext.fillStyle = \"#F9C328\";\n\t\tcontext.textAlign=\"center\";\n\t\tcontext.fillText(\"Score : \" + pacmans[0].score,context.canvas.width/2,context.canvas.height - 1.2*quantum);\n\n\t}", "function render() {\n loop(function (row, col) {\n x = (col * tileSize);\n y = (row * tileSize);\n\n // draw placements\n if (map[row][col] == 1) {\n context.fillStyle = \"#aa0000\";\n context.fillRect(x + tileOffset, y + tileOffset, tileSize - tileOffset, tileSize - tileOffset);\n }\n });\n }", "step() {\n let cells = this.board.tick();\n this.drawCells(cells);\n }", "draw() {\n if (this.imgLoaded) {\n if (this.isGrounded) {\n let frameStr = '';\n this.currentInvincibility == 0\n ? frameStr = `frame${this.currentFrame}`\n : frameStr = `frame${this.currentFrame + 4}`;\n engine.gfxController.drawSprite(\n this.img,\n this.spriteCoordinates[frameStr][0],\n this.spriteCoordinates[frameStr][1],\n 72,\n 128,\n this.x,\n this.y,\n this.spriteWidth,\n this.spriteHeight\n );\n \n if (!this.isStopped) {\n this.waitFrames--;\n if (this.waitFrames < 1) {\n this.currentFrame++;\n if (this.currentFrame > 4) {\n this.currentFrame = 1;\n }\n this.waitFrames = this.maxWaitFrames;\n }\n }\n } else {\n let jumpStr = (this.jumpDirection > 0)\n ? \"jumpUp\"\n : \"jumpDown\";\n if (this.currentInvincibility != 0) {\n jumpStr += \"Hit\";\n } \n engine.gfxController.drawSprite(\n this.img,\n this.spriteCoordinates[jumpStr][0],\n this.spriteCoordinates[jumpStr][1],\n 72,\n 128,\n this.x,\n this.y,\n this.spriteWidth,\n this.spriteHeight);\n }\n }\n }", "_drawFrame () {\n \n\n this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height)\n for (let x = 0; x < this.sizeX; x++) {\n for (let y = 0; y < this.sizeY; y++) {\n if (this.matrix[x][y] === -1) {\n this._drawBackgroundSquare(x, y, this.tileWidth, this.deathTileColor)\n this.matrix[x][y] = 0\n } else if (this.matrix[x][y] === 1) {\n this._drawSquare(x, y, this.tileWidth, this.tileColor)\n }\n }\n }\n this._drawMouse()\n }", "function MeligineGameScreenRender(){\r\n\tMeligineCleanTheScreen();\r\n\tactualCell=0;\r\n\t\r\n\tfor(var i=0;i<rows;i++){\r\n\t\t//where is the acctual cell on y\r\n\t\tactualY=i;\r\n\t\tif(actualY>playerY-cellsToDrawAroundPlayer+2 && actualY<playerY+cellsToDrawAroundPlayer-2){\r\n\t\t\tfor(var u=0;u<cellsPerRow;u++){\r\n\t\t\t\tactualX=u;\r\n\t\t\t\tif(actualX>playerX-cellsToDrawAroundPlayer && actualX<playerX+cellsToDrawAroundPlayer){\r\n\t\t\t\t//declare tile image\r\n\t\t\t\t\r\n\t\t\t\tvar tilesetImage= new Image();\r\n\t\t\t\tif(tilesetToUse==1){\r\n\t\t\t\ttilesetImage.src=tileset1;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t//where is the acctual cell on x\r\n\t\t\t\t\r\n\t\t\t\t//cell repositioning due to player moving\r\n\t\t\t\tcellReplaceX=(playerScreenPadX+actualX*cellSizeZoom)-cellSizeZoom/2;\r\n\t\t\t\tcellReplaceY=(playerScreenPadY+actualY*cellSizeZoom)-cellSizeZoom/2;\r\n\t\t\t\t\r\n\t\t\t\t//ctx.strokeStyle=\"rgb(100,100,100)\";\r\n\t\t\t\t//ctx.strokeRect(cellReplaceX,cellReplaceY,cellSizeZoom,cellSizeZoom);\r\n\t\t\t\t\r\n\t\t\t\ttilesetTileOnY=Math.floor(allCells[actualCell]/tilesetTilesOnWidth);\r\n\t\t\t//\ttilesetTileOnY=1;\r\n\t\t\t\ttilesetTileOnX=allCells[actualCell]-tilesetTileOnY*tilesetTilesOnWidth;\r\n\t\t\t//\ttilesetTileOnX=9;\r\n\t\t\t\t//set the tilesets on x and y to know from where to pick\r\n\t\t\t\ttilesetX=tilesetTileOnX*tilesetTileSize;\r\n\t\t\t\ttilesetY=tilesetTileOnY*tilesetTileSize;\r\n\t\t\t\t\r\n\t\t\t\tctx.drawImage(tilesetImage,tilesetX,tilesetY,tilesetTileSize,tilesetTileSize,cellReplaceX,cellReplaceY,cellSizeZoom,cellSizeZoom);\r\n\t\t\t\tctx.fillStyle=\"rgb(255,0,255)\";\r\n\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\tactualCell++;\r\n\t\t\t\t}else{\r\n\t\t\t\tactualCell++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\tactualCell+=cellsPerRow;\r\n\t\t}\r\n\t}\r\n\tMeligineDrawThePlayer();\r\n}", "function animate() {\n\trequestAnimFrame( animate );\n\tgame.background.draw();\n\tgame.ship.move();\n\tgame.ship.bulletPool.animate();\n\tgame.enemyPool.animate();\n\tgame.enemyBulletPool.animate();\n displayStats();\n}", "function draw() {\r\n requestAnimationFrame(draw);\r\n if (numberOfMissiles < 50) {\r\n missileGeneration();\r\n }\r\n moveMissile();\r\n TWEEN.update();\r\n renderer.render(scene,camera);\r\n}", "function render() {\n // showFPSaverage();\n showCompletedLines();\n game.getBoard.drawme();\n\n // game.getBoard.getPieces.forEach(piece => piece.drawme());\n}", "function draw(){\n tile.clearRect(0, 0, canvas.width, canvas.height);\n drawFoundAnswers();\n drawSelection();\n drawBoard();\n drawAnswers();\n drawWinner();\n}", "draw(){\n\t\tvar context = this.canvas.getContext('2d');\n\t\t//context.fillStyle = \"#007900\";\n\t\t//context.fillRect(0, 0, this.width, this.height);\n\n\t\tvar c = context;\n\n\t\tvar startCol = Math.floor(this.camera.x / map.tsize);\n \tvar endCol = startCol + (this.camera.width / map.tsize);\n \tvar startRow = Math.floor(this.camera.y / map.tsize);\n\t\tvar endRow = startRow + (this.camera.height / map.tsize);\n\t\t\n\t\tvar offsetX = -this.camera.x + startCol * map.tsize;\n \tvar offsetY = -this.camera.y + startRow * map.tsize;\n\n\t\tfor (var x = startCol; x < endCol; x++) {\n\t\t\tfor (var y = startRow; y < endRow; y++) {\n\t\t\t var drawx = x - startCol * 50 + offsetX;\n\t\t\t var drawy = y - startRow * 50 + offsetY;\n\n\t\t\t var colour = null;\n\t\t\t // Different colours for diverse terrain\n\t\t\t if (this.map[x][y] === 0 ) colour = \"#444\";\n\t\t\t else if (this.map[x][y] === 1 ) colour = \"#555\";\n\t\t\t else if (this.map[x][y] === 2 ) colour = \"#667\";\n\t\t\t else if (this.map[x][y] === 3 ) colour = \"#777\";\n\n\t\t\t // Damaging terrain: nuclear waste and map shrinking\n\t\t\t else if (this.map[x][y] === 8 ) colour = \"#FF8C00\";\n\t\t\t else if (this.map[x][y] === 9 ) colour = \"#707\";\n\n\n\t\t\t c.beginPath();\n\t\t\t c.rect(drawx*this.map.tsize, drawy *this.map.tsize, 50, 50);\n\t\t\t c.fillStyle = colour;\n\t\t\t c.fill();\n\t\t\t}\n\t\t\tthis.player.draw(c);\n\t\t}\n\n\t\t//context.clearRect(0, 0, this.width, this.height);\n\t\tfor(var i=0;i<this.actors.length;i++){\n\t\t\tthis.actors[i].draw(context);\n\t\t}\n\n\t\t// Call the drawUI method to render the user interface\n\t\tthis.drawUI();\n\t}", "function animate() {\n\twindow.requestAnimationFrame(animate);\n\trender();\n\t\n\tif(drillImage != null && hasFinishedInit == false && welcomePageUp == false){\n\t\thasFinishedInit = true;\n\t\tgenerateMapLevel(currentLevel);\n\t\tcreateLevel(currentLevel);\n\t}\n}", "function walk(){\n\t$(document).ready(function(){\n\tif(!checkMove()){ mainGame(); return;}\n\tdocument.getElementById(\"msg\").innerHTML = \"\";\n\tvar f = 0;\n\tvar pace = .5;\n\t//pace determines the speed of the animation. the pace is determined by the gameStatus[PACE]. the fast the in game pace, the faster the animation\n\tif(gameStatus[PACE] == STEADY)\n\t\tpace == 2;\n\telse if (gameStatus[PACE] == STRENUOUS)\n\t\tpace == 1;\n\telse if (gameStatus[PACE] == GRUELING)\n\t\tpace == .5;\n\tvar id = setInterval(frame, 5);\n function frame() {//every 50*pace iterations the frame is changed. it goes through 2 loops before stopping\n\t\tif (f == 0 || f == 200* pace){\n\t\t\t$(\"#ok\").attr(\"src\", \"image/Frame1.png\");\n\t\t}\n\t\telse if (f == (50 * pace) || f == (250 * pace)){\n\t\t\t$(\"#ok\").attr(\"src\", \"image/Frame2.png\");\n\t\t}\n\t\telse if (f == (100 * pace)|| f == (300 * pace)){\n\t\t\t$(\"#ok\").attr(\"src\", \"image/Frame1.png\");\n\t\t}\n\t\telse if (f == (150 * pace)|| f == (350 * pace)){\n\t\t\t$(\"#ok\").attr(\"src\", \"image/Frame4.png\");\n\t\t}\n if (f == 400 * pace) {//interval clears and travel trail is called once finished\n\t\t\t$(\"#ok\").attr(\"src\", \"image/Frame1.png\");\n clearInterval(id);\n\t\t\ttravelTrail();\n } \n\t\telse {\n\t\t\tf ++;\n }\n }\n\t});\n}", "function showTiles(char, index) {\n me.input.registerPointerEvent('click', char.collisionBox, function() {\n var menuing = game.data.moved.indexOf(true) >= 0;\n var isTargeted = (me.game.currentLevel.getLayerByName(\"map_layer\").getTileId(char.pos.x,char.pos.y) == 2);\n if (game.data.attacking && game.data.turn != game.data.teams[index] && isTargeted) {\n var i = game.data.moved.indexOf(true);\n game.data.moved[i] = false;\n game.data.waited[i] = true;\n game.data.attacking = false;\n for (m in game.data.buttons) {\n me.game.remove(game.data.buttons[m]);\n }\n while (game.data.highlight_x.length > 0) {\n me.game.currentLevel.getLayerByName(\"map_layer\").setTile(game.data.highlight_x.pop(),game.data.highlight_y.pop(), 1);\n }\n game.data.buttons = [];\n game.data.update_plz[i] = true;\n game.data.show_menu = false;\n console.log(\"simulating battle\");\n game.data.battle.simulate();\n game.data.battle.reset();\n } else if ((game.data.moving.indexOf(true) < 0) && !game.data.waited[index] && !menuing && (game.data.teams[index] === game.data.turn)) {\n //game.data.battle.init(char);\n game.data.back_x = game.data.location_x[index];\n game.data.back_y = game.data.location_y[index];\n\n for (var i = -(game.data.movement[index]); i <= game.data.movement[index]; i++) {\n\n var k = Math.abs(i);\n var cx = game.data.location_x[index]/32;\n var cy = game.data.location_y[index]/32;\n\n for (var j = k - game.data.movement[index]; j <= game.data.movement[index] - k; j++) {\n\n var hx = cx + i;\n var hy = cy + j;\n\n if ((hx >= 0)&&(hx <= 19)&&(hy >= 0)&&(hy <= 14)) {\n\n var corner = (Math.abs(i) + Math.abs(j)) == game.data.movement[index];\n\n if (corner) {\n for (m in game.data.range[index]) {\n\n var l = game.data.range[index][m];\n\n if (i <= 0 && j <= 0) {\n for (var n = 0; n <= l; n++) {\n if ((hx - n) >= 0 && (hy - (l - n)) >= 0) {\n game.data.highlight_x.push(hx - n);\n game.data.highlight_y.push(hy - l + n);\n me.game.currentLevel.getLayerByName(\"map_layer\").setTile(hx-n,hy-l+n,2);\n }\n }\n } \n\n else if (i <= 0 && j >= 0) {\n for (var n = 0; n <= l; n++) {\n if ((hx - n) >= 0 && (hy + (l - n)) <= 14) {\n game.data.highlight_x.push(hx - n);\n game.data.highlight_y.push(hy + l - n);\n me.game.currentLevel.getLayerByName(\"map_layer\").setTile(hx-n,hy+l-n,2);\n }\n }\n } \n\n else if (i >= 0 && j <= 0) {\n for (var n = 0; n <= l; n++) {\n if ((hx + n) <= 19 && (hy - (l - n)) >= 0) {\n game.data.highlight_x.push(hx + n);\n game.data.highlight_y.push(hy - l+ n);\n me.game.currentLevel.getLayerByName(\"map_layer\").setTile(hx+n,hy-l+n,2);\n }\n }\n } \n\n else if (i >= 0 && j >= 0) {\n for (var n = 0; n <= l; n++) {\n if ((hx + n) <= 19 && (hy + (l - n)) <= 14) {\n game.data.highlight_x.push(hx + n);\n game.data.highlight_y.push(hy + l - n);\n me.game.currentLevel.getLayerByName(\"map_layer\").setTile(hx+n,hy+l-n,2);\n }\n }\n }\n }\n }\n game.data.highlight_x.push(hx);\n game.data.highlight_y.push(hy);\n me.game.currentLevel.getLayerByName(\"map_layer\").setTile(hx,hy,3);\n }\n }\n }\n game.data.moving[index] = true;\n char.off_x = 0;\n char.off_y = 0;\n game.data.update_plz[index] = true;\n } \n\n else if (game.data.moving[index]) {\n while (game.data.highlight_x.length > 0) {\n me.game.currentLevel.getLayerByName(\"map_layer\").setTile(game.data.highlight_x.pop(),game.data.highlight_y.pop(), 1);\n }\n\n game.data.moving[index] = false;\n game.data.moved[index] = true;\n game.data.show_menu = true;\n menu(index);\n game.data.update_plz[index] = true;\n }\n });\n}", "function paint() {\n\n\t\t\tpaintStones();\n\n\t\t\t// Tag the current move\n\t\t\tif (goMap.currentMoveIndex > 0) {\n\t\t\t\tpaintCurrentMove();\n\t\t\t}\n\n\t\t\tif (displayNum) {\n\t\t\t\tpaintNumbers();\n\t\t\t}\n\t\t}", "moveToNextTile(){\n // if there is a new destination in the path\n if(Array.isArray(this.path) && typeof this.path[0]!==\"undefined\"){\n const tile = this.path.shift(); // the tile coordinates in the grid\n const destination = { // the tile coordinates in pixels\n x: (tile.x + 0.5) * this.scene.map.tileWidth,\n y: (tile.y + 0.5) * this.scene.map.tileHeight,\n }\n this.moveTo.moveTo(destination.x, destination.y);\n this.player.lookAt(destination);\n this.player.walk();\n // this.player.lookAhead();\n // Use Tweens instead of rexMoveTo plugin\n // const varX = destination.x - this.player.x;\n // const varY = destination.y - this.player.y;\n // const distance = Math.sqrt(Math.pow(varX, 2) + Math.pow(varY, 2));\n // const duration = distance * speed / this.scene.map.tileWidth;\n // this.scene.tweens.killTweensOf(this.player); // we remove all previous tween on the player\n // this.scene.tweens.add({\n // targets: this.player,\n // x: destination.x,\n // y: destination.y,\n // duration: duration,\n // onComplete: () => { this.moveToNextTile() },\n // });\n // if there is no more step in the path\n } else {\n // if the player was aiming at a target\n if(this.target){\n this.player.lookAt(this.target);\n this.target.lookAt(this.player);\n this.target.stop();\n // if this target is a npc, start a conversation\n if(this.target.constructor.name == 'Object_Character_NPC'){\n this.target.talk();\n this.scene.input.setDefaultCursor('url(assets/cursors/16x16/pointer.png), pointer');\n }\n }\n this.player.stop();\n }\n }", "function drawProjectiles(){\n for(i = 0; i < projectiles.length; i++){\n if(projectiles[i].type == \"water\"){\n ctx.strokeStyle = \"#233dbc\";\n ctx.beginPath();\n ctx.arc(projectiles[i].x, projectiles[i].y, projectiles[i].r, 0, 2*Math.PI);\n ctx.stroke();\n }else if(projectiles[i].type == \"bug\"){\n if(projectiles[i].dx < 0 ){\n ctx.drawImage(images[\"flyRight\"], projectiles[i].x - projectiles[i].r/2, projectiles[i].y - projectiles[i].r/2);\n }else{\n ctx.drawImage(images[\"flyLeft\"], projectiles[i].x - projectiles[i].r/2, projectiles[i].y - projectiles[i].r/2);\n }\n }\n \n }\n}", "function render()\n{\n requestAnimationFrame(render);\n\n\tctx.clearRect(0, 0, width, height);\n drawTiles();\n\tgui.draw(ctx, mouse);\n}", "animate() {\n this._drawSprite(\n this.image, \n this.width * this.frameX, \n this.height * this.frameY,\n this.width, \n this.height, \n this.x,\n this.y, \n this.width, \n this.height\n )\n this.movePlayer()\n this.playerFrame() \n }", "function buildGame() {\n\t\n\t// build a spritesheet up from the image we have loaded\n spriteSheet = new SpriteSheet({\n\t images: [spriteImage], \n\t frames: {width: CELL_SIZE, height: CELL_SIZE, count: 12, regX: 1, regY: 1},\n\t animations: {\n\t\t\tblank: [9],\n\t\t\tempty_cell: [0],\n\t\t\tyellow_cell: [1],\n\t\t\tred_cell: [2],\n\t\t\tplace_yellow: [9],//[4],\n\t\t\tplace_red: [9],//[5],\n\t\t\tfill_yellow: [4],//[7],\n\t\t\tfill_red: [5],//[8],\n\t\t\twin_yellow: [10],\n\t\t\twin_red: [11],\n\t\t}\n });\n \n // build a stage object to hold our game board\n stage = new Stage(game);\n stage.mouseEventsEnabled = true; // allow mouse events\n stage.enableMouseOver(); // allow mouseover events\n \n // set up a game ticker\n Ticker.addListener(stage);\n Ticker.useRAF = true;\n Ticker.setFPS(60);\n \n // initialise the game board\n map = [];\n for (var col = 0; col < max_col; col++) {\n \tvar line = [];\n \tfor (var row = 0; row < max_row + header_rows; row++) {\n \t\t/// create a new bitmap animation\n \t\tvar bma = new BitmapAnimation(spriteSheet);\n \t\t\n \t\t// set up the correct bitmap\n \t\tif (col > max_col) {\n \t\t\tbma.gotoAndPlay(\"blank\");\n \t\t} else {\n \t\t\tif (row == 0)\n\t \t\t{\n\t \t\t\tbma.gotoAndPlay(\"blank\");\n\t \t\t} else if (row == 1){\n\t \t\t\tbma.gotoAndPlay((current_team == YELLOW) ? \"place_yellow\" : \"place_red\");\n \t\t\t\tbma.onMouseOver = changePlaceMouseOver;\n \t\t\t\tbma.onMouseOut = changePlaceMouseOut;\n \t\t\t\tbma.onPress = placeDiscEvent;\n\t \t\t} else {\n\t \t\t\tbma.gotoAndPlay(\"empty_cell\");\n\t \t\t}\n \t\t}\n \t\t\n \t\t// configure the bitmap animation position\n \t\tbma.name = row + \",\" + col;\n \t\tbma.x = col * CELL_SIZE;\n \t\tbma.y = row * CELL_SIZE;\n \t\tstage.addChild(bma);\n\t \tline.push(bma);\n \t}\n \tmap.push(line);\n }\n}", "function animate() {\n\trequestAnimFrame(animate); \n\n\t// animate/update the \n\tgame.snake.update();\n\t//game.snake.draw();\n\t//game.food.draw();\n}", "function drawTileMap(){\n //+3, ker izrisujemo en tile prej(levo), ker indeksiramo z 0, in tile za tem\n let posX=-Math.floor(tileSide);\n let posY=-Math.floor(tileSide);\n for(let i=worldOffsetY; i<heightCols+worldOffsetY+4; i++){\n for(let j=worldOffsetX; j<widthCols+worldOffsetX+4; j++){\n if(map[i][j]===1){\n ctx.drawImage(tiles[1],Math.round(posX+tileOffsetX),Math.round(posY+tileOffsetY),tileSide,tileSide);\n }\n else if(map[i][j]===2){\n ctx.drawImage(tiles[6],Math.round(posX+tileOffsetX),Math.round(posY+tileOffsetY),tileSide,tileSide);\n }\n else if(map[i][j]===3){\n ctx.drawImage(tiles[7],Math.round(posX+tileOffsetX),Math.round(posY+tileOffsetY),tileSide,tileSide);\n }\n else if(map[i][j]===7){\n ctx.drawImage(tiles[10],Math.round(posX+tileOffsetX),Math.round(posY+tileOffsetY),tileSide,tileSide);\n }\n else if(map[i][j]===11){\n ctx.drawImage(tiles[11],Math.round(posX+tileOffsetX),Math.round(posY+tileOffsetY),tileSide,tileSide);\n }\n\n else{\n ctx.drawImage(tiles[0],Math.round(posX+tileOffsetX),Math.round(posY+tileOffsetY),tileSide,tileSide);\n }\n if(map[i][j]===9){\n ctx.drawImage(tiles[9],Math.round(posX+tileOffsetX),Math.round(posY+tileOffsetY)-128+tileSide,70,128);\n }\n posX+=tileSide\n }\n posX=-tileSide;\n posY+=tileSide;\n }\n }", "function drawEnemyBigShips(){\n\t\tfor(let i=0;i<enemyArr.length; i++){\n\n\n\t\t\tif(enemyArr[i].name === 'redCarier'){\n\n\t\t\t\t\tif(enemyArr[i].topFrame === true && enemyArr[i].y <= 0){\n\t\t\t\t\t\t\t\tenemyArr[i].speedY *= -1;\n\t\t\t\t\t}\n\t\t\t\t\tif(enemyArr[i].y >= enemyArr[i].yPos ){\n\t\t\t\t\t\tenemyArr[i].speedY *= -1;\n\t\t\t\t\t\tif(enemyArr[i].topFrame === false){\n\t\t\t\t\t\t\tenemyArr[i].topFrame = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(enemyArr[i].speedX === 0){\n\t\t\t\t\t\t\tenemyArr[i].speedX = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Fire Logics==================\n\t\t\t\t\tenemyArr[i].fire++;\n\n\t\t\t\t\tif(enemyArr[i].fire%180 === 0){\n\t\t\t\t\t\taddShipRed(enemyArr[i].x + 20,enemyArr[i].y + enemyArr[i].height);\n\t\t\t\t\t}\n\t\t\t\t\tif(enemyArr[i].fire%280 === 0){\n\t\t\t\t\t\taddShipRed(enemyArr[i].x + 40,enemyArr[i].y + enemyArr[i].height);\n\t\t\t\t\t\taddEnemy(enemyArr[i].x + 80,enemyArr[i].y + enemyArr[i].height);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t}\n\n}", "doFrame(moves, currTime, totalTime) {\n if (currTime < totalTime) {\n // Draw animation\n setTimeout(() => {\n this.doFrame(moves, currTime + 1 / FRAME_PER_SECOND, totalTime);\n }, 1 / FRAME_PER_SECOND * 1000);\n\n for (let move of moves) {\n // moves -> [[start[i, j], end[i, j]], ...]\n // move -> [start[i, j], end[i, j]]\n let block = this.blocks[move[0][0]][move[0][1]];\n\n let origin = this.gridToPosition(move[0][0], move[0][1]);\n let destination = this.gridToPosition(move[1][0], move[1][1]);\n let currPosition = [\n origin[0] + currTime / totalTime * (destination[0] - origin[0]),\n origin[1] + currTime / totalTime * (destination[1] - origin[1])\n ]\n\n block.style.top = currPosition[0];\n block.style.left = currPosition[1];\n }\n } else {\n view.drawGame();\n }\n }", "function drawMap() {\r\n\r\n let { grid, enemies } = game.map;\r\n \r\n grid.nodes.forEach(node => {\r\n // don't draw empty nodes\r\n if (node.type === 'empty') return;\r\n\r\n // draw tower node\r\n if (node.type === 'tower') {\r\n\r\n let towerImg = TOWER_IMAGES[node.tower.type];\r\n if (node.tower.level === 4) towerImg = towerImg.final;\r\n else towerImg = towerImg.base;\r\n if (node.tower.getOrientation().length > 5) towerImg = towerImg.diagonal;\r\n else towerImg = towerImg.regular;\r\n if (node.tower.getShooting()) towerImg = towerImg.shooting;\r\n else towerImg = towerImg.resting;\r\n\r\n console.log(node.tower.getShooting())\r\n\r\n // console.log(node.tower.getOrientation())\r\n display.drawImage(\r\n towerImg,\r\n node.col * NODE_SIZE,\r\n node.row * NODE_SIZE, \r\n NODE_SIZE, \r\n NODE_SIZE, \r\n node.tower.getOrientation()\r\n );\r\n\r\n // draw tower range if it is clicked by player\r\n if (node.isSelected()) {\r\n display.drawCircle(\r\n node.col * NODE_SIZE + (NODE_SIZE / 2),\r\n node.row * NODE_SIZE + (NODE_SIZE / 2),\r\n node.tower.range * NODE_SIZE,\r\n 'rgba(100, 100, 100, ',\r\n .2,\r\n );\r\n display.drawRectangle(\r\n node.col * NODE_SIZE,\r\n node.row * NODE_SIZE,\r\n NODE_SIZE,\r\n NODE_SIZE,\r\n SELECTED_COLOR,\r\n flashingTransparency,\r\n )\r\n } \r\n }\r\n \r\n if (node.isStart || node.isEnd) {\r\n // draw start and end node\r\n\r\n display.drawRectangle(\r\n node.col * NODE_SIZE,\r\n node.row * NODE_SIZE,\r\n NODE_SIZE,\r\n NODE_SIZE,\r\n NODE_IMAGES[node.type].color\r\n );\r\n\r\n display.drawImage(\r\n NODE_IMAGES[node.type].img,\r\n node.col * NODE_SIZE,\r\n node.row * NODE_SIZE, \r\n NODE_SIZE + 10, \r\n NODE_SIZE + 10, \r\n );\r\n }\r\n });\r\n\r\n // draw enemies to the map\r\n enemies.map(enemy => {\r\n display.drawImage(\r\n ENEMY_IMAGES[enemy.type],\r\n enemy.x - ENEMY_SIZE / 2, \r\n enemy.y - ENEMY_SIZE / 2,\r\n ENEMY_SIZE,\r\n ENEMY_SIZE,\r\n enemy.getOrientation()\r\n )\r\n\r\n // draw enemy health bar\r\n display.drawRectangle(\r\n enemy.x - (HEALTHBAR.width / 2),\r\n enemy.y - (ENEMY_SIZE / 1.5),\r\n HEALTHBAR.width,\r\n HEALTHBAR.height,\r\n HEALTHBAR.color1,\r\n )\r\n\r\n // draw enemy health in health bar\r\n display.drawRectangle(\r\n enemy.x - (HEALTHBAR.width / 2),\r\n enemy.y - (ENEMY_SIZE / 1.5),\r\n HEALTHBAR.width * (enemy.currentHealth / enemy.startingHealth),\r\n HEALTHBAR.height,\r\n HEALTHBAR.color2,\r\n )\r\n\r\n // draw enemy status\r\n if (enemy.status === 'fire') {\r\n display.drawCircle(\r\n enemy.x, \r\n enemy.y,\r\n ENEMY_SIZE / 2,\r\n 'rgba(255, 50, 50, ',\r\n flashingTransparency,\r\n );\r\n }\r\n\r\n if (enemy.status === 'frozen') {\r\n display.drawCircle(\r\n enemy.x, \r\n enemy.y,\r\n ENEMY_SIZE / 2,\r\n 'rgba(100, 100, 255, ',\r\n flashingTransparency,\r\n );\r\n }\r\n });\r\n}", "function drawAll() {\r\n //Reset the screen so a user can see a star as a dot. Otherwise, a star looks like a line.\r\n virtualContext.fillStyle = (jiki.damage) ? \"red\" : \"black\";//Screen color is red if jiki's damage is left. Otherwise, it's black.\r\n virtualContext.fillRect( camera_x, camera_y, SCREEN_W, SCREEN_H ); \r\n\r\n\r\n //Draw each object by substituting its object in drawObj() method\r\n drawObj( star );\r\n drawObj( bullet ); \r\n if ( !gameOver ) {\r\n jiki.draw();//Draw a new sprite\r\n } \r\n drawObj( enemy );\r\n drawObj( explosion );\r\n drawObj( enemyBullet );\r\n\r\n \r\n //Define the camera position so the sprite is always at the center of the camera\r\n //Sprite movement range; 0 to FIELD_W\r\n //Camera movement range; 0 to (FIELD_W - SCREEN_W)\r\n camera_x = Math.floor( (jiki.x>>8) / FIELD_W * (FIELD_W - SCREEN_W) );//Set the relative position to camera_x depends on jiki.x\r\n camera_y = Math.floor( (jiki.y>>8) / FIELD_H * (FIELD_H - SCREEN_H) );\r\n\r\n\r\n //Print the boss enemy's HP\r\n if ( 0 < bossHp ) {\r\n let size = ( SCREEN_W - 20 ) * bossHp / bossMaxHp;\r\n let size2 = SCREEN_W - 20;\r\n virtualContext.fillStyle = \"rgba(255, 0, 0, 0.5)\";\r\n virtualContext.fillRect( camera_x+10, camera_y+10, size, 10 );\r\n virtualContext.strokeStyle = \"rgba(255, 0, 0, 0.9)\";\r\n virtualContext.strokeRect( camera_x+10, camera_y+10, size2, 10 );\r\n }\r\n\r\n \r\n //Print Jiki's HP\r\n if ( 0 < jiki.hp ) {\r\n let size = ( SCREEN_W - 20 ) * jiki.hp / jiki.maxHp;\r\n let size2 = SCREEN_W - 20;\r\n virtualContext.fillStyle = \"rgba(0, 0, 255, 0.5)\";\r\n virtualContext.fillRect( camera_x+10, camera_y+SCREEN_H-14, size, 10 );\r\n virtualContext.strokeStyle = \"rgba(0, 0, 255, 0.9)\";\r\n virtualContext.strokeRect( camera_x+10, camera_y+SCREEN_H-14, size2, 10 );\r\n }\r\n\r\n //Print the score\r\n virtualContext.fillStyle = \"white\";\r\n virtualContext.fillText( \"SCORE \" + score, camera_x+10, camera_y+14 );\r\n\r\n\r\n //Copy drawing from the virtual screen to the actual screen\r\n context.drawImage( $virtualCanvas, camera_x, camera_y, SCREEN_W, SCREEN_H,\r\n 0, 0, CANVAS_W, CANVAS_H );\r\n}", "animate() {\n if (this.snake.isDead()) {\n this.over();\n return;\n }\n this.board.clear();\n this.food.draw(this.board.getboardContext());\n this.snake.update();\n this.snake.draw(this.board.getboardContext());\n this.collisionWithFood();\n this.collisionWithBorder();\n setTimeout(() => {\n requestAnimationFrame(() => this.animate());\n }, 100 / this.snake.getSpeed());\n // requestAnimationFrame(() => this.animate())\n }", "run() {\n this.spawns();\n this.move();\n this.draw();\n }", "function animate() {\n\tlet curTime = new Date()\n\tlet delta = (curTime.getTime() - startTime.getTime()) / SHIFT_TIME\n\t//\tconsole.log(\"curTime = \" + curTime.getTime())\n\tclearScreen()\n\tmap.draw(mapOrigin, delta, dir, [])\n\tmovingObjects.forEach(function(obj) {\n\t // console.log(obj)\n\t obj.draw(mapOrigin, obj.row, obj.col, 0, dir)\n\t})\n\tclearNonScreen()\n\tif (curTime.getTime() - startTime.getTime() < SHIFT_TIME) {\n\t window.requestAnimationFrame(animate)\n\t}\n\telse {\n\t world.row = incRow(world.row, dir)\n\t world.col = incCol(world.col, dir)\n\t //console.log(movingObjects)\n\t movingObjects.forEach(function(obj) {\n\t\tobj.row = incRow(obj.row, dir)\n\t\tobj.col = incCol(obj.col, dir)\n\t })\n\t //overWorld.player.inc(dir)\n\t world.draw()\n\t keyData.logic = prevLogic\n\t world.map.triggers.forEach(function(trigger) {\n\t\tif (trigger.isTriggered()) {\n\t\t trigger.onTrigger(world.eventLogic, world.overlayCallback)\n\t\t /*trigger.overlay.registerLogic(world.eventLogic)\n\t\t trigger.overlay.registerCallback(world.overlayCallback)\n\t\t trigger.overlay.step()*/\n\t\t}\n\t })\n\t //order of this logic is important. if portal, nothing else should happen\n\t if (world.isInPortal(player.row, player.col)) {\n\t\tworld.useActivePortal(player.row, player.col)\n\t }\n\t else {\n\t\t//neither of these should block the other. prevents object drag\n\t\tif (keyData.isKeyNew.get(GRAB)) {\n\t\t world.eventLogic(GRAB)\n\t\t}\n\t\tif (keyData.keyStack.length !== 0) {\n\t\t world.eventLogic(keyData.keyStack[keyData.keyStack.length - 1])\n\t\t}\n\t }\n\t}\n }", "draw() {\n if (this.stopFlag) {\n image(chickenSprites[5], this.x, this.y, this.w, this.h);\n }\n else {\n if (this.direction == \"left\") {\n image(chickenSprites[4 + floor(this.spriteTimer / 8) % 4], this.x, this.y, this.w, this.h);\n\n }\n else if (this.direction == \"right\") {\n image(chickenSprites[floor(this.spriteTimer / 8) % 4], this.x, this.y, this.w, this.h);\n }\n else {\n image(chickenSprites[floor(this.spriteTimer / 8) % 4], this.x, this.y, this.w, this.h);\n }\n }\n\n this.spriteTimer++;\n }", "function drawEverything() {\n drawthetrack();\n player1.DrawItSelf(i);\n player2.DrawItSelf(j);\n allTheObstacles1.forEach((eachObstacle) => {\n eachObstacle.drawItSelf();\n if (eachObstacle.x < 20) {\n allTheObstacles1.shift();\n }\n })\n allTheObstacles2.forEach((eachObstacle) => {\n eachObstacle.drawItSelf();\n if (eachObstacle.x < 20) {\n allTheObstacles2.shift();\n }\n })\n allCloud1.forEach((cloud) => {\n cloud.drawItSelf();\n if (cloud.x < 20) {\n allCloud1.shift();\n }\n })\n allCloud2.forEach((cloud) => {\n cloud.drawItSelf();\n if (cloud.x < 20) {\n allCloud2.shift();\n }\n })\n}", "draw() {\n let minCount = this.minuteCount();\n let minPosition = this.minutePosition();\n this.drawBG();\n this.drawFog(this.getFogOpacity(minCount, minPosition));\n this.drawActiveVisitors();\n this.drawTime(minCount);\n }", "function draw(){\n\n requestAnimationFrame(draw);\n \n //Draw background\n ctx.fillStyle = 'teal';\n ctx.fillRect(0,0, canvas.width, canvas.height);\n\n //Draw map\n drawCheckpoints();\n\n //Draw objects\n objects.forEach(obj => {\n obj.draw();\n });\n\n drawText();\n}", "function animate(){\n if(backgroundInfo.x === xGoal && backgroundInfo.y === yGoal){//if we hit the distance goal\n clearTimeout(loopTimer);\n console.log(\"congratulations, the animation completed!\");\n }\n //else\n else {\n //save, do something, restore\n ctx.save();\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n //console.log(\"background started at: \" + backgroundInfo.x + \" \" + backgroundInfo.y);\n backgroundInfo.x += x/32;\n backgroundInfo.y += y/32;\n console.log(\"background at: \" + backgroundInfo.x + \" \" + backgroundInfo.y);\n //TODO: if the backgrond is going to start moing off-screen, we need to do something idfferent\n ctx.drawImage(background, backgroundInfo.x, backgroundInfo.y);//draw the background to the new location\n ctx.restore();//restore canvas back to original location\n var loopTimer = setTimeout(animate, 1);//function to call to iterate through the animation, and the speed at which the animation will take to complete\n }\n }", "function animate(){\n // loop= window.requestAnimationFrame(animate) //continues the loop\n // score++\n // scoreboard.innertext = score;\n frameId=window.requestAnimationFrame(animate)\n ctx.clearRect(0,0,canvas.width,canvas.height) //clears the whole canvas\n drawBoard()\n drawLine()\n drawObstacle() //redraws\n drawCar() \n checkGameOver() //redraws\n}", "function AnimateGame()\n{\n\tvar deltaTime = calculateDeltaTime();\t\n\n\tctx.fillStyle=\"gray\";\n\tctx.fillRect(0,0,CANVAS_WIDTH,CANVAS_HEIGHT);\n\n\t//\tcalling updating functions\n\tupdateGame(deltaTime);\n\tgodzilla.update(deltaTime);\n\n\t//\tcalling drawing functions\n\tlevel.drawCurrentSection();\n\tgodzilla.draw();\n\tui.drawUI();\n\tif(spawnTime > 10)\n\t{\n\t\thelicopters.push(new Helicopter());\n\t\tspawnTime = 0;\t\t\n\t}\n\thelicopters.forEach(function(heli) {\n\t\theli.draw(ctx);\n\t});\n\theliBullets.forEach(function(bullet){\n\t\tbullet.draw(ctx);\n\t});\n\n\tthreadings[\"Game\"] = window.requestAnimFrame(AnimateGame);\n}", "function moleiconmovement(){\r\n found = true;\r\n while (found) {\r\n found = false;\r\n for (var i = 0; i < moleclickicons.length; i++) {\r\n cur = moleclickicons[i]\r\n cur.t++\r\n if (cur.t > 30) {\r\n moleclickicons.splice(i,1)\r\n found = true;\r\n continue\r\n } else if (cur.t < 5) {\r\n cur.x += cur.spread;\r\n cur.y -= 10;\r\n } else {\r\n cur.x += cur.spread;\r\n cur.y += 20;\r\n }\r\n }\r\n }\r\n sizer = 10*(5-Math.ceil(level/2))\r\n drawarray(moleclickicons, moleimg, sizer, sizer);\r\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }" ]
[ "0.7226908", "0.70082825", "0.6970953", "0.6858111", "0.6821993", "0.6760133", "0.6760034", "0.66750056", "0.6672165", "0.66682374", "0.66538596", "0.6637454", "0.6632285", "0.6614243", "0.6607741", "0.6602935", "0.6602935", "0.64913267", "0.6472996", "0.64635205", "0.6459503", "0.64446664", "0.64364", "0.64314705", "0.64303637", "0.64253396", "0.64221656", "0.64069223", "0.63981414", "0.63969016", "0.6394377", "0.63842046", "0.6372005", "0.63666755", "0.6361751", "0.6354509", "0.6352747", "0.6352596", "0.63397115", "0.6337571", "0.63346833", "0.6316698", "0.631393", "0.6310048", "0.6308234", "0.6299692", "0.6295409", "0.62931", "0.6289699", "0.6284513", "0.62808186", "0.6273388", "0.6263583", "0.62628376", "0.62619656", "0.6261301", "0.62580043", "0.6254088", "0.6253008", "0.6252392", "0.6252392", "0.6252392", "0.6252392", "0.6252392", "0.6252392", "0.6252392", "0.6252392", "0.6252392", "0.6252392", "0.6252392", "0.6252392", "0.6252392", "0.6252392", "0.6252392", "0.6252392", "0.6252392", "0.6252392", "0.6252392", "0.6252392", "0.6252392", "0.6252392", "0.6252392", "0.6252392", "0.6252392", "0.6252392", "0.6252392", "0.6252392", "0.6252392", "0.6252392", "0.6252392", "0.6252392", "0.6252392", "0.6252392", "0.6252392", "0.6252392", "0.6252392", "0.6252392", "0.6252392", "0.6252392", "0.6252392" ]
0.716197
1
AIzaSyCeNv5vBqhgZbVUdkNbNyIhPbuqXZPksfw import Case from './components/Case';
function App() { // world wide cases info const [info,setInfo]=useState({}); // get data of all countries const [countries,setCountries]=useState([]); // set data for table data const [data,setData]=useState([]); // material ui const classes = useStyles(); const [country, setCountry] = React.useState(''); const [open, setOpen] = React.useState(false); // map zoom const [mapCenter, setMapCenter] = useState({lat: 28.3949,lng: 84.1240}); const [mapZoom,setMapZoom]=useState(3); const [caseType,setCaseType]=useState('cases'); // scroll event handling // const containerRef = React.useRef(); // const elementRef = React.useRef(); // const scrollSpeed = 50; // const { scrollToElement, scrollToY } = useScroll({ scrollSpeed, containerRef }) const handleChange = (event) => { const Selected=event.target.value; const CountryLoad=async()=>{ const selected_response=await api.get(`/countries/${Selected}`); console.log(selected_response.data); setInfo(selected_response.data); setMapCenter([selected_response.data.countryInfo.lat,selected_response.data.countryInfo.long]); setMapZoom(5); } CountryLoad(); setCountry(event.target.value); }; const handleClose = () => { setOpen(false); }; const handleOpen = () => { setOpen(true); }; useEffect(()=>{ const AppLoad=async()=>{ const response=await api.get('/all'); setInfo(response.data); } AppLoad(); },[]); useEffect(()=>{ const countries=async()=>{ const response=await api.get('/countries'); setCountries(response.data); // console.log(response.data); setData(response.data); } countries(); },[]); return ( <div > <Navbar/> <div className="jumbotron" style={{ position: 'relative', overflow: 'scroll' }}> <Jumboturn info={info} setCaseType={setCaseType} /> <div style={{textAlign:"center",backgroundColor:"white"}}> <Button className={classes.button} onClick={handleOpen}> Select the country </Button> <FormControl className={classes.formControl}> <InputLabel id="demo-controlled-open-select-label">Country</InputLabel> <Select labelId="demo-controlled-open-select-label" id="demo-controlled-open-select" open={open} onClose={handleClose} onOpen={handleOpen} value={country} onChange={handleChange} > { countries.map((country)=>{ return <MenuItem value={country.country} key={country.country}>{country.country}</MenuItem> }) } </Select> </FormControl> </div> <Maps center={mapCenter} zoom={mapZoom} countries={countries} casesType={caseType} /> <br /> <TableData datas={data}/> </div> <Footer /> </div> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getCaseById(case_id : number): Promise <Case[]>{\n return axios.get(url+'/getCase/'+case_id);\n }", "createUserCase(casee: Case): Promise<void>{\n return axios.post(url+'/case', casee, axiosConfig);\n }", "component() {\n return import(/* webpackChunkName: \"about\" */ '../views/About.vue');\n }", "function App(){\n return(\n <div>\n <ContactCard name = \"Tarik\" email = \"random@gmail\" number = \"123-321-1231\" url = \"linkedin.com/in/user\" />\n </div>\n )\n}", "getAllCases(): Promise <Case[]> {\n return axios.get(url+'/case');\n }", "function importCase(court, caseNumber) {\n return new Promise(async (resolve, reject) => {\n var caseInfo;\n\n try {\n caseInfo = await getCase(court, caseNumber);\n }\n catch (e) {\n // if error indicates case is not in CourtAPI, look it up in PACER\n if (typeof e.error === 'string' && e.error.indexOf(\"No Matching Case\") !== -1) {\n await pacerSearchCase(court, caseNumber);\n caseInfo = await getCase(court, caseNumber);\n }\n else {\n return reject(e);\n }\n }\n\n resolve(caseInfo);\n });\n}", "getCaseByZip(zipcode : string): Promise <Case[]>{\n return axios.get(url+'/getOnZip/'+zipcode);\n }", "searchCaseByDesc(description: string): Promise<Case[]>{\n return axios.get(url+'/searchCaseDesc/'+description);\n }", "getCaseByCat(category_id : number): Promise <Case[]>{\n return axios.get(url+'/getOnCategory/'+category_id);\n }", "function openCase() {\n var ef = {};\n ef[\"entityName\"] = \"incident\";\n Microsoft.CIFramework.getFocusedSession().then((sessionId) => {\n\n var sessionI = phone.listOfSessions.get(sessionId);\n\n if (sessionI.currentCase) {\n ef[\"entityId\"] = sessionI.currentCase;\n }\n else {\n return;\n }\n var input = {\n templateName: \"entityrecord\",\n templateParameters: {\n entityName: \"incident\",\n entityId: ef[\"entityId\"]\n },\n isFocused: true\n }\n Microsoft.CIFramework.createTab(input);\n });\n}", "componentDidMount() {\n this.importBDD();\n }", "componentDidMount() {\n this.getCharacters('https://swapi.co/api/people');\n }", "componentDidMount() {\n let url = `${API}/models`;\n this.props.getModels(url);\n }", "static uploadContactFile() {\n return `contactus/upload`\n }", "componentDidMount() {\n this.loadGames();\n this.loadUser(this.state.userID);\n Geocode.setApiKey(\"AIzaSyBFxBvSfL6-CmTt4k6mtU03hLHt9OJgHuI\");\n }", "componentDidMount() {\n this.getCharacters('https://swapi.co/api/people');\n \n }", "componentDidMount() {\n\t const ApiKey = 'AIzaSyCm5liffecCZfRtAinGK-9m2jNkcpcLzUc&v'\n\t const script = document.createElement('script')\n\t script.src = `https://maps.googleapis.com/maps/api/js?v=3&key=${ApiKey}`\n\t script.async = true\n\t script.defer = true\n script.onerror = ()=>{alert(\"ERRO, Não foi possível carregar a API do Google Maps\")}\n\t script.addEventListener('load', () => {\n\t this.props.mapReady()\n\t })\n document.body.appendChild(script)\n }", "function LoginFront() {\r\n return(\r\n <div>\r\n <FrontCard\r\n cardclass = \"logcardfront1\"\r\n text1=\"LOGIN\"\r\n text2=\"TO\"\r\n text3=\"KHANA SHANA\"\r\n imgpath=\"https://firebasestorage.googleapis.com/v0/b/khana-shana-2020.appspot.com/o/Mehreen%2Fchefs.svg?alt=media&token=07d03c0e-a812-48dc-8ea0-bfcb34260e5f\"\r\n />\r\n </div>\r\n )\r\n}", "searchCaseByProv(province: string): Promise<Case[]>{\n return axios.get(url+'/allCases/'+province);\n }", "getCaseOnStatus(status_id: number): Promise <Case[]>{\n return axios.get(url+'/allCases/status/'+status_id);\n }", "function getCaseUri(){\n\treturn window.casesUris[window.caseIndex];\n}", "async componentDidMount() {\n // Load UUID from url\n let query = querystring.parse(window.location.search.substring(1));\n if (query.id) {\n this.uuid = query.id;\n this.join();\n }\n // video chat\n // \"bring your own file\"\n // now playing\n // remove from participant on disconnect\n // group/shared controls\n }", "function caseAttachment(id) {\n desk.case(id, {}, function(error, data) {\n if (data !== null) {\n let caseData = data\n desk.customer(caseData._links.customer.href.split(\"customers/\")[1], {}, function(error, data) {\n if (data !== null) {\n let customerData = data\n if (data !== null) {\n let assignedName = 'Nobody'\n if (caseData._links.assigned_user) {\n desk.user(caseData._links.assigned_user.href.split(\"users/\")[1], {}, function(error, data) {\n if (data) {\n let attachment = caseCard(\n null,\n caseData.status,\n caseData.id,\n caseData.subject,\n caseData.blurb,\n caseData.labels.toString(),\n Date.parse(caseData.received_at)/1000,\n customerData.display_name,\n customerData.company,\n customerData.avatar,\n data.public_name\n )\n res.send(\n {\n \"response_type\": \"in_channel\",\n \"attachments\": [attachment],\n }\n )\n }\n })\n } else {\n // function caseCard(text, status, id, subject, blurb, labels, ts, customer, company, customerGrav, assigned)\n let attachment = caseCard(\n null,\n caseData.status,\n caseData.id,\n caseData.subject,\n caseData.blurb,\n caseData.labels.toString(),\n Date.parse(caseData.received_at)/1000,\n customerData.display_name,\n customerData.company,\n customerData.avatar,\n null\n )\n res.send(\n {\n \"response_type\": \"in_channel\",\n \"attachments\": [attachment],\n }\n );\n }\n } else {\n help()\n }\n } else {\n help()\n }\n })\n } else if (data._embedded.entries.length < 1) {\n empty()\n } else {\n help()\n }\n });\n }", "render() {\n return (\n <div className=\"pokePlannerBanner\">\n <h1>PokePlanner</h1> \n </div>\n \n )\n }", "match (originalTag, { kebabTag, camelTag }) {\n if (kebabTag.startsWith('core-')) {\n return [camelTag, `import ${camelTag} from '@/components/core/${camelTag.substring(4)}.vue'`]\n }\n }", "searchCaseByCat(description: string): Promise<Case[]>{\n return axios.get(url+'/searchCaseCategory/'+description);\n }", "function CampaignName(props) {\n return (\n <h1 className=\"campaign-title\">\n {props.title}\n </h1>\n )\n}", "function load (component) {\n // '@' is aliased to src/components\n return () => import(`src/views/${component}.vue`)\n}", "function Main() {\n\n\n return (\n <div>\n <CardGrillaArriendosHome />\n\n </div>\n )\n}", "function CocaineDetails (){\n\n return(\n <>\n \n <DrugStatistics />\n <CocaineTabs />\n </>\n )\n}", "function App() {\n return <WebARTest />;\n}", "renderComponent(handle) {\n return `<div class=\"component-example\"><span class=\"component-example__preview-link\"><a href=\"../../components/detail/${handle.replace(\n \"@\",\n \"\"\n )}\">Open detail page of this component</a></span><iframe class=\"component-example__iframe\" src=\"../../components/preview/${handle.replace(\n \"@\",\n \"\"\n )}\"></iframe></div>`;\n }", "componentDidMount() {\n // this.props.onExportOutput();\n this.initTokenWithSynonymAlias(this.props.match.params.id);\n this.props.onGetCompleteness();\n }", "componentDidMount() {\n // alert(\"se acaba de cargar el componente\")\n }", "render() {\n return (\n<DictEzApp></DictEzApp>\n );\n }", "render(){\n console.log(this.props);\n const cca3 = this.props.countryData.match.params.cca3;\n const countryInfo = getCountryByCode(cca3);\n \n return(\n <h1>{countryInfo.name.common}</h1>\n )\n }", "function OjoBot() {\n // Import result is the URL of your image\n return <img src={logo} alt=\"Logo\" />;\n}", "async componentDidMount() {\n this.handleCountryChange('Australia');\n }", "function Loading() {\n return <div>Loading SDK...</div>\n}", "getStagePatternDetails(id) {\n axios.get('assets/samplejson/stagePattern' + id + '.json').then(response => {\n this.setState({stagePatternDetails: response})\n })\n }", "static get key () {\r\n return 'NewBetMail-job'\r\n }", "function App() {\n return (\n <div className=\"App\">\n <CharCard />\n </div>\n );\n}", "function CovidStatsView(cases){\n let caseData = cases.cases;\n return(\n <Container>\n <Row>\n <Col><h1 className=\"mt-5\" style={{color:\"#3399ff\",textAlign:\"center\", margin: \"10px auto\"}}>Recent COVID19 Cases in NSW</h1></Col>\n </Row>\n <div className=\"container-fluid\">\n <Container>\n <CovidMap covidLocations={caseData.isolate.concat(cases.cases.monitor)}/> \n </Container>\n <br/> \n <br/> \n <br/>\n\n <CovidCaseCards cases={caseData} statusKey={'isolate'}/>\n <CovidCaseCards cases={caseData} statusKey={'monitor'}/>\n <LocationList cases={caseData}/>\n <br/>\n\n <UsefulLinks/>\n <br/>\n </div>\n </Container>\n \n )\n}", "import() {\n }", "function caseCard(text, status, id, subject, blurb, labels, ts, customer, company, customerGrav, assigned) {\n if (company) {\n company = \"(\"+company+\")\"\n }\n if (!assigned) {\n assigned = \"Nobody\"\n }\n let attachement = {\n \"pretext\": status + \" case from \" + customer + \" \" + company,\n \"fallback\": status + \" case from \" + customer + \" \" + company + \"- #\" + id + \": \"+ subject,\n \"author_icon\": customerGrav,\n \"author_name\": customer + \" \" + company,\n \"title\": \"#\" + id + \": \"+ subject,\n \"title_link\": \"https://help.disqus.com/agent/case/\"+id,\n \"text\": blurb,\n \"fields\": [\n {\n \"title\": \"Assigned\",\n \"value\": assigned,\n \"short\": true\n },\n {\n \"title\": \"Labels\",\n \"value\": labels,\n \"short\": true\n }\n ],\n \"color\": \"#7CD197\",\n \"ts\": ts\n }\n return attachement\n }", "function openCase() {\n var ef = {};\n ef[\"entityName\"] = \"incident\";\n if (phone.currentCase) {\n ef[\"entityId\"] = phone.currentCase;\n }\n Microsoft.CIFramework.openForm(JSON.stringify(ef));\n}", "function LoadAPIKeyFromConfigStrategy () {\n}", "function ContactCard(props) {\n console.log(props)\n return (\n <div className=\"contact-card\">\n // The properties re accessed through dot notation. props = properties, contact = the object passed in from app.js, then the name of the property\n <img src={props.contact.imgUrl}/>\n <h3>{props.contact.name}</h3>\n <p>Phone: {props.contact.phone}</p>\n <p>Email: {props.contact.email}</p>\n </div>\n )\n}", "function wsEntityForBreakdown(uid) {\n switch (uid.substr(0,2)) {\n case 'co': return 'collections';\n case 'in': return 'institutions';\n case 'dr': return 'dataResources';\n case 'dp': return 'dataProviders';\n case 'dh': return 'dataHubs';\n default: return \"\";\n }\n}", "componentDidMount() {\n SMART.authorize({\n clientId: 'my-client-id',\n scope: 'launch launch/patient patient/*.write patient/read offline_access openid fhirUser',\n redirectUri: './app',\n iss:\n 'https://launch.smarthealthit.org/v/r3/sim/'\n + 'eyJoIjoiMSIsImIiOiJmMDQ2MjkzNi1lYjRiLTRkYT'\n + 'EtYjQ1YS1mYmQ5NmViZjhjY2IiLCJlIjoic21hcnQt'\n + 'UHJhY3RpdGlvbmVyLTcxNjE0NTAyIn0/fhir',\n\n });\n }", "componentDidMount() {\n // Load fonts.\n loadCSS(\n Constants.URI_CDN_GOOGLE_FONTS,\n document.querySelector('#insertion-point-jss')\n );\n }", "function getMode() {\r\n return import('./jsonMode.js');\r\n}", "render() {\n return (\n <div>\n <Card.Body>\n <Card.Text>\n <small><center>This is a student application</center></small>\n </Card.Text>\n </Card.Body>\n </div>\n\n );\n }", "function Card(props) //function Card({name, email,id})\n{\n\t//const {name, email}=props;\t\n\treturn( //can return only one component div here for an example\n\t\t\n\t\t<div className='tc bg-light-green dib br3 pa3 ma2 grow bw2 shadow-5 '>\n\t\t\t<img alt='robots' src={`https://robohash.org/${props.id}?200x200`} />\n\t\t\t<div>\n\t\t\t \t<h2>{props.name}</h2>\n\t\t\t \t<p>{props.email}</p>\n\t\t\t</div>\n\t\t</div>\n\n\n\n\n\n\t\t);\n}", "componentDidMount() {\n // UNCOMMENT LINES BELOW FOR HTTPS/LOCAL FILE\n\n // this.setState({datasent: members, data: members});\n // Modal.setAppElement('body');\n\n // COMMENT OUT REST OF FUNCTION FOR HTTPS/LOCAL FILE\n fetch(this.state.baseUrl + \"members.json\")\n .then(function(response) {\n return response.json();\n })\n .then( (data) => {\n this.setState({datasent: data, data});\n Modal.setAppElement('body');\n }).\n }", "render() {\n return (\n <h1>Hello World!!!!!!!!!! OMG LIVE RELOADING</h1>\n );\n }", "openAppShowcase() {\n\t\tthis.props.viewAppShowcase(this.state.id);\n\t}", "function Home() {\n \n \n return (\n \n <TeacherSignIn />\n );\n}", "function HpChoosePlan() {\n useEffect(() => {\n AOS.init({\n duration: 1000,\n once: true,\n });\n AOS.refresh();\n }, []);\n\n return (\n <div className=\"plan\" id=\"experience_online_classes\">\n <h1\n className=\"blog__header\"\n data-aos=\"fade-up\"\n data-aos-anchor-placement=\"top-center\"\n >\n Trải nghiệm lớp học trực tuyến\n </h1>\n\n <div className=\"video__samples\">\n <div className=\"video__samples__deck\">\n {/* {videos.map((video) => {\n return <HpVideoCard video={video} />;\n })} */}\n </div>\n </div>\n </div>\n );\n}", "render() {\n return (\n <>\n <Jumbotron>\n <h1 className=\"text-center\">\n <strong>Sheriff Goose</strong>\n </h1>\n <h2 className=\"text-center\">This town goose goose for goose goose of us</h2>\n </Jumbotron>\n {/* <ComicBox></ComicBox> */}\n <Card\n title={\"Fortune Favors the Bird: \"}\n date={\"01/29/2020\"}\n src={\"https://github.com/apino117/goose-comic/blob/master/client/src/assets/images/golden%20goose%2018.png?raw=true\"}\n alt={\"example\"}>\n </Card>\n </>\n );\n }", "render() {\n return (\n <div className=\"Backend\">\n </div>\n );\n }", "function App() {\n return (\n <div>\n <Router>\n <switch>\n <Route exact path='/' component={Ageclass}></Route>\n <Route exact path='/1' component={Cityclass}></Route>\n <Route exact path='/2' component={Dobclass}></Route>\n <Route exact path='/task2' component={Login}></Route>\n <Route exact path='/task3' component={Arithamaticoperation}></Route>\n <Route exact path='/task4' component={Eventchange}></Route>\n <Route exact path='/task5' component={Restfullservice}></Route> \n\n\n </switch>\n </Router>\n </div>\n );\n}", "static get className() {\n return \"Place\";\n }", "componentDidMount() {\n // locate iframe on page\n var e = document.getElementById(\"embed-Calendar\");\n if (e) {\n console.log(\"Found Google Calendar, loading id\");\n e.src = e.src + this.props.calendarID;\n // should not go here\n } else {\n console.log(\"Error, could not find Google Calendar\");\n }\n }", "componentDidMount() {\n const {pageActions, params} = this.props;\n pageActions.loadPoint( params.id );\n }", "componentDidMount() {\n this.getDetailsAPI()\n }", "componentDidMount() {\n this.loadModelesVehicules();\n }", "componentDidMount() {\n // Set the title of the page\n document.title = \"Support | Sober Buddy\";\n }", "render() {\n const {id, name, type, exp} = this.props;\n const imgSrc = `${POKE_API}${padToThree(id)}.png`;\n return (\n <div className=\"Pokecard\">\n <h1>{name}</h1>\n <img src={imgSrc} alt={name}/>\n <p>Type: {type}</p>\n <p>EXP: {exp}</p> \n </div>\n )\n }", "getMigration() {\n return axios.get('contract-builder/template/migrations/1_initial_migration.js')\n .then((response) => {\n return response.data\n })\n }", "function CardName(props){\n const {CallCard , Dummy , Date} = props;\n return <div className = \"FullCard\">\n <h1 className = \"CallCard\">{CallCard}</h1>\n <h3 className = \"DummyCard\">{Dummy}</h3>\n <h4 className = \"DateCard\">{Date}</h4>\n </div>\n}", "function App() {\r\n\treturn <Example/>;\r\n}", "render() {\n return (\n<div className=\"card\" styleType=\"width: 18rem;\"> \n <div className=\"card-header \" id=\"sectionTitle\"> \n <h3>Appetizers</h3> \n </div>\n <ul className=\"list-group list-group-flush\">\n <li className=\"list-group-item\">Crab Cakes -$3</li>\n </ul>\n</div>\n \n )\n }", "function Candidates() {\n const [loading, setLoading] = useState(true);\n document.title = 'HF Volunteer Portal - Candidates';\n return (\n <>\n <h1>Our Candidates</h1>\n <p>Support our endorsed candidates for this upcoming election!</p>\n {loading && <LoadingSpinner />}\n <iframe\n className=\"airtable-embed\"\n src=\"https://airtable.com/embed/shrmkdEXjXXBzpyl6?backgroundColor=green&amp;viewControls=on\"\n frameBorder=\"0\"\n width=\"100%\"\n height=\"1000\"\n onLoad={() => setLoading(false)}\n title=\"candidates\"\n styles=\"background: transparent; border: 1px solid #ccc;\"\n ></iframe>\n </>\n );\n}", "function App() {\n return (\n <>\n <Router>\n <Switch>\n <Route path=\"/\" exact component = {Home} />\n {/* <Route path=\"/sign-up\" exact component = {SignUp} /> */}\n <Route exact path='/dashboard' component={Dashboard}/>\n <Route exact path='/dashboard/:id' component={Dashboard}/> \n <Route exact path='/login' component={SignUp}/> \n <Route exact path='/about-us' component={AboutUs}/> \n <Route exact path='/quiz' component={Quiz}/> \n <Route exact path='/quizscore' component={Modelgen}/>\n </Switch>\n </Router>\n </>\n )\n}", "async getComponent(id) {\n let response = await axios.get(\n `${API_URL}/currCOmponents/${id}/getComponent`\n );\n console.log(response);\n return response.data;\n }", "componentDidMount () {\n let id = window.location.pathname.split('/')[2]\n this.retrieveStudent(id)\n this.retrieveProfilePicture(id)\n }", "function App() { \n return (\n <span> \n {/* <VideoPlayer src=\"https://www.learningcontainer.com/wp-content/uploads/2020/05/sample-mp4-file.mp4\" /> */}\n <SaranyuVideoPlayer />\n {/* <Video /> */}\n </span>\n );\n}", "get src() {\n // access the component's arguments using the this.args, an API provided by glimmer/component superclass\n // can return the value of src by using this.src from within the template\n let { lng, lat, width, height, zoom } = this.args;\n let coordinates = `${lng},${lat},${zoom}`;\n let dimensions = `${width}x${height}`;\n let accessToken = `access_token=${this.token}`;\n return `${MAPBOX_API}/${coordinates}/${dimensions}@2x?${accessToken}`;\n }", "function Chinhsachvip(props) {\n return (\n <div>\n chinh sach vip\n </div>\n );\n}", "componentDidMount() {\n const { autoSignIn } = this.props;\n autoSignIn();\n }", "componentDidMount() {\n console.log('>>>>>>>>>>>>>>>> BoardGames > componentDidMount() <<<<<<<<<<<<<<<<<<<<<<');\n }", "function Card(props){\n const thisCard = `/cards/${props.card}.png`\n return(\n <div className=\"col-sm-2 card\">\n <img src={thisCard} />\n </div>\n )\n}", "onComponentMount() {\n\n }", "function App() {\n return( \n <div>\n<Myblog name=\"teman sejati\" />\n<Myapp name=\"joni\" />\n\n<Myblog name=\"armadan\" />\n<Aptlib name='aditiya' urimg='https://' />\n </div>\n )\n}", "componentDidMount(){\n fetch(`http://localhost:3000/characters/${this.props.characterId}`,{\n headers: {\n Authorization: `Bearer ${sessionStorage.token}`\n }\n })\n .then(res => res.json())\n .then(data => this.props.characterEdit(data))\n }", "function App() {\n return (\n <Router basename={process.env.PUBLIC_URL}>\n <Switch>\n <Route path='/' exact component={Home} />\n {/* <Route path='/timeline' component={TimeLine} /> */}\n </Switch>\n </Router>\n );\n}", "function componentDidMount ()\n {\n\n }", "componentDidMount() {\n fetch('test.yaml')\n .then(response => response.text())\n .then(data => this.initializeCards(data))\n .catch(e => console.error('Couldn\\'t read yaml file. The error was:\\n', e));\n }", "function App() {\n return (\n <Switch className=\"App\">\n <Route exact path=\"/\"component={Login} />\n <Route exact path=\"/profile\" component={Dashboard}/>\n </Switch>\n );\n}", "function Services() {\r\n document.title = \"TRVL | Services\";\r\n return (\r\n <>\r\n {\r\n <div className=\"services\">Hola soy el contenido de Services</div>\r\n //<HeroSection />\r\n //<Cards />\r\n }\r\n </>\r\n );\r\n}", "function ct_importprofile() {\n fetch('https://hastebin.com/raw/mojohavode') // testing json\n .then(response => response.json())\n .then(data => console.log(data))\n}", "function ProfileName() {\n return (\n <React.Fragment>\n <img src={randoCalrissian} alt=\"Billy Dee Williams Impersonator - Jimmie Morgan\" width=\"50%\"/>\n <h3>Rando Calrissian</h3>\n </React.Fragment>\n );\n}", "function Title(props){\n return <h4>{props.content}</h4>\n}", "getChallengeDetail(id) {\n axios.get(`view/created-challenges?challengeId=${id}`).then(res => {\n let challenge = res.data.challenges[0];\n\n this.setState({\n challenge: challenge.title,\n aboutChallenge: challenge.challengeDescription.aboutChallenge,\n goalDescription: challenge.challengeDescription.goalDescription,\n joinDescription: challenge.challengeDescription.joinDescription,\n policyDescription: challenge.challengeDescription.policyDescription,\n challengeStartDate: challenge.startDate,\n challengeEndDate: challenge.endDate,\n image: BASE_URL + challenge.image,\n activityType: challenge.activityType,\n maxValue: challenge.totalCount,\n minValue: challenge.minCount\n });\n });\n }", "render() {\n return (\n <div>\n <JobCard />\n </div>\n )\n }", "async componentDidMount() {\n //The API calls should be made in componentDidMount method always.\n }", "function App() {\n var province= \" \";\n var hint= \" \";\n var rand=Math.floor(Math.random()*5);\n switch(rand){\n case 0 :\n province = \"Udonthani\"\n hint = \"อุดรธานี\"\n break;\n \n case 1 :\n province = \"Songkla\"\n hint = \"สงขลา\"\n break;\n \n case 2 :\n province = \"Pare\"\n hint = \"แพร่\"\n break;\n case 3 :\n province = \"Bankkok\"\n hint = \"กรุงเทพ\"\n break;\n case 4 :\n province = \"Chonburik\"\n hint = \"ชลบุรี\"\n break;\n }\n \n return (\n <body> <div className='text'>\n <h1>Hint</h1>\n <h2>{hint}</h2>\n \n \n <WordCard value={province}/>\n </div></body>\n );\n \n}", "function NetflixandChill(props) {\n return (\n <>\n <h1>Netflix and Chill</h1>\n </>\n );\n}", "function Oauth() {\n\n\n // const loadJournals = () => {\n // API.getJournals().then(response => {\n // console.log(response.data);\n // });\n // }\n\n return (\n <div className=\"row d-flex justify-content-center\">\n <div className=\"col-md-4 col-offset-md-4 col-xs-12 mt-5\">\n <a className=\"btn btn-lg btn-google btn-block btn-outline border rounded\" href={(process.env.REACT_APP_URL && `${process.env.REACT_APP_URL}/google`) || \"http://localhost:3001/google\"}>\n <img src=\"https://img.icons8.com/color/16/000000/google-logo.png\" alt=\"\" style={{ marginRight: '7px', marginBottom: '3px' }} /> \n Login With Google\n </a>\n </div>\n </div>\n );\n}", "render(){\n return (\n <div className='main'>\n \n <h1>\n {this.props.fullname ? \n `Welcome ${this.props.fullname.split(' ')[0]}` \n :\n 'Welcome!'\n }\n </h1>\n\n {this.state.createButton ? \n this.drawButton() \n : \n this.newCase()\n }<br/>\n\n <DrawCases deleteCase={this.props.deleteCase} cases={this.props.cases}/>\n\n </div>\n )\n }" ]
[ "0.5636929", "0.51538765", "0.5128173", "0.5030402", "0.49919602", "0.48987514", "0.48860973", "0.4881821", "0.48489416", "0.48084873", "0.4781285", "0.47500202", "0.47482222", "0.47224596", "0.4718368", "0.47182164", "0.4710577", "0.4709978", "0.47061932", "0.46965846", "0.4684859", "0.466039", "0.4650014", "0.4623515", "0.46221593", "0.46101123", "0.46064597", "0.46053353", "0.4600915", "0.45963922", "0.4560025", "0.45456582", "0.45420858", "0.45406693", "0.45356065", "0.45337176", "0.44901007", "0.44781837", "0.44725266", "0.44718984", "0.44490233", "0.4445064", "0.44383618", "0.4432284", "0.442841", "0.4423493", "0.44230503", "0.4414167", "0.44095233", "0.44092432", "0.44086418", "0.44067243", "0.44065335", "0.44037348", "0.44030884", "0.44004452", "0.43954238", "0.43938136", "0.43893766", "0.4389288", "0.4388575", "0.43874374", "0.43836612", "0.43779585", "0.43764535", "0.43700492", "0.43675953", "0.4363864", "0.43608376", "0.43558493", "0.43557328", "0.43543893", "0.43526268", "0.43517238", "0.4349325", "0.4346271", "0.43458512", "0.4342577", "0.43408582", "0.43408114", "0.43404523", "0.4340378", "0.43379626", "0.43372864", "0.43329012", "0.4331726", "0.4331527", "0.43259037", "0.43208924", "0.4317252", "0.4315556", "0.4312811", "0.43125638", "0.43111137", "0.4307133", "0.43067342", "0.43065292", "0.43052816", "0.43035066", "0.4303385", "0.4300529" ]
0.0
-1
Only change code above this line
function fun2() { var output = ""; if (typeof myGlobal != "undefined") { output += "myGlobal: " + myGlobal; } if (typeof oopsGlobal != "undefined") { output += " oopsGlobal: " + oopsGlobal; } console.log(output); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected internal function m252() {}", "private internal function m248() {}", "private public function m246() {}", "transient private protected internal function m182() {}", "transient final protected internal function m174() {}", "transient protected internal function m189() {}", "transient private internal function m185() {}", "transient final private protected internal function m167() {}", "static private protected internal function m118() {}", "static final private internal function m106() {}", "static transient final protected internal function m47() {}", "transient final private internal function m170() {}", "transient private protected public internal function m181() {}", "transient private public function m183() {}", "transient final private protected public internal function m166() {}", "static private internal function m121() {}", "static final private protected internal function m103() {}", "preset () { return false }", "static transient final private internal function m43() {}", "function kp() {\n $log.debug(\"TODO\");\n }", "static transient final private protected internal function m40() {}", "hacky(){\n return\n }", "static private protected public internal function m117() {}", "preorder() {\n throw new Error(\"This method hasn't been implemented yet!\");\n }", "function _____SHARED_functions_____(){}", "static transient private protected internal function m55() {}", "function jessica() {\n $log.debug(\"TODO\");\n }", "static transient final protected public internal function m46() {}", "livelyPrepareSave() {\n }", "function customHandling() { }", "static postUpdate() {\n return false;\n }", "async 'after sunbath' () {\n console.log( 'see? I appear here because of the first custom above' )\n }", "updated() {}", "static transient private protected public internal function m54() {}", "static protected internal function m125() {}", "static final private protected public internal function m102() {}", "function StupidBug() {}", "incapacitate(){\n\t\t//\n\t}", "__previnit(){}", "function additionalSettings(){\n\n\n}", "function comportement (){\n\t }", "__init7() {this._isEnabled = false;}", "static transient final protected function m44() {}", "function welcomeToBooleans() {\n\n// Only change code below this line.\n\nreturn true; // Change this line\n\n// Only change code above this line.\n}", "function welcomeToBooleans() {\n\n// Only change code below this line.\n\nreturn true; // Change this line\n\n// Only change code above this line.\n}", "function welcomeToBooleans() {\n\n// Only change code below this line.\n\nreturn true; // Change this line\n\n// Only change code above this line.\n}", "_reflow() {\n this._init();\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 }", "constructor() {\n \n\n \n \n\n \n\n \n }", "transient final private public function m168() {}", "_update() {\n }", "update() {\n // Subclasses should override\n }", "postorder() {\n throw new Error(\"This method hasn't been implemented yet!\");\n }", "function init() {\n //UH HUH, THIS MY SHIT!\n }", "function updateroster() {\n\n}", "fixupFrame() {\n // stub, used by Chaos Dragon\n }", "static transient final private protected public function m38() {}", "editTattoo () {\n\n }", "function _construct()\n\t\t{;\n\t\t}", "_FBPReady(){super._FBPReady();//this._FBPTraceWires()\n}", "_FBPReady(){super._FBPReady();//this._FBPTraceWires()\n}", "static transient final private protected public internal function m39() {}", "onModifySpA() {}", "function Annotate() {\r\n}", "patch() {\n }", "enable() {\n\t // leave empty in Widget.js\n\t }" ]
[ "0.704269", "0.6920925", "0.67108494", "0.67096627", "0.65723664", "0.64506495", "0.6447263", "0.6391223", "0.6114873", "0.5990437", "0.59698707", "0.5942723", "0.5900797", "0.58977413", "0.5895389", "0.5790728", "0.578317", "0.5776425", "0.5762054", "0.57532656", "0.5703712", "0.5702534", "0.57011616", "0.57002544", "0.5695516", "0.5628996", "0.5618956", "0.56009436", "0.5572395", "0.5550112", "0.55355316", "0.55033636", "0.548971", "0.54874855", "0.54627144", "0.54554695", "0.54305756", "0.542131", "0.54190683", "0.54000884", "0.539899", "0.5387328", "0.5381409", "0.5374772", "0.5374772", "0.5374772", "0.53684646", "0.5334544", "0.5334544", "0.5334544", "0.5334544", "0.5334544", "0.5334544", "0.5334544", "0.5334544", "0.5334544", "0.5334544", "0.5334544", "0.5334544", "0.5334544", "0.5334544", "0.5334544", "0.5334544", "0.5334544", "0.5334544", "0.5334544", "0.5334544", "0.5334544", "0.5334544", "0.5334544", "0.5334544", "0.5334544", "0.5334544", "0.5334544", "0.5334544", "0.5334544", "0.5334544", "0.5334544", "0.5334544", "0.5334544", "0.5334544", "0.5334544", "0.5334544", "0.5334544", "0.5332843", "0.5313967", "0.5313316", "0.5311835", "0.53064907", "0.5285132", "0.52653784", "0.52621984", "0.5260123", "0.5254416", "0.52537954", "0.52537954", "0.52434075", "0.5239028", "0.52312875", "0.52299595", "0.5215778" ]
0.0
-1
Note: AttributeMarshallingMixin will recognize `selected` as the name of attribute that should be parsed as a boolean attribute, and so will handling parsing it for us.
set selected(selected) { this[internal.setState]({ selected }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static get properties() {\n return {\n 'selected': {\n value: false,\n type: 'boolean'\n }\n };\n }", "get checked() {\n return this.hasAttribute(\"checked\");\n }", "function setBoolAttr(d) {\n // change the element's text\n let value = d3.select(this).node().textContent;\n $(this).parent().parent().find(\">button>span.boolVal\").text(value);\n let object = d3.select($(this).parents(\"li.attribute\").first().parent().get(0)).data()[0];\n let attrName = \"cim:\" + d.attributes[0].value.substring(1);\n // update the model\n self.model.setAttribute(object, attrName, value);\n }", "get selected() { return this._selected; }", "get selected() { return this._selected; }", "get selected() { return this._selected; }", "get selected() { return this._selected; }", "get selected() { return this._selected; }", "get selected() { return this._selected; }", "get selected() { return this._selected; }", "get selected() { return this._selected; }", "get selected() { return this._selected; }", "get selected() { return this._selected; }", "get selected() { return this._selected; }", "get selected() { return this._selected; }", "get checked() {\n return this.hasAttribute('checked');\n }", "_getAriaSelected() {\n return this.selected || (this.multiple ? false : null);\n }", "_getAriaSelected() {\n return this.selected || (this.multiple ? false : null);\n }", "_getAriaSelected() {\n return this.selected || (this.multiple ? false : null);\n }", "isSelected() {\n return __awaiter(this, void 0, void 0, function* () {\n const el = (yield this.element());\n if (!el)\n return false;\n if (this._args.isAndroid) {\n try {\n yield el.getAttribute(\"selected\");\n }\n catch (error) {\n console.error(\"Check if this is the correct element!\");\n }\n }\n try {\n return yield el.isSelected();\n }\n catch (ex) {\n console.warn(\"'selected' attr is not reachable on this element!\");\n }\n console.warn(\"Trying use 'value' attr!\");\n try {\n const attrValue = yield el.getAttribute(\"value\");\n return attrValue === \"1\" || attrValue === \"true\" || attrValue === true;\n }\n catch (error) {\n return false;\n }\n });\n }", "get selected() {\n return this._selected;\n }", "get selected() {\n return this._selected;\n }", "get selected() {\n return this._selected;\n }", "static fromBoolean(value) {\n return new DynamoAttributeValue({ BOOL: value });\n }", "get defaultChecked(){\n return this.hasAttribute('checked');\n }", "get defaultChecked(){\n return this.hasAttribute('checked');\n }", "function getForBoolean () {\n if (dataFrom === undefined) {\n from[attribute] = false;\n } else {\n from[attribute] = strToBool(dataFrom);\n }\n from[attribute] = boolToNum(from[attribute]);\n to[attribute] = boolToNum(strToBool(dataTo));\n partialSetAttribute = function (value) {\n el.setAttribute(attribute, !!value[attribute]);\n };\n }", "isSelected() {\n return this.selected;\n }", "function getForBoolean () {\n\t if (dataFrom === undefined) {\n\t from[attribute] = false;\n\t } else {\n\t from[attribute] = strToBool(dataFrom);\n\t }\n\t from[attribute] = boolToNum(from[attribute]);\n\t to[attribute] = boolToNum(strToBool(dataTo));\n\t partialSetAttribute = function (value) {\n\t el.setAttribute(attribute, !!value[attribute]);\n\t };\n\t }", "getValue() {\n attribute = true;\n const value = this.fragment\n ? this.fragment.valueOf()\n : booleanAttributes[this.name.toLowerCase()]\n ? true\n : this.value;\n attribute = false;\n return value;\n }", "isChecked() {\n return this.hasAnyAttribute('checked');\n }", "function option(value, selected) {\n return {\n selected: observable(has(selected) ? selected : allCheckbox()),\n value: has(value) ? value.toString() : \"\"\n };\n }", "get selectedAll() {\n return this.selectAllTarget.checked\n }", "get selected() { return this.selectionList.selectedOptions.isSelected(this); }", "get selected() { return this.selectionList.selectedOptions.isSelected(this); }", "get checked() { return this._checked; }", "get checked() { return this._checked; }", "get checked() { return this._checked; }", "function defineBooleanAttribute(key,handler){var attr=$attrs.$normalize('md-'+key);if(handler)defineProperty(key,handler);if($attrs.hasOwnProperty(attr))updateValue($attrs[attr]);$attrs.$observe(attr,updateValue);function updateValue(newValue){ctrl[key]=newValue!=='false';}}", "static get observedAttributes() {\n return ['checked', 'disabled'];\n }", "static booleanFromJsonPath(value) {\n (0, utils_1.validateJsonPath)(value);\n return new DynamoAttributeValue({ BOOL: value.toString() });\n }", "get selected() {\n return this._chipFoundation.isSelected();\n }", "getAttributeData(val) {\r\n let product;\r\n let allSelected = true;\r\n // deep cloning\r\n product = JSON.parse(JSON.stringify(this.state.product));\r\n product.attributes[val[0]].selectedvalue = val[1];\r\n for (let i = 0; i < product.attributes.length; i++) {\r\n if (product.attributes[i].selectedvalue === -1) {\r\n allSelected = false;\r\n }\r\n }\r\n this.setState({ product: product });\r\n if (allSelected) {\r\n this.setState({ allowAddingToCart: true });\r\n }\r\n }", "get selectable() { return this._selectable; }", "get selectable() { return this._selectable; }", "get valueBoolean () {\r\n\t\treturn this.__valueBoolean;\r\n\t}", "set boolValue(value) {}", "function selectModelTypeAttributes()\n{\n\tvar selectedList = jQuery(\"#selectedList\");\n\tjQuery(\"#availableList\").children().each(function(i, item){\n\t\tif( item.selected ){\n\t\t\thtml = \"<tr class='selected' id='\" + item.value + \"' ondblclick='unModelTypeAttribute( this )'><td onclick='select(this)'>\" + item.text + \"</td>\";\n\t\t\thtml += \"</tr>\";\n\t\t\tselectedList.append( html );\n\t\t\tjQuery( item ).remove();\n\t\t}\n\t});\n}", "get checked(){ return this.__checked; }", "get valueBoolean() {\n\t\treturn this.__valueBoolean;\n\t}", "function selectItem(elt, select) {\n if (select != null) {\n if (select === true) {\n elt.find(\"input\")[0].checked = true;\n if (elt.hasClass(\"selected\") === false)\n elt.addClass(\"selected\");\n }\n else {\n elt.find(\"input\")[0].checked = false;\n if (elt.hasClass(\"selected\"))\n elt.removeClass(\"selected\");\n }\n }\n else // toggle\n select(elt, ! elt.find(\"input\")[0].checked);\n}", "wants() {\n return this.yesElement.prop('checked');\n }", "_onChange() {\n let checked = this.execute('is checked');\n return this.attrs.onChange(checked, this);\n }", "selected() {\n\t\t\treturn this._selected;\n\t\t}", "function defineBooleanAttribute (key, handler) {\n var attr = $attrs.$normalize('md-' + key);\n if (handler) defineProperty(key, handler);\n if ($attrs.hasOwnProperty(attr)) updateValue($attrs[attr]);\n $attrs.$observe(attr, updateValue);\n function updateValue (newValue) {\n ctrl[ key ] = newValue !== 'false';\n }\n }", "function defineBooleanAttribute (key, handler) {\n var attr = $attrs.$normalize('md-' + key);\n if (handler) defineProperty(key, handler);\n if ($attrs.hasOwnProperty(attr)) updateValue($attrs[attr]);\n $attrs.$observe(attr, updateValue);\n function updateValue (newValue) {\n ctrl[ key ] = newValue !== 'false';\n }\n }", "function defineBooleanAttribute (key, handler) {\n var attr = $attrs.$normalize('md-' + key);\n if (handler) defineProperty(key, handler);\n if ($attrs.hasOwnProperty(attr)) updateValue($attrs[attr]);\n $attrs.$observe(attr, updateValue);\n function updateValue (newValue) {\n ctrl[ key ] = newValue !== 'false';\n }\n }", "function selectedAllOption(mixSelect, booSelected)\n{\n var select = getObject(mixSelect);\n if (empty(select))\n return false;\n if (!isBoolean(booSelected))\n booSelected = true;\n var arrOption = select.getElementsByTagName('OPTION');\n for (var intCount = 0; intCount < arrOption.length; ++intCount) {\n var option = arrOption[intCount];\n option.selected = booSelected;\n }\n return arrOption;\n}", "isSelected() {\n return this._node.__execute(() => this.element.isSelected());\n }", "get selected() {\n return this.checkboxTargets.filter(target => target.checked)\n }", "get fillAttrs() {\n return this.makeMap(\"checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected\")\n }", "get _shouldUpdateSelection(){return this.selected!=null;}", "get ariaSelected() {\n // Remove the `aria-selected` when the chip is deselected in single-selection mode, because\n // it adds noise to NVDA users where \"not selected\" will be read out for each chip.\n return this.selectable && (this._chipListMultiple || this.selected) ?\n this.selected.toString() : null;\n }", "get selected() {\n if (this.isObject(this.options)) {\n return this.options.selected;\n }\n else {\n return this.__selected;\n }\n }", "function isStatusSelected(value, device, options) {\t\t\n\t\tif(device['overridden'] == 'false') {\t\t\t\n\t\t\tif(value == 'overridden') {return 'selected';}\n\t\t} else {\n\t\t\tif(value == device['state']) {return 'selected';}\n\t\t}\t\n\t}", "get checked() {\n return this.input.checked;\n }", "function boolHandler( elem, name, isXML ) {\n\tvar val;\n\treturn isXML ?\n\t\tundefined :\n\t\t(val = elem.getAttributeNode( name )) && val.specified ?\n\t\t\tval.value :\n\t\t\telem[ name ] === true ? name.toLowerCase() : null;\n}", "constructor(value, selected) {\r\n this.value = value;\r\n this.selected = selected;\r\n }", "getValue() {\n return this.state.isChecked;\n }", "_setSelected(selected) {\n if (selected === this._selected) {\n return false;\n }\n this._selected = selected;\n if (selected) {\n this.selectionList.selectedOptions.select(this);\n }\n else {\n this.selectionList.selectedOptions.deselect(this);\n }\n this.selectedChange.emit(selected);\n this._changeDetector.markForCheck();\n return true;\n }", "setBooleanAttribute(element, attributeName, value) {\n value ? element.setAttribute(attributeName, \"\") : element.removeAttribute(attributeName);\n }", "get boolValue() {}", "select() { this.selected = true; }", "get selected() {\n const selected = this.selectionModel.selected;\n return this.multiple ? selected : (selected[0] || null);\n }", "get _componentTargetProperty() {\n return 'checked';\n }", "get selected() {\n return this.multiple ? this._selectionModel.selected : this._selectionModel.selected[0];\n }", "componentDidMount() {\n let props = this.props;\n if (!props.eReq) {\n props.formSetValue(props.inputProps.name, '', true, false);\n }\n if (props.iSelectedValue) {\n const valueField = props.valueField;\n const name = props.inputProps.name;\n const filterData = this.data.filter(d => props.iSelectedValue.match(new RegExp(\"(?:^|,)\" + d[valueField] + \"(?:,|$)\")));\n\n $.each(filterData, function (index, data) {\n const value = data[valueField];\n document.getElementById(name + value).checked = true;\n });\n\n var value = this.getCheckedValues();\n props.formSetValue(name, value, true, false);\n }\n }", "function shouldSetAttribute(name,value){if(isReservedProp(name)){return false;}if(name.length>2&&(name[0]==='o'||name[0]==='O')&&(name[1]==='n'||name[1]==='N')){return false;}if(value===null){return true;}switch(typeof value==='undefined'?'undefined':_typeof(value)){case'boolean':return shouldAttributeAcceptBooleanValue(name);case'undefined':case'number':case'string':case'object':return true;default:// function, symbol\nreturn false;}}", "function shouldSetAttribute(name,value){if(isReservedProp(name)){return false;}if(name.length>2&&(name[0]==='o'||name[0]==='O')&&(name[1]==='n'||name[1]==='N')){return false;}if(value===null){return true;}switch(typeof value==='undefined'?'undefined':_typeof(value)){case'boolean':return shouldAttributeAcceptBooleanValue(name);case'undefined':case'number':case'string':case'object':return true;default:// function, symbol\nreturn false;}}", "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}", "isSelectable() {\n return this.selectable === true\n }", "select () {\n this.selected = true;\n }", "get checkboxOptions() {\n return [\n { label: 'Create Without Confirmed Slot', value: 'selected' },\n \n ];\n}", "function attributeSelected(attribute, selected){\r\n\tvar selector = document.getElementById(attribute);\r\n\tif(selected === null){\r\n\t\tselector.value = 'null';\r\n\t}\r\n\telse{\r\n\t\tselector.value = selected;\r\n\t}\r\n}", "writeValue(value) {\n this.setProperty('checked', value);\n }", "set selected(value) {\n this._selected = value;\n this._selectedTimestamp = value ? new Date() : undefined;\n }", "_setSelected(selected) {\n if (selected === this._selected) {\n return false;\n }\n this._selected = selected;\n if (selected) {\n this.selectionList.selectedOptions.select(this);\n }\n else {\n this.selectionList.selectedOptions.deselect(this);\n }\n this._changeDetector.markForCheck();\n return true;\n }", "_setSingleAttribute(attributeName, value) {\n this.getSelectedObjects().forEach(selectedObject => {\n selectedObject[attributeName] = value;\n });\n }", "get disabled() {return booleanAttribute.get(this, 'disabled');}", "selectAll(event) {\n let selectedIntents = [];\n let updatedIntents = this.state.intents.map((intent) => {\n intent.checked = event.target.checked;\n return intent;\n })\n if(event.target.checked){\n selectedIntents = this.state.intents;\n } \n this.setState({\n intents: updatedIntents,\n selectedIntents: selectedIntents\n })\n console.log('selected intents', selectedIntents);\n }", "function getOptionIsSelected(sInputId, nValue)\n{\n\t//Declare return object.\n\tvar sSelectionAttribute = '';\n\n\t//If holder value matches this option add selected attribute/value markup.\n\tif (document.getElementById(sInputId).value == nValue)\n\t\tsSelectionAttribute = ' selected=\"selected\"';\n\n\treturn sSelectionAttribute;\n}", "otherAttributeStates() {\n let state = {};\n for (var i in this.props.defaultAttributes) {\n state[\"batch_\" + this.props.defaultAttributes[i][\"name\"]]=false;\n state[\"editing_\" + this.props.defaultAttributes[i][\"name\"]]=false;\n }\n return state;\n }", "function shouldSetAttribute(name,value){if(isReservedProp(name)){return false;}if(name.length>2&&(name[0]==='o'||name[0]==='O')&&(name[1]==='n'||name[1]==='N')){return false;}if(value===null){return true;}switch(typeof value==='undefined'?'undefined':_typeof(value)){case'boolean':return shouldAttributeAcceptBooleanValue(name);case'undefined':case'number':case'string':case'object':return true;default:// function, symbol\n\treturn false;}}", "get _shouldUpdateSelection(){return this.selected!=null||this.selectedValues!=null&&this.selectedValues.length;}", "_parseCheck(item) {\n if (item.dataset.checked && item.dataset.checked === \"true\") {\n return true;\n }\n\n return false;\n }", "function validateBoolean(context, name, def) {\n var value = context[name];\n\n if (value == null) {\n value = def;\n }\n\n if (typeof value !== 'boolean') {\n raise(value, 'options.' + name);\n }\n\n context[name] = value;\n}", "toggleSelected() {\n\t\t\tthis._selected = !this._selected;\n\t\t}", "triggerSelected() {\n let cachedValues = this.cachedValues\n let self = this\n let values = new Array()\n this.iterateChecks((index, line, box, span) => {\n if (box.prop(\"checked\")) {\n // Update the \"selected\" property\n cachedValues[index][1] = true\n values.push(cachedValues[index])\n }\n })\n this.model.SetSelected(values)\n super.triggerSelected()\n }", "setIsEnabled(valueNew){let t=e.ValueConverter.toBoolean(valueNew);null===t&&(t=this.getAttributeDefaultValueInternal(\"IsEnabled\")),t!==this.__isEnabled&&(this.__isEnabled=t,this.__processIsEnabled())}", "asString() {\n if (validation.isEmpty(this.selectedAttribute)) {\n return null;\n } else {\n return this.selectedAttribute.toString();\n }\n }" ]
[ "0.6249087", "0.6003263", "0.60014135", "0.5926826", "0.5926826", "0.5926826", "0.5926826", "0.5926826", "0.5926826", "0.5926826", "0.5926826", "0.5926826", "0.5926826", "0.5926826", "0.5926826", "0.59092534", "0.587611", "0.587611", "0.587611", "0.58644813", "0.57658046", "0.57658046", "0.57658046", "0.5685851", "0.5683429", "0.5683429", "0.56577665", "0.56384313", "0.55843806", "0.5564808", "0.5517095", "0.5486517", "0.5461289", "0.5442083", "0.5442083", "0.542881", "0.542881", "0.542881", "0.54161495", "0.53789866", "0.53706676", "0.5357177", "0.53391534", "0.53135425", "0.53135425", "0.53134704", "0.53088266", "0.5248335", "0.52239317", "0.5220222", "0.5216895", "0.5214901", "0.52046317", "0.5202811", "0.5198202", "0.5198202", "0.5198202", "0.5187752", "0.5177161", "0.51760185", "0.51627684", "0.514886", "0.5142811", "0.513814", "0.511874", "0.51175696", "0.5107797", "0.51071954", "0.510427", "0.50919706", "0.5087916", "0.5078029", "0.50755745", "0.5065265", "0.5058328", "0.50488067", "0.50444317", "0.5041403", "0.5041403", "0.5033621", "0.50331235", "0.5026352", "0.5024875", "0.50134194", "0.50072074", "0.50057834", "0.5005494", "0.49956512", "0.49818766", "0.497718", "0.49741954", "0.49691564", "0.49519607", "0.4945461", "0.49333575", "0.49325827", "0.492264", "0.4920116", "0.49046853", "0.4904045" ]
0.49235755
96
! moment.js locale configuration
function t(e){return e%100===11||e%10!==1}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cl(e,t,n){return\"m\"===n?t?\"минута\":\"минуту\":e+\" \"+\n//! moment.js locale configuration\n//! locale : Russian [ru]\n//! author : Viktorminator : https://github.com/Viktorminator\n//! Author : Menelion Elensúle : https://github.com/Oire\n//! author : Коренберг Марк : https://github.com/socketpair\nfunction(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}({ss:t?\"секунда_секунды_секунд\":\"секунду_секунды_секунд\",mm:t?\"минута_минуты_минут\":\"минуту_минуты_минут\",hh:\"час_часа_часов\",dd:\"день_дня_дней\",MM:\"месяц_месяца_месяцев\",yy:\"год_года_лет\"}[n],+e)}", "function Os(e,t,n){return\"m\"===n?t?\"хвилина\":\"хвилину\":\"h\"===n?t?\"година\":\"годину\":e+\" \"+\n//! moment.js locale configuration\nfunction(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}({ss:t?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:t?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:t?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"}[n],+e)}", "function At(e,t,a){return\"m\"===a?t?\"хвилина\":\"хвилину\":\"h\"===a?t?\"година\":\"годину\":e+\" \"+\n//! moment.js locale configuration\nfunction(e,t){var a=e.split(\"_\");return t%10==1&&t%100!=11?a[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?a[1]:a[2]}({ss:t?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:t?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:t?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"}[a],+e)}", "function localizeMoment(mom) {\n\t\tif ('_locale' in mom) { // moment 2.8 and above\n\t\t\tmom._locale = localeData;\n\t\t}\n\t\telse { // pre-moment-2.8\n\t\t\tmom._lang = localeData;\n\t\t}\n\t}", "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}else{if(typeof console!=='undefined'&&console.warn){//warn user if arguments are passed but the locale could not be set\nconsole.warn('Locale '+key+' not found. Did you forget to load it?');}}}return globalLocale._abbr;}", "function localizeMoment(mom) {\n\t\tmom._locale = localeData;\n\t}", "function hd(i,ee,te){return i+\" \"+function kd(i,ee){return 2===ee?function ld(i){var ee={m:\"v\",b:\"v\",d:\"z\"};return void 0===ee[i.charAt(0)]?i:ee[i.charAt(0)]+i.substring(1)}\n//! moment.js locale configuration\n//! locale : bosnian (bs)\n//! author : Nedim Cholich : https://github.com/frontyard\n//! based on (hr) translation by Bojan Marković\n(i):i}({mm:\"munutenn\",MM:\"miz\",dd:\"devezh\"}[te],i)}", "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}}return globalLocale._abbr;}", "function localizeMoment(mom) {\n\t\t\tmom._locale = localeData;\n\t\t}", "function Io(e,t,n){var i={mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},o=\" \";return(e%100>=20||e>=100&&e%100===0)&&(o=\" de \"),e+o+i[n]}//! moment.js locale configuration", "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data = getLocale(key);}else {data = defineLocale(key,values);}if(data){ // moment.duration._locale = moment._locale = data;\nglobalLocale = data;}else {if(typeof console !== 'undefined' && console.warn){ //warn user if arguments are passed but the locale could not be set\nconsole.warn('Locale ' + key + ' not found. Did you forget to load it?');}}}return globalLocale._abbr;}", "function locale_locales__getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=locale_locales__getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\r\n\tglobalLocale=data;}}return globalLocale._abbr;}", "function locale_locales__getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=locale_locales__getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\r\n\tglobalLocale=data;}}return globalLocale._abbr;}", "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n __f__(\"warn\",\n 'Locale ' + key + ' not found. Did you forget to load it?', \" at node_modules/moment/moment.js:2121\");\n\n }\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else\n {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else\n {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n __f__(\"warn\", 'Locale ' + key + ' not found. Did you forget to load it?', \" at node_modules/moment/moment.js:1880\");\n }\n }\n }\n\n return globalLocale._abbr;\n }", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "static getLocale() {\n return 'en_US';\n }", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}" ]
[ "0.82635474", "0.803583", "0.7878269", "0.7548106", "0.72040725", "0.71984273", "0.7174624", "0.71708643", "0.7132608", "0.7130732", "0.7045036", "0.66717654", "0.66717654", "0.6335232", "0.62935024", "0.62765163", "0.62765163", "0.62765163", "0.62765163", "0.6211631", "0.6094649", "0.60929024", "0.60929024", "0.60929024", "0.60929024", "0.60929024", "0.60782045", "0.60782045", "0.60782045", "0.60782045", "0.60782045", "0.60782045", "0.6077035", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029" ]
0.0
-1
! moment.js locale configuration
function t(e,t,n,r){var i={s:["thoddea sekondamni","thodde sekond"],ss:[e+" sekondamni",e+" sekond"],m:["eka mintan","ek minut"],mm:[e+" mintamni",e+" mintam"],h:["eka voran","ek vor"],hh:[e+" voramni",e+" voram"],d:["eka disan","ek dis"],dd:[e+" disamni",e+" dis"],M:["eka mhoinean","ek mhoino"],MM:[e+" mhoineamni",e+" mhoine"],y:["eka vorsan","ek voros"],yy:[e+" vorsamni",e+" vorsam"]};return r?i[n][0]:i[n][1]}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cl(e,t,n){return\"m\"===n?t?\"минута\":\"минуту\":e+\" \"+\n//! moment.js locale configuration\n//! locale : Russian [ru]\n//! author : Viktorminator : https://github.com/Viktorminator\n//! Author : Menelion Elensúle : https://github.com/Oire\n//! author : Коренберг Марк : https://github.com/socketpair\nfunction(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}({ss:t?\"секунда_секунды_секунд\":\"секунду_секунды_секунд\",mm:t?\"минута_минуты_минут\":\"минуту_минуты_минут\",hh:\"час_часа_часов\",dd:\"день_дня_дней\",MM:\"месяц_месяца_месяцев\",yy:\"год_года_лет\"}[n],+e)}", "function Os(e,t,n){return\"m\"===n?t?\"хвилина\":\"хвилину\":\"h\"===n?t?\"година\":\"годину\":e+\" \"+\n//! moment.js locale configuration\nfunction(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}({ss:t?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:t?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:t?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"}[n],+e)}", "function At(e,t,a){return\"m\"===a?t?\"хвилина\":\"хвилину\":\"h\"===a?t?\"година\":\"годину\":e+\" \"+\n//! moment.js locale configuration\nfunction(e,t){var a=e.split(\"_\");return t%10==1&&t%100!=11?a[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?a[1]:a[2]}({ss:t?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:t?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:t?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"}[a],+e)}", "function localizeMoment(mom) {\n\t\tif ('_locale' in mom) { // moment 2.8 and above\n\t\t\tmom._locale = localeData;\n\t\t}\n\t\telse { // pre-moment-2.8\n\t\t\tmom._lang = localeData;\n\t\t}\n\t}", "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}else{if(typeof console!=='undefined'&&console.warn){//warn user if arguments are passed but the locale could not be set\nconsole.warn('Locale '+key+' not found. Did you forget to load it?');}}}return globalLocale._abbr;}", "function localizeMoment(mom) {\n\t\tmom._locale = localeData;\n\t}", "function hd(i,ee,te){return i+\" \"+function kd(i,ee){return 2===ee?function ld(i){var ee={m:\"v\",b:\"v\",d:\"z\"};return void 0===ee[i.charAt(0)]?i:ee[i.charAt(0)]+i.substring(1)}\n//! moment.js locale configuration\n//! locale : bosnian (bs)\n//! author : Nedim Cholich : https://github.com/frontyard\n//! based on (hr) translation by Bojan Marković\n(i):i}({mm:\"munutenn\",MM:\"miz\",dd:\"devezh\"}[te],i)}", "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}}return globalLocale._abbr;}", "function localizeMoment(mom) {\n\t\t\tmom._locale = localeData;\n\t\t}", "function Io(e,t,n){var i={mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},o=\" \";return(e%100>=20||e>=100&&e%100===0)&&(o=\" de \"),e+o+i[n]}//! moment.js locale configuration", "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data = getLocale(key);}else {data = defineLocale(key,values);}if(data){ // moment.duration._locale = moment._locale = data;\nglobalLocale = data;}else {if(typeof console !== 'undefined' && console.warn){ //warn user if arguments are passed but the locale could not be set\nconsole.warn('Locale ' + key + ' not found. Did you forget to load it?');}}}return globalLocale._abbr;}", "function locale_locales__getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=locale_locales__getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\r\n\tglobalLocale=data;}}return globalLocale._abbr;}", "function locale_locales__getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=locale_locales__getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\r\n\tglobalLocale=data;}}return globalLocale._abbr;}", "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n __f__(\"warn\",\n 'Locale ' + key + ' not found. Did you forget to load it?', \" at node_modules/moment/moment.js:2121\");\n\n }\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else\n {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else\n {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n __f__(\"warn\", 'Locale ' + key + ' not found. Did you forget to load it?', \" at node_modules/moment/moment.js:1880\");\n }\n }\n }\n\n return globalLocale._abbr;\n }", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "static getLocale() {\n return 'en_US';\n }", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}" ]
[ "0.82627255", "0.80355096", "0.7878359", "0.75476736", "0.72037613", "0.71981734", "0.71757025", "0.7170814", "0.71322805", "0.7130772", "0.7044428", "0.667163", "0.667163", "0.6334324", "0.6292554", "0.62773275", "0.62773275", "0.62773275", "0.62773275", "0.62090504", "0.6093498", "0.60916936", "0.60916936", "0.60916936", "0.60916936", "0.60916936", "0.60770184", "0.60770184", "0.60770184", "0.60770184", "0.60770184", "0.60770184", "0.60759085", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914" ]
0.0
-1
! betternormalscroll v1.15.0 (c) 20162019 ustbhuangyi Released under the MIT License.
function r(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mkdOnWindowScroll() {\n \n }", "function OCM_scrolling() {\r\n\t\t\t\t\t\r\n\t\t\t\t\t$offCanvasEl.mousewheel(function (event, delta) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tthis.scrollTop -= (delta * 30);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tevent.preventDefault();\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t}", "function bgenScroll(e) {\n if (window.pageYOffset != null) {\n st = window.pageYOffset + '';\n }\n if (document.body.scrollWidth != null) {\n if (document.body.scrollTop) {\n st = document.body.scrollTop;\n }\n st = document.documentElement.scrollTop;\n }\n setTimeout('window.scroll(0,st)', 50);\n}", "function edgtfOnWindowScroll() {\n \n }", "function VirtualScrollStrategy() {}", "function VirtualScrollStrategy() {}", "function VirtualScrollStrategy() {}", "function VirtualScrollStrategy() {}", "function updateScroll(){if(!elements.li[0])return;var height=elements.li[0].offsetHeight,top=height*ctrl.index,bot=top+height,hgt=elements.scroller.clientHeight,scrollTop=elements.scroller.scrollTop;if(top<scrollTop){scrollTo(top);}else if(bot>scrollTop+hgt){scrollTo(bot-hgt);}}", "function VirtualScrollStrategy() { }", "function VirtualScrollStrategy() { }", "scroll() {\n const env = this;\n const container = this['$container']['$node'];\n container.parentNode.addEventListener( 'scroll', function( e ) {\n env['$content'].scrollTop = container.parentNode.scrollTop;\n env['$content'].scrollLeft = container.parentNode.scrollLeft;\n env.setPage();\n });\n }", "function cust_PageScroll(ref) {\n\n}", "function qodeOnWindowScroll() {\n\t qodeInitNewsShortcodesPagination().scroll();\n }", "initScroll() {\n this.libraryView.effetLibrarySelect.scrollTop += 1;\n this.libraryView.exempleLibrarySelect.scrollTop += 1;\n this.libraryView.intrumentLibrarySelect.scrollTop += 1;\n }", "function mkdfOnWindowScroll() {\n\n }", "function ViewportScrollPosition() { }", "function ViewportScrollPosition() { }", "function updateScroll(){\n historique.scrollTop = historique.scrollHeight;\n}", "function UpdateScrollThumbs()\n{\n UpdateVerticalScrollVisual();\n UpdateHorizontalScrollVisual();\n}", "function scrollStart() {\n // Hide context menu if showing\n component.hideContextMenu();\n // Bind clickout scroll\n //component.layers[\"clickout\"].on(\"scroll\", onChangeLayout);\n }", "handleScroll() {\n // //for a perfect page infinit loading ...\n let elements = document.getElementsByClassName(\"masonry\");\n let short = this.getShortestCol(elements)\n // console.log(short)\n let rect;\n if(short){\n rect = short.getBoundingClientRect();\n // if \"half port view height\" near to bottom trigger load more\n if(rect.bottom <= (window.innerHeight * 2 || document.documentElement.clientHeight * 2)){\n if(!this.state.bottom){\n // console.log(\"bottoooom\")\n this.setState({\n bottom: true,\n next: this.state.next +1,\n });\n }\n\n }else{\n if(this.state.bottom){\n // console.log(\"not bottom\")\n this.setState({\n bottom: false\n });\n }\n }\n\n }\n\n }", "function updateScroll () {\n if (!elements.li[0]) return;\n if (mode === MODE_STANDARD) {\n updateStandardScroll();\n } else {\n updateVirtualScroll();\n }\n }", "handleScroll() {\n if(this.scroller) {\n const heightOfContent = this.scroller.offsetHeight;\n const yOffset = window.pageYOffset;\n const wholeY = yOffset + window.innerHeight;\n if(wholeY >= heightOfContent) {\n this.lazyLoad();\n }\n }\n\n }", "function ViewportScrollPosition() {}", "function ViewportScrollPosition() {}", "function ViewportScrollPosition() {}", "function ViewportScrollPosition() {}", "function eltdfOnWindowScroll() {\n\n }", "function eltdfOnWindowScroll() {\n }", "function eltdfOnWindowScroll() {\n }", "function onScroll() {\r\n requestTick();\r\n}", "onscroll(event) {\n let target = event.target.scrollingElement;\n let posAtual = target.scrollTop;\n let maxScroll = target.scrollTopMax;\n if (posAtual > maxScroll * 0.9 && !this.variables.getCarregandoMaisComics()) {\n this.variables.setCarregandoMaisComics(true);\n this.comics.getComics(this.variables.getTituloBusca(), this.variables.getComics().length).subscribe(comics => {\n this.variables.setComics(comics.data.results, false);\n this.variables.setCarregandoMaisComics(false);\n });\n }\n }", "function customScroll(elemento) {\n if ($.fn.mCustomScrollbar) {\n //$('.withScroll').each(function() {\n $(elemento).mCustomScrollbar(\"destroy\");\n var scroll_height = $(elemento).data('height') ? $(elemento).data('height') : 'auto';\n var data_padding = $(elemento).data('padding') ? $(elemento).data('padding') : 0;\n if ($(elemento).data('height') == 'window') {\n thisHeight = $(elemento).height();\n windowHeight = $(window).height() - data_padding - 50;\n if (thisHeight < windowHeight) scroll_height = thisHeight;\n else scroll_height = windowHeight;\n }\n $(elemento).mCustomScrollbar({\n scrollButtons: {\n enable: false\n },\n autoHideScrollbar: $(elemento).hasClass('show-scroll') ? false : true,\n scrollInertia: 150,\n theme: \"light\",\n set_height: scroll_height,\n advanced: {\n updateOnContentResize: true\n }\n });\n //});\n }\n}", "function activateScroll()\n{\n windowResize();\n\n if (onePageScrollActive)\n {\n new fullScroll({\n mainElement: \"main\",\n displayDots: true,\n dotsPosition: \"left\",\n animateTime: 0.7,\n animateFunction: \"ease\",\n });\n } \n}", "updateScroll(){\n \t\tif (this.$.content.scrollHeight > this.$.content.offsetHeight){\n \t\t\tthis.$.content.scrollTop = this.$.content.scrollHeight - this.$.content.offsetHeight;\n \t\t}\n \t}", "_scrollHandler () {}", "function customScroll() {\n $( '.cn-custom-scroll' ).mCustomScrollbar( {\n theme: \"dark-2\",\n scrollEasing: \"linear\",\n scrollInertia: 200,\n } );\n\n $( '.cn-custom-scroll-inner' ).bind( 'mousewheel DOMMouseScroll', function( e ) {\n var e0 = e.originalEvent,\n delta = e0.wheelDelta || -e0.detail;\n\n this.scrollTop += ( delta < 0 ? 1 : -1 ) * 30;\n e.preventDefault();\n } );\n }", "function initializeScrollbar() { \n $(\".mcustomScroll\").mCustomScrollbar({ \n theme:\"dark-3\",\n axis:\"yx\",\n advanced:{\n updateOnContentResize: true\n }\n });\n\n $(\".mcustomScroll.mcustomScrollVerticalOnly\").mCustomScrollbar({ \n theme:\"dark-3\",\n axis:\"y\",\n advanced:{\n updateOnContentResize: true\n }\n });\n }", "function bgenScroll()\n{\n // DESCRIPTION:\n // When using CSS-Targets, a <a href=\"#anchor\"> is required.\n // To prevent the page from jumping to the anchor and therefor putting\n // it on top of the page, the <a>-Tag needs to contain the following event:\n // onclick=\"bgenScroll();\"\n\n if (window.pageYOffset!= null)\n {\n st=window.pageYOffset+\"\";\n }\n\n if (document.body.scrollWidth!= null)\n {\n if (document.body.scrollTop)\n {\n st=document.body.scrollTop;\n }\n st=document.documentElement.scrollTop;\n }\n setTimeout(\"window.scroll(0,st)\",10);\n}", "function ScrollPosition() {}", "function $a(e,t){var a=e.display,n=ya(e.display);t.top<0&&(t.top=0);var r=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:a.scroller.scrollTop,f=qt(e),o={};t.bottom-t.top>f&&(t.bottom=t.top+f);var i=e.doc.height+Bt(a),s=t.top<n,c=t.bottom>i-n;if(t.top<r)o.scrollTop=s?0:t.top;else if(t.bottom>r+f){var u=Math.min(t.top,(c?i:t.bottom)-f);u!=r&&(o.scrollTop=u)}var l=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:a.scroller.scrollLeft,d=zt(e)-(e.options.fixedGutter?a.gutters.offsetWidth:0),_=t.right-t.left>d;return _&&(t.right=t.left+d),t.left<10?o.scrollLeft=0:t.left<l?o.scrollLeft=Math.max(0,t.left-(_?0:10)):t.right>d+l-3&&(o.scrollLeft=t.right+(_?0:10)-d),o}", "get _scrollBottom(){return this._scrollPosition+this._viewportHeight;}", "[scroll]() {\n if (!this.scrollableElement || !this.currentMousePosition) {\n return;\n }\n\n cancelAnimationFrame(this.scrollAnimationFrame);\n\n const { speed, sensitivity } = this.options;\n\n const rect = this.scrollableElement.getBoundingClientRect();\n const bottomCutOff = rect.bottom > window.innerHeight;\n const topCutOff = rect.top < 0;\n const cutOff = topCutOff || bottomCutOff;\n\n const documentScrollingElement = getDocumentScrollingElement();\n const scrollableElement = this.scrollableElement;\n const clientX = this.currentMousePosition.clientX;\n const clientY = this.currentMousePosition.clientY;\n\n if (scrollableElement !== document.body && scrollableElement !== document.documentElement && !cutOff) {\n const { offsetHeight, offsetWidth } = scrollableElement;\n\n if (rect.top + offsetHeight - clientY < sensitivity) {\n scrollableElement.scrollTop += speed;\n } else if (clientY - rect.top < sensitivity) {\n scrollableElement.scrollTop -= speed;\n }\n\n if (rect.left + offsetWidth - clientX < sensitivity) {\n scrollableElement.scrollLeft += speed;\n } else if (clientX - rect.left < sensitivity) {\n scrollableElement.scrollLeft -= speed;\n }\n } else {\n const { innerHeight, innerWidth } = window;\n\n if (clientY < sensitivity) {\n documentScrollingElement.scrollTop -= speed;\n } else if (innerHeight - clientY < sensitivity) {\n documentScrollingElement.scrollTop += speed;\n }\n\n if (clientX < sensitivity) {\n documentScrollingElement.scrollLeft -= speed;\n } else if (innerWidth - clientX < sensitivity) {\n documentScrollingElement.scrollLeft += speed;\n }\n }\n\n this.scrollAnimationFrame = requestAnimationFrame(this[scroll]);\n }", "function initScroll(){var windowH=$(window).height(),newW=windowH/1400*29232+1e3/windowH*3;scrollWidth=newW-$(window).width(),$(\".helper\").width(newW),$(\"#wrapper,.helper\").height(windowH),myscroll=new iScroll(\"wrapper\",{hScrollbar:!0,useTransition:!0,hScroll:!0,vScroll:!1,checkDOMChanges:!0,bounce:!1,scrollbarClass:\"myScrollbar\"}),\n// \nmyscroll.options.onScrollStart=function(){\"block\"==$(\".detail\").css(\"display\")&&($(\".detail\").css(\"display\",\"none\"),$(\"#daoyu\").attr(\"id\",\"\")),\"block\"==$(\".detail-w\").css(\"display\")&&($(\".detail-w\").css(\"display\",\"none\"),$(\"#daoyu\").attr(\"id\",\"\"))},myscroll.options.onScrollEnd=function(){$(\".myScrollbarH\").hide(),timer&&clearTimeout(timer),timer=setTimeout(function(){clearTimeout(timer),timer=null,myscroll.scrollTo(myscroll.x+scrollWidth,0,Math.abs(5e5*(scrollWidth+myscroll.x)/scrollWidth),\"relative\")},2e4)},myscroll.scrollTo(scrollWidth,0,5e5,\"relative\"),$(\".myScrollbarH\").hide()}", "function hsClickScroll()\n {\n var imageOffset = self.getOffsetRect(this).top; \n var clientOffset = (docElement.clientHeight-hs.maxHeight) / 2;\n window.scrollTo(0,imageOffset-clientOffset);\n }", "function updateScreenshotScroll() {\r\n if (!isMobile) { \r\n $('#screenshots').slimScroll(slimOptionsContent); \r\n }\r\n}", "function updateScroll(){\n var treshold = 5;\n ux.scroll.offsetPrevious = ux.scroll.offset;\n ux.scroll.offset = $(window).scrollTop();\n \n // We compare distance traveled with a defined treshold and report scroll direction\n if( ux.scroll.offset - ux.scroll.offsetPrevious > treshold ){\n ux.scroll.direction = 'down';\n } else if( ux.scroll.offsetPrevious - ux.scroll.offset > treshold ){\n ux.scroll.direction = 'up';\n }\n \n ux.viewport.visibleTop = ux.scroll.offset\n ux.viewport.visibleBottom = ux.viewport.height + ux.scroll.offset;\n}", "function throttledScrollEvents() {\n\n }", "function setScrollingArguments0() {\n elem_position = \"0\";\n elem_name = 'body'\n }", "function setScrolling()\n {\n scrolling = true;\n }", "function customScroll() {\n if ($.fn.mCustomScrollbar) {\n $('.withScroll').each(function() {\n $(this).mCustomScrollbar(\"destroy\");\n var scroll_height = $(this).data('height') ? $(this).data('height') : 'auto';\n var data_padding = $(this).data('padding') ? $(this).data('padding') : 0;\n if ($(this).data('height') == 'window') {\n thisHeight = $(this).height();\n windowHeight = $(window).height() - data_padding - 50;\n if (thisHeight < windowHeight) scroll_height = thisHeight;\n else scroll_height = windowHeight;\n }\n $(this).mCustomScrollbar({\n scrollButtons: {\n enable: false\n },\n autoHideScrollbar: $(this).hasClass('show-scroll') ? false : true,\n scrollInertia: 150,\n theme: \"light\",\n set_height: scroll_height,\n advanced: {\n updateOnContentResize: true\n }\n });\n });\n }\n}", "function setCustomScrollBars() {\n /* * * M a l i h u j Q u e r y C u s t o m C o n t e n t S c r o l l e r : BEGIN * * */\n /*http://manos.malihu.gr/jquery-custom-content-scroller/*/\n //$(\".consoleLogOutput\").append('<div class=\"consoleLog_helm\">$(window).load() event starting.</div>');\n if (Compass.Global.isInternetExplorer === false) {\n $(\"#LoanDatesPanelContent_helm\").mCustomScrollbar({\n theme: \"dark\",\n alwaysShowScrollbar: 0, //Disable scrolll bar when there’s nothing to scroll.\n //scrollbarPosition: \"outside\",\n snapAmount: 26,\n snapOffset: 3,\n mouseWheel: {\n deltaFactor: 28,\n normalizeDelta: false\n },\n callbacks: {\n onScrollStart: function () {\n Compass.Helm.hideHelpPopOvers();\n }\n },\n scrollInertia: 500\n\n });\n $(\"#LoanContactsListContainer_helm\").mCustomScrollbar({\n theme: \"dark\",\n alwaysShowScrollbar: 0, //Disable scrolll bar when there’s nothing to scroll.\n //scrollbarPosition: \"outside\",\n snapAmount: 26,\n snapOffset: 3,\n mouseWheel: {\n deltaFactor: 28,\n normalizeDelta: false\n },\n scrollInertia: 500\n\n });\n }\n /* * * M a l i h u j Q u e r y C u s t o m C o n t e n t S c r o l l e r : END * * */\n }", "set scrolling(scrolling) {\n this._scrolling = scrolling;\n }", "get _scrollBottom(){return this._scrollPosition+this._viewportHeight}", "function eltdOnWindowScrollHeader() {\n \n }", "scroll() {\r\n window.onscroll = () => {\r\n let bottomOfWindow = document.documentElement.scrollTop + window.innerHeight >= (document.documentElement.offsetHeight - 200);\r\n if (bottomOfWindow) {\r\n this.page++\r\n if(this.searchedTitle === \"\"){\r\n this.searchPopular()\r\n } else if(this.genreSelected === \"All\"){\r\n this.searchFilm()\r\n this.searchTv()\r\n } else if(this.genreSelected === \"Films\") {\r\n this.searchFilm()\r\n } else {\r\n this.searchTv()\r\n }\r\n }\r\n };\r\n }", "scrollBehavior() {\n return { x: 0, y: 0 };\n }", "function fullscreenBioScrolling() {\r\n\t\t\t\t\t$('.nectar_team_member_overlay .inner-wrap').mousewheel(function (event, delta) {\r\n\t\t\t\t\t\tthis.scrollTop -= (delta * 30);\r\n\t\t\t\t\t\tevent.preventDefault();\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t}", "function resetMaxScrolls()\n {\n var offsets = getPageOffsets();\n\n var x = offsets[0];\n minXOffset = x;\n maxXOffset = x;\n\n var y = offsets[1];\n minYOffset = y;\n maxYOffset = y;\n }", "start() {\n\t\tthis.scroll.start();\n\t}", "function scroll() {\n d3.select(window)\n .on('scroll.scroller', position)\n .on('resize.scroller', resize)\n resize();\n let timer = d3.timer(function() {\n position();\n timer.stop();\n });\n }", "function gscroll(cont) {\n if (cont) {\n return [{ c: cont, y: 1 }];\n }\n }", "update() {\n\t\tthis.scroll.update();\n\t}", "jump() {\n const env = this;\n const container = this['$container']['$node'];\n container.parentNode.addEventListener( 'scroll', function( e ) {\n env['$content'].scrollTop = container.parentNode.scrollTop;\n env['$content'].scrollLeft = container.parentNode.scrollLeft;\n env.setPage();\n });\n }", "function customScroll() {\r\n\t\tvar windowWidth = $(window).width();\r\n\t\tif (windowWidth > 991) {\r\n\t\t\t// Custom Subpage Scroll\r\n\t\t\t$(\".pt-page\").mCustomScrollbar({\r\n\t\t\t\tscrollInertia: 8\r\n\t\t\t});\r\n\r\n\t\t\t// Custom Header Scroll\r\n\t\t\t$(\"#site_header\").mCustomScrollbar({\r\n\t\t\t\tscrollInertia: 8\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\t$(\".pt-page\").mCustomScrollbar('destroy');\r\n\r\n\t\t\t$(\"#site_header\").mCustomScrollbar('destroy');\r\n\t\t}\r\n\t}", "handleScroll(){\n this.setState({\n detachIOPanel: window.scrollY > 80\n });\n }", "handleScroll() {\n const { scrollPos } = this.state;\n this.setState({\n scrollPos: document.body.getBoundingClientRect().top,\n show: document.body.getBoundingClientRect().top > scrollPos\n });\n }", "function createScrollBarForAll(){\n if($('body').hasClass(RESPONSIVE)){\n removeResponsiveScrollOverflows();\n }\n else{\n forEachSectionAndSlide(createScrollBar);\n }\n }", "function onScroll() {\n lastScrollY = window.scrollY;\n requestFrame();\n}", "function C16101_KeyWord_Mouse_Wheel_to_Scroll()\n{ \ntry{\n Log.AppendFolder(\"C16101_KeyWord_Mouse_Wheel_to_Scroll\");\n InitializationEnviornment.initiliaze();\n AppLoginLogout.login();\n passportPOS.listListgroup.Refresh();\n aqUtils.Delay(1000);\n var keyWordName =\"Trade\";\n WrapperFunction.selectKeywordName(keyWordName);\n passportPOS.listListgroup.Refresh();\n aqUtils.Delay(1000);\n keyWordName =\"Reservations\";\n WrapperFunction.selectKeywordName(keyWordName);\n passportPOS.listListgroup.Refresh();\n aqUtils.Delay(1000);\n keyWordName =\"Taxes and Fees\";\n WrapperFunction.selectKeywordName(keyWordName);\n// var wnd = Aliases.Passport_POS.wndApolloRuntimeContentWindow;\n// var passportPOS = wnd.passportposPassportpos1;\n// var Keyword_Listgroup =passportPOS.Keyword_Listgroup;\n// var allItemCnt = Keyword_Listgroup.ItemCount;\n// temp = Keyword_Listgroup.FindAllChildren(\"Visible\",\"True\" ,1, true);\n// var visibleItemCnt = temp.length;\n// var counter = allItemCnt - visibleItemCnt; \n// cnt = Keyword_Listgroup.ChildCount;\n// flag = false; \n// while(!flag){\n// if (counter == 0){\n// flag = true;\n// merlinLogError(\"Scroll is not working correctly.\");\n// break;\n// }\n// counter -- ; \n// Keyword_Listgroup.MouseWheel(-1);\n// Keyword_Listgroup.Refresh();\n// Log.Message(\"--\"+counter);\n// cnt = Keyword_Listgroup.ChildCount;\n// for(let i = 0 ; i < cnt ; i++){\n// if((Keyword_Listgroup.Child(i).Visible)&&(Keyword_Listgroup.Child(i).Caption == \"Promo Codes\")){\n// Keyword_Listgroup.MouseWheel(-1);\n// flag = true;\n// Log.Message(\"Scroll functionality working correctly.\");\n// break;\n// }\n// } \n// } \n AppLoginLogout.logout(); \n } catch (e) {\n\t merlinLogError(\"Oops! There's some glitch in the script: \" + e.message);\t \n }\n finally { \n\t Log.PopLogFolder();\n } \n}", "function eltdOnWindowScrollHeaderBehaviour() {\n }", "scrollBehavior () {\n return { x: 0, y: 0 }\n }", "function cs_nicescroll(){\r\n\t\t'use strict';\t\r\n\t\tvar nice = jQuery(\"html\").niceScroll({mousescrollstep: \"20\",scrollspeed: \"150\",}); \r\n\t}", "function onScroll() {\n _lastScrollY = window.scrollY;\n requestTick();\n }", "controlScroll(e) {\n const event = e.nativeEvent;\n const interval = Dimensions.get('window').width - (dimensions.widthWeight * 57);\n\n let rate = event.contentOffset.x / interval\n - Math.floor(event.contentOffset.x / interval);\n let moveTo;\n if (rate <= 0.25 || rate >= 0.75) {\n moveTo = (Math.round(event.contentOffset.x / interval));\n } else {\n moveTo = (event.contentOffset.x - this.state.scrollBegin >= 0) ?\n (Math.ceil(event.contentOffset.x / interval)) :\n (Math.floor(event.contentOffset.x / interval));\n }\n\n if (moveTo > this.props.dataSource._cachedRowCount - 1) {\n moveTo -= 1;\n } else if (moveTo < 0) {\n moveTo = 0;\n }\n\n this.resetListView.scrollTo({\n x: moveTo * interval,\n y: 0,\n animated: true,\n });\n\n }", "_addScrollBar() {\n const canvas = this.getCanvas();\n\n canvas.add(this._horizontalScroll);\n canvas.add(this._verticalScroll);\n\n if (this.scrollBarTid) {\n clearTimeout(this.scrollBarTid);\n }\n\n this.scrollBarTid = setTimeout(() => {\n canvas.remove(this._horizontalScroll);\n canvas.remove(this._verticalScroll);\n }, 3000);\n }", "appendScrollBar(){\n $('body').append('<div class=\"scroll position-fixed\" style=\"width:70px; bottom: 100%;right:1em; transition: all .3s ease-in-out\">' +\n '<img src=\"../../File/T--USTC-Software--scroll.png\"/>' +\n '<div class=\"position-relative backHead\" style=\"width: 70px; height: 110px; top: -110px; cursor: pointer;\"></div>' +\n '</div>');\n }", "function body_scroll(){\n\n\tdrag_manager.body_scroll = document.documentElement.scrollTop;\n\n}", "function handleScrollStop() {\n scrollEngaged = false;\n}", "function tinyScroll() {\n window.scrollBy(0, 1);\n}", "function onScroll() {\n latest = getScrollY();\n requestTick();\n }", "function updateScroll() {\n\t//gets the div class element that holds the list and the scroll.\n let element = document.getElementsByClassName(\"isgrP\")[0];\n element.scrollTop = element.scrollHeight;\n}", "updateScroll() {\n\t\t\tthis.scrollPosition = window.scrollY;\n\t\t}", "scrollPage(){\n setTimeout(() => {\n window.scrollBy(0, this.scrollDirection * AUTO_SCROLL_STEP);\n if(this.shouldScroll){\n this.scrollPage();\n }\n }, AUTO_SCROLL_DELAY);\n }", "function onIndexPageScroll() {\n var clientHeight = $(this).height();\n var scrollTop = Math.ceil($(this).scrollTop());\n var scrollHeight = $(document).height();\n if(scrollTop + clientHeight === scrollHeight){\n // Get the first then items from the grid, clone them, and add them to the bottom of the grid\n var $container = $(\"#waterfall\");\n var $items = $('div.item', $container);\n var $itemCount = $items.length;\n if ($itemCount < 100) {\n getIndexPicture(appendItemToWaterFall);\n }\n }\n}", "function detecteScroll() {\n var myElement= document.getElementsByClassName(\"right-side__product\")[0];\n // console.log(`the position scroll is :${window.scrollY}`);\n if( myElement.scrollHeight> window.scrollY) {\n gsap.to('.demande-btn', {opacity:1, height:\"auto\", display:\"block\", ease:\"ease-in\"});\n } else {\n gsap.to('.demande-btn', {opacity:0, height:0, display:\"none\"});\n }\n \n}", "function updateMaxScrolls()\n {\n var offsets = getPageOffsets();\n\n var x = offsets[0];\n if (x < minXOffset)\n {\n minXOffset = x;\n } else if (x > maxXOffset)\n {\n maxXOffset = x;\n }\n\n var y = offsets[1];\n if (y < minYOffset)\n {\n minYOffset = y;\n } else if (y > maxYOffset)\n {\n maxYOffset = y;\n }\n }", "scrollBehavior () {\n return { x: 0, y: 0 }\n }", "function onscrolling(){if($(document).scrollTop()+$(window).height() + 10/*some px before touch bottom*/ >= $(document).height()){console.log('loading...');loadquery();/*$(\"#container\").BlocksIt('reload');*/}}", "startScroll(element) {\n // VARIABLE QUE NOS PERMITIRA GUARDAR EL NUMERO DEL SCROLL EN EL QUE VA EL ELEMENTO Y COMPARARLO \n // CON EL OBJETIVO DE VER SI YA LLEGO A SU MAXIMO REINICIALIZAR EL SCROLL DEL ELEMENTO A 0 PARA HACER UNA ANIMACION \n // INFINITA\n let maxScroll = 0;\n var animateScroll = function(){ \n // SE AUMENTA 1 CADA VEZ QUE SE EJECUTA ESTA FUNCION AL SCROLLLEFT DEL ELEMENTO\n element.scrollLeft += 1;\n // ESTE COMPARATIVO REVISA SI EL SCROLL DEL ELEMENTO HA LLEGADO A SU MAXIMO DEBE REINICIALIZAR EL SCROLL A 0, \n // ES DECIR QUE EL ELEMENTO QUE SE MUESTRE SEA EL PRIMERO\n if(maxScroll === element.scrollLeft && element.scrollLeft !== 0){\n element.scrollLeft = 0\n }\n // SI EL SCROLL TODAVIA NO LLEGA A SU MAXIMO QUE SE GUARDE EL VALOR DEL SCROLLLEFT DEL ELEMENTO EN LA VARIABLE MAXSCROLL EL CUAL \n // EN UN FUTURO NOS AYUDARA A COMPARARLO \n else{\n maxScroll = element.scrollLeft;\n }\n // INTERVALO DE TIEMPO QUE EJECUTARA LA FUNCION HASTA QUE LE DIGAMOS QUE PARE\n setTime = setTimeout(animateScroll);\n };\n // EJECUTAMOS EL CALLBACK DE ESTA FUNCION\n animateScroll();\n }", "function Scroll(){\n\n const content = document.querySelector(\".content\");\n const sidebar = document.querySelector(\".sidebar\");\n const controller = new ScrollMagic.Controller();\n const scene = new ScrollMagic.Scene({\n triggerElement: sidebar,\n triggerHook: 0,\n offset: -140,\n duration: getDuration\n }).addTo(controller);\n if (window.matchMedia(\"(min-width: 1200px)\").matches) {\n scene.setPin(sidebar, {\n pushFollowers: false\n });\n }\n window.addEventListener(\"resize\", () => {\n if (window.matchMedia(\"(min-width: 1200px)\").matches) {\n scene.setPin(sidebar, {\n pushFollowers: false\n });\n } else {\n scene.removePin(sidebar, true);\n }\n });\n\n function getDuration() {\n return content.offsetHeight - sidebar.offsetHeight;\n }\n\n}", "function updateScroll () {\n if (!elements.li[0]) return;\n var height = elements.li[0].offsetHeight,\n top = height * ctrl.index,\n bot = top + height,\n hgt = elements.scroller.clientHeight,\n scrollTop = elements.scroller.scrollTop;\n if (top < scrollTop) {\n scrollTo(top);\n } else if (bot > scrollTop + hgt) {\n scrollTo(bot - hgt);\n }\n }", "function updateScroll () {\n if (!elements.li[0]) return;\n var height = elements.li[0].offsetHeight,\n top = height * ctrl.index,\n bot = top + height,\n hgt = elements.scroller.clientHeight,\n scrollTop = elements.scroller.scrollTop;\n if (top < scrollTop) {\n scrollTo(top);\n } else if (bot > scrollTop + hgt) {\n scrollTo(bot - hgt);\n }\n }", "function updateScroll () {\n if (!elements.li[0]) return;\n var height = elements.li[0].offsetHeight,\n top = height * ctrl.index,\n bot = top + height,\n hgt = elements.scroller.clientHeight,\n scrollTop = elements.scroller.scrollTop;\n if (top < scrollTop) {\n scrollTo(top);\n } else if (bot > scrollTop + hgt) {\n scrollTo(bot - hgt);\n }\n }", "function judgeScroll(){\n\n for(var j= 1 ; j < num.length ; j++ ){\n if ( num[j] < (wScrollTop + wH) ) {\n for ( var k = 0 ; k <= j ; k++){\n obj.eq(k).addClass('scrollIn');\n }\n }\n }\n }", "scrollBehavior() {\n return {\n top: 0\n }\n }", "setScroll() {\n this.canScroll = true\n }", "function Wa(e,t){null!=t&&(Qa(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}", "function scrollHandler()\n {\n updateMaxScrolls();\n activityHandler();\n }", "refreshVirtualScrollbars() {\n // NOTE: This was at some point changed to only run on platforms with width-occupying scrollbars, but it needs\n // to run with overlayed scrollbars also to make them show/hide as they should.\n const me = this,\n {\n headerContainer,\n footerContainer,\n virtualScrollers,\n hasVerticalOverflow\n } = me,\n // We need to ask each subGrid if it has horizontal overflow.\n // If any do, we show the virtual scroller, otherwise we hide it.\n hasHorizontalOverflow = Object.values(me.subGrids).some(subGrid => subGrid.overflowingHorizontally),\n method = hasVerticalOverflow ? 'add' : 'remove';\n\n if (hasHorizontalOverflow) {\n virtualScrollers.classList.remove('b-hide-display');\n } else {\n virtualScrollers.classList.add('b-hide-display');\n } // Auto-widthed padding element at end hides or shows to create matching margin.\n\n if (DomHelper.scrollBarWidth) {\n headerContainer.classList[method]('b-show-yscroll-padding');\n footerContainer.classList[method]('b-show-yscroll-padding');\n virtualScrollers.classList[method]('b-show-yscroll-padding');\n } // Change of scrollbar status means height change\n\n me.onHeightChange();\n }" ]
[ "0.691387", "0.67678505", "0.675519", "0.6720355", "0.67146266", "0.67146266", "0.67146266", "0.67146266", "0.6700945", "0.66830236", "0.66830236", "0.66798145", "0.6676134", "0.66471356", "0.6584729", "0.65828604", "0.65779155", "0.65779155", "0.65555125", "0.6535867", "0.65231574", "0.6512781", "0.64942855", "0.6484172", "0.64820063", "0.64820063", "0.64820063", "0.64820063", "0.6480147", "0.64710087", "0.64710087", "0.6468482", "0.64468384", "0.6442504", "0.64385754", "0.64262325", "0.64062315", "0.63974917", "0.6394765", "0.63780314", "0.63690627", "0.6367542", "0.63653547", "0.6364272", "0.6360052", "0.63579434", "0.63518316", "0.6349213", "0.63456076", "0.6312122", "0.63087606", "0.63059133", "0.6305198", "0.62946403", "0.62937534", "0.62605965", "0.6249859", "0.62317383", "0.62270206", "0.6221252", "0.6219096", "0.6215025", "0.6205664", "0.6204929", "0.62018234", "0.619316", "0.61908114", "0.61874336", "0.6183814", "0.6183752", "0.6183232", "0.61772823", "0.6172096", "0.6166192", "0.61635536", "0.6163461", "0.61595833", "0.615668", "0.6155127", "0.61539894", "0.61536115", "0.6146015", "0.613945", "0.6139326", "0.61360514", "0.61278754", "0.6126054", "0.61183506", "0.6104569", "0.61038023", "0.60904", "0.6076975", "0.60756224", "0.60756224", "0.60756224", "0.60691905", "0.6068631", "0.6054843", "0.6050982", "0.6050507", "0.6047928" ]
0.0
-1
! moment.js locale configuration
function t(e,t){var n=e.split("_");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cl(e,t,n){return\"m\"===n?t?\"минута\":\"минуту\":e+\" \"+\n//! moment.js locale configuration\n//! locale : Russian [ru]\n//! author : Viktorminator : https://github.com/Viktorminator\n//! Author : Menelion Elensúle : https://github.com/Oire\n//! author : Коренберг Марк : https://github.com/socketpair\nfunction(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}({ss:t?\"секунда_секунды_секунд\":\"секунду_секунды_секунд\",mm:t?\"минута_минуты_минут\":\"минуту_минуты_минут\",hh:\"час_часа_часов\",dd:\"день_дня_дней\",MM:\"месяц_месяца_месяцев\",yy:\"год_года_лет\"}[n],+e)}", "function Os(e,t,n){return\"m\"===n?t?\"хвилина\":\"хвилину\":\"h\"===n?t?\"година\":\"годину\":e+\" \"+\n//! moment.js locale configuration\nfunction(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}({ss:t?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:t?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:t?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"}[n],+e)}", "function At(e,t,a){return\"m\"===a?t?\"хвилина\":\"хвилину\":\"h\"===a?t?\"година\":\"годину\":e+\" \"+\n//! moment.js locale configuration\nfunction(e,t){var a=e.split(\"_\");return t%10==1&&t%100!=11?a[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?a[1]:a[2]}({ss:t?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:t?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:t?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"}[a],+e)}", "function localizeMoment(mom) {\n\t\tif ('_locale' in mom) { // moment 2.8 and above\n\t\t\tmom._locale = localeData;\n\t\t}\n\t\telse { // pre-moment-2.8\n\t\t\tmom._lang = localeData;\n\t\t}\n\t}", "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}else{if(typeof console!=='undefined'&&console.warn){//warn user if arguments are passed but the locale could not be set\nconsole.warn('Locale '+key+' not found. Did you forget to load it?');}}}return globalLocale._abbr;}", "function localizeMoment(mom) {\n\t\tmom._locale = localeData;\n\t}", "function hd(i,ee,te){return i+\" \"+function kd(i,ee){return 2===ee?function ld(i){var ee={m:\"v\",b:\"v\",d:\"z\"};return void 0===ee[i.charAt(0)]?i:ee[i.charAt(0)]+i.substring(1)}\n//! moment.js locale configuration\n//! locale : bosnian (bs)\n//! author : Nedim Cholich : https://github.com/frontyard\n//! based on (hr) translation by Bojan Marković\n(i):i}({mm:\"munutenn\",MM:\"miz\",dd:\"devezh\"}[te],i)}", "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}}return globalLocale._abbr;}", "function localizeMoment(mom) {\n\t\t\tmom._locale = localeData;\n\t\t}", "function Io(e,t,n){var i={mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},o=\" \";return(e%100>=20||e>=100&&e%100===0)&&(o=\" de \"),e+o+i[n]}//! moment.js locale configuration", "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data = getLocale(key);}else {data = defineLocale(key,values);}if(data){ // moment.duration._locale = moment._locale = data;\nglobalLocale = data;}else {if(typeof console !== 'undefined' && console.warn){ //warn user if arguments are passed but the locale could not be set\nconsole.warn('Locale ' + key + ' not found. Did you forget to load it?');}}}return globalLocale._abbr;}", "function locale_locales__getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=locale_locales__getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\r\n\tglobalLocale=data;}}return globalLocale._abbr;}", "function locale_locales__getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=locale_locales__getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\r\n\tglobalLocale=data;}}return globalLocale._abbr;}", "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n __f__(\"warn\",\n 'Locale ' + key + ' not found. Did you forget to load it?', \" at node_modules/moment/moment.js:2121\");\n\n }\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else\n {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else\n {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n __f__(\"warn\", 'Locale ' + key + ' not found. Did you forget to load it?', \" at node_modules/moment/moment.js:1880\");\n }\n }\n }\n\n return globalLocale._abbr;\n }", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "static getLocale() {\n return 'en_US';\n }", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}" ]
[ "0.82635474", "0.803583", "0.7878269", "0.7548106", "0.72040725", "0.71984273", "0.7174624", "0.71708643", "0.7132608", "0.7130732", "0.7045036", "0.66717654", "0.66717654", "0.6335232", "0.62935024", "0.62765163", "0.62765163", "0.62765163", "0.62765163", "0.6211631", "0.6094649", "0.60929024", "0.60929024", "0.60929024", "0.60929024", "0.60929024", "0.60782045", "0.60782045", "0.60782045", "0.60782045", "0.60782045", "0.60782045", "0.6077035", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029" ]
0.0
-1
! moment.js locale configuration
function t(e,t,n){var r=e+" ";switch(n){case"ss":return r+=1===e?"sekunda":2===e||3===e||4===e?"sekunde":"sekundi",r;case"m":return t?"jedna minuta":"jedne minute";case"mm":return r+=1===e?"minuta":2===e||3===e||4===e?"minute":"minuta",r;case"h":return t?"jedan sat":"jednog sata";case"hh":return r+=1===e?"sat":2===e||3===e||4===e?"sata":"sati",r;case"dd":return r+=1===e?"dan":"dana",r;case"MM":return r+=1===e?"mjesec":2===e||3===e||4===e?"mjeseca":"mjeseci",r;case"yy":return r+=1===e?"godina":2===e||3===e||4===e?"godine":"godina",r}}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cl(e,t,n){return\"m\"===n?t?\"минута\":\"минуту\":e+\" \"+\n//! moment.js locale configuration\n//! locale : Russian [ru]\n//! author : Viktorminator : https://github.com/Viktorminator\n//! Author : Menelion Elensúle : https://github.com/Oire\n//! author : Коренберг Марк : https://github.com/socketpair\nfunction(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}({ss:t?\"секунда_секунды_секунд\":\"секунду_секунды_секунд\",mm:t?\"минута_минуты_минут\":\"минуту_минуты_минут\",hh:\"час_часа_часов\",dd:\"день_дня_дней\",MM:\"месяц_месяца_месяцев\",yy:\"год_года_лет\"}[n],+e)}", "function Os(e,t,n){return\"m\"===n?t?\"хвилина\":\"хвилину\":\"h\"===n?t?\"година\":\"годину\":e+\" \"+\n//! moment.js locale configuration\nfunction(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}({ss:t?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:t?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:t?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"}[n],+e)}", "function At(e,t,a){return\"m\"===a?t?\"хвилина\":\"хвилину\":\"h\"===a?t?\"година\":\"годину\":e+\" \"+\n//! moment.js locale configuration\nfunction(e,t){var a=e.split(\"_\");return t%10==1&&t%100!=11?a[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?a[1]:a[2]}({ss:t?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:t?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:t?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"}[a],+e)}", "function localizeMoment(mom) {\n\t\tif ('_locale' in mom) { // moment 2.8 and above\n\t\t\tmom._locale = localeData;\n\t\t}\n\t\telse { // pre-moment-2.8\n\t\t\tmom._lang = localeData;\n\t\t}\n\t}", "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}else{if(typeof console!=='undefined'&&console.warn){//warn user if arguments are passed but the locale could not be set\nconsole.warn('Locale '+key+' not found. Did you forget to load it?');}}}return globalLocale._abbr;}", "function localizeMoment(mom) {\n\t\tmom._locale = localeData;\n\t}", "function hd(i,ee,te){return i+\" \"+function kd(i,ee){return 2===ee?function ld(i){var ee={m:\"v\",b:\"v\",d:\"z\"};return void 0===ee[i.charAt(0)]?i:ee[i.charAt(0)]+i.substring(1)}\n//! moment.js locale configuration\n//! locale : bosnian (bs)\n//! author : Nedim Cholich : https://github.com/frontyard\n//! based on (hr) translation by Bojan Marković\n(i):i}({mm:\"munutenn\",MM:\"miz\",dd:\"devezh\"}[te],i)}", "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}}return globalLocale._abbr;}", "function localizeMoment(mom) {\n\t\t\tmom._locale = localeData;\n\t\t}", "function Io(e,t,n){var i={mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},o=\" \";return(e%100>=20||e>=100&&e%100===0)&&(o=\" de \"),e+o+i[n]}//! moment.js locale configuration", "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data = getLocale(key);}else {data = defineLocale(key,values);}if(data){ // moment.duration._locale = moment._locale = data;\nglobalLocale = data;}else {if(typeof console !== 'undefined' && console.warn){ //warn user if arguments are passed but the locale could not be set\nconsole.warn('Locale ' + key + ' not found. Did you forget to load it?');}}}return globalLocale._abbr;}", "function locale_locales__getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=locale_locales__getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\r\n\tglobalLocale=data;}}return globalLocale._abbr;}", "function locale_locales__getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=locale_locales__getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\r\n\tglobalLocale=data;}}return globalLocale._abbr;}", "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n __f__(\"warn\",\n 'Locale ' + key + ' not found. Did you forget to load it?', \" at node_modules/moment/moment.js:2121\");\n\n }\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else\n {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else\n {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n __f__(\"warn\", 'Locale ' + key + ' not found. Did you forget to load it?', \" at node_modules/moment/moment.js:1880\");\n }\n }\n }\n\n return globalLocale._abbr;\n }", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "static getLocale() {\n return 'en_US';\n }", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}" ]
[ "0.82635474", "0.803583", "0.7878269", "0.7548106", "0.72040725", "0.71984273", "0.7174624", "0.71708643", "0.7132608", "0.7130732", "0.7045036", "0.66717654", "0.66717654", "0.6335232", "0.62935024", "0.62765163", "0.62765163", "0.62765163", "0.62765163", "0.6211631", "0.6094649", "0.60929024", "0.60929024", "0.60929024", "0.60929024", "0.60929024", "0.60782045", "0.60782045", "0.60782045", "0.60782045", "0.60782045", "0.60782045", "0.6077035", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029" ]
0.0
-1
! vuex v3.6.2 (c) 2021 Evan You
function r(e){var t=Number(e.version.split(".")[0]);if(t>=2)e.mixin({beforeCreate:r});else{var n=e.prototype._init;e.prototype._init=function(e){void 0===e&&(e={}),e.init=e.init?[r].concat(e.init):r,n.call(this,e)}}function r(){var e=this.$options;e.store?this.$store="function"===typeof e.store?e.store():e.store:e.parent&&e.parent.$store&&(this.$store=e.parent.$store)}}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getFieldVuex() {\n return store.getters.dataField;\n }", "getProfileVuex() {\n return store.getters.dataProfile;\n }", "function vuexInit(){var options=this.$options;// store injection\n\tif(options.store){this.$store=options.store;}else if(options.parent&&options.parent.$store){this.$store=options.parent.$store;}}", "function U(He){Le&&(He._devtoolHook=Le,Le.emit('vuex:init',He),Le.on('vuex:travel-to-state',function(Ne){He.replaceState(Ne)}),He.subscribe(function(Ne,je){Le.emit('vuex:mutation',Ne,je)}))}", "function vuexInit() {\n\t var options = this.$options;\n\t var store = options.store;\n\t var vuex = options.vuex;\n\t // store injection\n\t\n\t if (store) {\n\t this.$store = store;\n\t } else if (options.parent && options.parent.$store) {\n\t this.$store = options.parent.$store;\n\t }\n\t // vuex option handling\n\t if (vuex) {\n\t if (!this.$store) {\n\t console.warn('[vuex] store not injected. make sure to ' + 'provide the store option in your root component.');\n\t }\n\t var state = vuex.state;\n\t var getters = vuex.getters;\n\t var actions = vuex.actions;\n\t // handle deprecated state option\n\t\n\t if (state && !getters) {\n\t console.warn('[vuex] vuex.state option will been deprecated in 1.0. ' + 'Use vuex.getters instead.');\n\t getters = state;\n\t }\n\t // getters\n\t if (getters) {\n\t options.computed = options.computed || {};\n\t for (var key in getters) {\n\t defineVuexGetter(this, key, getters[key]);\n\t }\n\t }\n\t // actions\n\t if (actions) {\n\t options.methods = options.methods || {};\n\t for (var _key in actions) {\n\t options.methods[_key] = makeBoundAction(this.$store, actions[_key], _key);\n\t }\n\t }\n\t }\n\t }", "function vuexlocal() {\n return store => {\n // 判断是否有本地缓存如果有就取本地缓存的如果没有就取自身初始值\n let local = JSON.parse(localStorage.getItem('myVuex')) || store.replaceState(state)\n store.replaceState(local); // 替换state的数据\n store.subscribe((mutation,state) => { // 监听\n // 替换之前先取一次防止数据丢失\n let newstate = JSON.parse(JSON.stringify(state))\n localStorage.setItem('myVuex',JSON.stringify(newstate))\n })\n }\n}", "function vuexInit () {\n\t var options = this.$options;\n\t // store injection\n\t if (options.store) {\n\t this.$store = options.store;\n\t } else if (options.parent && options.parent.$store) {\n\t this.$store = options.parent.$store;\n\t }\n\t }", "function vuexInit () {\n\t var options = this.$options;\n\t // store injection\n\t if (options.store) {\n\t this.$store = options.store;\n\t } else if (options.parent && options.parent.$store) {\n\t this.$store = options.parent.$store;\n\t }\n\t }", "function vuexInit () {\n\t var options = this.$options;\n\t // store injection\n\t if (options.store) {\n\t this.$store = options.store;\n\t } else if (options.parent && options.parent.$store) {\n\t this.$store = options.parent.$store;\n\t }\n\t }", "function vuexInit () {\n\t var options = this.$options\n\t // store injection\n\t if (options.store) {\n\t this.$store = options.store\n\t } else if (options.parent && options.parent.$store) {\n\t this.$store = options.parent.$store\n\t }\n\t }", "users() {\n return this.$store.getters.users\n }", "function vuexInit () {\n\t var options = this.$options;\n\t // store injection\n\t if (options.store) {\n\t this.$store = typeof options.store === 'function'\n\t ? options.store()\n\t : options.store;\n\t } else if (options.parent && options.parent.$store) {\n\t this.$store = options.parent.$store;\n\t }\n\t }", "getTokenVuex() {\n return store.getters.jwt;\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\r\n var options = this.$options;\r\n // store injection\r\n if (options.store) {\r\n this.$store = typeof options.store === 'function'\r\n ? options.store()\r\n : options.store;\r\n } else if (options.parent && options.parent.$store) {\r\n this.$store = options.parent.$store;\r\n }\r\n }", "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function' ? options.store() : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function' ? options.store() : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function' ? options.store() : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function' ? options.store() : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function' ? options.store() : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }" ]
[ "0.6760562", "0.6703852", "0.66438663", "0.6288551", "0.6274809", "0.62527895", "0.6230704", "0.6230704", "0.6230704", "0.62251097", "0.6144431", "0.6115101", "0.61012393", "0.606092", "0.606092", "0.606092", "0.606092", "0.606092", "0.60600334", "0.6054526", "0.6018124", "0.5965885", "0.5965885", "0.5965885", "0.5965885", "0.5965885", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913", "0.59398913" ]
0.0
-1
! moment.js locale configuration
function t(e,t,n,r){var i={m:["eng Minutt","enger Minutt"],h:["eng Stonn","enger Stonn"],d:["een Dag","engem Dag"],M:["ee Mount","engem Mount"],y:["ee Joer","engem Joer"]};return t?i[n][0]:i[n][1]}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cl(e,t,n){return\"m\"===n?t?\"минута\":\"минуту\":e+\" \"+\n//! moment.js locale configuration\n//! locale : Russian [ru]\n//! author : Viktorminator : https://github.com/Viktorminator\n//! Author : Menelion Elensúle : https://github.com/Oire\n//! author : Коренберг Марк : https://github.com/socketpair\nfunction(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}({ss:t?\"секунда_секунды_секунд\":\"секунду_секунды_секунд\",mm:t?\"минута_минуты_минут\":\"минуту_минуты_минут\",hh:\"час_часа_часов\",dd:\"день_дня_дней\",MM:\"месяц_месяца_месяцев\",yy:\"год_года_лет\"}[n],+e)}", "function Os(e,t,n){return\"m\"===n?t?\"хвилина\":\"хвилину\":\"h\"===n?t?\"година\":\"годину\":e+\" \"+\n//! moment.js locale configuration\nfunction(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}({ss:t?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:t?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:t?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"}[n],+e)}", "function At(e,t,a){return\"m\"===a?t?\"хвилина\":\"хвилину\":\"h\"===a?t?\"година\":\"годину\":e+\" \"+\n//! moment.js locale configuration\nfunction(e,t){var a=e.split(\"_\");return t%10==1&&t%100!=11?a[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?a[1]:a[2]}({ss:t?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:t?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:t?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"}[a],+e)}", "function localizeMoment(mom) {\n\t\tif ('_locale' in mom) { // moment 2.8 and above\n\t\t\tmom._locale = localeData;\n\t\t}\n\t\telse { // pre-moment-2.8\n\t\t\tmom._lang = localeData;\n\t\t}\n\t}", "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}else{if(typeof console!=='undefined'&&console.warn){//warn user if arguments are passed but the locale could not be set\nconsole.warn('Locale '+key+' not found. Did you forget to load it?');}}}return globalLocale._abbr;}", "function localizeMoment(mom) {\n\t\tmom._locale = localeData;\n\t}", "function hd(i,ee,te){return i+\" \"+function kd(i,ee){return 2===ee?function ld(i){var ee={m:\"v\",b:\"v\",d:\"z\"};return void 0===ee[i.charAt(0)]?i:ee[i.charAt(0)]+i.substring(1)}\n//! moment.js locale configuration\n//! locale : bosnian (bs)\n//! author : Nedim Cholich : https://github.com/frontyard\n//! based on (hr) translation by Bojan Marković\n(i):i}({mm:\"munutenn\",MM:\"miz\",dd:\"devezh\"}[te],i)}", "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}}return globalLocale._abbr;}", "function localizeMoment(mom) {\n\t\t\tmom._locale = localeData;\n\t\t}", "function Io(e,t,n){var i={mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},o=\" \";return(e%100>=20||e>=100&&e%100===0)&&(o=\" de \"),e+o+i[n]}//! moment.js locale configuration", "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data = getLocale(key);}else {data = defineLocale(key,values);}if(data){ // moment.duration._locale = moment._locale = data;\nglobalLocale = data;}else {if(typeof console !== 'undefined' && console.warn){ //warn user if arguments are passed but the locale could not be set\nconsole.warn('Locale ' + key + ' not found. Did you forget to load it?');}}}return globalLocale._abbr;}", "function locale_locales__getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=locale_locales__getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\r\n\tglobalLocale=data;}}return globalLocale._abbr;}", "function locale_locales__getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=locale_locales__getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\r\n\tglobalLocale=data;}}return globalLocale._abbr;}", "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n __f__(\"warn\",\n 'Locale ' + key + ' not found. Did you forget to load it?', \" at node_modules/moment/moment.js:2121\");\n\n }\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else\n {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else\n {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n __f__(\"warn\", 'Locale ' + key + ' not found. Did you forget to load it?', \" at node_modules/moment/moment.js:1880\");\n }\n }\n }\n\n return globalLocale._abbr;\n }", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "static getLocale() {\n return 'en_US';\n }", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}" ]
[ "0.82635474", "0.803583", "0.7878269", "0.7548106", "0.72040725", "0.71984273", "0.7174624", "0.71708643", "0.7132608", "0.7130732", "0.7045036", "0.66717654", "0.66717654", "0.6335232", "0.62935024", "0.62765163", "0.62765163", "0.62765163", "0.62765163", "0.6211631", "0.6094649", "0.60929024", "0.60929024", "0.60929024", "0.60929024", "0.60929024", "0.60782045", "0.60782045", "0.60782045", "0.60782045", "0.60782045", "0.60782045", "0.6077035", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029" ]
0.0
-1
! moment.js locale configuration
function t(e,t,n){var r=e+" ";switch(n){case"ss":return r+=1===e?"sekunda":2===e||3===e||4===e?"sekunde":"sekundi",r;case"m":return t?"jedna minuta":"jedne minute";case"mm":return r+=1===e?"minuta":2===e||3===e||4===e?"minute":"minuta",r;case"h":return t?"jedan sat":"jednog sata";case"hh":return r+=1===e?"sat":2===e||3===e||4===e?"sata":"sati",r;case"dd":return r+=1===e?"dan":"dana",r;case"MM":return r+=1===e?"mjesec":2===e||3===e||4===e?"mjeseca":"mjeseci",r;case"yy":return r+=1===e?"godina":2===e||3===e||4===e?"godine":"godina",r}}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cl(e,t,n){return\"m\"===n?t?\"минута\":\"минуту\":e+\" \"+\n//! moment.js locale configuration\n//! locale : Russian [ru]\n//! author : Viktorminator : https://github.com/Viktorminator\n//! Author : Menelion Elensúle : https://github.com/Oire\n//! author : Коренберг Марк : https://github.com/socketpair\nfunction(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}({ss:t?\"секунда_секунды_секунд\":\"секунду_секунды_секунд\",mm:t?\"минута_минуты_минут\":\"минуту_минуты_минут\",hh:\"час_часа_часов\",dd:\"день_дня_дней\",MM:\"месяц_месяца_месяцев\",yy:\"год_года_лет\"}[n],+e)}", "function Os(e,t,n){return\"m\"===n?t?\"хвилина\":\"хвилину\":\"h\"===n?t?\"година\":\"годину\":e+\" \"+\n//! moment.js locale configuration\nfunction(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}({ss:t?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:t?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:t?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"}[n],+e)}", "function At(e,t,a){return\"m\"===a?t?\"хвилина\":\"хвилину\":\"h\"===a?t?\"година\":\"годину\":e+\" \"+\n//! moment.js locale configuration\nfunction(e,t){var a=e.split(\"_\");return t%10==1&&t%100!=11?a[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?a[1]:a[2]}({ss:t?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:t?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:t?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"}[a],+e)}", "function localizeMoment(mom) {\n\t\tif ('_locale' in mom) { // moment 2.8 and above\n\t\t\tmom._locale = localeData;\n\t\t}\n\t\telse { // pre-moment-2.8\n\t\t\tmom._lang = localeData;\n\t\t}\n\t}", "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}else{if(typeof console!=='undefined'&&console.warn){//warn user if arguments are passed but the locale could not be set\nconsole.warn('Locale '+key+' not found. Did you forget to load it?');}}}return globalLocale._abbr;}", "function localizeMoment(mom) {\n\t\tmom._locale = localeData;\n\t}", "function hd(i,ee,te){return i+\" \"+function kd(i,ee){return 2===ee?function ld(i){var ee={m:\"v\",b:\"v\",d:\"z\"};return void 0===ee[i.charAt(0)]?i:ee[i.charAt(0)]+i.substring(1)}\n//! moment.js locale configuration\n//! locale : bosnian (bs)\n//! author : Nedim Cholich : https://github.com/frontyard\n//! based on (hr) translation by Bojan Marković\n(i):i}({mm:\"munutenn\",MM:\"miz\",dd:\"devezh\"}[te],i)}", "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}}return globalLocale._abbr;}", "function localizeMoment(mom) {\n\t\t\tmom._locale = localeData;\n\t\t}", "function Io(e,t,n){var i={mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},o=\" \";return(e%100>=20||e>=100&&e%100===0)&&(o=\" de \"),e+o+i[n]}//! moment.js locale configuration", "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data = getLocale(key);}else {data = defineLocale(key,values);}if(data){ // moment.duration._locale = moment._locale = data;\nglobalLocale = data;}else {if(typeof console !== 'undefined' && console.warn){ //warn user if arguments are passed but the locale could not be set\nconsole.warn('Locale ' + key + ' not found. Did you forget to load it?');}}}return globalLocale._abbr;}", "function locale_locales__getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=locale_locales__getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\r\n\tglobalLocale=data;}}return globalLocale._abbr;}", "function locale_locales__getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=locale_locales__getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\r\n\tglobalLocale=data;}}return globalLocale._abbr;}", "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n __f__(\"warn\",\n 'Locale ' + key + ' not found. Did you forget to load it?', \" at node_modules/moment/moment.js:2121\");\n\n }\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else\n {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else\n {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n __f__(\"warn\", 'Locale ' + key + ' not found. Did you forget to load it?', \" at node_modules/moment/moment.js:1880\");\n }\n }\n }\n\n return globalLocale._abbr;\n }", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "static getLocale() {\n return 'en_US';\n }", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}" ]
[ "0.82635474", "0.803583", "0.7878269", "0.7548106", "0.72040725", "0.71984273", "0.7174624", "0.71708643", "0.7132608", "0.7130732", "0.7045036", "0.66717654", "0.66717654", "0.6335232", "0.62935024", "0.62765163", "0.62765163", "0.62765163", "0.62765163", "0.6211631", "0.6094649", "0.60929024", "0.60929024", "0.60929024", "0.60929024", "0.60929024", "0.60782045", "0.60782045", "0.60782045", "0.60782045", "0.60782045", "0.60782045", "0.6077035", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029" ]
0.0
-1
! moment.js locale configuration
function t(e,t,n){var r={mm:"munutenn",MM:"miz",dd:"devezh"};return e+" "+i(r[n],e)}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cl(e,t,n){return\"m\"===n?t?\"минута\":\"минуту\":e+\" \"+\n//! moment.js locale configuration\n//! locale : Russian [ru]\n//! author : Viktorminator : https://github.com/Viktorminator\n//! Author : Menelion Elensúle : https://github.com/Oire\n//! author : Коренберг Марк : https://github.com/socketpair\nfunction(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}({ss:t?\"секунда_секунды_секунд\":\"секунду_секунды_секунд\",mm:t?\"минута_минуты_минут\":\"минуту_минуты_минут\",hh:\"час_часа_часов\",dd:\"день_дня_дней\",MM:\"месяц_месяца_месяцев\",yy:\"год_года_лет\"}[n],+e)}", "function Os(e,t,n){return\"m\"===n?t?\"хвилина\":\"хвилину\":\"h\"===n?t?\"година\":\"годину\":e+\" \"+\n//! moment.js locale configuration\nfunction(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}({ss:t?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:t?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:t?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"}[n],+e)}", "function At(e,t,a){return\"m\"===a?t?\"хвилина\":\"хвилину\":\"h\"===a?t?\"година\":\"годину\":e+\" \"+\n//! moment.js locale configuration\nfunction(e,t){var a=e.split(\"_\");return t%10==1&&t%100!=11?a[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?a[1]:a[2]}({ss:t?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:t?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:t?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"}[a],+e)}", "function localizeMoment(mom) {\n\t\tif ('_locale' in mom) { // moment 2.8 and above\n\t\t\tmom._locale = localeData;\n\t\t}\n\t\telse { // pre-moment-2.8\n\t\t\tmom._lang = localeData;\n\t\t}\n\t}", "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}else{if(typeof console!=='undefined'&&console.warn){//warn user if arguments are passed but the locale could not be set\nconsole.warn('Locale '+key+' not found. Did you forget to load it?');}}}return globalLocale._abbr;}", "function localizeMoment(mom) {\n\t\tmom._locale = localeData;\n\t}", "function hd(i,ee,te){return i+\" \"+function kd(i,ee){return 2===ee?function ld(i){var ee={m:\"v\",b:\"v\",d:\"z\"};return void 0===ee[i.charAt(0)]?i:ee[i.charAt(0)]+i.substring(1)}\n//! moment.js locale configuration\n//! locale : bosnian (bs)\n//! author : Nedim Cholich : https://github.com/frontyard\n//! based on (hr) translation by Bojan Marković\n(i):i}({mm:\"munutenn\",MM:\"miz\",dd:\"devezh\"}[te],i)}", "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}}return globalLocale._abbr;}", "function localizeMoment(mom) {\n\t\t\tmom._locale = localeData;\n\t\t}", "function Io(e,t,n){var i={mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},o=\" \";return(e%100>=20||e>=100&&e%100===0)&&(o=\" de \"),e+o+i[n]}//! moment.js locale configuration", "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data = getLocale(key);}else {data = defineLocale(key,values);}if(data){ // moment.duration._locale = moment._locale = data;\nglobalLocale = data;}else {if(typeof console !== 'undefined' && console.warn){ //warn user if arguments are passed but the locale could not be set\nconsole.warn('Locale ' + key + ' not found. Did you forget to load it?');}}}return globalLocale._abbr;}", "function locale_locales__getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=locale_locales__getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\r\n\tglobalLocale=data;}}return globalLocale._abbr;}", "function locale_locales__getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=locale_locales__getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\r\n\tglobalLocale=data;}}return globalLocale._abbr;}", "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n __f__(\"warn\",\n 'Locale ' + key + ' not found. Did you forget to load it?', \" at node_modules/moment/moment.js:2121\");\n\n }\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else\n {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else\n {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n __f__(\"warn\", 'Locale ' + key + ' not found. Did you forget to load it?', \" at node_modules/moment/moment.js:1880\");\n }\n }\n }\n\n return globalLocale._abbr;\n }", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "static getLocale() {\n return 'en_US';\n }", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}" ]
[ "0.82635474", "0.803583", "0.7878269", "0.7548106", "0.72040725", "0.71984273", "0.7174624", "0.71708643", "0.7132608", "0.7130732", "0.7045036", "0.66717654", "0.66717654", "0.6335232", "0.62935024", "0.62765163", "0.62765163", "0.62765163", "0.62765163", "0.6211631", "0.6094649", "0.60929024", "0.60929024", "0.60929024", "0.60929024", "0.60929024", "0.60782045", "0.60782045", "0.60782045", "0.60782045", "0.60782045", "0.60782045", "0.6077035", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029" ]
0.0
-1
! moment.js locale configuration
function t(e,t,n,r){var i=e+" ";switch(n){case"s":return t||r?"nekaj sekund":"nekaj sekundami";case"ss":return i+=1===e?t?"sekundo":"sekundi":2===e?t||r?"sekundi":"sekundah":e<5?t||r?"sekunde":"sekundah":"sekund",i;case"m":return t?"ena minuta":"eno minuto";case"mm":return i+=1===e?t?"minuta":"minuto":2===e?t||r?"minuti":"minutama":e<5?t||r?"minute":"minutami":t||r?"minut":"minutami",i;case"h":return t?"ena ura":"eno uro";case"hh":return i+=1===e?t?"ura":"uro":2===e?t||r?"uri":"urama":e<5?t||r?"ure":"urami":t||r?"ur":"urami",i;case"d":return t||r?"en dan":"enim dnem";case"dd":return i+=1===e?t||r?"dan":"dnem":2===e?t||r?"dni":"dnevoma":t||r?"dni":"dnevi",i;case"M":return t||r?"en mesec":"enim mesecem";case"MM":return i+=1===e?t||r?"mesec":"mesecem":2===e?t||r?"meseca":"mesecema":e<5?t||r?"mesece":"meseci":t||r?"mesecev":"meseci",i;case"y":return t||r?"eno leto":"enim letom";case"yy":return i+=1===e?t||r?"leto":"letom":2===e?t||r?"leti":"letoma":e<5?t||r?"leta":"leti":t||r?"let":"leti",i}}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cl(e,t,n){return\"m\"===n?t?\"минута\":\"минуту\":e+\" \"+\n//! moment.js locale configuration\n//! locale : Russian [ru]\n//! author : Viktorminator : https://github.com/Viktorminator\n//! Author : Menelion Elensúle : https://github.com/Oire\n//! author : Коренберг Марк : https://github.com/socketpair\nfunction(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}({ss:t?\"секунда_секунды_секунд\":\"секунду_секунды_секунд\",mm:t?\"минута_минуты_минут\":\"минуту_минуты_минут\",hh:\"час_часа_часов\",dd:\"день_дня_дней\",MM:\"месяц_месяца_месяцев\",yy:\"год_года_лет\"}[n],+e)}", "function Os(e,t,n){return\"m\"===n?t?\"хвилина\":\"хвилину\":\"h\"===n?t?\"година\":\"годину\":e+\" \"+\n//! moment.js locale configuration\nfunction(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}({ss:t?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:t?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:t?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"}[n],+e)}", "function At(e,t,a){return\"m\"===a?t?\"хвилина\":\"хвилину\":\"h\"===a?t?\"година\":\"годину\":e+\" \"+\n//! moment.js locale configuration\nfunction(e,t){var a=e.split(\"_\");return t%10==1&&t%100!=11?a[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?a[1]:a[2]}({ss:t?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:t?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:t?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"}[a],+e)}", "function localizeMoment(mom) {\n\t\tif ('_locale' in mom) { // moment 2.8 and above\n\t\t\tmom._locale = localeData;\n\t\t}\n\t\telse { // pre-moment-2.8\n\t\t\tmom._lang = localeData;\n\t\t}\n\t}", "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}else{if(typeof console!=='undefined'&&console.warn){//warn user if arguments are passed but the locale could not be set\nconsole.warn('Locale '+key+' not found. Did you forget to load it?');}}}return globalLocale._abbr;}", "function localizeMoment(mom) {\n\t\tmom._locale = localeData;\n\t}", "function hd(i,ee,te){return i+\" \"+function kd(i,ee){return 2===ee?function ld(i){var ee={m:\"v\",b:\"v\",d:\"z\"};return void 0===ee[i.charAt(0)]?i:ee[i.charAt(0)]+i.substring(1)}\n//! moment.js locale configuration\n//! locale : bosnian (bs)\n//! author : Nedim Cholich : https://github.com/frontyard\n//! based on (hr) translation by Bojan Marković\n(i):i}({mm:\"munutenn\",MM:\"miz\",dd:\"devezh\"}[te],i)}", "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}}return globalLocale._abbr;}", "function localizeMoment(mom) {\n\t\t\tmom._locale = localeData;\n\t\t}", "function Io(e,t,n){var i={mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},o=\" \";return(e%100>=20||e>=100&&e%100===0)&&(o=\" de \"),e+o+i[n]}//! moment.js locale configuration", "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data = getLocale(key);}else {data = defineLocale(key,values);}if(data){ // moment.duration._locale = moment._locale = data;\nglobalLocale = data;}else {if(typeof console !== 'undefined' && console.warn){ //warn user if arguments are passed but the locale could not be set\nconsole.warn('Locale ' + key + ' not found. Did you forget to load it?');}}}return globalLocale._abbr;}", "function locale_locales__getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=locale_locales__getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\r\n\tglobalLocale=data;}}return globalLocale._abbr;}", "function locale_locales__getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=locale_locales__getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\r\n\tglobalLocale=data;}}return globalLocale._abbr;}", "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n __f__(\"warn\",\n 'Locale ' + key + ' not found. Did you forget to load it?', \" at node_modules/moment/moment.js:2121\");\n\n }\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else\n {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else\n {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n __f__(\"warn\", 'Locale ' + key + ' not found. Did you forget to load it?', \" at node_modules/moment/moment.js:1880\");\n }\n }\n }\n\n return globalLocale._abbr;\n }", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "static getLocale() {\n return 'en_US';\n }", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}" ]
[ "0.82627255", "0.80355096", "0.7878359", "0.75476736", "0.72037613", "0.71981734", "0.71757025", "0.7170814", "0.71322805", "0.7130772", "0.7044428", "0.667163", "0.667163", "0.6334324", "0.6292554", "0.62773275", "0.62773275", "0.62773275", "0.62773275", "0.62090504", "0.6093498", "0.60916936", "0.60916936", "0.60916936", "0.60916936", "0.60916936", "0.60770184", "0.60770184", "0.60770184", "0.60770184", "0.60770184", "0.60770184", "0.60759085", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914" ]
0.0
-1
! vuerouter v3.5.1 (c) 2021 Evan You
function r(e,t){0}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "function jj(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"source.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function version(){ return \"0.13.0\" }", "function TM(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"source.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function BO(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"source.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "private internal function m248() {}", "function Es(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"source.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function Uk(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function yh(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"graticule.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "vampireWithName(name) {\n \n }", "function Qw(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function iP(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"source.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function fyv(){\n \n }", "function Bv(e){let{basename:t,children:n,window:r}=e,l=X.exports.useRef();l.current==null&&(l.current=gv({window:r}));let o=l.current,[i,u]=X.exports.useState({action:o.action,location:o.location});return X.exports.useLayoutEffect(()=>o.listen(u),[o]),X.exports.createElement(Fv,{basename:t,children:n,location:i.location,navigationType:i.action,navigator:o})}", "function cO(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"source.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "upgrade() {}", "function ow(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "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 vT(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"layer.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function Ak(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function Wx(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function PD(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "transient private internal function m185() {}", "function dp(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function Hr(e,t){\"undefined\"!==typeof console&&(console.warn(\"[vue-i18n] \"+e),t&&console.warn(t.stack))}", "function Ek(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function Rb(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function JV(e,t){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+e),t&&console.warn(t.stack))}", "function SigV4Utils() { }", "function jx(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function vI(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"style.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "transient final protected internal function m174() {}", "function VI(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"layer.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function hA(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function __vue_normalize__(a,b,c,d,e){var f=(\"function\"==typeof c?c.options:c)||{};// For security concerns, we use only base name in production mode.\nreturn f.__file=\"/Users/hadefication/Packages/vue-chartisan/src/components/Pie.vue\",f.render||(f.render=a.render,f.staticRenderFns=a.staticRenderFns,f._compiled=!0,e&&(f.functional=!0)),f._scopeId=d,f}", "updated() {}", "function $S(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "protected internal function m252() {}", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }" ]
[ "0.5826907", "0.5787431", "0.57791466", "0.57177967", "0.5693478", "0.56677026", "0.56438506", "0.55971104", "0.55622447", "0.55450404", "0.5535287", "0.5513169", "0.55086446", "0.54607594", "0.54414064", "0.5400921", "0.5376999", "0.5369956", "0.5369956", "0.5369956", "0.5369956", "0.5369956", "0.5369956", "0.5369956", "0.5369956", "0.5369956", "0.5369956", "0.5369956", "0.5369956", "0.5369956", "0.5369956", "0.5369956", "0.5369956", "0.5369956", "0.5369956", "0.5369956", "0.5369956", "0.5369956", "0.5369956", "0.5369956", "0.5369956", "0.5369956", "0.5369956", "0.5369956", "0.5369956", "0.5369956", "0.5369956", "0.5369956", "0.5369956", "0.5369956", "0.5369956", "0.5369956", "0.5369956", "0.5369956", "0.5369752", "0.5363974", "0.53633904", "0.533222", "0.5324066", "0.53214735", "0.5318183", "0.5314555", "0.5311868", "0.5305943", "0.52721816", "0.52700067", "0.5258986", "0.5258811", "0.5236348", "0.52326745", "0.5212611", "0.5206278", "0.5206222", "0.51942533", "0.51581", "0.51581", "0.51581", "0.51581", "0.51581", "0.51581", "0.51581", "0.51581", "0.51581", "0.51581", "0.51581", "0.51581", "0.51581", "0.51581", "0.51581", "0.51581", "0.51581", "0.51581", "0.51581", "0.51581", "0.51581", "0.51581", "0.51581", "0.51581", "0.51581", "0.51581", "0.51581" ]
0.0
-1
! moment.js locale configuration
function t(e){return"undefined"!==typeof Function&&e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cl(e,t,n){return\"m\"===n?t?\"минута\":\"минуту\":e+\" \"+\n//! moment.js locale configuration\n//! locale : Russian [ru]\n//! author : Viktorminator : https://github.com/Viktorminator\n//! Author : Menelion Elensúle : https://github.com/Oire\n//! author : Коренберг Марк : https://github.com/socketpair\nfunction(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}({ss:t?\"секунда_секунды_секунд\":\"секунду_секунды_секунд\",mm:t?\"минута_минуты_минут\":\"минуту_минуты_минут\",hh:\"час_часа_часов\",dd:\"день_дня_дней\",MM:\"месяц_месяца_месяцев\",yy:\"год_года_лет\"}[n],+e)}", "function Os(e,t,n){return\"m\"===n?t?\"хвилина\":\"хвилину\":\"h\"===n?t?\"година\":\"годину\":e+\" \"+\n//! moment.js locale configuration\nfunction(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}({ss:t?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:t?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:t?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"}[n],+e)}", "function At(e,t,a){return\"m\"===a?t?\"хвилина\":\"хвилину\":\"h\"===a?t?\"година\":\"годину\":e+\" \"+\n//! moment.js locale configuration\nfunction(e,t){var a=e.split(\"_\");return t%10==1&&t%100!=11?a[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?a[1]:a[2]}({ss:t?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:t?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:t?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"}[a],+e)}", "function localizeMoment(mom) {\n\t\tif ('_locale' in mom) { // moment 2.8 and above\n\t\t\tmom._locale = localeData;\n\t\t}\n\t\telse { // pre-moment-2.8\n\t\t\tmom._lang = localeData;\n\t\t}\n\t}", "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}else{if(typeof console!=='undefined'&&console.warn){//warn user if arguments are passed but the locale could not be set\nconsole.warn('Locale '+key+' not found. Did you forget to load it?');}}}return globalLocale._abbr;}", "function localizeMoment(mom) {\n\t\tmom._locale = localeData;\n\t}", "function hd(i,ee,te){return i+\" \"+function kd(i,ee){return 2===ee?function ld(i){var ee={m:\"v\",b:\"v\",d:\"z\"};return void 0===ee[i.charAt(0)]?i:ee[i.charAt(0)]+i.substring(1)}\n//! moment.js locale configuration\n//! locale : bosnian (bs)\n//! author : Nedim Cholich : https://github.com/frontyard\n//! based on (hr) translation by Bojan Marković\n(i):i}({mm:\"munutenn\",MM:\"miz\",dd:\"devezh\"}[te],i)}", "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}}return globalLocale._abbr;}", "function localizeMoment(mom) {\n\t\t\tmom._locale = localeData;\n\t\t}", "function Io(e,t,n){var i={mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},o=\" \";return(e%100>=20||e>=100&&e%100===0)&&(o=\" de \"),e+o+i[n]}//! moment.js locale configuration", "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data = getLocale(key);}else {data = defineLocale(key,values);}if(data){ // moment.duration._locale = moment._locale = data;\nglobalLocale = data;}else {if(typeof console !== 'undefined' && console.warn){ //warn user if arguments are passed but the locale could not be set\nconsole.warn('Locale ' + key + ' not found. Did you forget to load it?');}}}return globalLocale._abbr;}", "function locale_locales__getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=locale_locales__getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\r\n\tglobalLocale=data;}}return globalLocale._abbr;}", "function locale_locales__getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=locale_locales__getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\r\n\tglobalLocale=data;}}return globalLocale._abbr;}", "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n __f__(\"warn\",\n 'Locale ' + key + ' not found. Did you forget to load it?', \" at node_modules/moment/moment.js:2121\");\n\n }\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else\n {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else\n {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n __f__(\"warn\", 'Locale ' + key + ' not found. Did you forget to load it?', \" at node_modules/moment/moment.js:1880\");\n }\n }\n }\n\n return globalLocale._abbr;\n }", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "static getLocale() {\n return 'en_US';\n }", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}" ]
[ "0.82635474", "0.803583", "0.7878269", "0.7548106", "0.72040725", "0.71984273", "0.7174624", "0.71708643", "0.7132608", "0.7130732", "0.7045036", "0.66717654", "0.66717654", "0.6335232", "0.62935024", "0.62765163", "0.62765163", "0.62765163", "0.62765163", "0.6211631", "0.6094649", "0.60929024", "0.60929024", "0.60929024", "0.60929024", "0.60929024", "0.60782045", "0.60782045", "0.60782045", "0.60782045", "0.60782045", "0.60782045", "0.6077035", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029" ]
0.0
-1
! moment.js locale configuration
function t(e,t){var n=e.split("_");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cl(e,t,n){return\"m\"===n?t?\"минута\":\"минуту\":e+\" \"+\n//! moment.js locale configuration\n//! locale : Russian [ru]\n//! author : Viktorminator : https://github.com/Viktorminator\n//! Author : Menelion Elensúle : https://github.com/Oire\n//! author : Коренберг Марк : https://github.com/socketpair\nfunction(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}({ss:t?\"секунда_секунды_секунд\":\"секунду_секунды_секунд\",mm:t?\"минута_минуты_минут\":\"минуту_минуты_минут\",hh:\"час_часа_часов\",dd:\"день_дня_дней\",MM:\"месяц_месяца_месяцев\",yy:\"год_года_лет\"}[n],+e)}", "function Os(e,t,n){return\"m\"===n?t?\"хвилина\":\"хвилину\":\"h\"===n?t?\"година\":\"годину\":e+\" \"+\n//! moment.js locale configuration\nfunction(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}({ss:t?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:t?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:t?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"}[n],+e)}", "function At(e,t,a){return\"m\"===a?t?\"хвилина\":\"хвилину\":\"h\"===a?t?\"година\":\"годину\":e+\" \"+\n//! moment.js locale configuration\nfunction(e,t){var a=e.split(\"_\");return t%10==1&&t%100!=11?a[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?a[1]:a[2]}({ss:t?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:t?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:t?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"}[a],+e)}", "function localizeMoment(mom) {\n\t\tif ('_locale' in mom) { // moment 2.8 and above\n\t\t\tmom._locale = localeData;\n\t\t}\n\t\telse { // pre-moment-2.8\n\t\t\tmom._lang = localeData;\n\t\t}\n\t}", "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}else{if(typeof console!=='undefined'&&console.warn){//warn user if arguments are passed but the locale could not be set\nconsole.warn('Locale '+key+' not found. Did you forget to load it?');}}}return globalLocale._abbr;}", "function localizeMoment(mom) {\n\t\tmom._locale = localeData;\n\t}", "function hd(i,ee,te){return i+\" \"+function kd(i,ee){return 2===ee?function ld(i){var ee={m:\"v\",b:\"v\",d:\"z\"};return void 0===ee[i.charAt(0)]?i:ee[i.charAt(0)]+i.substring(1)}\n//! moment.js locale configuration\n//! locale : bosnian (bs)\n//! author : Nedim Cholich : https://github.com/frontyard\n//! based on (hr) translation by Bojan Marković\n(i):i}({mm:\"munutenn\",MM:\"miz\",dd:\"devezh\"}[te],i)}", "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}}return globalLocale._abbr;}", "function localizeMoment(mom) {\n\t\t\tmom._locale = localeData;\n\t\t}", "function Io(e,t,n){var i={mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},o=\" \";return(e%100>=20||e>=100&&e%100===0)&&(o=\" de \"),e+o+i[n]}//! moment.js locale configuration", "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data = getLocale(key);}else {data = defineLocale(key,values);}if(data){ // moment.duration._locale = moment._locale = data;\nglobalLocale = data;}else {if(typeof console !== 'undefined' && console.warn){ //warn user if arguments are passed but the locale could not be set\nconsole.warn('Locale ' + key + ' not found. Did you forget to load it?');}}}return globalLocale._abbr;}", "function locale_locales__getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=locale_locales__getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\r\n\tglobalLocale=data;}}return globalLocale._abbr;}", "function locale_locales__getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=locale_locales__getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\r\n\tglobalLocale=data;}}return globalLocale._abbr;}", "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n __f__(\"warn\",\n 'Locale ' + key + ' not found. Did you forget to load it?', \" at node_modules/moment/moment.js:2121\");\n\n }\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else\n {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else\n {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n __f__(\"warn\", 'Locale ' + key + ' not found. Did you forget to load it?', \" at node_modules/moment/moment.js:1880\");\n }\n }\n }\n\n return globalLocale._abbr;\n }", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "static getLocale() {\n return 'en_US';\n }", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}" ]
[ "0.82635474", "0.803583", "0.7878269", "0.7548106", "0.72040725", "0.71984273", "0.7174624", "0.71708643", "0.7132608", "0.7130732", "0.7045036", "0.66717654", "0.66717654", "0.6335232", "0.62935024", "0.62765163", "0.62765163", "0.62765163", "0.62765163", "0.6211631", "0.6094649", "0.60929024", "0.60929024", "0.60929024", "0.60929024", "0.60929024", "0.60782045", "0.60782045", "0.60782045", "0.60782045", "0.60782045", "0.60782045", "0.6077035", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029" ]
0.0
-1
! moment.js locale configuration
function t(e,t,n,r){switch(n){case"s":return t?"хэдхэн секунд":"хэдхэн секундын";case"ss":return e+(t?" секунд":" секундын");case"m":case"mm":return e+(t?" минут":" минутын");case"h":case"hh":return e+(t?" цаг":" цагийн");case"d":case"dd":return e+(t?" өдөр":" өдрийн");case"M":case"MM":return e+(t?" сар":" сарын");case"y":case"yy":return e+(t?" жил":" жилийн");default:return e}}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cl(e,t,n){return\"m\"===n?t?\"минута\":\"минуту\":e+\" \"+\n//! moment.js locale configuration\n//! locale : Russian [ru]\n//! author : Viktorminator : https://github.com/Viktorminator\n//! Author : Menelion Elensúle : https://github.com/Oire\n//! author : Коренберг Марк : https://github.com/socketpair\nfunction(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}({ss:t?\"секунда_секунды_секунд\":\"секунду_секунды_секунд\",mm:t?\"минута_минуты_минут\":\"минуту_минуты_минут\",hh:\"час_часа_часов\",dd:\"день_дня_дней\",MM:\"месяц_месяца_месяцев\",yy:\"год_года_лет\"}[n],+e)}", "function Os(e,t,n){return\"m\"===n?t?\"хвилина\":\"хвилину\":\"h\"===n?t?\"година\":\"годину\":e+\" \"+\n//! moment.js locale configuration\nfunction(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}({ss:t?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:t?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:t?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"}[n],+e)}", "function At(e,t,a){return\"m\"===a?t?\"хвилина\":\"хвилину\":\"h\"===a?t?\"година\":\"годину\":e+\" \"+\n//! moment.js locale configuration\nfunction(e,t){var a=e.split(\"_\");return t%10==1&&t%100!=11?a[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?a[1]:a[2]}({ss:t?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:t?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:t?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"}[a],+e)}", "function localizeMoment(mom) {\n\t\tif ('_locale' in mom) { // moment 2.8 and above\n\t\t\tmom._locale = localeData;\n\t\t}\n\t\telse { // pre-moment-2.8\n\t\t\tmom._lang = localeData;\n\t\t}\n\t}", "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}else{if(typeof console!=='undefined'&&console.warn){//warn user if arguments are passed but the locale could not be set\nconsole.warn('Locale '+key+' not found. Did you forget to load it?');}}}return globalLocale._abbr;}", "function localizeMoment(mom) {\n\t\tmom._locale = localeData;\n\t}", "function hd(i,ee,te){return i+\" \"+function kd(i,ee){return 2===ee?function ld(i){var ee={m:\"v\",b:\"v\",d:\"z\"};return void 0===ee[i.charAt(0)]?i:ee[i.charAt(0)]+i.substring(1)}\n//! moment.js locale configuration\n//! locale : bosnian (bs)\n//! author : Nedim Cholich : https://github.com/frontyard\n//! based on (hr) translation by Bojan Marković\n(i):i}({mm:\"munutenn\",MM:\"miz\",dd:\"devezh\"}[te],i)}", "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}}return globalLocale._abbr;}", "function localizeMoment(mom) {\n\t\t\tmom._locale = localeData;\n\t\t}", "function Io(e,t,n){var i={mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},o=\" \";return(e%100>=20||e>=100&&e%100===0)&&(o=\" de \"),e+o+i[n]}//! moment.js locale configuration", "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data = getLocale(key);}else {data = defineLocale(key,values);}if(data){ // moment.duration._locale = moment._locale = data;\nglobalLocale = data;}else {if(typeof console !== 'undefined' && console.warn){ //warn user if arguments are passed but the locale could not be set\nconsole.warn('Locale ' + key + ' not found. Did you forget to load it?');}}}return globalLocale._abbr;}", "function locale_locales__getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=locale_locales__getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\r\n\tglobalLocale=data;}}return globalLocale._abbr;}", "function locale_locales__getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=locale_locales__getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\r\n\tglobalLocale=data;}}return globalLocale._abbr;}", "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n __f__(\"warn\",\n 'Locale ' + key + ' not found. Did you forget to load it?', \" at node_modules/moment/moment.js:2121\");\n\n }\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else\n {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else\n {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n __f__(\"warn\", 'Locale ' + key + ' not found. Did you forget to load it?', \" at node_modules/moment/moment.js:1880\");\n }\n }\n }\n\n return globalLocale._abbr;\n }", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "static getLocale() {\n return 'en_US';\n }", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}" ]
[ "0.82627255", "0.80355096", "0.7878359", "0.75476736", "0.72037613", "0.71981734", "0.71757025", "0.7170814", "0.71322805", "0.7130772", "0.7044428", "0.667163", "0.667163", "0.6334324", "0.6292554", "0.62773275", "0.62773275", "0.62773275", "0.62773275", "0.62090504", "0.6093498", "0.60916936", "0.60916936", "0.60916936", "0.60916936", "0.60916936", "0.60770184", "0.60770184", "0.60770184", "0.60770184", "0.60770184", "0.60770184", "0.60759085", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914", "0.6071914" ]
0.0
-1
! moment.js locale configuration
function t(e,t,n){var r={ss:"secunde",mm:"minute",hh:"ore",dd:"zile",ww:"săptămâni",MM:"luni",yy:"ani"},i=" ";return(e%100>=20||e>=100&&e%100===0)&&(i=" de "),e+i+r[n]}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cl(e,t,n){return\"m\"===n?t?\"минута\":\"минуту\":e+\" \"+\n//! moment.js locale configuration\n//! locale : Russian [ru]\n//! author : Viktorminator : https://github.com/Viktorminator\n//! Author : Menelion Elensúle : https://github.com/Oire\n//! author : Коренберг Марк : https://github.com/socketpair\nfunction(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}({ss:t?\"секунда_секунды_секунд\":\"секунду_секунды_секунд\",mm:t?\"минута_минуты_минут\":\"минуту_минуты_минут\",hh:\"час_часа_часов\",dd:\"день_дня_дней\",MM:\"месяц_месяца_месяцев\",yy:\"год_года_лет\"}[n],+e)}", "function Os(e,t,n){return\"m\"===n?t?\"хвилина\":\"хвилину\":\"h\"===n?t?\"година\":\"годину\":e+\" \"+\n//! moment.js locale configuration\nfunction(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}({ss:t?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:t?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:t?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"}[n],+e)}", "function At(e,t,a){return\"m\"===a?t?\"хвилина\":\"хвилину\":\"h\"===a?t?\"година\":\"годину\":e+\" \"+\n//! moment.js locale configuration\nfunction(e,t){var a=e.split(\"_\");return t%10==1&&t%100!=11?a[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?a[1]:a[2]}({ss:t?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:t?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:t?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"}[a],+e)}", "function localizeMoment(mom) {\n\t\tif ('_locale' in mom) { // moment 2.8 and above\n\t\t\tmom._locale = localeData;\n\t\t}\n\t\telse { // pre-moment-2.8\n\t\t\tmom._lang = localeData;\n\t\t}\n\t}", "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}else{if(typeof console!=='undefined'&&console.warn){//warn user if arguments are passed but the locale could not be set\nconsole.warn('Locale '+key+' not found. Did you forget to load it?');}}}return globalLocale._abbr;}", "function localizeMoment(mom) {\n\t\tmom._locale = localeData;\n\t}", "function hd(i,ee,te){return i+\" \"+function kd(i,ee){return 2===ee?function ld(i){var ee={m:\"v\",b:\"v\",d:\"z\"};return void 0===ee[i.charAt(0)]?i:ee[i.charAt(0)]+i.substring(1)}\n//! moment.js locale configuration\n//! locale : bosnian (bs)\n//! author : Nedim Cholich : https://github.com/frontyard\n//! based on (hr) translation by Bojan Marković\n(i):i}({mm:\"munutenn\",MM:\"miz\",dd:\"devezh\"}[te],i)}", "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}}return globalLocale._abbr;}", "function localizeMoment(mom) {\n\t\t\tmom._locale = localeData;\n\t\t}", "function Io(e,t,n){var i={mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},o=\" \";return(e%100>=20||e>=100&&e%100===0)&&(o=\" de \"),e+o+i[n]}//! moment.js locale configuration", "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data = getLocale(key);}else {data = defineLocale(key,values);}if(data){ // moment.duration._locale = moment._locale = data;\nglobalLocale = data;}else {if(typeof console !== 'undefined' && console.warn){ //warn user if arguments are passed but the locale could not be set\nconsole.warn('Locale ' + key + ' not found. Did you forget to load it?');}}}return globalLocale._abbr;}", "function locale_locales__getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=locale_locales__getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\r\n\tglobalLocale=data;}}return globalLocale._abbr;}", "function locale_locales__getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=locale_locales__getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\r\n\tglobalLocale=data;}}return globalLocale._abbr;}", "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n __f__(\"warn\",\n 'Locale ' + key + ' not found. Did you forget to load it?', \" at node_modules/moment/moment.js:2121\");\n\n }\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else\n {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else\n {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n __f__(\"warn\", 'Locale ' + key + ' not found. Did you forget to load it?', \" at node_modules/moment/moment.js:1880\");\n }\n }\n }\n\n return globalLocale._abbr;\n }", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "static getLocale() {\n return 'en_US';\n }", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}" ]
[ "0.82635474", "0.803583", "0.7878269", "0.7548106", "0.72040725", "0.71984273", "0.7174624", "0.71708643", "0.7132608", "0.7130732", "0.7045036", "0.66717654", "0.66717654", "0.6335232", "0.62935024", "0.62765163", "0.62765163", "0.62765163", "0.62765163", "0.6211631", "0.6094649", "0.60929024", "0.60929024", "0.60929024", "0.60929024", "0.60929024", "0.60782045", "0.60782045", "0.60782045", "0.60782045", "0.60782045", "0.60782045", "0.6077035", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029", "0.6073029" ]
0.0
-1